var $l=Object.defineProperty;var Al=(e,t,n)=>t in e?$l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var I=(e,t,n)=>(Al(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function ht(){}const ea=e=>e;function N(e,t){for(const n in t)e[n]=t[n];return e}function na(e){return e()}function rs(){return Object.create(null)}function Jt(e){e.forEach(na)}function ae(e){return typeof e=="function"}function Y(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Pl(e){return Object.keys(e).length===0}function Ds(e,...t){if(e==null)return ht;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Fl(e){let t;return Ds(e,n=>t=n)(),t}function gt(e,t,n){e.$$.on_destroy.push(Ds(t,n))}function Rt(e,t,n,i){if(e){const s=ia(e,t,n,i);return e[0](s)}}function ia(e,t,n,i){return e[1]&&i?N(n.ctx.slice(),e[1](i(t))):n.ctx}function $t(e,t,n,i){if(e[2]&&i){const s=e[2](i(n));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),Es=sa?e=>requestAnimationFrame(e):ht;const We=new Set;function oa(e){We.forEach(t=>{t.c(e)||(We.delete(t),t.f())}),We.size!==0&&Es(oa)}function Ol(e){let t;return We.size===0&&Es(oa),{promise:new Promise(n=>{We.add(t={c:e,f:n})}),abort(){We.delete(t)}}}let Ri=!1;function El(){Ri=!0}function Ll(){Ri=!1}function Tl(e,t,n,i){for(;e>1);n(s)<=i?e=s+1:t=s}return e}function Il(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const l=[];for(let c=0;c0&&t[n[s]].claim_order<=c?s+1:Tl(1,s,d=>t[n[d]].claim_order,c))-1;i[l]=n[u]+1;const f=u+1;n[f]=l,s=Math.max(f,s)}const o=[],r=[];let a=t.length-1;for(let l=n[s]+1;l!=0;l=i[l-1]){for(o.push(t[l-1]);a>=l;a--)r.push(t[a]);a--}for(;a>=0;a--)r.push(t[a]);o.reverse(),r.sort((l,c)=>l.claim_order-c.claim_order);for(let l=0,c=0;l=o[c].claim_order;)c++;const u=ce.removeEventListener(t,n,i)}function O(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Bl(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set?e[i]=t[i]:O(e,i,t[i])}function ii(e,t){for(const n in t)O(e,n,t[n])}function jl(e){return Array.from(e.childNodes)}function Wl(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Gl(e,t,n,i,s=!1){Wl(e);const o=(()=>{for(let r=e.claim_info.last_index;r=0;r--){const a=e[r];if(t(a)){const l=n(a);return l===void 0?e.splice(r,1):e[r]=l,s?l===void 0&&e.claim_info.last_index--:e.claim_info.last_index=r,a}}return i()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function ql(e,t){return Gl(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>J(t),!0)}function jt(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function io(e,t){e.value=t??""}function Fn(e,t,n){e.classList[n?"add":"remove"](t)}function Yl(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(e,n,i,t),s}function Xe(e,t){return new e(t)}const si=new Map;let oi=0;function Ul(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Xl(e,t){const n={stylesheet:Vl(t),rules:{}};return si.set(e,n),n}function so(e,t,n,i,s,o,r,a=0){const l=16.666/i;let c=`{ `;for(let m=0;m<=1;m+=l){const _=t+(n-t)*o(m);c+=m*100+`%{${r(_,1-_)}} `}const u=c+`100% {${r(n,1-n)}} }`,f=`__svelte_${Ul(u)}_${a}`,d=ra(e),{stylesheet:h,rules:g}=si.get(d)||Xl(d,e);g[f]||(g[f]=!0,h.insertRule(`@keyframes ${f} ${u}`,h.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${f} ${i}ms linear ${s}ms 1 both`,oi+=1,f}function Kl(e,t){const n=(e.style.animation||"").split(", "),i=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),s=n.length-i.length;s&&(e.style.animation=i.join(", "),oi-=s,oi||Ql())}function Ql(){Es(()=>{oi||(si.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&X(t)}),si.clear())})}let De;function Ae(e){De=e}function tn(){if(!De)throw new Error("Function called outside component initialization");return De}function $i(e){tn().$$.on_mount.push(e)}function Zl(e){tn().$$.after_update.push(e)}function en(e){tn().$$.on_destroy.push(e)}function Jl(e,t){return tn().$$.context.set(e,t),t}function Ls(e){return tn().$$.context.get(e)}function tc(e){return tn().$$.context.has(e)}function ec(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Be=[],Ke=[];let Ge=[];const as=[],la=Promise.resolve();let ls=!1;function ca(){ls||(ls=!0,la.then(fa))}function Ts(){return ca(),la}function Qe(e){Ge.push(e)}function ua(e){as.push(e)}const Vi=new Set;let Ve=0;function fa(){if(Ve!==0)return;const e=De;do{try{for(;Vee.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Ge=t}let nn;function sc(){return nn||(nn=Promise.resolve(),nn.then(()=>{nn=null})),nn}function zi(e,t,n){e.dispatchEvent(Yl(`${t?"intro":"outro"}${n}`))}const Kn=new Set;let re;function Lt(){re={r:0,c:[],p:re}}function Tt(){re.r||Jt(re.c),re=re.p}function S(e,t){e&&e.i&&(Kn.delete(e),e.i(t))}function M(e,t,n,i){if(e&&e.o){if(Kn.has(e))return;Kn.add(e),re.c.push(()=>{Kn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}const oc={duration:0};function ri(e,t,n,i){const s={direction:"both"};let o=t(e,n,s),r=i?0:1,a=null,l=null,c=null;function u(){c&&Kl(e,c)}function f(h,g){const p=h.b-r;return g*=Math.abs(p),{a:r,b:h.b,d:p,duration:g,start:h.start,end:h.start+g,group:h.group}}function d(h){const{delay:g=0,duration:p=300,easing:m=ea,tick:_=ht,css:b}=o||oc,y={start:Dl()+g,b:h};h||(y.group=re,re.r+=1),a||l?l=y:(b&&(u(),c=so(e,r,h,p,g,m,b)),h&&_(0,1),a=f(y,p),Qe(()=>zi(e,h,"start")),Ol(x=>{if(l&&x>l.start&&(a=f(l,p),l=null,zi(e,a.b,"start"),b&&(u(),c=so(e,r,a.b,a.duration,0,m,o.css))),a){if(x>=a.end)_(r=a.b,1-r),zi(e,a.b,"end"),l||(a.b?u():--a.group.r||Jt(a.group.c)),a=null;else if(x>=a.start){const v=x-a.start;r=a.a+a.d*m(v/a.duration),_(r,1-r)}}return!!(a||l)}))}return{run(h){ae(o)?sc().then(()=>{o=o(s),d(h)}):d(h)},end(){u(),a=l=null}}}function Vt(e,t){const n={},i={},s={$$scope:1};let o=e.length;for(;o--;){const r=e[o],a=t[o];if(a){for(const l in r)l in a||(i[l]=1);for(const l in a)s[l]||(n[l]=a[l],s[l]=1);e[o]=a}else for(const l in r)s[l]=1}for(const r in i)r in n||(n[r]=void 0);return n}function te(e){return typeof e=="object"&&e!==null?e:{}}const rc=/[&"]/g,ac=/[&<]/g;function lc(e,t=!1){const n=String(e),i=t?rc:ac;i.lastIndex=0;let s="",o=0;for(;i.test(n);){const r=i.lastIndex-1,a=n[r];s+=n.substring(o,r)+(a==="&"?"&":a==='"'?""":"<"),o=r+1}return s+n.substring(o)}function cc(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Hi;function da(e){function t(n,i,s,o,r){const a=De,l={on_destroy:Hi,context:new Map(r||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:rs()};Ae({$$:l});const c=e(n,i,s,o);return Ae(a),c}return{render:(n={},{$$slots:i={},context:s=new Map}={})=>{Hi=[];const o={title:"",head:"",css:new Set},r=t(o,n,{},i,s);return Jt(Hi),{html:r,css:{code:Array.from(o.css).map(a=>a.code).join(` `),map:null},head:o.title+o.head}},$$render:t}}function ha(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function H(e){e&&e.c()}function uc(e,t){e&&e.l(t)}function V(e,t,n,i){const{fragment:s,after_update:o}=e.$$;s&&s.m(t,n),i||Qe(()=>{const r=e.$$.on_mount.map(na).filter(ae);e.$$.on_destroy?e.$$.on_destroy.push(...r):Jt(r),e.$$.on_mount=[]}),o.forEach(Qe)}function z(e,t){const n=e.$$;n.fragment!==null&&(ic(n.after_update),Jt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function fc(e,t){e.$$.dirty[0]===-1&&(Be.push(e),ca(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=h.length?h[0]:d;return c.ctx&&s(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),u&&fc(e,f)),d}):[],c.update(),u=!0,Jt(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){El();const f=jl(t.target);c.fragment&&c.fragment.l(f),f.forEach(X)}else c.fragment&&c.fragment.c();t.intro&&S(e.$$.fragment),V(e,t.target,t.anchor,t.customElement),Ll(),fa()}Ae(l)}class K{$destroy(){z(this,1),this.$destroy=ht}$on(t,n){if(!ae(n))return ht;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!Pl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ze=[];function cs(e,t){return{subscribe:Ft(e,t).subscribe}}function Ft(e,t=ht){let n;const i=new Set;function s(a){if(Y(e,a)&&(e=a,n)){const l=!ze.length;for(const c of i)c[1](),ze.push(c,e);if(l){for(let c=0;c{i.delete(c),i.size===0&&n&&(n(),n=null)}}return{set:s,update:o,subscribe:r}}function Ai(e,t,n){const i=!Array.isArray(e),s=i?[e]:e,o=t.length<2;return cs(n,r=>{let a=!1;const l=[];let c=0,u=ht;const f=()=>{if(c)return;u();const h=t(i?l[0]:l,r);o?r(h):u=ae(h)?h:ht},d=s.map((h,g)=>Ds(h,p=>{l[g]=p,c&=~(1<{c|=1<a.startsWith(":")?(n.push(a.slice(1)),"([^\\/]+)"):a).join("\\/"),r=t.match(new RegExp(`^${o}$`));return r||(s=!1,r=t.match(new RegExp(`^${o}`))),r?(n.forEach((a,l)=>i[a]=r[l+1]),{exact:s,params:i,part:r[0].slice(0,-1)}):null}function ga(e,t,n){if(n==="")return e;if(n[0]==="/")return n;let i=r=>r.split("/").filter(a=>a!==""),s=i(e);return"/"+(t?i(t):[]).map((r,a)=>s[a]).join("/")+"/"+n}function oo(e,t,n,i){let s=[t,"data-"+t].reduce((o,r)=>{let a=e.getAttribute(r);return n&&e.removeAttribute(r),a===null?o:a},!1);return!i&&s===""?!0:s||i||!1}function hc(e){let t=e.split("&").map(n=>n.split("=")).reduce((n,i)=>{let s=i[0];if(!s)return n;let o=i.length>1?i[i.length-1]:!0;return typeof o=="string"&&o.includes(",")&&(o=o.split(",")),n[s]===void 0?n[s]=[o]:n[s].push(o),n},{});return Object.entries(t).reduce((n,i)=>(n[i[0]]=i[1].length>1?i[1]:i[1][0],n),{})}function gc(e){return Object.entries(e).map(([t,n])=>n?n===!0?t:`${t}=${Array.isArray(n)?n.join(","):n}`:null).filter(t=>t).join("&")}function ro(e,t){return e?t+e:""}function pa(e){throw new Error("[Tinro] "+e)}var Ht={HISTORY:1,HASH:2,MEMORY:3,OFF:4,run(e,t,n,i){return e===this.HISTORY?t&&t():e===this.HASH?n&&n():i&&i()},getDefault(){return!window||window.location.pathname==="srcdoc"?this.MEMORY:this.HISTORY}},Is,ma,_a,ai="",zt=pc();function pc(){let e=Ht.getDefault(),t,n=r=>window.onhashchange=window.onpopstate=Is=null,i=r=>t&&t(Ni(e)),s=r=>{r&&(e=r),n(),e!==Ht.OFF&&Ht.run(e,a=>window.onpopstate=i,a=>window.onhashchange=i)&&i()},o=r=>{let a=Object.assign(Ni(e),r);return a.path+ro(gc(a.query),"?")+ro(a.hash,"#")};return{mode:s,get:r=>Ni(e),go(r,a){mc(e,r,a),i()},start(r){t=r,s()},stop(){t=null,s(Ht.OFF)},set(r){this.go(o(r),!r.path)},methods(){return _c(this)},base:r=>ai=r}}function mc(e,t,n){!n&&(ma=_a);let i=s=>history[`${n?"replace":"push"}State`]({},"",s);Ht.run(e,s=>i(ai+t),s=>i(`#${t}`),s=>Is=t)}function Ni(e){let t=window.location,n=Ht.run(e,s=>(ai?t.pathname.replace(ai,""):t.pathname)+t.search+t.hash,s=>String(t.hash.slice(1)||"/"),s=>Is||"/"),i=n.match(/^([^?#]+)(?:\?([^#]+))?(?:\#(.+))?$/);return _a=n,{url:n,from:ma,path:i[1]||"",query:hc(i[2]||""),hash:i[3]||""}}function _c(e){let t=()=>e.get().query,n=r=>e.set({query:r}),i=r=>n(r(t())),s=()=>e.get().hash,o=r=>e.set({hash:r});return{hash:{get:s,set:o,clear:()=>o("")},query:{replace:n,clear:()=>n(""),get(r){return r?t()[r]:t()},set(r,a){i(l=>(l[r]=a,l))},delete(r){i(a=>(a[r]&&delete a[r],a))}}}}var Oe=bc();function bc(){let{subscribe:e}=Ft(zt.get(),t=>{zt.start(t);let n=yc(zt.go);return()=>{zt.stop(),n()}});return{subscribe:e,goto:zt.go,params:vc,meta:Vs,useHashNavigation:t=>zt.mode(t?Ht.HASH:Ht.HISTORY),mode:{hash:()=>zt.mode(Ht.HASH),history:()=>zt.mode(Ht.HISTORY),memory:()=>zt.mode(Ht.MEMORY)},base:zt.base,location:zt.methods()}}function yc(e){let t=n=>{let i=n.target.closest("a[href]"),s=i&&oo(i,"target",!1,"_self"),o=i&&oo(i,"tinro-ignore"),r=n.ctrlKey||n.metaKey||n.altKey||n.shiftKey;if(s=="_self"&&!o&&!r&&i){let a=i.getAttribute("href").replace(/^\/#/,"");/^\/\/|^#|^[a-zA-Z]+:/.test(a)||(n.preventDefault(),e(a.startsWith("/")?a:i.href.replace(window.location.origin,"")))}};return addEventListener("click",t),()=>removeEventListener("click",t)}function vc(){return Ls("tinro").meta.params}var li="tinro",xc=ba({pattern:"",matched:!0});function wc(e){let t=Ls(li)||xc;(t.exact||t.fallback)&&pa(`${e.fallback?"":``} can't be inside ${t.fallback?"":` with exact path`}`);let n=e.fallback?"fallbacks":"childs",i=Ft({}),s=ba({fallback:e.fallback,parent:t,update(o){s.exact=!o.path.endsWith("/*"),s.pattern=us(`${s.parent.pattern||""}${o.path}`),s.redirect=o.redirect,s.firstmatch=o.firstmatch,s.breadcrumb=o.breadcrumb,s.match()},register:()=>(s.parent[n].add(s),async()=>{s.parent[n].delete(s),s.parent.activeChilds.delete(s),s.router.un&&s.router.un(),s.parent.match()}),show:()=>{e.onShow(),!s.fallback&&s.parent.activeChilds.add(s)},hide:()=>{e.onHide(),s.parent.activeChilds.delete(s)},match:async()=>{s.matched=!1;let{path:o,url:r,from:a,query:l}=s.router.location,c=dc(s.pattern,o);if(!s.fallback&&c&&s.redirect&&(!s.exact||s.exact&&c.exact)){let u=ga(o,s.parent.pattern,s.redirect);return Oe.goto(u,!0)}s.meta=c&&{from:a,url:r,query:l,match:c.part,pattern:s.pattern,breadcrumbs:s.parent.meta&&s.parent.meta.breadcrumbs.slice()||[],params:c.params,subscribe:i.subscribe},s.breadcrumb&&s.meta&&s.meta.breadcrumbs.push({name:s.breadcrumb,path:c.part}),i.set(s.meta),c&&!s.fallback&&(!s.exact||s.exact&&c.exact)&&(!s.parent.firstmatch||!s.parent.matched)?(e.onMeta(s.meta),s.parent.matched=!0,s.show()):s.hide(),c&&s.showFallbacks()}});return Jl(li,s),$i(()=>s.register()),s}function Vs(){return tc(li)?Ls(li).meta:pa("meta() function must be run inside any `` child component only")}function ba(e){let t={router:{},exact:!1,pattern:null,meta:null,parent:null,fallback:!1,redirect:!1,firstmatch:!1,breadcrumb:null,matched:!1,childs:new Set,activeChilds:new Set,fallbacks:new Set,async showFallbacks(){if(!this.fallback&&(await Ts(),this.childs.size>0&&this.activeChilds.size==0||this.childs.size==0&&this.fallbacks.size>0)){let n=this;for(;n.fallbacks.size==0;)if(n=n.parent,!n)return;n&&n.fallbacks.forEach(i=>{if(i.redirect){let s=ga("/",i.parent.pattern,i.redirect);Oe.goto(s,!0)}else i.show()})}},start(){this.router.un||(this.router.un=Oe.subscribe(n=>{this.router.location=n,this.pattern!==null&&this.match()}))},match(){this.showFallbacks()}};return Object.assign(t,e),t.start(),t}const Sc=e=>({params:e&2,meta:e&4}),ao=e=>({params:e[1],meta:e[2]});function lo(e){let t;const n=e[9].default,i=Rt(n,e,e[8],ao);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&262)&&At(i,n,s,s[8],t?$t(n,s[8],o,Sc):Pt(s[8]),ao)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function Cc(e){let t,n,i=e[0]&&lo(e);return{c(){i&&i.c(),t=kn()},m(s,o){i&&i.m(s,o),ot(s,t,o),n=!0},p(s,[o]){s[0]?i?(i.p(s,o),o&1&&S(i,1)):(i=lo(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(Lt(),M(i,1,1,()=>{i=null}),Tt())},i(s){n||(S(i),n=!0)},o(s){M(i),n=!1},d(s){i&&i.d(s),s&&X(t)}}}function Mc(e,t,n){let{$$slots:i={},$$scope:s}=t,{path:o="/*"}=t,{fallback:r=!1}=t,{redirect:a=!1}=t,{firstmatch:l=!1}=t,{breadcrumb:c=null}=t,u=!1,f={},d={};const h=wc({fallback:r,onShow(){n(0,u=!0)},onHide(){n(0,u=!1)},onMeta(g){n(2,d=g),n(1,f=d.params)}});return e.$$set=g=>{"path"in g&&n(3,o=g.path),"fallback"in g&&n(4,r=g.fallback),"redirect"in g&&n(5,a=g.redirect),"firstmatch"in g&&n(6,l=g.firstmatch),"breadcrumb"in g&&n(7,c=g.breadcrumb),"$$scope"in g&&n(8,s=g.$$scope)},e.$$.update=()=>{e.$$.dirty&232&&h.update({path:o,redirect:a,firstmatch:l,breadcrumb:c})},[u,f,d,o,r,a,l,c,s,i]}class co extends K{constructor(t){super(),Q(this,t,Mc,Cc,Y,{path:3,fallback:4,redirect:5,firstmatch:6,breadcrumb:7})}}async function ya(e,t={}){const n={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},i=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${i}/${e}`,n)).json()}var uo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function fo(e,t,n){const i=e.slice();return i[9]=t[n][0],i[10]=t[n][1],i}function Bi(e){let t,n=[e[10]],i={};for(let s=0;s{n(6,t=N(N({},t),nt(d))),n(5,s=no(t,i)),"name"in d&&n(0,a=d.name),"color"in d&&n(1,l=d.color),"size"in d&&n(2,c=d.size),"stroke"in d&&n(3,u=d.stroke),"iconNode"in d&&n(4,f=d.iconNode),"$$scope"in d&&n(7,r=d.$$scope)},t=nt(t),[a,l,c,u,f,s,t,r,o]}class $c extends K{constructor(t){super(),Q(this,t,Rc,kc,Y,{name:0,color:1,size:2,stroke:3,iconNode:4})}}const le=$c;function Ac(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function Pc(e){let t,n;const i=[{name:"chevron-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Ac]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Dc extends K{constructor(t){super(),Q(this,t,Fc,Pc,Y,{})}}const va=Dc;function Oc(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function Ec(e){let t,n;const i=[{name:"chevron-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Oc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Tc extends K{constructor(t){super(),Q(this,t,Lc,Ec,Y,{})}}const Ic=Tc;function Vc(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function zc(e){let t,n;const i=[{name:"chevrons-left"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Vc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Nc extends K{constructor(t){super(),Q(this,t,Hc,zc,Y,{})}}const Bc=Nc;function jc(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function Wc(e){let t,n;const i=[{name:"chevrons-right"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[jc]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class qc extends K{constructor(t){super(),Q(this,t,Gc,Wc,Y,{})}}const Yc=qc,ji=Ft(!1),fs=Ft("");let go;const Uc=Ai(fs,(e,t)=>(go=setTimeout(()=>t(e),500),()=>clearTimeout(go))),ds=Ft([]),Xc=Ai([ds,Uc],([e,t],n)=>{if(t===""||!t)return n(e);const i=t.toLowerCase();return n(e.filter(s=>s.toLowerCase().includes(i)))}),hs=Ft({queries:0,timeQuerying:0,slowQueries:0}),gs=Ft({labels:[],data:[]}),Qn=Ft([]),ps=Ft({resourceQueriesCount:0,resourceSlowQueries:0,resourceTime:0}),de=Ft(0);let po;const Kc=Ai(de,(e,t)=>{clearTimeout(po),po=setTimeout(()=>{t(e)},300)});function Qc(e){let t,n,i,s,o,r,a,l,c,u,f,d=e[1]+1+"",h,g,p,m,_,b,y,x,v,R,k,$,A,F;return i=new Bc({}),a=new va({}),b=new Ic({}),R=new Yc({}),{c(){t=P("div"),n=P("button"),H(i.$$.fragment),o=q(),r=P("button"),H(a.$$.fragment),c=q(),u=P("p"),f=J("Page "),h=J(d),g=J(" of "),p=J(e[0]),m=q(),_=P("button"),H(b.$$.fragment),x=q(),v=P("button"),H(R.$$.fragment),n.disabled=s=e[1]===0,O(n,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 disabled:cursor-not-allowed text-dark-100 hover:text-white focus-visible:text-white rounded-md hover:bg-dark-500 p-2 active:translate-y-[3px] outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),r.disabled=l=e[1]===0,O(r,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 disabled:cursor-not-allowed text-dark-100 hover:text-white focus-visible:text-white rounded-md hover:bg-dark-500 p-2 active:translate-y-[3px] outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),_.disabled=y=e[1]>=e[0]-1,O(_,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 disabled:cursor-not-allowed text-dark-100 hover:text-white focus-visible:text-white rounded-md hover:bg-dark-500 p-2 active:translate-y-[3px] outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),v.disabled=k=e[1]===e[0]-1,O(v,"class","bg-dark-600 disabled:bg-dark-300 disabled:text-dark-400 disabled:cursor-not-allowed text-dark-100 hover:text-white focus-visible:text-white rounded-md hover:bg-dark-500 p-2 active:translate-y-[3px] outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),O(t,"class","flex justify-center items-center gap-6 pb-5")},m(C,D){ot(C,t,D),w(t,n),V(i,n,null),w(t,o),w(t,r),V(a,r,null),w(t,c),w(t,u),w(u,f),w(u,h),w(u,g),w(u,p),w(t,m),w(t,_),V(b,_,null),w(t,x),w(t,v),V(R,v,null),$=!0,A||(F=[Nt(n,"click",e[2]),Nt(r,"click",e[3]),Nt(_,"click",e[4]),Nt(v,"click",e[5])],A=!0)},p(C,[D]){(!$||D&2&&s!==(s=C[1]===0))&&(n.disabled=s),(!$||D&2&&l!==(l=C[1]===0))&&(r.disabled=l),(!$||D&2)&&d!==(d=C[1]+1+"")&&jt(h,d),(!$||D&1)&&jt(p,C[0]),(!$||D&3&&y!==(y=C[1]>=C[0]-1))&&(_.disabled=y),(!$||D&3&&k!==(k=C[1]===C[0]-1))&&(v.disabled=k)},i(C){$||(S(i.$$.fragment,C),S(a.$$.fragment,C),S(b.$$.fragment,C),S(R.$$.fragment,C),$=!0)},o(C){M(i.$$.fragment,C),M(a.$$.fragment,C),M(b.$$.fragment,C),M(R.$$.fragment,C),$=!1},d(C){C&&X(t),z(i),z(a),z(b),z(R),A=!1,Jt(F)}}}function Zc(e,t,n){let i;gt(e,de,c=>n(1,i=c));let{maxPage:s}=t;en(()=>n(0,s=0));const o=()=>St(de,i=0,i),r=()=>St(de,i--,i),a=()=>St(de,i++,i),l=()=>St(de,i=s-1,i);return e.$$set=c=>{"maxPage"in c&&n(0,s=c.maxPage)},[s,i,o,r,a,l]}let Jc=class extends K{constructor(t){super(),Q(this,t,Zc,Qc,Y,{maxPage:0})}};function tu(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function eu(e){let t,n;const i=[{name:"chevron-down"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[tu]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class iu extends K{constructor(t){super(),Q(this,t,nu,eu,Y,{})}}const su=iu;function ou(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function ru(e){let t,n;const i=[{name:"chevron-up"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[ou]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class lu extends K{constructor(t){super(),Q(this,t,au,ru,Y,{})}}const cu=lu;/** * table-core * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function he(e,t){return typeof e=="function"?e(t):e}function It(e,t){return n=>{t.setState(i=>({...i,[e]:he(n,i[e])}))}}function ci(e){return e instanceof Function}function uu(e,t){const n=[],i=s=>{s.forEach(o=>{n.push(o);const r=t(o);r!=null&&r.length&&i(r)})};return i(e),n}function L(e,t,n){let i=[],s;return()=>{let o;n.key&&n.debug&&(o=Date.now());const r=e();if(!(r.length!==i.length||r.some((c,u)=>i[u]!==c)))return s;i=r;let l;if(n.key&&n.debug&&(l=Date.now()),s=t(...r),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,d=(h,g)=>{for(h=String(h);h.length{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:i,depth:n,columnDef:a,columns:[],getFlatColumns:L(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:L(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,h)=>Object.assign(d,h.createColumn==null?void 0:h.createColumn(f,e)),f),f}function mo(e,t,n){var i;let o={id:(i=n.id)!=null?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),r.push(l)};return a(o),r},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(r=>{Object.assign(o,r.createHeader==null?void 0:r.createHeader(o,e))}),o}const du={createTable:e=>({getHeaderGroups:L(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>{var o,r;const a=(o=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],l=(r=s==null?void 0:s.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?r:[],c=n.filter(f=>!(i!=null&&i.includes(f.id))&&!(s!=null&&s.includes(f.id)));return Dn(t,[...a,...c,...l],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:L(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>(n=n.filter(o=>!(i!=null&&i.includes(o.id))&&!(s!=null&&s.includes(o.id))),Dn(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:L(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return Dn(t,o,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:L(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var s;const o=(s=i==null?void 0:i.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?s:[];return Dn(t,o,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:L(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:L(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:L(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:L(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:L(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:L(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:L(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:L(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:L(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:L(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:L(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:L(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,i)=>{var s,o,r,a,l,c;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(l=(c=i[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function Dn(e,t,n,i){var s,o;let r=0;const a=function(d,h){h===void 0&&(h=1),r=Math.max(r,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[i,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const _=[...p].reverse()[0],b=m.column.depth===g.depth;let y,x=!1;if(b&&m.column.parent?y=m.column.parent:(y=m.column,x=!0),_&&(_==null?void 0:_.column)===y)_.subHeaders.push(m);else{const v=mo(n,y,{id:[i,h,y.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(R=>R.column===y).length}`:void 0,depth:h,index:p.length});v.subHeaders.push(m),p.push(v)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>mo(n,d,{depth:r,index:h}));c(u,r-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,_=[0];g.subHeaders&&g.subHeaders.length?(_=[],f(g.subHeaders).forEach(y=>{let{colSpan:x,rowSpan:v}=y;p+=x,_.push(v)})):p=1;const b=Math.min(..._);return m=m+b,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((s=(o=l[0])==null?void 0:o.headers)!=null?s:[]),l}const On={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Wi=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hu={getDefaultColumnDef:()=>On,getInitialState:e=>({columnSizing:{},columnSizingInfo:Wi(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:It("columnSizing",e),onColumnSizingInfoChange:It("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,i,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:On.minSize,(i=o??e.columnDef.size)!=null?i:On.size),(s=e.columnDef.maxSize)!=null?s:On.maxSize)},getStart:n=>{const i=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),s=i.findIndex(o=>o.id===e.id);if(s>0){const o=i[s-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:i,...s}=n;return s})},getCanResize:()=>{var n,i;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return i(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),i=n==null?void 0:n.getCanResize();return s=>{if(!n||!i||(s.persist==null||s.persist(),Gi(s)&&s.touches&&s.touches.length>1))return;const o=e.getSize(),r=e?e.getLeafHeaders().map(p=>[p.column.id,p.column.getSize()]):[[n.id,n.getSize()]],a=Gi(s)?Math.round(s.touches[0].clientX):s.clientX,l={},c=(p,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(_=>{var b,y;const x=m-((b=_==null?void 0:_.startOffset)!=null?b:0),v=Math.max(x/((y=_==null?void 0:_.startSize)!=null?y:0),-.999999);return _.columnSizingStart.forEach(R=>{let[k,$]=R;l[k]=Math.round(Math.max($+$*v,0)*100)/100}),{..._,deltaOffset:x,deltaPercentage:v}}),(t.options.columnResizeMode==="onChange"||p==="end")&&t.setColumnSizing(_=>({..._,...l})))},u=p=>c("move",p),f=p=>{c("end",p),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:p=>u(p.clientX),upHandler:p=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(p.clientX)}},h={moveHandler:p=>(p.cancelable&&(p.preventDefault(),p.stopPropagation()),u(p.touches[0].clientX),!1),upHandler:p=>{var m;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),p.cancelable&&(p.preventDefault(),p.stopPropagation()),f((m=p.touches[0])==null?void 0:m.clientX)}},g=gu()?{passive:!1}:!1;Gi(s)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",d.moveHandler,g),document.addEventListener("mouseup",d.upHandler,g)),t.setColumnSizingInfo(p=>({...p,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?Wi():(n=e.initialState.columnSizingInfo)!=null?n:Wi())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0}})};let En=null;function gu(){if(typeof En=="boolean")return En;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return En=e,En}function Gi(e){return e.type==="touchstart"}const pu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:It("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),toggleAllRowsExpanded:i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:i=>{var s,o;e.setExpanded(i?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},getCanSomeRowsExpand:()=>e.getRowModel().flatRows.some(i=>i.getCanExpand()),getToggleAllRowsExpandedHandler:()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},getIsAllRowsExpanded:()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},getExpandedDepth:()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const r=o.split(".");i=Math.max(i,r.length)}),i},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(i=>{var s;const o=i===!0?!0:!!(i!=null&&i[e.id]);let r={};if(i===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=i,n=(s=n)!=null?s:!o,!o&&n)return{...r,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=r;return l}return i})},getIsExpanded:()=>{var n;const i=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:i===!0||i!=null&&i[e.id])},getCanExpand:()=>{var n,i,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((i=t.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},xa=(e,t,n)=>{var i;const s=n.toLowerCase();return!!((i=e.getValue(t))!=null&&i.toLowerCase().includes(s))};xa.autoRemove=e=>Wt(e);const wa=(e,t,n)=>{var i;return!!((i=e.getValue(t))!=null&&i.includes(n))};wa.autoRemove=e=>Wt(e);const Sa=(e,t,n)=>{var i;return((i=e.getValue(t))==null?void 0:i.toLowerCase())===n.toLowerCase()};Sa.autoRemove=e=>Wt(e);const Ca=(e,t,n)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(n)};Ca.autoRemove=e=>Wt(e)||!(e!=null&&e.length);const Ma=(e,t,n)=>!n.some(i=>{var s;return!((s=e.getValue(t))!=null&&s.includes(i))});Ma.autoRemove=e=>Wt(e)||!(e!=null&&e.length);const ka=(e,t,n)=>n.some(i=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(i)});ka.autoRemove=e=>Wt(e)||!(e!=null&&e.length);const Ra=(e,t,n)=>e.getValue(t)===n;Ra.autoRemove=e=>Wt(e);const $a=(e,t,n)=>e.getValue(t)==n;$a.autoRemove=e=>Wt(e);const zs=(e,t,n)=>{let[i,s]=n;const o=e.getValue(t);return o>=i&&o<=s};zs.resolveFilterValue=e=>{let[t,n]=e,i=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(i)?-1/0:i,r=n===null||Number.isNaN(s)?1/0:s;if(o>r){const a=o;o=r,r=a}return[o,r]};zs.autoRemove=e=>Wt(e)||Wt(e[0])&&Wt(e[1]);const ee={includesString:xa,includesStringSensitive:wa,equalsString:Sa,arrIncludes:Ca,arrIncludesAll:Ma,arrIncludesSome:ka,equals:Ra,weakEquals:$a,inNumberRange:zs};function Wt(e){return e==null||e===""}const mu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:It("columnFilters",e),onGlobalFilterChange:It("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,i;const s=(n=e.getCoreRowModel().flatRows[0])==null||(i=n._getAllCellsByColumnId()[t.id])==null?void 0:i.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);return typeof i=="string"?ee.includesString:typeof i=="number"?ee.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?ee.equals:Array.isArray(i)?ee.arrIncludes:ee.weakEquals},getFilterFn:()=>{var n,i;return ci(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?n:ee[e.columnDef.filterFn]},getCanFilter:()=>{var n,i,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,i,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,i;return(n=t.getState().columnFilters)==null||(i=n.find(s=>s.id===e.id))==null?void 0:i.value},getFilterIndex:()=>{var n,i;return(n=(i=t.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(i=>{const s=e.getFilterFn(),o=i==null?void 0:i.find(u=>u.id===e.id),r=he(n,o?o.value:void 0);if(_o(s,r,e)){var a;return(a=i==null?void 0:i.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:r};if(o){var c;return(c=i==null?void 0:i.map(u=>u.id===e.id?l:u))!=null?c:[]}return i!=null&&i.length?[...i,l]:[l]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>ee.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:i}=e.options;return ci(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[i])!=null?t:ee[i]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),i=s=>{var o;return(o=he(t,s))==null?void 0:o.filter(r=>{const a=n.find(l=>l.id===r.id);if(a){const l=a.getFilterFn();if(_o(l,r.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,i;e.setColumnFilters(t?[]:(n=(i=e.initialState)==null?void 0:i.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function _o(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const _u=(e,t,n)=>n.reduce((i,s)=>{const o=s.getValue(e);return i+(typeof o=="number"?o:0)},0),bu=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i>o||i===void 0&&o>=o)&&(i=o)}),i},yu=(e,t,n)=>{let i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(i=o)&&(i=o)}),i},vu=(e,t,n)=>{let i,s;return n.forEach(o=>{const r=o.getValue(e);r!=null&&(i===void 0?r>=r&&(i=s=r):(i>r&&(i=r),s{let n=0,i=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,i+=o)}),n)return i/n},wu=(e,t)=>{if(!t.length)return;let n=0,i=0;return t.forEach(s=>{let o=s.getValue(e);typeof o=="number"&&(n=Math.min(n,o),i=Math.max(i,o))}),(n+i)/2},Su=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Cu=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Mu=(e,t)=>t.length,qi={sum:_u,min:bu,max:yu,extent:vu,mean:xu,median:wu,unique:Su,uniqueCount:Cu,count:Mu},ku={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:It("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(i=>i!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,i,s,o;return(n=(i=(s=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?s:t.options.enableGrouping)!=null?i:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],i=n==null?void 0:n.getValue(e.id);if(typeof i=="number")return qi.sum;if(Object.prototype.toString.call(i)==="[object Date]")return qi.extent},getAggregationFn:()=>{var n,i;if(!e)throw new Error;return ci(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?n:qi[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,i;e.setGrouping(t?[]:(n=(i=e.initialState)==null?void 0:i.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:e=>({getIsGrouped:()=>!!e.groupingColumnId,_groupingValuesCache:{}}),createCell:(e,t,n,i)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}})};function Ru(e,t,n){if(!(t!=null&&t.length)||!n)return e;const i=e.filter(o=>!t.includes(o.id));return n==="remove"?i:[...t.map(o=>e.find(r=>r.id===o)).filter(Boolean),...i]}const $u={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:It("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:L(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,i)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const r=[...t],a=[...s];for(;a.length&&r.length;){const l=r.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return Ru(o,n,i)},{key:!1})})},ms=0,_s=10,Yi=()=>({pageIndex:ms,pageSize:_s}),Au={getInitialState:e=>({...e,pagination:{...Yi(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:It("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:i=>{const s=o=>he(i,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},resetPagination:i=>{var s;e.setPagination(i?Yi():(s=e.initialState.pagination)!=null?s:Yi())},setPageIndex:i=>{e.setPagination(s=>{let o=he(i,s.pageIndex);const r=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,r)),{...s,pageIndex:o}})},resetPageIndex:i=>{var s,o,r;e.setPageIndex(i?ms:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageIndex)!=null?s:ms)},resetPageSize:i=>{var s,o,r;e.setPageSize(i?_s:(s=(o=e.initialState)==null||(r=o.pagination)==null?void 0:r.pageSize)!=null?s:_s)},setPageSize:i=>{e.setPagination(s=>{const o=Math.max(1,he(i,s.pageSize)),r=s.pageSize*s.pageIndex,a=Math.floor(r/o);return{...s,pageIndex:a,pageSize:o}})},setPageCount:i=>e.setPagination(s=>{var o;let r=he(i,(o=e.options.pageCount)!=null?o:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...s,pageCount:r}}),getPageOptions:L(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((o,r)=>r)),s},{key:!1,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:ie.setPageIndex(i=>i-1),nextPage:()=>e.setPageIndex(i=>i+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},Ui=()=>({left:[],right:[]}),Pu={getInitialState:e=>({columnPinning:Ui(),...e}),getDefaultOptions:e=>({onColumnPinningChange:It("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,r;if(n==="right"){var a,l;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(f=>!(i!=null&&i.includes(f))),right:[...((l=s==null?void 0:s.right)!=null?l:[]).filter(f=>!(i!=null&&i.includes(f))),...i]}}if(n==="left"){var c,u;return{left:[...((c=s==null?void 0:s.left)!=null?c:[]).filter(f=>!(i!=null&&i.includes(f))),...i],right:((u=s==null?void 0:s.right)!=null?u:[]).filter(f=>!(i!=null&&i.includes(f)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(f=>!(i!=null&&i.includes(f))),right:((r=s==null?void 0:s.right)!=null?r:[]).filter(f=>!(i!=null&&i.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(i=>{var s,o;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:i,right:s}=t.getState().columnPinning,o=n.some(a=>i==null?void 0:i.includes(a)),r=n.some(a=>s==null?void 0:s.includes(a));return o?"left":r?"right":!1},getPinnedIndex:()=>{var n,i,s;const o=e.getIsPinned();return o?(n=(i=t.getState().columnPinning)==null||(s=i[o])==null?void 0:s.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:L(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,i,s)=>{const o=[...i??[],...s??[]];return n.filter(r=>!o.includes(r.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:L(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:L(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,i)=>(i??[]).map(o=>n.find(r=>r.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,i;return e.setColumnPinning(t?Ui():(n=(i=e.initialState)==null?void 0:i.columnPinning)!=null?n:Ui())},getIsSomeColumnsPinned:t=>{var n;const i=e.getState().columnPinning;if(!t){var s,o;return!!((s=i.left)!=null&&s.length||(o=i.right)!=null&&o.length)}return!!((n=i[t])!=null&&n.length)},getLeftLeafColumns:L(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:L(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:L(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i)=>{const s=[...n??[],...i??[]];return t.filter(o=>!s.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Fu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:It("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(i[o.id]=!0)}):s.forEach(o=>{delete i[o.id]}),i})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{bs(s,o.id,i,e)}),s}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:L(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:L(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:L(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Xi(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!(t.length&&Object.keys(n).length);return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const i=e.getIsSelected();t.setRowSelection(s=>{if(n=typeof n<"u"?n:!i,i===n)return s;const o={...s};return bs(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Hs(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return bo(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return bo(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return i=>{var s;n&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}})},bs=(e,t,n,i)=>{var s;const o=i.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(r=>delete e[r]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(s=o.subRows)!=null&&s.length&&o.getCanSelectSubRows()&&o.subRows.forEach(r=>bs(e,r.id,n,i))};function Xi(e,t){const n=e.getState().rowSelection,i=[],s={},o=function(r,a){return r.map(l=>{var c;const u=Hs(l,n);if(u&&(i.push(l),s[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:s}}function Hs(e,t){var n;return(n=t[e.id])!=null?n:!1}function bo(e,t,n){if(e.subRows&&e.subRows.length){let i=!0,s=!1;return e.subRows.forEach(o=>{s&&!i||(Hs(o,t)?s=!0:i=!1)}),i?"all":s?"some":!1}return!1}const ys=/([0-9]+)/gm,Du=(e,t,n)=>Aa(ye(e.getValue(n)).toLowerCase(),ye(t.getValue(n)).toLowerCase()),Ou=(e,t,n)=>Aa(ye(e.getValue(n)),ye(t.getValue(n))),Eu=(e,t,n)=>Ns(ye(e.getValue(n)).toLowerCase(),ye(t.getValue(n)).toLowerCase()),Lu=(e,t,n)=>Ns(ye(e.getValue(n)),ye(t.getValue(n))),Tu=(e,t,n)=>{const i=e.getValue(n),s=t.getValue(n);return i>s?1:iNs(e.getValue(n),t.getValue(n));function Ns(e,t){return e===t?0:e>t?1:-1}function ye(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Aa(e,t){const n=e.split(ys).filter(Boolean),i=t.split(ys).filter(Boolean);for(;n.length&&i.length;){const s=n.shift(),o=i.shift(),r=parseInt(s,10),a=parseInt(o,10),l=[r,a].sort();if(isNaN(l[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(l[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-i.length}const sn={alphanumeric:Du,alphanumericCaseSensitive:Ou,text:Eu,textCaseSensitive:Lu,datetime:Tu,basic:Iu},Vu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:It("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return sn.datetime;if(typeof o=="string"&&(i=!0,o.split(ys).length>1))return sn.alphanumeric}return i?sn.text:sn.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,i;if(!e)throw new Error;return ci(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?n:sn[e.columnDef.sortingFn]},toggleSorting:(n,i)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===e.id),l=r==null?void 0:r.findIndex(h=>h.id===e.id);let c=[],u,f=o?n:s==="desc";if(r!=null&&r.length&&e.getCanMultiSort()&&i?a?u="toggle":u="add":r!=null&&r.length&&l!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||s||(u="remove")),u==="add"){var d;c=[...r,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=r.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=r.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},getFirstSortDir:()=>{var n,i;return((n=(i=e.columnDef.sortDescFirst)!=null?i:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var i,s;const o=e.getFirstSortDir(),r=e.getIsSorted();return r?r!==o&&((i=t.options.enableSortingRemoval)==null||i)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:r==="desc"?"asc":"desc":o},getCanSort:()=>{var n,i;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,i;return(n=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const i=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},getSortIndex:()=>{var n,i;return(n=(i=t.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return i=>{n&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,i;e.setSorting(t?[]:(n=(i=e.initialState)==null?void 0:i.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},zu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:It("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(i=>({...i,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,i;return(n=(i=t.getState().columnVisibility)==null?void 0:i[e.id])!=null?n:!0},getCanHide:()=>{var n,i;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((i=t.options.enableHiding)!=null?i:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:L(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:L(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,i,s)=>[...n,...i,...s],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,i)=>L(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var i;e.setColumnVisibility(n?{}:(i=e.initialState.columnVisibility)!=null?i:{})},toggleAllColumnsVisible:n=>{var i;n=(i=n)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var i;e.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}}},yo=[du,zu,$u,Pu,mu,Vu,ku,pu,Au,Fu,hu];function Hu(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:yo};const i=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),s=u=>n.options.mergeOptions?n.options.mergeOptions(i,u):{...i,...u};let r={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let l=!1;const c={_features:yo,options:{...i,...e},initialState:r,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=he(u,n.options);n.options=s(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,d)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,d))!=null?h:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:u=>{const f=n.getRowModel().rowsById[u];if(!f)throw new Error;return f},_getDefaultColumnDef:L(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:d=>{const h=d.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:d=>{var h,g;return(h=(g=d.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((d,h)=>Object.assign(d,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:L(()=>[n._getColumnDefs()],u=>{const f=function(d,h,g){return g===void 0&&(g=0),d.map(p=>{const m=fu(n,p,g,h),_=p;return m.columns=_.columns?f(_.columns,m,g+1):[],m})};return f(u)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:L(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:L(()=>[n.getAllFlatColumns()],u=>u.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:L(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let d=u.flatMap(h=>h.getLeafColumns());return f(d)},{key:!1,debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>n._getAllFlatColumnsById()[u]};return Object.assign(n,c),n._features.forEach(u=>Object.assign(n,u.createTable==null?void 0:u.createTable(n))),n}function Nu(e,t,n,i){const s=()=>{var r;return(r=o.getValue())!=null?r:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:s,getContext:L(()=>[e,n,t,o],(r,a,l,c)=>({table:r,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(r=>{Object.assign(o,r.createCell==null?void 0:r.createCell(o,n,t,e))},{}),o}const Bu=(e,t,n,i,s,o,r)=>{let a={id:t,index:i,original:n,depth:s,parentRow:r,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,i),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,i),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>uu(a.subRows,l=>l.subRows),getAllCells:L(()=>[e.getAllLeafColumns()],l=>l.map(c=>Nu(e,a,c,c.id)),{key:!1,debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:L(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;lL(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(s,o,r){o===void 0&&(o=0);const a=[];for(let c=0;c{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}/** * svelte-table * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Wu(e){let t;return{c(){t=J(e[0])},l(n){t=ql(n,e[0])},m(n,i){Nl(n,t,i)},p(n,[i]){i&1&&jt(t,n[0])},i:ht,o:ht,d(n){n&&X(t)}}}function Gu(e,t,n){let{content:i}=t;return e.$$set=s=>{"content"in s&&n(0,i=s.content)},[i]}class qu extends K{constructor(t){super(),Q(this,t,Gu,Wu,Y,{content:0})}}const Yu=da((e,t,n,i)=>`${lc(t.content)}`);var Uu=typeof document>"u"?Yu:qu;function Xu(e,t,n){let i,s;return i=new t({props:n,$$inline:!0}),{c(){H(i.$$.fragment)},l(o){uc(i.$$.fragment,o)},m(o,r){V(i,o,r),s=!0},p:ht,i(o){s||(S(i.$$.fragment,o),s=!0)},o(o){M(i.$$.fragment,o),s=!1},d(o){z(i,o)}}}function Ku(e,t){return class extends K{constructor(i){super(),Q(this,i,null,s=>Xu(s,e,t),Y,{},void 0)}}}function Qu(e,t){return da((i,s,o,r)=>`${cc(e,"TableComponent").$$render(i,t,{},{})}`)}const Pa=typeof window>"u"?Qu:Ku;function Zu(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Ju(e){var t,n;let i="__SVELTE_HMR"in window;return e.prototype instanceof K||i&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function vo(e){return typeof document>"u"?Zu(e):Ju(e)}function xo(e){return Pa(Uu,{content:e})}function ui(e,t){if(!e)return null;if(vo(e))return Pa(e,t);if(typeof e=="function"){const n=e(t);return vo(n)?n:xo(n)}return xo(e)}function tf(e){let t;"subscribe"in e?t=e:t=cs(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...Fl(t)},i=Hu(n),s=Ft(i.initialState),o=Ai([s,t],a=>a);return cs(i,function(l){const c=o.subscribe(u=>{let[f,d]=u;i.setOptions(h=>({...h,...d,state:{...f,...d.state},onStateChange:g=>{g instanceof Function?s.update(g):s.set(g),n.onStateChange==null||n.onStateChange(g)}})),l(i)});return function(){c()}})}function Pi(e){return e.split("-")[1]}function Fa(e){return e==="y"?"height":"width"}function Pe(e){return e.split("-")[0]}function Fi(e){return["top","bottom"].includes(Pe(e))?"x":"y"}function wo(e,t,n){let{reference:i,floating:s}=e;const o=i.x+i.width/2-s.width/2,r=i.y+i.height/2-s.height/2,a=Fi(t),l=Fa(a),c=i[l]/2-s[l]/2,u=a==="x";let f;switch(Pe(t)){case"top":f={x:o,y:i.y-s.height};break;case"bottom":f={x:o,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:r};break;case"left":f={x:i.x-s.width,y:r};break;default:f={x:i.x,y:i.y}}switch(Pi(t)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(n&&u?-1:1)}return f}const ef=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=wo(c,i,l),d=i,h={},g=0;for(let p=0;pe.concat(t,t+"-start",t+"-end"),[]);const af={left:"right",right:"left",bottom:"top",top:"bottom"};function di(e){return e.replace(/left|right|bottom|top/g,t=>af[t])}function lf(e,t,n){n===void 0&&(n=!1);const i=Pi(e),s=Fi(e),o=Fa(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=di(r)),{main:r,cross:di(r)}}const cf={start:"end",end:"start"};function Ki(e){return e.replace(/start|end/g,t=>cf[t])}const uf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:i,middlewareData:s,rects:o,initialPlacement:r,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...p}=e,m=Pe(i),_=Pe(r)===r,b=await(a.isRTL==null?void 0:a.isRTL(l.floating)),y=f||(_||!g?[di(r)]:function(C){const D=di(C);return[Ki(C),D,Ki(D)]}(r));f||h==="none"||y.push(...function(C,D,U,Z){const E=Pi(C);let T=function(B,ft,it){const xt=["left","right"],Ut=["right","left"],pt=["top","bottom"],mt=["bottom","top"];switch(B){case"top":case"bottom":return it?ft?Ut:xt:ft?xt:Ut;case"left":case"right":return ft?pt:mt;default:return[]}}(Pe(C),U==="start",Z);return E&&(T=T.map(B=>B+"-"+E),D&&(T=T.concat(T.map(Ki)))),T}(r,g,h,b));const x=[r,...y],v=await Da(t,p),R=[];let k=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&R.push(v[m]),u){const{main:C,cross:D}=lf(i,o,b);R.push(v[C],v[D])}if(k=[...k,{placement:i,overflows:R}],!R.every(C=>C<=0)){var $,A;const C=((($=s.flip)==null?void 0:$.index)||0)+1,D=x[C];if(D)return{data:{index:C,overflows:k},reset:{placement:D}};let U=(A=k.filter(Z=>Z.overflows[0]<=0).sort((Z,E)=>Z.overflows[1]-E.overflows[1])[0])==null?void 0:A.placement;if(!U)switch(d){case"bestFit":{var F;const Z=(F=k.map(E=>[E.placement,E.overflows.filter(T=>T>0).reduce((T,B)=>T+B,0)]).sort((E,T)=>E[1]-T[1])[0])==null?void 0:F[0];Z&&(U=Z);break}case"initialPlacement":U=r}if(i!==U)return{reset:{placement:U}}}return{}}}},ff=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:i}=t,s=await async function(o,r){const{placement:a,platform:l,elements:c}=o,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Pe(a),d=Pi(a),h=Fi(a)==="x",g=["left","top"].includes(f)?-1:1,p=u&&h?-1:1,m=typeof r=="function"?r(o):r;let{mainAxis:_,crossAxis:b,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return d&&typeof y=="number"&&(b=d==="end"?-1*y:y),h?{x:b*p,y:_*g}:{x:_*g,y:b*p}}(t,e);return{x:n+s.x,y:i+s.y,data:s}}}};function df(e){return e==="x"?"y":"x"}const hf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:m=>{let{x:_,y:b}=m;return{x:_,y:b}}},...l}=e,c={x:n,y:i},u=await Da(t,l),f=Fi(Pe(s)),d=df(f);let h=c[f],g=c[d];if(o){const m=f==="y"?"bottom":"right";h=So(h+u[f==="y"?"top":"left"],h,h-u[m])}if(r){const m=d==="y"?"bottom":"right";g=So(g+u[d==="y"?"top":"left"],g,g-u[m])}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-i}}}}};function Ct(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zt(e){return Ct(e).getComputedStyle(e)}function Oa(e){return e instanceof Ct(e).Node}function ve(e){return Oa(e)?(e.nodeName||"").toLowerCase():""}let Ln;function Ea(){if(Ln)return Ln;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Ln=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Ln):navigator.userAgent}function qt(e){return e instanceof Ct(e).HTMLElement}function Gt(e){return e instanceof Ct(e).Element}function Co(e){return typeof ShadowRoot>"u"?!1:e instanceof Ct(e).ShadowRoot||e instanceof ShadowRoot}function Di(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=Zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(s)}function gf(e){return["table","td","th"].includes(ve(e))}function vs(e){const t=/firefox/i.test(Ea()),n=Zt(e),i=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!i&&i!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(s=>n.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const o=n.contain;return o!=null&&o.includes(s)})}function xs(){return/^((?!chrome|android).)*safari/i.test(Ea())}function Bs(e){return["html","body","#document"].includes(ve(e))}const Mo=Math.min,hn=Math.max,hi=Math.round;function La(e){const t=Zt(e);let n=parseFloat(t.width),i=parseFloat(t.height);const s=qt(e),o=s?e.offsetWidth:n,r=s?e.offsetHeight:i,a=hi(n)!==o||hi(i)!==r;return a&&(n=o,i=r),{width:n,height:i,fallback:a}}function Ta(e){return Gt(e)?e:e.contextElement}const Ia={x:1,y:1};function qe(e){const t=Ta(e);if(!qt(t))return Ia;const n=t.getBoundingClientRect(),{width:i,height:s,fallback:o}=La(t);let r=(o?hi(n.width):n.width)/i,a=(o?hi(n.height):n.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function Ee(e,t,n,i){var s,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=Ta(e);let l=Ia;t&&(i?Gt(i)&&(l=qe(i)):l=qe(e));const c=a?Ct(a):window,u=xs()&&n;let f=(r.left+(u&&((s=c.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,d=(r.top+(u&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/l.y,h=r.width/l.x,g=r.height/l.y;if(a){const p=Ct(a),m=i&&Gt(i)?Ct(i):i;let _=p.frameElement;for(;_&&i&&m!==p;){const b=qe(_),y=_.getBoundingClientRect(),x=getComputedStyle(_);y.x+=(_.clientLeft+parseFloat(x.paddingLeft))*b.x,y.y+=(_.clientTop+parseFloat(x.paddingTop))*b.y,f*=b.x,d*=b.y,h*=b.x,g*=b.y,f+=y.x,d+=y.y,_=Ct(_).frameElement}}return fi({width:h,height:g,x:f,y:d})}function _e(e){return((Oa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Oi(e){return Gt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Va(e){return Ee(_e(e)).left+Oi(e).scrollLeft}function vn(e){if(ve(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Co(e)&&e.host||_e(e);return Co(t)?t.host:t}function za(e){const t=vn(e);return Bs(t)?t.ownerDocument.body:qt(t)&&Di(t)?t:za(t)}function gn(e,t){var n;t===void 0&&(t=[]);const i=za(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=Ct(i);return s?t.concat(o,o.visualViewport||[],Di(i)?i:[]):t.concat(i,gn(i))}function ko(e,t,n){let i;if(t==="viewport")i=function(r,a){const l=Ct(r),c=_e(r),u=l.visualViewport;let f=c.clientWidth,d=c.clientHeight,h=0,g=0;if(u){f=u.width,d=u.height;const p=xs();(!p||p&&a==="fixed")&&(h=u.offsetLeft,g=u.offsetTop)}return{width:f,height:d,x:h,y:g}}(e,n);else if(t==="document")i=function(r){const a=_e(r),l=Oi(r),c=r.ownerDocument.body,u=hn(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),f=hn(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight);let d=-l.scrollLeft+Va(r);const h=-l.scrollTop;return Zt(c).direction==="rtl"&&(d+=hn(a.clientWidth,c.clientWidth)-u),{width:u,height:f,x:d,y:h}}(_e(e));else if(Gt(t))i=function(r,a){const l=Ee(r,!0,a==="fixed"),c=l.top+r.clientTop,u=l.left+r.clientLeft,f=qt(r)?qe(r):{x:1,y:1};return{width:r.clientWidth*f.x,height:r.clientHeight*f.y,x:u*f.x,y:c*f.y}}(t,n);else{const r={...t};if(xs()){var s,o;const a=Ct(e);r.x-=((s=a.visualViewport)==null?void 0:s.offsetLeft)||0,r.y-=((o=a.visualViewport)==null?void 0:o.offsetTop)||0}i=r}return fi(i)}function Ro(e,t){return qt(e)&&Zt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function $o(e,t){const n=Ct(e);if(!qt(e))return n;let i=Ro(e,t);for(;i&&gf(i)&&Zt(i).position==="static";)i=Ro(i,t);return i&&(ve(i)==="html"||ve(i)==="body"&&Zt(i).position==="static"&&!vs(i))?n:i||function(s){let o=vn(s);for(;qt(o)&&!Bs(o);){if(vs(o))return o;o=vn(o)}return null}(e)||n}function pf(e,t,n){const i=qt(t),s=_e(t),o=Ee(e,!0,n==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&n!=="fixed")if((ve(t)!=="body"||Di(s))&&(r=Oi(t)),qt(t)){const l=Ee(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Va(s));return{x:o.left+r.scrollLeft-a.x,y:o.top+r.scrollTop-a.y,width:o.width,height:o.height}}const mf={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=n==="clippingAncestors"?function(c,u){const f=u.get(c);if(f)return f;let d=gn(c).filter(m=>Gt(m)&&ve(m)!=="body"),h=null;const g=Zt(c).position==="fixed";let p=g?vn(c):c;for(;Gt(p)&&!Bs(p);){const m=Zt(p),_=vs(p);m.position==="fixed"?h=null:(g?_||h:_||m.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=m:d=d.filter(b=>b!==p),p=vn(p)}return u.set(c,d),d}(t,this._c):[].concat(n),r=[...o,i],a=r[0],l=r.reduce((c,u)=>{const f=ko(t,u,s);return c.top=hn(f.top,c.top),c.right=Mo(f.right,c.right),c.bottom=Mo(f.bottom,c.bottom),c.left=hn(f.left,c.left),c},ko(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:i}=e;const s=qt(n),o=_e(n);if(n===o)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&i!=="fixed")&&((ve(n)!=="body"||Di(o))&&(r=Oi(n)),qt(n))){const c=Ee(n);a=qe(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:Gt,getDimensions:function(e){return La(e)},getOffsetParent:$o,getDocumentElement:_e,getScale:qe,async getElementRects(e){let{reference:t,floating:n,strategy:i}=e;const s=this.getOffsetParent||$o,o=this.getDimensions;return{reference:pf(t,await s(n),i),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Zt(e).direction==="rtl"};function _f(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=!0,animationFrame:a=!1}=i,l=s&&!a,c=l||o?[...Gt(e)?gn(e):e.contextElement?gn(e.contextElement):[],...gn(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let u,f=null;r&&(f=new ResizeObserver(()=>{n()}),Gt(e)&&!a&&f.observe(e),Gt(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t));let d=a?Ee(e):null;return a&&function h(){const g=Ee(e);!d||g.x===d.x&&g.y===d.y&&g.width===d.width&&g.height===d.height||n(),d=g,u=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(g=>{l&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(u)}}const bf=(e,t,n)=>{const i=new Map,s={platform:mf,...n},o={...s.platform,_c:i};return ef(e,t,{...s,platform:o})};function yf(e){let t,n;const i={autoUpdate:!0};let s=e;const o=u=>({...i,...e||{},...u||{}}),r=u=>{t&&n&&(s=o(u),bf(t,n,s).then(f=>{Object.assign(n.style,{position:f.strategy,left:`${f.x}px`,top:`${f.y}px`}),s!=null&&s.onComputed&&s.onComputed(f)}))},a=u=>{if("subscribe"in u)return c(u),{};t=u,r()},l=(u,f)=>{let d;n=u,s=o(f),setTimeout(()=>r(f),0),r(f);const h=()=>{d&&(d(),d=void 0)},g=({autoUpdate:p}=s||{})=>{h(),p!==!1&&Ts().then(()=>_f(t,n,()=>r(s),p===!0?{}:p))};return d=g(),{update(p){r(p),d=g(p)},destroy(){h()}}},c=u=>{const f=u.subscribe(d=>{t===void 0?(t=d,r()):(Object.assign(t,d),r())});en(f)};return[a,l,r]}function vf(e){const t=e-1;return t*t*t+1}function Ao(e,{delay:t=0,duration:n=400,easing:i=ea}={}){const s=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:i,css:o=>`opacity: ${o*s}`}}function Po(e,{delay:t=0,duration:n=400,easing:i=vf,start:s=0,opacity:o=0}={}){const r=getComputedStyle(e),a=+r.opacity,l=r.transform==="none"?"":r.transform,c=1-s,u=a*(1-o);return{delay:t,duration:n,easing:i,css:(f,d)=>` transform: ${l} scale(${1-c*d}); opacity: ${a-u*d} `}}function xf(e){let t,n,i,s,o;const r=e[2].default,a=Rt(r,e,e[1],null);return{c(){t=P("div"),a&&a.c(),t.hidden=!0},m(l,c){ot(l,t,c),a&&a.m(t,null),i=!0,s||(o=Os(n=wf.call(null,t,e[0])),s=!0)},p(l,[c]){a&&a.p&&(!i||c&2)&&At(a,r,l,l[1],i?$t(r,l[1],c,null):Pt(l[1]),null),n&&ae(n.update)&&c&1&&n.update.call(null,l[0])},i(l){i||(S(a,l),i=!0)},o(l){M(a,l),i=!1},d(l){l&&X(t),a&&a.d(l),s=!1,o()}}}function wf(e,t="body"){let n;async function i(o){if(t=o,typeof t=="string"){if(n=document.querySelector(t),n===null&&(await Ts(),n=document.querySelector(t)),n===null)throw new Error(`No element found matching css selector: "${t}"`)}else if(t instanceof HTMLElement)n=t;else throw new TypeError(`Unknown portal target type: ${t===null?"null":typeof t}. Allowed types: string (CSS selector) or HTMLElement.`);n.appendChild(e),e.hidden=!1}function s(){e.parentNode&&e.parentNode.removeChild(e)}return i(t),{update:i,destroy:s}}function Sf(e,t,n){let{$$slots:i={},$$scope:s}=t,{target:o="body"}=t;return e.$$set=r=>{"target"in r&&n(0,o=r.target),"$$scope"in r&&n(1,s=r.$$scope)},[o,s,i]}class Cf extends K{constructor(t){super(),Q(this,t,Sf,xf,Y,{target:0})}}const Mf=e=>({}),Fo=e=>({floatingRef:e[3],displayTooltip:e[5],hideTooltip:e[6]});function Do(e){let t,n;return t=new Cf({props:{target:"body",$$slots:{default:[kf]},$$scope:{ctx:e}}}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},p(i,s){const o={};s&257&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function kf(e){let t,n,i,s,o,r;return{c(){t=P("div"),n=J(e[0]),O(t,"class","absolute p-2 text-sm bg-dark-50 text-dark-400 rounded-md max-w-xl font-main")},m(a,l){ot(a,t,l),w(t,n),s=!0,o||(r=Os(e[4].call(null,t)),o=!0)},p(a,l){(!s||l&1)&&jt(n,a[0])},i(a){s||(Qe(()=>{s&&(i||(i=ri(t,Ao,{duration:150},!0)),i.run(1))}),s=!0)},o(a){i||(i=ri(t,Ao,{duration:150},!1)),i.run(0),s=!1},d(a){a&&X(t),a&&i&&i.end(),o=!1,r()}}}function Rf(e){let t,n,i;const s=e[7].default,o=Rt(s,e,e[8],Fo);let r=e[2]&&!e[1]&&Do(e);return{c(){o&&o.c(),t=q(),r&&r.c(),n=kn()},m(a,l){o&&o.m(a,l),ot(a,t,l),r&&r.m(a,l),ot(a,n,l),i=!0},p(a,[l]){o&&o.p&&(!i||l&256)&&At(o,s,a,a[8],i?$t(s,a[8],l,Mf):Pt(a[8]),Fo),a[2]&&!a[1]?r?(r.p(a,l),l&6&&S(r,1)):(r=Do(a),r.c(),S(r,1),r.m(n.parentNode,n)):r&&(Lt(),M(r,1,1,()=>{r=null}),Tt())},i(a){i||(S(o,a),S(r),i=!0)},o(a){M(o,a),M(r),i=!1},d(a){o&&o.d(a),a&&X(t),r&&r.d(a),a&&X(n)}}}function $f(e,t,n){let{$$slots:i={},$$scope:s}=t,{content:o}=t,{disabled:r}=t;const[a,l]=yf({strategy:"absolute",placement:"top",middleware:[ff(6),uf(),hf()]});let c=!1,u;const f=()=>{r||(clearTimeout(u),u=setTimeout(()=>{n(2,c=!0)},300))},d=()=>{r||(clearTimeout(u),n(2,c=!1))};return e.$$set=h=>{"content"in h&&n(0,o=h.content),"disabled"in h&&n(1,r=h.disabled),"$$scope"in h&&n(8,s=h.$$scope)},[o,r,c,a,l,f,d,i,s]}class Af extends K{constructor(t){super(),Q(this,t,$f,Rf,Y,{content:0,disabled:1})}}function Oo(e,t,n){const i=e.slice();return i[9]=t[n],i}function Eo(e,t,n){const i=e.slice();return i[12]=t[n],i}function Lo(e,t,n){const i=e.slice();return i[18]=t[n],i}function To(e,t,n){const i=e.slice();return i[21]=t[n],i}function Io(e){let t,n,i,s,o,r,a,l,c,u;var f=ui(e[21].column.columnDef.header,e[21].getContext());function d(m){return{}}f&&(n=Xe(f,d()));const h=[Ff,Pf],g=[];function p(m,_){return _&1&&(s=null),_&1&&(o=null),s==null&&(s=m[21].column.getIsSorted()==="asc"),s?0:(o==null&&(o=m[21].column.getIsSorted()==="desc"),o?1:-1)}return~(r=p(e,-1))&&(a=g[r]=h[r](e)),{c(){t=P("button"),n&&H(n.$$.fragment),i=q(),a&&a.c(),O(t,"class","flex items-center justify-center w-full gap-1"),Fn(t,"cursor-pointer",e[21].column.getCanSort()),Fn(t,"select-none",e[21].column.getCanSort())},m(m,_){ot(m,t,_),n&&V(n,t,null),w(t,i),~r&&g[r].m(t,null),l=!0,c||(u=Nt(t,"click",function(){ae(e[21].column.getToggleSortingHandler())&&e[21].column.getToggleSortingHandler().apply(this,arguments)}),c=!0)},p(m,_){if(e=m,_&1&&f!==(f=ui(e[21].column.columnDef.header,e[21].getContext()))){if(n){Lt();const y=n;M(y.$$.fragment,1,0,()=>{z(y,1)}),Tt()}f?(n=Xe(f,d()),H(n.$$.fragment),S(n.$$.fragment,1),V(n,t,i)):n=null}let b=r;r=p(e,_),r!==b&&(a&&(Lt(),M(g[b],1,1,()=>{g[b]=null}),Tt()),~r?(a=g[r],a||(a=g[r]=h[r](e),a.c()),S(a,1),a.m(t,null)):a=null),(!l||_&1)&&Fn(t,"cursor-pointer",e[21].column.getCanSort()),(!l||_&1)&&Fn(t,"select-none",e[21].column.getCanSort())},i(m){l||(n&&S(n.$$.fragment,m),S(a),l=!0)},o(m){n&&M(n.$$.fragment,m),M(a),l=!1},d(m){m&&X(t),n&&z(n),~r&&g[r].d(),c=!1,u()}}}function Pf(e){let t,n;return t=new su({}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function Ff(e){let t,n;return t=new cu({}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function Vo(e){let t,n,i,s=!e[21].isPlaceholder&&Io(e);return{c(){t=P("th"),s&&s.c(),O(t,"class",n=`p-1 bg-dark-600 select-none ${e[21].id==="executionTime"?"w-1/4":"w-3/4"}`)},m(o,r){ot(o,t,r),s&&s.m(t,null),i=!0},p(o,r){o[21].isPlaceholder?s&&(Lt(),M(s,1,1,()=>{s=null}),Tt()):s?(s.p(o,r),r&1&&S(s,1)):(s=Io(o),s.c(),S(s,1),s.m(t,null)),(!i||r&1&&n!==(n=`p-1 bg-dark-600 select-none ${o[21].id==="executionTime"?"w-1/4":"w-3/4"}`))&&O(t,"class",n)},i(o){i||(S(s),i=!0)},o(o){M(s),i=!1},d(o){o&&X(t),s&&s.d()}}}function zo(e){let t,n,i,s=e[18].headers,o=[];for(let a=0;aM(o[a],1,1,()=>{o[a]=null});return{c(){t=P("tr");for(let a=0;a{z(f,1)}),Tt()}a?(n=Xe(a,l()),H(n.$$.fragment),S(n.$$.fragment,1),V(n,t,null)):n=null}(!s||u&1&&i!==(i=`${e[12].column.id==="executionTime"&&"text-center"} p-2 bg-dark-700 ${e[9].original.slow&&"text-yellow-500"} truncate max-w-[200px]`))&&O(t,"class",i)},i(c){s||(n&&S(n.$$.fragment,c),s=!0)},o(c){n&&M(n.$$.fragment,c),s=!1},d(c){c&&X(t),n&&z(n),o=!1,Jt(r)}}}function Ho(e){let t,n;return t=new Af({props:{content:e[12].getValue(),disabled:e[12].column.id!=="query",$$slots:{default:[Df,({floatingRef:i,displayTooltip:s,hideTooltip:o})=>({15:i,16:s,17:o}),({floatingRef:i,displayTooltip:s,hideTooltip:o})=>(i?32768:0)|(s?65536:0)|(o?131072:0)]},$$scope:{ctx:e}}}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},p(i,s){const o={};s&1&&(o.content=i[12].getValue()),s&1&&(o.disabled=i[12].column.id!=="query"),s&16973825&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function No(e){let t,n,i,s=e[9].getVisibleCells(),o=[];for(let a=0;aM(o[a],1,1,()=>{o[a]=null});return{c(){t=P("tr");for(let a=0;aM(l[h],1,1,()=>{l[h]=null});let u=e[0].getRowModel().rows,f=[];for(let h=0;hM(f[h],1,1,()=>{f[h]=null});return{c(){t=P("div"),n=P("table"),i=P("thead");for(let h=0;hn(3,i=d)),gt(e,Qn,d=>n(4,s=d));const r=Vs(),a=[{accessorKey:"query",header:"Query",cell:d=>d.getValue(),enableSorting:!0},{accessorKey:"executionTime",header:"Time (ms)",cell:d=>d.getValue().toFixed(4),enableSorting:!0}];let l=[];const c=d=>{d instanceof Function?n(2,l=d(l)):n(2,l=d),u.update(h=>({...h,state:{...h.state,sorting:l}}))},u=Ft({data:s,columns:a,manualPagination:!0,manualSorting:!0,pageCount:-1,getCoreRowModel:ju(),onSortingChange:c,state:{sorting:l}}),f=tf(u);return gt(e,f,d=>n(0,o=d)),e.$$.update=()=>{e.$$.dirty&16&&u.update(d=>({...d,data:s})),e.$$.dirty&12&&ya("fetchResource",{resource:r.params.resource,pageIndex:i,sortBy:l})},[o,f,l,i,s]}class Lf extends K{constructor(t){super(),Q(this,t,Ef,Of,Y,{})}}function Tf(e){let t,n,i,s,o,r,a,l,c,u=e[0].resourceQueriesCount+"",f,d,h,g,p=e[0].resourceTime.toFixed(4)+"",m,_,b,y,x,v=e[0].resourceSlowQueries+"",R,k,$,A;return i=new va({}),{c(){t=P("div"),n=P("button"),H(i.$$.fragment),s=q(),o=P("p"),o.textContent=`${e[1].params.resource}`,r=q(),a=P("div"),l=P("p"),c=J("Queries: "),f=J(u),d=q(),h=P("p"),g=J("Time: "),m=J(p),_=J(" ms"),b=q(),y=P("p"),x=J("Slow queries: "),R=J(v),O(n,"class","flex p-2 w-12 bg-dark-600 text-dark-100 hover:text-white rounded-md justify-center items-center hover:bg-dark-500 outline-none border-[1px] border-transparent focus-visible:border-cyan-600"),O(o,"class","text-center text-lg"),O(y,"class","text-yellow-500"),O(a,"class","text-end text-dark-100 flex flex-col text-xs"),O(t,"class","p-4 grid grid-flow-col grid-cols-3 items-center ")},m(F,C){ot(F,t,C),w(t,n),V(i,n,null),w(t,s),w(t,o),w(t,r),w(t,a),w(a,l),w(l,c),w(l,f),w(a,d),w(a,h),w(h,g),w(h,m),w(h,_),w(a,b),w(a,y),w(y,x),w(y,R),k=!0,$||(A=Nt(n,"click",e[2]),$=!0)},p(F,[C]){(!k||C&1)&&u!==(u=F[0].resourceQueriesCount+"")&&jt(f,u),(!k||C&1)&&p!==(p=F[0].resourceTime.toFixed(4)+"")&&jt(m,p),(!k||C&1)&&v!==(v=F[0].resourceSlowQueries+"")&&jt(R,v)},i(F){k||(S(i.$$.fragment,F),k=!0)},o(F){M(i.$$.fragment,F),k=!1},d(F){F&&X(t),z(i),$=!1,A()}}}function If(e,t,n){let i;gt(e,ps,r=>n(0,i=r));const s=Vs();return[i,s,()=>Oe.goto("/")]}class Vf extends K{constructor(t){super(),Q(this,t,If,Tf,Y,{})}}function Ha(e,t){const n=i=>{const{action:s,data:o}=i.data;s===e&&t(o)};$i(()=>window.addEventListener("message",n)),en(()=>window.removeEventListener("message",n))}const Na=()=>!window.invokeNative,Ba=(e,t=1e3)=>{if(Na())for(const n of e)setTimeout(()=>{window.dispatchEvent(new MessageEvent("message",{data:{action:n.action,data:n.data}}))},t)};function zf(e){let t,n,i,s,o,r,a,l;return i=new Vf({}),o=new Lf({}),a=new Jc({props:{maxPage:e[0]}}),{c(){t=P("div"),n=P("div"),H(i.$$.fragment),s=q(),H(o.$$.fragment),r=q(),H(a.$$.fragment),O(t,"class","flex flex-col w-full justify-between")},m(c,u){ot(c,t,u),w(t,n),V(i,n,null),w(n,s),V(o,n,null),w(t,r),V(a,t,null),l=!0},p(c,[u]){const f={};u&1&&(f.maxPage=c[0]),a.$set(f)},i(c){l||(S(i.$$.fragment,c),S(o.$$.fragment,c),S(a.$$.fragment,c),l=!0)},o(c){M(i.$$.fragment,c),M(o.$$.fragment,c),M(a.$$.fragment,c),l=!1},d(c){c&&X(t),z(i),z(o),z(a)}}}function Hf(e,t,n){let i,s,o;gt(e,ps,a=>n(1,i=a)),gt(e,Qn,a=>n(2,s=a)),gt(e,de,a=>n(3,o=a));let r=0;return en(()=>{St(Qn,s=[],s),St(de,o=0,o)}),Ba([{action:"loadResource",data:{queries:[{query:"SELECT * FROM users WHERE ID = 1",executionTime:3,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:23,slow:!0,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:15,slow:!1,date:Date.now()},{query:"SELECT * FROM users WHERE ID = 1",executionTime:122,slow:!0,date:Date.now()}],resourceQueriesCount:3,resourceSlowQueries:2,resourceTime:1342,pageCount:3}}]),Ha("loadResource",a=>{n(0,r=a.pageCount),St(Qn,s=a.queries,s),St(ps,i={resourceQueriesCount:a.resourceQueriesCount,resourceSlowQueries:a.resourceSlowQueries,resourceTime:a.resourceTime},i)}),[r]}class Nf extends K{constructor(t){super(),Q(this,t,Hf,zf,Y,{})}}function Bf(e){let t,n,i,s,o,r,a,l;var c=e[1];function u(f){return{props:{class:"text-dark-300"}}}return c&&(i=Xe(c,u())),{c(){t=P("div"),n=P("div"),i&&H(i.$$.fragment),s=q(),o=P("input"),O(n,"class","pr-2"),O(o,"type","text"),O(o,"class","bg-transparent outline-none w-full"),O(o,"placeholder","Search resources..."),O(t,"class","p-2 flex items-center outline-none border-[1px] border-transparent transition-all duration-100 focus-within:border-cyan-600 rounded-md bg-dark-600")},m(f,d){ot(f,t,d),w(t,n),i&&V(i,n,null),w(t,s),w(t,o),io(o,e[0]),r=!0,a||(l=Nt(o,"input",e[2]),a=!0)},p(f,[d]){if(d&2&&c!==(c=f[1])){if(i){Lt();const h=i;M(h.$$.fragment,1,0,()=>{z(h,1)}),Tt()}c?(i=Xe(c,u()),H(i.$$.fragment),S(i.$$.fragment,1),V(i,n,null)):i=null}d&1&&o.value!==f[0]&&io(o,f[0])},i(f){r||(i&&S(i.$$.fragment,f),r=!0)},o(f){i&&M(i.$$.fragment,f),r=!1},d(f){f&&X(t),i&&z(i),a=!1,l()}}}function jf(e,t,n){let{icon:i}=t,{value:s}=t;function o(){s=this.value,n(0,s)}return e.$$set=r=>{"icon"in r&&n(1,i=r.icon),"value"in r&&n(0,s=r.value)},[s,i,o]}class Wf extends K{constructor(t){super(),Q(this,t,jf,Bf,Y,{icon:1,value:0})}}function Gf(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function qf(e){let t,n;const i=[{name:"file-analytics"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Gf]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Uf extends K{constructor(t){super(),Q(this,t,Yf,qf,Y,{})}}const Xf=Uf;function Kf(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function Qf(e){let t,n;const i=[{name:"search"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[Kf]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class Jf extends K{constructor(t){super(),Q(this,t,Zf,Qf,Y,{})}}const td=Jf;function ed(e){let t;const n=e[2].default,i=Rt(n,e,e[3],null);return{c(){i&&i.c()},m(s,o){i&&i.m(s,o),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&At(i,n,s,s[3],t?$t(n,s[3],o,null):Pt(s[3]),null)},i(s){t||(S(i,s),t=!0)},o(s){M(i,s),t=!1},d(s){i&&i.d(s)}}}function nd(e){let t,n;const i=[{name:"source-code"},e[1],{iconNode:e[0]}];let s={$$slots:{default:[ed]},$$scope:{ctx:e}};for(let o=0;o{n(1,t=N(N({},t),nt(r))),"$$scope"in r&&n(3,s=r.$$scope)},t=nt(t),[o,t,i,s]}class sd extends K{constructor(t){super(),Q(this,t,id,nd,Y,{})}}const od=sd;/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */function Rn(e){return e+.5|0}const ge=(e,t,n)=>Math.max(Math.min(e,n),t);function un(e){return ge(Rn(e*2.55),0,255)}function be(e){return ge(Rn(e*255),0,255)}function oe(e){return ge(Rn(e/2.55)/100,0,1)}function Bo(e){return ge(Rn(e*100),0,100)}const Et={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ws=[..."0123456789ABCDEF"],rd=e=>ws[e&15],ad=e=>ws[(e&240)>>4]+ws[e&15],Tn=e=>(e&240)>>4===(e&15),ld=e=>Tn(e.r)&&Tn(e.g)&&Tn(e.b)&&Tn(e.a);function cd(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Et[e[1]]*17,g:255&Et[e[2]]*17,b:255&Et[e[3]]*17,a:t===5?Et[e[4]]*17:255}:(t===7||t===9)&&(n={r:Et[e[1]]<<4|Et[e[2]],g:Et[e[3]]<<4|Et[e[4]],b:Et[e[5]]<<4|Et[e[6]],a:t===9?Et[e[7]]<<4|Et[e[8]]:255})),n}const ud=(e,t)=>e<255?t(e):"";function fd(e){var t=ld(e)?rd:ad;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ud(e.a,t):void 0}const dd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ja(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function hd(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function gd(e,t,n){const i=ja(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function pd(e,t,n,i,s){return e===s?(t-n)/i+(t.5?u/(2-o-r):u/(o+r),l=pd(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Ws(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(be)}function Gs(e,t,n){return Ws(ja,e,t,n)}function md(e,t,n){return Ws(gd,e,t,n)}function _d(e,t,n){return Ws(hd,e,t,n)}function Wa(e){return(e%360+360)%360}function bd(e){const t=dd.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?un(+t[5]):be(+t[5]));const s=Wa(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=md(s,o,r):t[1]==="hsv"?i=_d(s,o,r):i=Gs(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function yd(e,t){var n=js(e);n[0]=Wa(n[0]+t),n=Gs(n),e.r=n[0],e.g=n[1],e.b=n[2]}function vd(e){if(!e)return;const t=js(e),n=t[0],i=Bo(t[1]),s=Bo(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${oe(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const jo={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"},Wo={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 xd(){const e={},t=Object.keys(Wo),n=Object.keys(jo);let i,s,o,r,a;for(i=0;i>16&255,o>>8&255,o&255]}return e}let In;function wd(e){In||(In=xd(),In.transparent=[0,0,0,0]);const t=In[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Sd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Cd(e){const t=Sd.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?un(r):ge(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?un(i):ge(i,0,255)),s=255&(t[4]?un(s):ge(s,0,255)),o=255&(t[6]?un(o):ge(o,0,255)),{r:i,g:s,b:o,a:n}}}function Md(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${oe(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Qi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,He=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function kd(e,t,n){const i=He(oe(e.r)),s=He(oe(e.g)),o=He(oe(e.b));return{r:be(Qi(i+n*(He(oe(t.r))-i))),g:be(Qi(s+n*(He(oe(t.g))-s))),b:be(Qi(o+n*(He(oe(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Vn(e,t,n){if(e){let i=js(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Gs(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Ga(e,t){return e&&Object.assign(t||{},e)}function Go(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=be(e[3]))):(t=Ga(e,{r:0,g:0,b:0,a:1}),t.a=be(t.a)),t}function Rd(e){return e.charAt(0)==="r"?Cd(e):bd(e)}class xn{constructor(t){if(t instanceof xn)return t;const n=typeof t;let i;n==="object"?i=Go(t):n==="string"&&(i=cd(t)||wd(t)||Rd(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ga(this._rgb);return t&&(t.a=oe(t.a)),t}set rgb(t){this._rgb=Go(t)}rgbString(){return this._valid?Md(this._rgb):void 0}hexString(){return this._valid?fd(this._rgb):void 0}hslString(){return this._valid?vd(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=kd(this._rgb,t._rgb,n)),this}clone(){return new xn(this.rgb)}alpha(t){return this._rgb.a=be(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Rn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Vn(this._rgb,2,t),this}darken(t){return Vn(this._rgb,2,-t),this}saturate(t){return Vn(this._rgb,1,t),this}desaturate(t){return Vn(this._rgb,1,-t),this}rotate(t){return yd(this._rgb,t),this}}/*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */function ne(){}const $d=(()=>{let e=0;return()=>e++})();function tt(e){return e===null||typeof e>"u"}function st(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function W(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function dt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function wt(e,t){return dt(e)?e:t}function et(e,t){return typeof e>"u"?t:e}const Ad=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qa=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function rt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function G(e,t,n,i){let s,o,r;if(st(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;se,x:e=>e.x,y:e=>e.y};function Dd(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Od(e){const t=Dd(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Ze(e,t){return(qo[t]||(qo[t]=Od(t)))(e)}function qs(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yt=e=>typeof e<"u",xe=e=>typeof e=="function",Yo=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Ed(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ct=Math.PI,at=2*ct,mi=Number.POSITIVE_INFINITY,Ld=ct/180,lt=ct/2,Ce=ct/4,Uo=ct*2/3,pe=Math.log10,_i=Math.sign;function Zn(e,t,n){return Math.abs(e-t)s-o).pop(),t}function bi(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Id(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Ua(e,t,n){let i,s,o;for(i=0,s=e.length;il&&c=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Us(e,t,n){n=n||(r=>e[r]1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ss=(e,t,n,i)=>Us(e,n,i?s=>{const o=e[s][t];return oe[s][t]Us(e,n,i=>e[i][t]>=n);function Bd(e,t,n){let i=0,s=e.length;for(;ii&&e[s-1]>n;)s--;return i>0||s{const i="_onData"+qs(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Qo(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ka.forEach(o=>{delete e[o]}),delete e._chartjs)}function Wd(e){const t=new Set;let n,i;for(n=0,i=e.length;n"u"?function(e){return e()}:window.requestAnimationFrame}();function Za(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Qa.call(window,()=>{i=!1,e.apply(t,n)}))}}function Gd(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Ja=e=>e==="start"?"left":e==="end"?"right":"center",mn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,zn=e=>e===0||e===1,Zo=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*at/n)),Jo=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*at/n)+1,_n={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*lt)+1,easeOutSine:e=>Math.sin(e*lt),easeInOutSine:e=>-.5*(Math.cos(ct*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>zn(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zn(e)?e:Zo(e,.075,.3),easeOutElastic:e=>zn(e)?e:Jo(e,.075,.3),easeInOutElastic(e){return zn(e)?e:e<.5?.5*Zo(e*2,.1125,.45):.5+.5*Jo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-_n.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?_n.easeInBounce(e*2)*.5:_n.easeOutBounce(e*2-1)*.5+.5};function tl(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function tr(e){return tl(e)?e:new xn(e)}function Zi(e){return tl(e)?e:new xn(e).saturate(.5).darken(.1).hexString()}const qd=["x","y","borderWidth","radius","tension"],Yd=["color","borderColor","backgroundColor"];function Ud(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Yd},numbers:{type:"number",properties:qd}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Xd(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const er=new Map;function Kd(e,t){t=t||{};const n=e+JSON.stringify(t);let i=er.get(n);return i||(i=new Intl.NumberFormat(e,t),er.set(n,i)),i}function $n(e,t,n){return Kd(t,n).format(e)}const el={values(e){return st(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Qd(e,n)}const r=pe(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),$n(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pe(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?el.numeric.call(this,e,t,n):""}};function Qd(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Ei={formatters:el};function Zd(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ei.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Le=Object.create(null),Cs=Object.create(null);function bn(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;ii.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=(i,s)=>Zi(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zi(s.borderColor),this.hoverColor=(i,s)=>Zi(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ji(this,t,n)}get(t){return bn(this,t)}describe(t,n){return Ji(Cs,t,n)}override(t,n){return Ji(Le,t,n)}route(t,n,i,s){const o=bn(this,t),r=bn(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return W(l)?Object.assign({},c,l):et(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ut=new Jd({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ud,Xd,Zd]);function th(e){return!e||tt(e.size)||tt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function vi(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function eh(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,f,d;for(l=0;ln.length){for(l=0;l0&&e.stroke()}}function nl(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,ih(e,o),l=0;l+e||0;function Xs(e,t){const n={},i=W(t),s=i?Object.keys(t):t,o=W(e)?i?r=>et(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=ch(o(r));return n}function uh(e){return Xs(e,{top:"y",right:"x",bottom:"y",left:"x"})}function yn(e){return Xs(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(e){const t=uh(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bt(e,t){e=e||{},t=t||ut.font;let n=et(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=et(e.style,t.style);i&&!(""+i).match(ah)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:et(e.family,t.family),lineHeight:lh(et(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:et(e.weight,t.weight),string:""};return s.string=th(s),s}function Hn(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;on&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Te(e,t){return Object.assign(Object.create(e),t)}function Ks(e,t=[""],n=e,i,s=()=>e[0]){Yt(i)||(i=ll("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:s,override:r=>Ks([r,...e],t,n,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete e[0][a],!0},get(r,a){return rl(r,a,()=>yh(a,t,e,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,a){return or(r).includes(a)},ownKeys(r){return or(r)},set(r,a,l){const c=r._storage||(r._storage=s());return r[a]=c[a]=l,delete r._keys,!0}})}function Je(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ol(e,i),setContext:o=>Je(e,o,n,i),override:o=>Je(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return rl(o,r,()=>hh(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function ol(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:xe(n)?n:()=>n,isIndexable:xe(i)?i:()=>i}}const dh=(e,t)=>e?e+qs(t):t,Qs=(e,t)=>W(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function rl(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function hh(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return xe(a)&&r.isScriptable(t)&&(a=gh(t,a,e,n)),st(a)&&a.length&&(a=ph(t,a,e,r.isIndexable)),Qs(t,a)&&(a=Je(a,s,o&&o[t],r)),a}function gh(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);return a.add(e),t=t(o,r||i),a.delete(e),Qs(e,t)&&(t=Zs(s._scopes,s,e,t)),t}function ph(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(Yt(o.index)&&i(e))t=t[o.index%t.length];else if(W(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=Zs(c,s,e,u);t.push(Je(f,o,r&&r[e],a))}}return t}function al(e,t,n){return xe(e)?e(t,n):e}const mh=(e,t)=>e===!0?t:typeof e=="string"?Ze(t,e):void 0;function _h(e,t,n,i,s){for(const o of t){const r=mh(n,o);if(r){e.add(r);const a=al(r._fallback,n,s);if(Yt(a)&&a!==n&&a!==i)return a}else if(r===!1&&Yt(i)&&n!==i)return null}return!1}function Zs(e,t,n,i){const s=t._rootScopes,o=al(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=sr(a,r,n,o||n,i);return l===null||Yt(o)&&o!==n&&(l=sr(a,r,o,l,i),l===null)?!1:Ks(Array.from(a),[""],s,o,()=>bh(t,n,i))}function sr(e,t,n,i,s){for(;n;)n=_h(e,t,n,i,s);return n}function bh(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return st(s)&&W(n)?n:s||{}}function yh(e,t,n,i){let s;for(const o of t)if(s=ll(dh(o,e),n),Yt(s))return Qs(e,s)?Zs(n,i,e,s):s}function ll(e,t){for(const n of t){if(!n)continue;const i=n[e];if(Yt(i))return i}}function or(e){let t=e._keys;return t||(t=e._keys=vh(e._scopes)),t}function vh(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function xh(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;ae.ownerDocument.defaultView.getComputedStyle(e,null);function wh(e,t){return Li(e).getPropertyValue(t)}const Sh=["top","right","bottom","left"];function Fe(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Sh[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ch=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Mh(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Ch(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function $e(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Li(n),o=s.boxSizing==="border-box",r=Fe(s,"padding"),a=Fe(s,"border","width"),{x:l,y:c,box:u}=Mh(e,n),f=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:h,height:g}=t;return o&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-f)/h*n.width/i),y:Math.round((c-d)/g*n.height/i)}}function kh(e,t,n){let i,s;if(t===void 0||n===void 0){const o=Js(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Li(o),l=Fe(a,"border","width"),c=Fe(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=xi(a.maxWidth,o,"clientWidth"),s=xi(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||mi,maxHeight:s||mi}}const Nn=e=>Math.round(e*10)/10;function Rh(e,t,n,i){const s=Li(e),o=Fe(s,"margin"),r=xi(s.maxWidth,e,"clientWidth")||mi,a=xi(s.maxHeight,e,"clientHeight")||mi,l=kh(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const d=Fe(s,"border","width"),h=Fe(s,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Nn(Math.min(c,r,l.maxWidth)),u=Nn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Nn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Nn(Math.floor(u*i))),{width:c,height:u}}function rr(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $h=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function ar(e,t){const n=wh(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}const Ah=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Ph=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ts(e,t,n){return e?Ah(t,n):Ph()}function Fh(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Dh(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}/*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */class Oh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Qa.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ie=new Oh;const lr="transparent",Eh={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tr(e||lr),s=i.valid&&tr(t||lr);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Lh{constructor(t,n,i,s){const o=n[i];s=Hn([t.to,s,o,t.from]);const r=Hn([t.from,o,s]);this._active=!0,this._fn=t.fn||Eh[t.type||typeof r],this._easing=_n[t.easing]||_n.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Hn([t.to,n,s,t.from]),this._from=Hn([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const o=t[s];if(!W(o))return;const r={};for(const a of n)r[a]=o[a];(st(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=Ih(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Th(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const d=i.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){t[c]=u;continue}o[c]=f=new Lh(d,t,c,u),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return ie.add(this._chart,i),!0}}function Th(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&o<0)return s.index}return null}function hr(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Nh(o,r,i),f=t.length;let d;for(let h=0;hn[i].axis===t).shift()}function Wh(e,t){return Te(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gh(e,t,n){return Te(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function on(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const ns=e=>e==="reset"||e==="none",gr=(e,t)=>t?e:Object.assign({},e),qh=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:fl(n,!0),values:null};class Ye{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=fr(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&on(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(f,d,h,g)=>f==="x"?d:f==="r"?g:h,o=n.xAxisID=et(i.xAxisID,es(t,"x")),r=n.yAxisID=et(i.yAxisID,es(t,"y")),a=n.rAxisID=et(i.rAxisID,es(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Qo(this._data,this),t._stacked&&on(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(W(n))this._data=Hh(n);else if(i!==n){if(i){Qo(i,this);const s=this._cachedMeta;on(s),s._parsed=[]}n&&Object.isExtensible(n)&&jd(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=fr(n.vScale,n),n.stack!==i.stack&&(s=!0,on(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&hr(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,f,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{st(s[t])?d=this.parseArrayData(i,s,t,n):W(s[t])?d=this.parseObjectData(i,s,t,n):d=this.parsePrimitiveData(i,s,t,n);const h=()=>f[a]===null||c&&f[a]p||f=0;--d)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s=0&&tthis.getContext(i,s,n),p=c.resolveNamedOptions(d,h,g,f);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(gr(p,l))),p}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(d,this.getContext(t,i,n))}const c=new ul(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ns(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){ns(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ns(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;ayi(y,a,l,!0)?1:Math.max(x,x*n,v,v*n),g=(y,x,v)=>yi(y,a,l,!0)?-1:Math.min(x,x*n,v,v*n),p=h(0,c,f),m=h(lt,u,d),_=g(ct,c,f),b=g(ct+lt,u,d);i=(p-_)/2,s=(m-b)/2,o=-(p+_)/2,r=-(m+b)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class je extends Ye{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(W(i[t])){const{key:l="value"}=this._parsing;o=c=>+Ze(i[c],l)}let r,a;for(r=t,a=t+n;r0&&!isNaN(t)?at*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=$n(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"}),I(je,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class Jn extends Ye{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=$n(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return xh.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(on.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,d=c.getIndexAngle(0)-.5*ct;let h=d,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Bt(this.resolveDataElementOptions(t,n).angle||i):0}}I(Jn,"id","polarArea"),I(Jn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),I(Jn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ks extends je{}I(ks,"id","pie"),I(ks,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function ke(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class to{static override(t){Object.assign(to.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return ke()}parse(){return ke()}format(){return ke()}add(){return ke()}diff(){return ke()}startOf(){return ke()}endOf(){return ke()}}var Uh={_date:to};function Xh(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Nd:Ss;if(i){if(s._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(o,t,n-u),d=l(o,t,n+u);return{lo:f.lo,hi:d.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function An(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a{l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Jh={evaluateInteractionItems:An,modes:{index(e,t,n,i){const s=$e(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?is(e,s,o,i,r):ss(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=$e(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?is(e,s,o,i,r):ss(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function mr(e,t){return e.filter(n=>dl.indexOf(n.pos)===-1&&n.box.axis===t)}function an(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function tg(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=an(rn(t,"left"),!0),s=an(rn(t,"right")),o=an(rn(t,"top"),!0),r=an(rn(t,"bottom")),a=mr(t,"x"),l=mr(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:rn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function _r(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function hl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function sg(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!W(s)){n.size&&(e[s]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[s]+=n.size}o.getPadding&&hl(r,o.getPadding());const a=Math.max(0,t.outerWidth-_r(r,e,"left","right")),l=Math.max(0,t.outerHeight-_r(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function og(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function rg(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function fn(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},s);hl(d,kt(i));const h=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=ng(l.concat(c),f);fn(a.fullSize,h,f,g),fn(l,h,f,g),fn(c,h,f,g)&&fn(l,h,f,g),og(h),br(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,br(a.rightAndBottom,h,f,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},G(a.chartArea,p=>{const m=p.box;Object.assign(m,e.chartArea),m.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class gl{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ag extends gl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ti="$chartjs",lg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yr=e=>e===null||e==="";function cg(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[ti]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",yr(s)){const o=ar(e,"width");o!==void 0&&(e.width=o)}if(yr(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=ar(e,"height");o!==void 0&&(e.height=o)}return e}const pl=$h?{passive:!0}:!1;function ug(e,t,n){e.addEventListener(t,n,pl)}function fg(e,t,n){e.canvas.removeEventListener(t,n,pl)}function dg(e,t){const n=lg[e.type]||e.type,{x:i,y:s}=$e(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function wi(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function hg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||wi(a.addedNodes,i),r=r&&!wi(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function gg(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||wi(a.removedNodes,i),r=r&&!wi(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Cn=new Map;let vr=0;function ml(){const e=window.devicePixelRatio;e!==vr&&(vr=e,Cn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function pg(e,t){Cn.size||window.addEventListener("resize",ml),Cn.set(e,t)}function mg(e){Cn.delete(e),Cn.size||window.removeEventListener("resize",ml)}function _g(e,t,n){const i=e.canvas,s=i&&Js(i);if(!s)return;const o=Za((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),pg(e,o),r}function os(e,t,n){n&&n.disconnect(),t==="resize"&&mg(e)}function bg(e,t,n){const i=e.canvas,s=Za(o=>{e.ctx!==null&&n(dg(o,e))},e);return ug(i,t,s),s}class yg extends gl{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(cg(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[ti])return!1;const i=n[ti].initial;["height","width"].forEach(o=>{const r=i[o];tt(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[ti],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:hg,detach:gg,resize:_g}[n]||bg;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:os,detach:os,resize:os}[n]||fg)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Rh(t,n,i,s)}isAttached(t){const n=Js(t);return!!(n&&n.isConnected)}}function vg(e){return!cl()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?ag:yg}var Xn;let Pn=(Xn=class{constructor(){I(this,"active",!1)}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return bi(this.x)&&bi(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}},I(Xn,"defaults",{}),I(Xn,"defaultRoutes"),Xn);function xg(e,t){const n=e.options.ticks,i=wg(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Cg(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Mg(t,c,o,r/s),c;const u=Sg(o,t,s);if(r>0){let f,d;const h=r>1?Math.round((l-a)/(r-1)):null;for(jn(t,c,u,tt(h)?0:a-h,a),f=0,d=r-1;fs)return l}return Math.max(s,1)}function Cg(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,xr=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,wr=(e,t)=>Math.min(t||e,e);function Sr(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;or+a)))return l}function Ag(e,t){G(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;oi?i:n,i=s&&n>i?n:i,{min:wt(n,wt(i,n)),max:wt(i,wt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fh(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=Mt(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/i:h/(i-1),f+6>a&&(a=h/(i-(t.offset?.5:1)),l=this.maxHeight-ln(t.grid)-n.padding-Cr(t.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),r=Ys(Math.min(Math.asin(Mt((u.highest.height+6)/a,-1,1)),Math.asin(Mt(l/c,-1,1))-Math.asin(Mt(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Cr(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=ln(o)+l):(t.height=this.maxHeight,t.width=ln(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=i.padding*2,g=Bt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const _=i.mirror?0:m*f.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+_+h)}else{const _=i.mirror?0:p*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+_+h)}this._calculatePadding(c,u,m,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;l?c?(d=s*t.width,h=i*n.height):(d=i*t.height,h=s*n.width):o==="start"?h=n.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,h=n.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_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(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:r[A]||0,height:a[A]||0});return{first:$(0),last:$(n-1),widest:$(R),highest:$(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return zd(this._alignToPixels?Me(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=ln(o),h=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,_=function(T){return Me(i,T,p)};let b,y,x,v,R,k,$,A,F,C,D,U;if(r==="top")b=_(this.bottom),k=this.bottom-d,A=b-m,C=_(t.top)+m,U=t.bottom;else if(r==="bottom")b=_(this.top),C=t.top,U=_(t.bottom)-m,k=b+m,A=this.top+d;else if(r==="left")b=_(this.right),R=this.right-d,$=b-m,F=_(t.left)+m,D=t.right;else if(r==="right")b=_(this.left),F=t.left,D=_(t.right)-m,R=b+m,$=this.left+d;else if(n==="x"){if(r==="center")b=_((t.top+t.bottom)/2+.5);else if(W(r)){const T=Object.keys(r)[0],B=r[T];b=_(this.chart.scales[T].getPixelForValue(B))}C=t.top,U=t.bottom,k=b+m,A=k+d}else if(n==="y"){if(r==="center")b=_((t.left+t.right)/2);else if(W(r)){const T=Object.keys(r)[0],B=r[T];b=_(this.chart.scales[T].getPixelForValue(B))}R=b-m,$=R-d,F=t.left,D=t.right}const Z=et(s.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/Z));for(y=0;yo.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");ut.route(o,s,l,a)})}function Tg(e){return"id"in e&&"defaults"in e}class Ig{constructor(){this.controllers=new Wn(Ye,"datasets",!0),this.elements=new Wn(Pn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Ie,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):G(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=qs(t);rt(i["before"+s],[],i),n[t](i),rt(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;no.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function zg(e){const t={},n=[],i=Object.keys(Kt.plugins.items);for(let o=0;o1&&Si(e[0].toLowerCase(),t),e))return e;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function qg(e,t){const n=Le[e.type]||{scales:{}},i=t.scales||{},s=Rs(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!W(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Si(r,a),c=Wg(l,s),u=n.scales||{};o[r]=pn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||Rs(a,t),u=(Le[a]||{}).scales||{};Object.keys(u).forEach(f=>{const d=jg(f,l),h=r[d+"AxisID"]||d;o[h]=o[h]||Object.create(null),pn(o[h],[{axis:d},i[h],u[f]])})}),Object.keys(o).forEach(r=>{const a=o[r];pn(a,[ut.scales[a.type],ut.scale])}),o}function _l(e){const t=e.options||(e.options={});t.plugins=et(t.plugins,{}),t.scales=qg(e,t)}function bl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Yg(e){return e=e||{},e.data=bl(e.data),_l(e),e}const Mr=new Map,yl=new Set;function Gn(e,t){let n=Mr.get(e);return n||(n=t(),Mr.set(e,n),yl.add(n)),n}const cn=(e,t,n)=>{const i=Ze(t,n);i!==void 0&&e.add(i)};class Ug{constructor(t){this._config=Yg(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=bl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),_l(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Gn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Gn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Gn(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>cn(l,t,f))),u.forEach(f=>cn(l,s,f)),u.forEach(f=>cn(l,Le[o]||{},f)),u.forEach(f=>cn(l,ut,f)),u.forEach(f=>cn(l,Cs,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),yl.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Le[n]||{},ut.datasets[n]||{},{type:n},ut,Cs]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=kr(this._resolverCache,t,s);let l=r;if(Kg(r,n)){o.$shared=!1,i=xe(i)?i():i;const c=this.createResolver(t,i,a);l=Je(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=kr(this._resolverCache,t,i);return W(n)?Je(o,n,void 0,s):o}}function kr(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:Ks(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Xg=e=>W(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||xe(e[n]),!1);function Kg(e,t){const{isScriptable:n,isIndexable:i}=ol(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(xe(a)||Xg(a))||r&&st(a))return!0}return!1}var Qg="4.2.1";const Zg=["top","bottom","left","right","chartArea"];function Rr(e,t){return e==="top"||e==="bottom"||Zg.indexOf(e)===-1&&t==="x"}function $r(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Ar(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),rt(n&&n.onComplete,[e],t)}function Jg(e){const t=e.chart,n=t.options.animation;rt(n&&n.onProgress,[e],t)}function vl(e){return cl()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ei={},Pr=e=>{const t=vl(e);return Object.values(ei).filter(n=>n.canvas===t).pop()};function tp(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function ep(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function np(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}var fe;let Ti=(fe=class{static register(...t){Kt.add(...t),Fr()}static unregister(...t){Kt.remove(...t),Fr()}constructor(t,n){const i=this.config=new Ug(n),s=vl(t),o=Pr(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||vg(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=$d(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Vg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gd(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],ei[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ie.listen(this,"complete",Ar),ie.listen(this,"progress",Jg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return tt(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Kt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nr(this.canvas,this.ctx),this}stop(){return ie.stop(this),this}resize(t,n){ie.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,rr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),rt(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};G(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=Si(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),G(o,r=>{const a=r.options,l=a.id,c=Si(l,a),u=et(a.type,r.dtype);(a.position===void 0||Rr(a.position,c)!==Rr(r.dposition))&&(a.position=r.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===u)f=i[l];else{const d=Kt.getScale(u);f=new d({id:l,type:u,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,t)}),G(s,(r,a)=>{r||delete i[a]}),G(i,r=>{me.configure(this,r,r.options),me.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($r("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){G(this.scales,t=>{me.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Yo(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;tp(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;me.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],G(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,o=np(t)||this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&il(n,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&sl(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return nl(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Jh.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Te(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Yt(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ie.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};G(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){G(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},G(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!gi(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Ed(t),c=ep(t,this._lastEvent,i,l);i&&(this._lastEvent=null,rt(o.onHover,[t,a,this],this),l&&rt(o.onClick,[t,a,this],this));const u=!gi(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},I(fe,"defaults",ut),I(fe,"instances",ei),I(fe,"overrides",Le),I(fe,"registry",Kt),I(fe,"version",Qg),I(fe,"getChart",Pr),fe);function Fr(){return G(Ti.instances,e=>e._plugins.invalidate())}function ip(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+lt,i-lt),e.closePath(),e.clip()}function sp(e){return Xs(e,["outerStart","outerEnd","innerStart","innerEnd"])}function op(e,t,n,i){const s=sp(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Mt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Mt(s.innerStart,0,r),innerEnd:Mt(s.innerEnd,0,r)}}function Ne(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Ci(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let h=0;const g=s-l;if(i){const E=u>0?u-i:0,T=f>0?f-i:0,B=(E+T)/2,ft=B!==0?g*B/(B+i):g;h=(g-ft)/2}const p=Math.max(.001,g*f-n/ct)/f,m=(g-p)/2,_=l+m+h,b=s-m-h,{outerStart:y,outerEnd:x,innerStart:v,innerEnd:R}=op(t,d,f,b-_),k=f-y,$=f-x,A=_+y/k,F=b-x/$,C=d+v,D=d+R,U=_+v/C,Z=b-R/D;if(e.beginPath(),o){const E=(A+F)/2;if(e.arc(r,a,f,A,E),e.arc(r,a,f,E,F),x>0){const it=Ne($,F,r,a);e.arc(it.x,it.y,x,F,b+lt)}const T=Ne(D,b,r,a);if(e.lineTo(T.x,T.y),R>0){const it=Ne(D,Z,r,a);e.arc(it.x,it.y,R,b+lt,Z+Math.PI)}const B=(b-R/d+(_+v/d))/2;if(e.arc(r,a,d,b-R/d,B,!0),e.arc(r,a,d,B,_+v/d,!0),v>0){const it=Ne(C,U,r,a);e.arc(it.x,it.y,v,U+Math.PI,_-lt)}const ft=Ne(k,_,r,a);if(e.lineTo(ft.x,ft.y),y>0){const it=Ne(k,A,r,a);e.arc(it.x,it.y,y,_-lt,A)}}else{e.moveTo(r,a);const E=Math.cos(A)*f+r,T=Math.sin(A)*f+a;e.lineTo(E,T);const B=Math.cos(F)*f+r,ft=Math.sin(F)*f+a;e.lineTo(B,ft)}e.closePath()}function rp(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Ci(e,t,n,i,l,s);for(let c=0;c=at||yi(o,a,l),p=Hd(r,c+d,u+d);return g&&p}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,f=(r+a+c+l)/2;return{x:n+Math.cos(u)*f,y:i+Math.sin(u)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>at?Math.floor(i/at):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(ct,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,rp(t,this,c,o,r),ap(t,this,c,o,r),t.restore()}}I(ni,"id","arc"),I(ni,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),I(ni,"defaultRoutes",{backgroundColor:"backgroundColor"});const $s=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Dr=$s.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function xl(e){return $s[e%$s.length]}function wl(e){return Dr[e%Dr.length]}function lp(e,t){return e.borderColor=xl(t),e.backgroundColor=wl(t),++t}function cp(e,t){return e.backgroundColor=e.data.map(()=>xl(t++)),t}function up(e,t){return e.backgroundColor=e.data.map(()=>wl(t++)),t}function fp(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof je?t=cp(n,t):s instanceof Jn?t=up(n,t):s&&(t=lp(n,t))}}function Or(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function dp(e){return e&&(e.borderColor||e.backgroundColor)}var hp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s;if(!n.forceOverride&&(Or(i)||dp(s)||o&&Or(o)))return;const r=fp(e);i.forEach(r)}};class Sl extends Pn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=st(i.text)?i.text.length:1;this._padding=kt(i.padding);const o=s*bt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,f;return this.isHorizontal()?(u=mn(a,i,o),f=n+t,c=o-i):(r.position==="left"?(u=i+t,f=mn(a,s,n),l=ct*-.5):(u=o-t,f=mn(a,n,s),l=ct*.5),c=s-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=bt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Sn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Ja(n.align),textBaseline:"middle",translation:[r,a]})}}function gp(e,t){const n=new Sl({ctx:e.ctx,options:t,chart:e});me.configure(e,n,t),me.addBox(e,n),e.titleBlock=n}var pp={id:"title",_element:Sl,start(e,t,n){gp(e,n)},stop(e){const t=e.titleBlock;me.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;me.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const dn={average(e){if(!e.length)return!1;let t,n,i=0,s=0,o=0;for(t=0,n=e.length;t-1?e.split(` `):e}function mp(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Er(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=bt(t.bodyFont),c=bt(t.titleFont),u=bt(t.footerFont),f=o.length,d=s.length,h=i.length,g=kt(t.padding);let p=g.height,m=0,_=i.reduce((x,v)=>x+v.before.length+v.lines.length+v.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const x=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*x+(_-h)*l.lineHeight+(_-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let b=0;const y=function(x){m=Math.max(m,n.measureText(x).width+b)};return n.save(),n.font=c.string,G(e.title,y),n.font=l.string,G(e.beforeBody.concat(e.afterBody),y),b=t.displayColors?r+2+t.boxPadding:0,G(i,x=>{G(x.before,y),G(x.lines,y),G(x.after,y)}),b=0,n.font=u.string,G(e.footer,y),n.restore(),m+=g.width,{width:m,height:p}}function _p(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function bp(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function yp(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),bp(c,e,t,n)&&(c="center"),c}function Lr(e,t,n){const i=n.yAlign||t.yAlign||_p(e,n);return{xAlign:n.xAlign||t.xAlign||yp(e,t,n,i),yAlign:i}}function vp(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function xp(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Tr(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=yn(r);let g=vp(t,a);const p=xp(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,d)+s:a==="right"&&(g+=Math.max(f,h)+s),{x:Mt(g,0,i.width-t.width),y:Mt(p,0,i.height-t.height)}}function qn(e,t,n){const i=kt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Ir(e){return Xt([],se(e))}function wp(e,t,n){return Te(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Vr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Cl={beforeTitle:ne,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Cl[t].call(n,i):s}class As extends Pn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new ul(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=wp(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=yt(i,"beforeTitle",this,t),o=yt(i,"title",this,t),r=yt(i,"afterTitle",this,t);let a=[];return a=Xt(a,se(s)),a=Xt(a,se(o)),a=Xt(a,se(r)),a}getBeforeBody(t,n){return Ir(yt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return G(t,o=>{const r={before:[],lines:[],after:[]},a=Vr(i,o);Xt(r.before,se(yt(a,"beforeLabel",this,o))),Xt(r.lines,yt(a,"label",this,o)),Xt(r.after,se(yt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Ir(yt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=yt(i,"beforeFooter",this,t),o=yt(i,"footer",this,t),r=yt(i,"afterFooter",this,t);let a=[];return a=Xt(a,se(s)),a=Xt(a,se(o)),a=Xt(a,se(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,f,d,i))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,i))),G(a,u=>{const f=Vr(t.callbacks,u);s.push(yt(f,"labelColor",this,u)),o.push(yt(f,"labelPointStyle",this,u)),r.push(yt(f,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=dn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=Er(this,i),c=Object.assign({},a,l),u=Lr(this.chart,i,c),f=Tr(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=yn(a),{x:d,y:h}=t,{width:g,height:p}=n;let m,_,b,y,x,v;return o==="center"?(x=h+p/2,s==="left"?(m=d,_=m-r,y=x+r,v=x-r):(m=d+g,_=m+r,y=x-r,v=x+r),b=m):(s==="left"?_=d+Math.max(l,u)+r:s==="right"?_=d+g-Math.max(c,f)-r:_=this.caretX,o==="top"?(y=h,x=y-r,m=_-r,b=_+r):(y=h+p,x=y+r,m=_+r,b=_-r),v=y),{x1:m,x2:_,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=ts(i.rtl,this.x,this.width);for(t.x=qn(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=bt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ms(t,{x:m,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ms(t,{x:_,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,f=bt(i.bodyFont);let d=f.lineHeight,h=0;const g=ts(i.rtl,this.x,this.width),p=function($){n.fillText($,g.x(t.x+h),t.y+d/2),t.y+=d+o},m=g.textAlign(r);let _,b,y,x,v,R,k;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,t.x=qn(this,m,i),n.fillStyle=i.bodyColor,G(this.beforeBody,p),h=a&&m!=="right"?r==="center"?c/2+u:c+2+u:0,x=0,R=s.length;x0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=dn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Er(this,t),l=Object.assign({},r,this._size),c=Lr(n,t,l),u=Tr(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=kt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Fh(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Dh(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!gi(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!gi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=dn[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}I(As,"positioners",dn);var Sp={id:"tooltip",_element:As,positioners:dn,afterInit(e,t,n){n&&(e.tooltip=new As({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Cl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Cp=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Mp(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Cp(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const kp=(e,t)=>e===null?null:Mt(Math.round(e),0,t);function zr(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}I(Ps,"id","category"),I(Ps,"defaults",{ticks:{callback:zr}});function Rp(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=e,h=o||1,g=u-1,{min:p,max:m}=t,_=!tt(r),b=!tt(a),y=!tt(c),x=(m-p)/(f+1);let v=Xo((m-p)/g/h)*h,R,k,$,A;if(v<1e-14&&!_&&!b)return[{value:p},{value:m}];A=Math.ceil(m/v)-Math.floor(p/v),A>g&&(v=Xo(A*v/g/h)*h),tt(l)||(R=Math.pow(10,l),v=Math.ceil(v*R)/R),s==="ticks"?(k=Math.floor(p/v)*v,$=Math.ceil(m/v)*v):(k=p,$=m),_&&b&&o&&Id((a-r)/o,v/1e3)?(A=Math.round(Math.min((a-r)/v,u)),v=(a-r)/A,k=r,$=a):y?(k=_?r:k,$=b?a:$,A=c-1,v=($-k)/A):(A=($-k)/v,Zn(A,Math.round(A),v/1e3)?A=Math.round(A):A=Math.ceil(A));const F=Math.max(Ko(v),Ko(k));R=Math.pow(10,tt(l)?F:l),k=Math.round(k*R)/R,$=Math.round($*R)/R;let C=0;for(_&&(d&&k!==r?(n.push({value:r}),ks=n?s:l,a=l=>o=i?o:l;if(t){const l=_i(s),c=_i(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=Rp(s,o);return t.bounds==="ticks"&&Ua(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return $n(t,this.chart.options.locale,this.options.ticks.format)}}class Nr extends Mi{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Bt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}I(Nr,"id","linear"),I(Nr,"defaults",{ticks:{callback:Ei.formatters.numeric}});const Mn=e=>Math.floor(pe(e)),Re=(e,t)=>Math.pow(10,Mn(e)+t);function Br(e){return e/Math.pow(10,Mn(e))===1}function jr(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function $p(e,t){const n=t-e;let i=Mn(n);for(;jr(e,t,i)>10;)i++;for(;jr(e,t,i)<10;)i--;return Math.min(i,Mn(e))}function Ap(e,{min:t,max:n}){t=wt(e.min,t);const i=[],s=Mn(t);let o=$p(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,o)),d=wt(e.min,Math.round((l+u+f*Math.pow(10,o))*r)/r);for(;d=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,r=o>=0?1:r),d=Math.round((l+u+f*Math.pow(10,o))*r)/r;const h=wt(e.max,d);return i.push({value:h,major:Br(h),significand:f}),i}class Wr extends Ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Mi.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return dt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===Re(this.min,0)?Re(this.min,-1):Re(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Re(i,-1)),r(Re(s,1)))),i<=0&&o(Re(s,-1)),s<=0&&r(Re(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=Ap(n,this);return t.bounds==="ticks"&&Ua(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":$n(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pe(t),this._valueRange=pe(this.max)-pe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}I(Wr,"id","logarithmic"),I(Wr,"defaults",{ticks:{callback:Ei.formatters.logarithmic,major:{enabled:!0}}});function Fs(e){const t=e.ticks;if(t.display&&e.display){const n=kt(t.backdropPadding);return et(t.font&&t.font.size,ut.font.size)+n.height}return 0}function Pp(e,t,n){return n=st(n)?n:[n],{w:eh(e,t.string,n),h:n.length*t.lineHeight}}function Gr(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function Fp(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?ct/o:0;for(let l=0;lt.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function Op(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,r=Fs(o)/2,a=e.drawingArea,l=o.pointLabels.centerPointLabels?ct/s:0;for(let c=0;c270||n<90)&&(e-=t),e}function Ip(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=i.setContext(e.getPointLabelContext(s)),r=bt(o.font),{x:a,y:l,textAlign:c,left:u,top:f,right:d,bottom:h}=e._pointLabelItems[s],{backdropColor:g}=o;if(!tt(g)){const p=yn(o.borderRadius),m=kt(o.backdropPadding);n.fillStyle=g;const _=u-m.left,b=f-m.top,y=d-u+m.width,x=h-f+m.height;Object.values(p).some(v=>v!==0)?(n.beginPath(),Ms(n,{x:_,y:b,w:y,h:x,radius:p}),n.fill()):n.fillRect(_,b,y,x)}Sn(n,e._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Ml(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,at);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r{const s=rt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Fp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=at/(this._pointLabels.length||1),i=this.options.startAngle||0;return Qt(t*n+Bt(i))}getDistanceFromCenterForValue(t){if(tt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(tt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(f),h=s.setContext(d),g=o.setContext(d);Vp(this,h,l,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=bt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=kt(c.backdropPadding);t.fillRect(-r/2-f.left,-o-u.size/2-f.top,r+f.width,u.size+f.height)}Sn(t,a.label,0,-o,u,{color:c.color})}),t.restore()}drawTitle(){}}I(Yn,"id","radialLinear"),I(Yn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ei.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),I(Yn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),I(Yn,"descriptors",{angleLines:{_fallback:"grid"}});const Ii={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}},vt=Object.keys(Ii);function Hp(e,t){return e-t}function qr(e,t){if(tt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),dt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(bi(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function Yr(e,t,n,i){const s=vt.length;for(let o=vt.indexOf(e);o=vt.indexOf(n);o--){const r=vt[o];if(Ii[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return vt[n?vt.indexOf(n):0]}function Bp(e){for(let t=vt.indexOf(e)+1,n=vt.length;t=t?n[i]:n[s];e[o]=!0}}function jp(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function Xr(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Mt(n,0,r),i=Mt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Yr(o.minUnit,n,i,this._getLabelCapacity(n)),a=et(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=bi(l)||l===!0,u={};let f=n,d,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;dp-m).map(p=>+p)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return rt(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],d=i[n],h=c&&f&&d&&d.major;return this._adapter.format(t,s||(h?f:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ss(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ss(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Kr extends ki{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Un(n,this.min),this._tableRange=Un(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r{Qr.test(e)&&kl.push(e.replace(Qr,""))});function Rl(e){const t=De,n=[];function i(s){ec(t,s)}$i(()=>{const s=e();kl.forEach(s instanceof Element?o=>n.push(Nt(s,o,i)):o=>n.push(s.$on(o,i)))}),en(()=>{for(;n.length;)n.pop()()})}function Wp(e){let t,n=[e[1]],i={};for(let s=0;s{n(2,l=new Ti(c,{type:i,data:s,options:o,plugins:r}))}),Zl(()=>{l&&(n(2,l.data=s,l),Object.assign(l.options,o),l.update(a))}),en(()=>{l&&l.destroy(),n(2,l=null)}),Rl(()=>c);function f(d){Ke[d?"unshift":"push"](()=>{c=d,n(0,c)})}return e.$$set=d=>{n(9,t=N(N({},t),nt(d))),"type"in d&&n(3,i=d.type),"data"in d&&n(4,s=d.data),"options"in d&&n(5,o=d.options),"plugins"in d&&n(6,r=d.plugins),"updateMode"in d&&n(7,a=d.updateMode),"chart"in d&&n(2,l=d.chart)},t=nt(t),[c,u,l,i,s,o,r,a,f]}let Yp=class extends K{constructor(t){super(),Q(this,t,qp,Wp,Y,{type:3,data:4,options:5,plugins:6,updateMode:7,chart:2})}};function Up(e){let t,n,i;const s=[{type:"pie"},e[1]];function o(a){e[4](a)}let r={};for(let a=0;aha(t,"chart",o)),{c(){H(t.$$.fragment)},m(a,l){V(t,a,l),i=!0},p(a,[l]){const c=l&2?Vt(s,[s[0],te(a[1])]):{};!n&&l&1&&(n=!0,c.chart=a[0],ua(()=>n=!1)),t.$set(c)},i(a){i||(S(t.$$.fragment,a),i=!0)},o(a){M(t.$$.fragment,a),i=!1},d(a){e[3](null),z(t,a)}}}function Xp(e,t,n){Ti.register(ks);let{chart:i=null}=t,s,o;Rl(()=>o);function r(l){Ke[l?"unshift":"push"](()=>{o=l,n(2,o)})}function a(l){i=l,n(0,i)}return e.$$set=l=>{n(5,t=N(N({},t),nt(l))),"chart"in l&&n(0,i=l.chart)},e.$$.update=()=>{n(1,s=t)},t=nt(t),[i,s,o,r,a]}class Kp extends K{constructor(t){super(),Q(this,t,Xp,Up,Y,{chart:0})}}function Qp(e){let t,n;return t=new Kp({props:{class:"self-center",width:256,height:256,data:{labels:e[0].labels,datasets:[{data:e[0].data}]},options:{maintainAspectRatio:!1,responsive:!1,parsing:{key:"time"},animation:!1,plugins:{tooltip:{callbacks:{label:Zp}}}}}}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},p(i,[s]){const o={};s&1&&(o.data={labels:i[0].labels,datasets:[{data:i[0].data}]}),t.$set(o)},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}const Zp=e=>`Queries: ${e.raw.queries}, Time: ${e.raw.time.toFixed(4)} ms`;function Jp(e,t,n){let i;return gt(e,gs,s=>n(0,i=s)),Ti.register(pp,Sp,ni,Ps,hp),[i]}class tm extends K{constructor(t){super(),Q(this,t,Jp,Qp,Y,{})}}function Zr(e,t,n){const i=e.slice();return i[5]=t[n],i}function Jr(e){let t,n=e[5]+"",i,s,o,r;function a(){return e[4](e[5])}return{c(){t=P("button"),i=J(n),s=q(),O(t,"class","bg-dark-600 p-3 border-[1px] outline-none border-transparent focus-visible:border-cyan-600 text-left hover:bg-dark-400 rounded-md")},m(l,c){ot(l,t,c),w(t,i),w(t,s),o||(r=Nt(t,"click",a),o=!0)},p(l,c){e=l,c&2&&n!==(n=e[5]+"")&&jt(i,n)},d(l){l&&X(t),o=!1,r()}}}function em(e){let t,n,i,s,o,r,a,l,c,u,f,d,h,g,p,m,_,b,y,x,v,R,k,$=e[2].queries+"",A,F,C,D,U=e[2].timeQuerying.toFixed(4)+"",Z,E,T,B,ft,it=e[2].slowQueries+"",xt,Ut,pt,mt;a=new od({});function we(j){e[3](j)}let ce={icon:td};e[0]!==void 0&&(ce.value=e[0]),c=new Wf({props:ce}),Ke.push(()=>ha(c,"value",we));let Dt=e[1],_t=[];for(let j=0;ju=!1)),c.$set(Se),ue&2){Dt=j[1];let Ot;for(Ot=0;Otn(0,i=l)),gt(e,Xc,l=>n(1,s=l)),gt(e,hs,l=>n(2,o=l));function r(l){i=l,fs.set(i)}return[i,s,o,r,l=>Oe.goto(`/${l}`)]}class im extends K{constructor(t){super(),Q(this,t,nm,em,Y,{})}}function ta(e){let t,n,i,s,o,r,a;return i=new co({props:{path:"/",$$slots:{default:[sm]},$$scope:{ctx:e}}}),o=new co({props:{path:"/:resource",$$slots:{default:[om]},$$scope:{ctx:e}}}),{c(){t=P("main"),n=P("div"),H(i.$$.fragment),s=q(),H(o.$$.fragment),O(n,"class","bg-dark-800 text-white w-[1000px] h-[600px] flex rounded-md"),O(t,"class","w-full h-full flex justify-center items-center font-main")},m(l,c){ot(l,t,c),w(t,n),V(i,n,null),w(n,s),V(o,n,null),a=!0},i(l){a||(S(i.$$.fragment,l),S(o.$$.fragment,l),Qe(()=>{a&&(r||(r=ri(t,Po,{start:.95,duration:150},!0)),r.run(1))}),a=!0)},o(l){M(i.$$.fragment,l),M(o.$$.fragment,l),r||(r=ri(t,Po,{start:.95,duration:150},!1)),r.run(0),a=!1},d(l){l&&X(t),z(i),z(o),l&&r&&r.end()}}}function sm(e){let t,n;return t=new im({}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function om(e){let t,n;return t=new Nf({}),{c(){H(t.$$.fragment)},m(i,s){V(t,i,s),n=!0},i(i){n||(S(t.$$.fragment,i),n=!0)},o(i){M(t.$$.fragment,i),n=!1},d(i){z(t,i)}}}function rm(e){let t,n,i=e[0]&&ta(e);return{c(){i&&i.c(),t=kn()},m(s,o){i&&i.m(s,o),ot(s,t,o),n=!0},p(s,[o]){s[0]?i?o&1&&S(i,1):(i=ta(s),i.c(),S(i,1),i.m(t.parentNode,t)):i&&(Lt(),M(i,1,1,()=>{i=null}),Tt())},i(s){n||(S(i),n=!0)},o(s){M(i),n=!1},d(s){i&&i.d(s),s&&X(t)}}}function am(e,t,n){let i,s,o,r;gt(e,ji,l=>n(0,i=l)),gt(e,gs,l=>n(1,s=l)),gt(e,hs,l=>n(2,o=l)),gt(e,ds,l=>n(3,r=l)),Oe.mode.hash(),Oe.goto("/"),Ha("openUI",l=>{St(ji,i=!0,i),St(ds,r=l.resources,r),St(hs,o={queries:l.totalQueries,slowQueries:l.slowQueries,timeQuerying:l.totalTime},o),St(gs,s={labels:l.chartData.labels,data:l.chartData.data},s)}),Ba([{action:"openUI",data:{resources:["ox_core","oxmysql","ox_inventory","ox_doorlock","ox_lib","ox_vehicleshop","ox_target"],slowQueries:13,totalQueries:332,totalTime:230123,chartData:{labels:["oxmysql","ox_core","ox_inventory","ox_doorlock"],data:[{queries:25,time:133},{queries:5,time:12},{queries:3,time:2},{queries:72,time:133}]}}}]);const a=l=>{l.key==="Escape"&&(St(ji,i=!1,i),ya("exit"))};return e.$$.update=()=>{e.$$.dirty&1&&(i?window.addEventListener("keydown",a):window.removeEventListener("keydown",a))},[i]}class lm extends K{constructor(t){super(),Q(this,t,am,rm,Y,{})}}new lm({target:document.getElementById("app")});if(Na()){const e=document.getElementById("app");e.style.backgroundImage='url("https://i.imgur.com/3pzRj9n.png")',e.style.backgroundSize="cover",e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center"}