vite-plugin-kiru 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5409,15 +5409,15 @@ function updatePluginState(state, config, opts) {
|
|
|
5409
5409
|
}
|
|
5410
5410
|
|
|
5411
5411
|
// ../devtools-host/dist/index.js
|
|
5412
|
-
var dist_default = `var Cg=Object.create;var io=Object.defineProperty;var Pg=Object.getOwnPropertyDescriptor;var Dg=Object.getOwnPropertyNames;var Ag=Object.getPrototypeOf,Og=Object.prototype.hasOwnProperty;var Rg=(e,t,n)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ig=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Br=(e,t)=>{for(var n in t)io(e,n,{get:t[n],enumerable:!0})},Ng=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dg(t))!Og.call(e,s)&&s!==n&&io(e,s,{get:()=>t[s],enumerable:!(i=Pg(t,s))||i.enumerable});return e};var Lg=(e,t,n)=>(n=e!=null?Cg(Ag(e)):{},Ng(t||!e||!e.__esModule?io(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>Rg(e,typeof t!="symbol"?t+"":t,n);var Wr,R,rt,ct=M(()=>{"use strict";Wr="production";if(Wr!=="development"&&Wr!=="production")throw new Error("NODE_ENV must either be set to development or production.");R=Wr==="development",rt="window"in globalThis&&typeof window<"u"});var jr,Rn,Gt,$r,te,je,si,Oc,Ur,oi,ee,ne,In,Yt,$e,Wi,Rc,Gr,so,Ic,at=M(()=>{"use strict";jr=Symbol.for("kiru.signal"),Rn=Symbol.for("kiru.context"),Gt=Symbol.for("kiru.fragment"),$r=Symbol.for("kiru.error"),te=Symbol.for("kiru.hmrAccept"),je=Symbol.for("kiru.errorBoundary"),si=Symbol.for("kiru.streamData"),Oc=Symbol.for("kiru.devFileLink"),Ur=50,oi="kiru:deferred",ee=2,ne=4,In=8,Yt=16,$e=128,Wi=/^on:?/,Rc=new Set(["kiru-head-outlet","kiru-body-outlet","area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Gr=new Set(["animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","path","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use"]),so=new Set(["allowfullscreen","autofocus","autoplay","async","checked","compact","controls","contenteditable","declare","default","defer","disabled","download","hidden","inert","ismap","multiple","nohref","noresize","noshade","novalidate","nowrap","open","popover","readonly","required","sandbox","scoped","selected","sortable","spellcheck","translate","wrap"]),Ic=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]])});var Nc=M(()=>{"use strict"});function Lc(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}var zc=M(()=>{"use strict"});var K,pt,Vc,ri,oo,xt=M(()=>{"use strict";ct();K={current:null},pt={current:rt?"dom":"string"},Vc={current:"dynamic"},ri=new WeakMap,oo=[]});function Yr(){let e=document.activeElement;e===document.body||!(e instanceof HTMLElement)||(e.addEventListener("blur",Fc),Nn=e)}function Kr(){Nn&&(Nn.removeEventListener("blur",Fc),Nn.isConnected&&Nn.focus(),Nn=null)}function Xr(e){return t=>{if(Nn){t.preventDefault(),t.stopPropagation();return}e(t)}}function Fc(e){e.preventDefault(),e.stopPropagation()}var Nn,qr=M(()=>{"use strict";Nn=null});function Hc(e){let{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{};if(Xg(t)){let p=r.nodeValue;!L.isSignal(p)&&t.nodeValue!==p&&(t.nodeValue=p);return}if(!n){Bg(e,t,r,s);let p=r.ref;p&&Ln(p,t);return}let a=new Set,l,c;for(let p in o){let b=o[p],x=r[p];if(b!==x){if(p.length>=2&&p.charCodeAt(0)===111&&p.charCodeAt(1)===110&&!x){c??(c=cn.get(e)??{}),cn.set(e,c);let y=p.replace(Wi,""),w=c[y];w&&(t.removeEventListener(y,w),delete c[y]);continue}L.isSignal(b)&&s?.[p]&&(s[p](),delete s[p]),a.add(p)}}for(let p in r)(!(p in o)||o[p]!==r[p])&&a.add(p);let u=Array.from(a);if(ro(t)&&u.length>1){let p=a,b=!1,x=!1,y=[],w=!1,_=!1;for(let T in r){let E=T.length>=2&&T.charCodeAt(0)===111&&T.charCodeAt(1)===110;E?w=!0:_=!0;let D=!E&&T.startsWith("bind:")?T.slice(5):T,O=jc(D,E);O===1?(b=!0,p.has(T)&&(x=!0)):O===5&&y.push(T)}if(b&&x)for(let T of y)!p.has(T)&&T in r&&(u.push(T),p.add(T));(b&&x||w&&_)&&u.length>1&&Wc(u)}for(let p=0;p<u.length;p++){let b=u[p],x=o[b],y=r[b];if(!Jr.has(b)){if(b.length>=2&&b.charCodeAt(0)===111&&b.charCodeAt(1)===110){c??(c=cn.get(e)??{}),cn.set(e,c);let w=b.replace(Wi,""),_=c[w];if(!y){_&&(t.removeEventListener(w,_),delete c[w]);continue}let S=y.bind(void 0);if((w==="focus"||w==="blur")&&(S=Xr(S)),_){_.handleEvent=S;continue}t.addEventListener(w,c[w]={handleEvent:S});continue}if(L.isSignal(y)){Uc(e,t,b,y,x);continue}if(b==="style"&&typeof y=="object"&&y!==null){if(s?.style&&(s.style(),delete s.style),l||(l=new Map),ao(t,y,x,!0),l.size>0){let w=[];for(let[_,S]of l.entries())w.push(S.subscribe(_.startsWith("--")?T=>$i(t,_,T):T=>Ui(t,_,T)));l.clear(),ie(e,"style",()=>w.forEach(_=>_()))}continue}Gi(t,b,y,x)}}let d=o.ref,f=r.ref;d!==f&&(d&&Ln(d,null),f&&Ln(f,t))}function Bc(e,t,n,i){let s;for(let r in n){let a=n[r];if(!Jr.has(r)){if(r.length>=2&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110){s??(s=cn.get(e)??{}),cn.set(e,s);let l=r.replace(Wi,""),c=s[l];c&&(t.removeEventListener(l,c),delete s[l]);continue}if(L.isSignal(a)&&i?.[r]){i[r](),delete i[r];continue}if(r==="style"){i?.style&&(i.style(),delete i.style),ro(t)&&ao(t,void 0,a);continue}ro(t)&&Gi(t,r,void 0,a)}}let o=n.ref;o&&Ln(o,null)}function Bg(e,t,n,i){let s=Object.keys(n);ro(t)&&s.length>1&&Wc(s);let o;for(let r=0;r<s.length;r++){let a=s[r],l=n[a];if(!Jr.has(a)){if(a.length>=2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110){if(!l)continue;o??(o=cn.get(e)??{}),cn.set(e,o);let c=a.replace(Wi,""),u=o[c],d=l.bind(void 0);(c==="focus"||c==="blur")&&(d=Xr(d)),u?u.handleEvent=d:t.addEventListener(c,o[c]={handleEvent:d});continue}if(L.isSignal(l)){Uc(e,t,a,l,void 0);continue}if(a==="style"&&typeof l=="object"&&l!==null){if(ao(t,l,void 0,!0),ji.size>0){i??(i={});for(let[c,u]of ji.entries()){let d=\`style-\${c}\`;i[d]?.(),i[d]=u.subscribe(c.startsWith("--")?f=>$i(t,c,f):f=>Ui(t,c,f))}ji.clear()}continue}Gi(t,a,l,void 0)}}}function Wc(e){if(e.length<=1)return;for(let n=0;n<7;n++)Zr[n].length=0;for(let n=0;n<e.length;n++){let i=e[n],s=i.length>=2&&i.charCodeAt(0)===111&&i.charCodeAt(1)===110,o=i;!s&&i.length>5&&i.charCodeAt(4)===58&&(o=i.slice(5));let r=jc(o,s),a;r<=0?a=0:r===1?a=1:r===2?a=2:r===3?a=3:r===5?a=4:r>=9?a=6:a=5,Zr[a].push(i)}let t=0;for(let n=0;n<7;n++){let i=Zr[n];for(let s=0;s<i.length;s++)e[t++]=i[s]}}function jc(e,t){if(t)return 9;switch(e){case"innerHTML":case"type":case"muted":case"autoplay":case"loop":return 0;case"min":case"max":case"step":case"pattern":case"accept":case"multiple":case"preload":case"minLength":case"maxLength":case"crossOrigin":case"decoding":case"loading":case"referrerPolicy":return 1;case"style":case"className":return 3;case"value":case"checked":case"selected":case"open":case"src":return 5;default:return 4}}function $c(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}let n=e.options,i=n.length;for(let s=0;s<i;s++){let o=n[s];o.selected=t.indexOf(o.value)>-1}}function Uc(e,t,n,i,s){let o=n.indexOf(":"),r=o===-1?n:n.slice(0,o),a=o===-1?void 0:n.slice(o+1);if(r==="bind"){let u=Vg[a];if(!u){R&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let d=i.peek(),f=Wg(e,t,a,u,i,d);ie(e,n,f)}else{let u=i.subscribe((d,f)=>{d!==f&&(Gi(t,n,d,f),R&&Yc(e))});ie(e,n,u)}let l=i.peek(),c=Z(s);r!=="bind"&&l!==c&&Gi(t,a??r,l,c)}function Wg(e,t,n,i,s,o){let r=b=>{s.sneak(b),s.notify(x=>x!==l)},a=t.nodeName==="SELECT"&&n==="value"?b=>$c(t,b):b=>t[n]=b,l=b=>{a(b),R&&Yc(e)},c,u;n==="value"?(c=Gg(t),u=()=>r(c())):u=()=>{let b=t[n];n==="currentTime"&&s.peek()===b||r(b)},o!==void 0&&l(o);let d;n==="value"&&c?d=c():d=t[n];let f=s.peek();d!==f&&r(d),t.addEventListener(i,u);let p=s.subscribe(l);return()=>{t.removeEventListener(i,u),p()}}function Gi(e,t,n,i){switch(t){case"style":return ao(e,n,i);case"className":return Ug(e,n);case"innerHTML":return $g(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return $c(e,n);let s=n==null?"":String(n);if(Hg.has(e.nodeName)){e.value=s;return}e.setAttribute("value",s);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!n;return}e.setAttribute("checked",String(n));return;default:return jg(e,Qr(t),n)}}function jg(e,t,n){let i=so.has(t);Gc(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}function $g(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Ug(e,t){let n=Z(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function $i(e,t,n){if(n==null){e.style.removeProperty(t);return}e.style.setProperty(t,String(n))}function Ui(e,t,n){e.style[t]=n!=null?String(n):""}function ao(e,t,n,i=!1){if(Gc(e,"style",t))return;let s=Z(t);if(s==null){e.removeAttribute("style");return}if(typeof s=="string"){e.setAttribute("style",s);return}let o={},r=Z(n);typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r!==null&&(o=r);let a=s,l=Object.keys(o),c=Object.keys(a);if(l.length===0){for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(p);i&&L.isSignal(p)&&ji.set(f,p),f.startsWith("--")?$i(e,f,b):Ui(e,f,b)}return}let u=new Set(c);for(let d=0;d<l.length;d++){let f=l[d];u.has(f)||(f.startsWith("--")?$i(e,f,void 0):Ui(e,f,void 0))}for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(o[f]),x=Z(p);i&&L.isSignal(p)&&ji.set(f,p),b!==x&&(f.startsWith("--")?$i(e,f,x):Ui(e,f,x))}}function Gc(e,t,n,i=!1){if(n===null)return e.removeAttribute(t),!0;switch(typeof n){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(i&&!n)return e.removeAttribute(t),!0}return!1}function Gg(e){return e.nodeName==="INPUT"?Yg(e):e.nodeName==="SELECT"?()=>Kg(e):()=>e.value}function Yg(e){let t=e.type;return Fg.has(t)?()=>e.valueAsNumber:()=>e.value}function Kg(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Yc(e){rt&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",Nt(e))}function ro(e){return e.nodeType===1}function Xg(e){return e.nodeType===3}var cn,Jr,Zr,Vg,Fg,Hg,ji,Kc=M(()=>{"use strict";q();de();un();at();ct();qr();cn=new WeakMap,Jr=new Set(["children","ref","key"]),Zr=[[],[],[],[],[],[],[]],Vg={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Fg=new Set(["progress","meter","number","range"]),Hg=new Set(["INPUT","TEXTAREA"]);ji=new Map});var Yi,zn,fe,ta=M(()=>{"use strict";Yi=[],zn=[],fe={bumpChildIndex(){zn[zn.length-1]++},getCurrentChild(){let e=zn[zn.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return Yi[Yi.length-1]},clear(){Yi.length=0,zn.length=0},pop(){Yi.pop(),zn.pop()},push(e){Yi.push(e),zn.push(0)}}});function qg(e){let t=e,n=[];for(;t&&t.parent;)typeof t.type=="function"?n.push(Zg(t.type)):typeof t.type=="string"&&n.push(t.type),t=t.parent;let i=typeof e.type=="function"?e:ea(e,s=>typeof s.type=="function");return\`The above error occurred in the <\${qc(i?.type||Zc)}> component:
|
|
5412
|
+
var dist_default = `var Dg=Object.create;var so=Object.defineProperty;var Ag=Object.getOwnPropertyDescriptor;var Og=Object.getOwnPropertyNames;var Rg=Object.getPrototypeOf,Ig=Object.prototype.hasOwnProperty;var Ng=(e,t,n)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t)=>()=>(e&&(t=e(e=0)),t);var Lg=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wr=(e,t)=>{for(var n in t)so(e,n,{get:t[n],enumerable:!0})},zg=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Og(t))!Ig.call(e,s)&&s!==n&&so(e,s,{get:()=>t[s],enumerable:!(i=Ag(t,s))||i.enumerable});return e};var Vg=(e,t,n)=>(n=e!=null?Dg(Rg(e)):{},zg(t||!e||!e.__esModule?so(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>Ng(e,typeof t!="symbol"?t+"":t,n);var jr,R,rt,ct=M(()=>{"use strict";jr="production";if(jr!=="development"&&jr!=="production")throw new Error("NODE_ENV must either be set to development or production.");R=jr==="development",rt="window"in globalThis&&typeof window<"u"});var $r,On,Yt,Ur,ee,je,si,Nc,Gr,oi,ne,ie,Rn,Kt,$e,ji,Lc,Yr,oo,zc,at=M(()=>{"use strict";$r=Symbol.for("kiru.signal"),On=Symbol.for("kiru.context"),Yt=Symbol.for("kiru.fragment"),Ur=Symbol.for("kiru.error"),ee=Symbol.for("kiru.hmrAccept"),je=Symbol.for("kiru.errorBoundary"),si=Symbol.for("kiru.streamData"),Nc=Symbol.for("kiru.devFileLink"),Gr=50,oi="kiru:deferred",ne=2,ie=4,Rn=8,Kt=16,$e=128,ji=/^on:?/,Lc=new Set(["kiru-head-outlet","kiru-body-outlet","area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Yr=new Set(["animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","path","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use"]),oo=new Set(["allowfullscreen","autofocus","autoplay","async","checked","compact","controls","contenteditable","declare","default","defer","disabled","download","hidden","inert","ismap","multiple","nohref","noresize","noshade","novalidate","nowrap","open","popover","readonly","required","sandbox","scoped","selected","sortable","spellcheck","translate","wrap"]),zc=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]])});var Vc=M(()=>{"use strict"});function Fc(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}var Hc=M(()=>{"use strict"});var K,pt,Bc,ri,ro,xt=M(()=>{"use strict";ct();K={current:null},pt={current:rt?"dom":"string"},Bc={current:"dynamic"},ri=new WeakMap,ro=[]});function Kr(){let e=document.activeElement;e===document.body||!(e instanceof HTMLElement)||(e.addEventListener("blur",Wc),In=e)}function Xr(){In&&(In.removeEventListener("blur",Wc),In.isConnected&&In.focus(),In=null)}function qr(e){return t=>{if(In){t.preventDefault(),t.stopPropagation();return}e(t)}}function Wc(e){e.preventDefault(),e.stopPropagation()}var In,Zr=M(()=>{"use strict";In=null});function lo(e){let{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{};if(Zg(t)){let p=r.nodeValue;!L.isSignal(p)&&t.nodeValue!==p&&(t.nodeValue=p);return}if(!n){jg(e,t,r,s);let p=r.ref;p&&Nn(p,t);return}let a=new Set,l,c;for(let p in o){let b=o[p],x=r[p];if(b!==x){if(p.length>=2&&p.charCodeAt(0)===111&&p.charCodeAt(1)===110&&!x){c??(c=cn.get(e)??{}),cn.set(e,c);let y=p.replace(ji,""),w=c[y];w&&(t.removeEventListener(y,w),delete c[y]);continue}L.isSignal(b)&&s?.[p]&&(s[p](),delete s[p]),a.add(p)}}for(let p in r)(!(p in o)||o[p]!==r[p])&&a.add(p);let u=Array.from(a);if(ao(t)&&u.length>1){let p=a,b=!1,x=!1,y=[],w=!1,_=!1;for(let T in r){let E=T.length>=2&&T.charCodeAt(0)===111&&T.charCodeAt(1)===110;E?w=!0:_=!0;let P=!E&&T.startsWith("bind:")?T.slice(5):T,O=Uc(P,E);O===1?(b=!0,p.has(T)&&(x=!0)):O===5&&y.push(T)}if(b&&x)for(let T of y)!p.has(T)&&T in r&&(u.push(T),p.add(T));(b&&x||w&&_)&&u.length>1&&$c(u)}for(let p=0;p<u.length;p++){let b=u[p],x=o[b],y=r[b];if(!Qr.has(b)){if(b.length>=2&&b.charCodeAt(0)===111&&b.charCodeAt(1)===110){c??(c=cn.get(e)??{}),cn.set(e,c);let w=b.replace(ji,""),_=c[w];if(!y){_&&(t.removeEventListener(w,_),delete c[w]);continue}let S=y.bind(void 0);if((w==="focus"||w==="blur")&&(S=qr(S)),_){_.handleEvent=S;continue}t.addEventListener(w,c[w]={handleEvent:S});continue}if(L.isSignal(y)){Yc(e,t,b,y,x);continue}if(b==="style"&&typeof y=="object"&&y!==null){if(s?.style&&(s.style(),delete s.style),l||(l=new Map),co(t,y,x,!0),l.size>0){let w=[];for(let[_,S]of l.entries())w.push(S.subscribe(_.startsWith("--")?T=>Ui(t,_,T):T=>Gi(t,_,T)));l.clear(),se(e,"style",()=>w.forEach(_=>_()))}continue}Yi(t,b,y,x)}}let d=o.ref,f=r.ref;d!==f&&(d&&Nn(d,null),f&&Nn(f,t))}function jc(e,t,n,i){let s;for(let r in n){let a=n[r];if(!Qr.has(r)){if(r.length>=2&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110){s??(s=cn.get(e)??{}),cn.set(e,s);let l=r.replace(ji,""),c=s[l];c&&(t.removeEventListener(l,c),delete s[l]);continue}if(L.isSignal(a)&&i?.[r]){i[r](),delete i[r];continue}if(r==="style"){i?.style&&(i.style(),delete i.style),ao(t)&&co(t,void 0,a);continue}ao(t)&&Yi(t,r,void 0,a)}}let o=n.ref;o&&Nn(o,null)}function jg(e,t,n,i){let s=Object.keys(n);ao(t)&&s.length>1&&$c(s);let o;for(let r=0;r<s.length;r++){let a=s[r],l=n[a];if(!Qr.has(a)){if(a.length>=2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110){if(!l)continue;o??(o=cn.get(e)??{}),cn.set(e,o);let c=a.replace(ji,""),u=o[c],d=l.bind(void 0);(c==="focus"||c==="blur")&&(d=qr(d)),u?u.handleEvent=d:t.addEventListener(c,o[c]={handleEvent:d});continue}if(L.isSignal(l)){Yc(e,t,a,l,void 0);continue}if(a==="style"&&typeof l=="object"&&l!==null){if(co(t,l,void 0,!0),$i.size>0){i??(i={});for(let[c,u]of $i.entries()){let d=\`style-\${c}\`;i[d]?.(),i[d]=u.subscribe(c.startsWith("--")?f=>Ui(t,c,f):f=>Gi(t,c,f))}$i.clear()}continue}Yi(t,a,l,void 0)}}}function $c(e){if(e.length<=1)return;for(let n=0;n<7;n++)Jr[n].length=0;for(let n=0;n<e.length;n++){let i=e[n],s=i.length>=2&&i.charCodeAt(0)===111&&i.charCodeAt(1)===110,o=i;!s&&i.length>5&&i.charCodeAt(4)===58&&(o=i.slice(5));let r=Uc(o,s),a;r<=0?a=0:r===1?a=1:r===2?a=2:r===3?a=3:r===5?a=4:r>=9?a=6:a=5,Jr[a].push(i)}let t=0;for(let n=0;n<7;n++){let i=Jr[n];for(let s=0;s<i.length;s++)e[t++]=i[s]}}function Uc(e,t){if(t)return 9;switch(e){case"innerHTML":case"type":case"muted":case"autoplay":case"loop":return 0;case"min":case"max":case"step":case"pattern":case"accept":case"multiple":case"preload":case"minLength":case"maxLength":case"crossOrigin":case"decoding":case"loading":case"referrerPolicy":return 1;case"style":case"className":return 3;case"value":case"checked":case"selected":case"open":case"src":return 5;default:return 4}}function Gc(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}let n=e.options,i=n.length;for(let s=0;s<i;s++){let o=n[s];o.selected=t.indexOf(o.value)>-1}}function Yc(e,t,n,i,s){let o=n.indexOf(":"),r=o===-1?n:n.slice(0,o),a=o===-1?void 0:n.slice(o+1);if(r==="bind"){let u=Hg[a];if(!u){R&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let d=i.peek(),f=$g(e,t,a,u,i,d);se(e,n,f)}else{let u=i.subscribe((d,f)=>{d!==f&&(Yi(t,n,d,f),R&&Xc(e))});se(e,n,u)}let l=i.peek(),c=q(s);r!=="bind"&&l!==c&&Yi(t,a??r,l,c)}function $g(e,t,n,i,s,o){let r=b=>{s.sneak(b),s.notify(x=>x!==l)},a=t.nodeName==="SELECT"&&n==="value"?b=>Gc(t,b):b=>t[n]=b,l=b=>{a(b),R&&Xc(e)},c,u;n==="value"?(c=Kg(t),u=()=>r(c())):u=()=>{let b=t[n];n==="currentTime"&&s.peek()===b||r(b)},o!==void 0&&l(o);let d;n==="value"&&c?d=c():d=t[n];let f=s.peek();d!==f&&r(d),t.addEventListener(i,u);let p=s.subscribe(l);return()=>{t.removeEventListener(i,u),p()}}function Yi(e,t,n,i){switch(t){case"style":return co(e,n,i);case"className":return Yg(e,n);case"innerHTML":return Gg(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Gc(e,n);let s=n==null?"":String(n);if(Wg.has(e.nodeName)){e.value=s;return}e.setAttribute("value",s);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!n;return}e.setAttribute("checked",String(n));return;default:return Ug(e,ea(t),n)}}function Ug(e,t,n){let i=oo.has(t);Kc(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}function Gg(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Yg(e,t){let n=q(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function Ui(e,t,n){if(n==null){e.style.removeProperty(t);return}e.style.setProperty(t,String(n))}function Gi(e,t,n){e.style[t]=n!=null?String(n):""}function co(e,t,n,i=!1){if(Kc(e,"style",t))return;let s=q(t);if(s==null){e.removeAttribute("style");return}if(typeof s=="string"){e.setAttribute("style",s);return}let o={},r=q(n);typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r!==null&&(o=r);let a=s,l=Object.keys(o),c=Object.keys(a);if(l.length===0){for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=q(p);i&&L.isSignal(p)&&$i.set(f,p),f.startsWith("--")?Ui(e,f,b):Gi(e,f,b)}return}let u=new Set(c);for(let d=0;d<l.length;d++){let f=l[d];u.has(f)||(f.startsWith("--")?Ui(e,f,void 0):Gi(e,f,void 0))}for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=q(o[f]),x=q(p);i&&L.isSignal(p)&&$i.set(f,p),b!==x&&(f.startsWith("--")?Ui(e,f,x):Gi(e,f,x))}}function Kc(e,t,n,i=!1){if(n===null)return e.removeAttribute(t),!0;switch(typeof n){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(i&&!n)return e.removeAttribute(t),!0}return!1}function Kg(e){return e.nodeName==="INPUT"?Xg(e):e.nodeName==="SELECT"?()=>qg(e):()=>e.value}function Xg(e){let t=e.type;return Bg.has(t)?()=>e.valueAsNumber:()=>e.value}function qg(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Xc(e){rt&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",Lt(e))}function ao(e){return e.nodeType===1}function Zg(e){return e.nodeType===3}var cn,Qr,Jr,Hg,Bg,Wg,$i,ta=M(()=>{"use strict";Z();fe();Ln();at();ct();Zr();cn=new WeakMap,Qr=new Set(["children","ref","key"]),Jr=[[],[],[],[],[],[],[]],Hg={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Bg=new Set(["progress","meter","number","range"]),Wg=new Set(["INPUT","TEXTAREA"]);$i=new Map});var Ki,zn,he,na=M(()=>{"use strict";Ki=[],zn=[],he={bumpChildIndex(){zn[zn.length-1]++},getCurrentChild(){let e=zn[zn.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return Ki[Ki.length-1]},clear(){Ki.length=0,zn.length=0},pop(){Ki.pop(),zn.pop()},push(e){Ki.push(e),zn.push(0)}}});function Jg(e){let t=e,n=[];for(;t&&t.parent;)typeof t.type=="function"?n.push(Qg(t.type)):typeof t.type=="string"&&n.push(t.type),t=t.parent;let i=typeof e.type=="function"?e:ia(e,s=>typeof s.type=="function");return\`The above error occurred in the <\${Zc(i?.type||Jc)}> component:
|
|
5413
5413
|
|
|
5414
5414
|
\${n.map(s=>\` at \${s}\`).join(\`
|
|
5415
5415
|
\`)}
|
|
5416
|
-
\`}function Zg(e){let t=qc(e);if(R){let n=Jg(e);n&&(t=\`\${t} (\${n})\`)}return t}function qc(e){return e.displayName??(e.name||"Anonymous Function")}function Jg(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var Xc,Et,ai=M(()=>{"use strict";at();ct();q();Et=class extends Error{constructor(t){let n=typeof t=="string"?t:t.message;super(n),this[Xc]=!0,typeof t!="string"&&(R&&t?.vNode&&(this.customNodeStack=qg(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[$r]===!0}};Xc=$r});function ia(e){let t=e.type;return t=="#text"?nm(e):Gr.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function sa(e){let t=e.type==="#text"?em(e):fe.getCurrentChild();if(fe.bumpChildIndex(),!t)throw new Et({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Gr.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Et({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&Yt))return;L.isSignal(e.props.nodeValue)&&na(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){let o=s;fe.bumpChildIndex();let r=String(Z(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,L.isSignal(o.props.nodeValue)&&na(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Jc(e){let t=e.parent,n=t?.dom;for(;t&&!n;)t=t.parent,n=t?.dom;if(!n||!t){if(!e.parent&&e.dom)return e;throw new Et({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function Qc(e,t){let{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}let o=Qg(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function Qg(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(ne|Yt))){let s=tm(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&Yt||n===t)return}}function tm(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&Yt)return;t=t.child}}function em(e){let t=e.props.nodeValue;if(!L.isSignal(t))return fe.getCurrentChild();let n=t.peek();if(dn(n))return fe.getCurrentChild();let i=tu(e,t),s=fe.getCurrentChild();return s?(s.before(i),i):fe.getCurrentParent().appendChild(i)}function na(e,t,n){let i=n.subscribe((s,o)=>{s!==o&&(t.nodeValue=s,R&&rt&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Nt(e)))});ie(e,"nodeValue",i)}function nm(e){let{nodeValue:t}=e.props;return L.isSignal(t)?tu(e,t):document.createTextNode(t)}function tu(e,t){let n=t.peek()??"",i=document.createTextNode(n);return na(e,i,t),i}var oa=M(()=>{"use strict";at();de();un();ta();q();ai();ct()});function aa(e){if(pt.current==="hydrate")return fn(e,lo);let t={node:e.dom?e:Jc(e)};ra(e,t,(e.flags&ne)>0),e.dom&&!(e.flags&Yt)&&eu(e,t,!1),lo(e)}function ra(e,t,n){let i=e.child;for(;i;)i.dom?(ra(i,{node:i},!1),i.flags&Yt||eu(i,t,n)):ra(i,t,(i.flags&ne)>0||n),lo(i),i=i.sibling}function eu(e,t,n){if((n||!e.dom.isConnected||e.flags&ne)&&Qc(e,t),R&&e.prev&&Ki()){let{dom:i,prev:s,cleanups:o}=e;Bc(e,i,s.props,o),e.prev=null}(!e.prev||e.flags&ee)&&Hc(e),t.lastChild=e.dom}function la(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;R&&(t=Nt(e)),fn(e,n=>{let{subs:i,cleanups:s,dom:o,props:{ref:r},hooks:a}=n;if(i?.forEach(l=>l()),s&&Object.values(s).forEach(l=>l()),a){let{preCleanups:l,postCleanups:c}=a;oo.push(...c),l.forEach(Lt),l.length=c.length=0}R&&(window.__kiru.profilingContext?.emit("removeNode",t),o instanceof Element&&delete o.__kiruNode),o&&(o.isConnected&&!(n.flags&Yt)&&o.remove(),r&&Ln(r,null),delete n.dom)}),e.parent=null}var nu=M(()=>{"use strict";q();at();ct();xt();Xi();Kc();oa()});var iu=M(()=>{"use strict";nu();qr();oa()});function m(e,t=null,...n){e===vt&&(e=Gt);let i=t===null?{}:t,s=ca(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function vt({children:e,key:t}){return{type:Gt,key:ca(t),props:{children:e}}}var li=M(()=>{"use strict";at();q()});function co(e,t=null,n={},i=null,s=0){e===vt&&(e=Gt);let o=t?t.depth+1:0;return{type:e,key:i,props:n,parent:t,index:s,depth:o,flags:0,child:null,sibling:null,prev:null,deletions:null}}var ua=M(()=>{"use strict";at();li()});function ho(e,t){return R&&(ha=Nt(e)),Array.isArray(t)?(R&&(cu in t&&am(e,t),rm(e,t)),sm(e,t)):im(e,t)}function im(e,t){let n=e.child;if(n===null)return au(e,t);let i=n.sibling,s=ou(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?fa(e,n):i&&fa(e,i),s;{let o=uu(n),r=lu(o,e,0,t);if(r!==null){let a=r.prev;if(a!==null){let l=a.key;o.delete(l===null?a.index:l)}uo(r,0,0)}return o.forEach(a=>fo(e,a)),r}}function sm(e,t){let n=null,i=null,s=e.child,o=null,r=0,a=0;for(;s!==null&&a<t.length;a++){s.index>a?(o=s,s=null):o=s.sibling;let c=ou(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&fo(e,s),r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return fa(e,s),n;if(s===null){for(;a<t.length;a++){let c=au(e,t[a]);c!==null&&(r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}let l=uu(s);for(;a<t.length;a++){let c=lu(l,e,a,t[a]);if(c!==null){let u=c.prev;if(u!==null){let d=u.key;l.delete(d===null?u.index:d)}r=uo(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>fo(e,c)),n}function ou(e,t,n){let i=t===null?null:t.key;return dn(n)?i!==null||t?.type==="#text"&&L.isSignal(t.props.nodeValue)?null:su(e,t,""+n):L.isSignal(n)?t&&t.props.nodeValue!==n?null:su(e,t,n):ci(n)?n.key!==i?null:om(e,t,n):Array.isArray(n)?i!==null?null:(R&&pa(n),ru(e,t,n)):null}function su(e,t,n){return t===null||t.type!=="#text"?Se(e,"#text",{nodeValue:n}):(R&&qi(),t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ee),t.sibling=null,t)}function om(e,t,n){let{type:i,props:s,key:o}=n;return R&&typeof i=="function"&&(i=wt(i)),i===Gt?ru(e,t,s.children||[],s):t?.type===i?(R&&qi(),t.index=0,t.sibling=null,typeof i=="string"?hu(t.props,s)&&(t.flags|=ee):t.flags|=ee,t.props=s,t):Se(e,i,s,o)}function ru(e,t,n,i={}){return t===null||t.type!==Gt?Se(e,Gt,{children:n,...i}):(R&&qi(),t.props={...t.props,...i,children:n},t.flags|=ee,t.sibling=null,t)}function au(e,t){return dn(t)?Se(e,"#text",{nodeValue:""+t}):L.isSignal(t)?Se(e,"#text",{nodeValue:t}):ci(t)?Se(e,t.type,t.props,t.key):Array.isArray(t)?(R&&pa(t),Se(e,Gt,{children:t})):null}function uo(e,t,n){e.index=n;let i=e.prev;if(i!==null){let s=i.index;return s<t?(e.flags|=ne,t):s}else return e.flags|=ne,t}function lu(e,t,n,i){if(L.isSignal(i)||dn(i)){let o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&L.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Se(t,"#text",{nodeValue:i},null,n)}if(ci(i)){let{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(R&&qi(),typeof o=="string"?hu(l.props,r)&&(l.flags|=ee):l.flags|=ee,l.props=r,l.sibling=null,l.index=n,l):Se(t,o,r,a,n)}if(Array.isArray(i)){let o={children:i},r=e.get(n);return R&&pa(i),r?(R&&qi(),r.flags|=ee,r.props=o,r):Se(t,Gt,o,null,n)}return null}function qi(){rt&&window.__kiru.profilingContext?.emit("updateNode",ha)}function pa(e){Object.assign(e,{[cu]:!0})}function uu(e){let t=new Map;for(;e;){let n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function fo(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function fa(e,t){for(;t;)fo(e,t),t=t.sibling}function rm(e,t){let n=new Set,i=!1;for(let s of t){if(!ci(s))continue;let o=s.key;if(typeof o=="string"){if(!i&&n.has(o)){let r=fu(e);du(\`\${r} component produced a child in a list with a duplicate key prop: "\${o}". Keys should be unique so that components maintain their identity across updates\`),i=!0}n.add(o)}}}function am(e,t){let n=!1,i=!1;for(let s of t)ci(s)&&(typeof s.key=="string"?n=!0:i=!0);if(i&&n){let s=fu(e);du(\`\${s} component produced a child in a list without a valid key prop\`)}}function du(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}function fu(e){if(da.has(e))return da.get(e);let t=e.parent,n;for(;!n&&t;)typeof t.type=="function"&&(n=t.type),t=t.parent;let i=\`<\${n?.displayName||n?.name||"Anonymous Function"} />\`;return da.set(e,i),i}function Se(e,t,n,i=null,s=0){let o=co(t,e,n,i,s);return o.flags|=ne,R&&rt&&window.__kiru.profilingContext?.emit("createNode",ha),o}function hu(e,t){return po(e,t,lm)}var ha,cu,da,lm,pu=M(()=>{"use strict";at();q();de();ct();ua();cu=Symbol("kiru:marked-list-child");da=new WeakMap;lm=["children","key"]});function Zi(e){if(ui){ga.push(e);return}e()}function pn(){ui&&(window.cancelAnimationFrame(bu),yu())}function wa(e){e.flags|=$e,Me.push(e),ui=!0,pn()}function zt(e){if(pt.current==="hydrate")return Zi(()=>gu(e));gu(e)}function xu(){let e=K.current;if(!e)throw new Error("useRequestUpdate must be called inside a Kiru component");return()=>zt(e)}function gu(e){if(ma&&(ba=!0),K.current===e){R&&window.__kiru.profilingContext?.emit("updateDirtied",Ee),xa=!0;return}if(!(e.flags&($e|In))){if(e.flags|=$e,!Me.length){Me.push(e),ui||(ui=!0,bu=window.requestAnimationFrame(yu));return}Me.push(e)}}function cm(e){fn(e,t=>t.flags|=In),mo.push(e)}function yu(){if(R){let t=mo[0]??Me[0];t?(Ee=Nt(t),window.__kiru.profilingContext?.beginTick(Ee)):Ee=null}let e=1;for(Yr();Me.length;){Me.length>e&&Me.sort(um),hn=Me.shift(),e=Me.length;let t=hn.flags;if(!(t&In)&&t&$e){let n=hn;for(;n=dm(n););for(;mo.length;)la(mo.pop());aa(hn),hn.flags&=~$e}}if(Kr(),ma=!0,go(mu),ma=!1,ba)return bm(),go(va),ba=!1,ya++,R&&(window.__kiru.profilingContext?.endTick(Ee),window.__kiru.profilingContext?.emit("updateDirtied",Ee)),pn();for(ya=0,ui=!1;ga.length;)ga.shift()();queueMicrotask(()=>{go(oo),go(va)}),R&&(window.__kiru.emit("update",Ee),window.__kiru.profilingContext?.emit("update",Ee),window.__kiru.profilingContext?.endTick(Ee))}function dm(e){let t=fm(e);if(e.deletions!==null&&(e.deletions.forEach(cm),e.deletions=null),t)return t;let n=e;for(;n;){let{hooks:i}=n;if(i&&(mu.push(...i.pre),va.push(...i.post),i.pre.length=0,i.post.length=0),n===hn)return null;if(n.sibling)return n.sibling;n=n.parent,pt.current==="hydrate"&&n?.dom&&fe.pop()}return null}function fm(e){let{type:t,props:n,prev:i,flags:s}=e;if(!(R&&Ki())){if(i&&(s&$e)===0&&(i.props===n||!po(i.props,n)))return null}try{return typeof t=="string"?mm(e):bo(t)?hm(e):pm(e)}catch(o){R&&window.__kiru.emit("error",Ee,o instanceof Error?o:new Error(String(o)));let r=vu(e);if(r){let a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<hn.depth&&(hn=r),r}if(Et.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function hm(e){let{props:t,type:n}=e,i=t.children;if(n===je){let s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=ho(e,i)}function pm(e){let{type:t,props:n,subs:i}=e,s=(e.flags&$e)===0;try{K.current=e;let o,r=0;do{if(e.flags&=~$e,xa=!1,i&&(i.forEach(Lt),i.clear()),R&&Ki()){let{hooks:a,cleanups:l}=e;if(l&&(Object.values(l).forEach(Lt),delete e.cleanups),a){let{preCleanups:c,postCleanups:u}=a;c.forEach(Lt),u.forEach(Lt),c.length=u.length=0}delete e.propSyncs,delete e.render}if(o=gm(e,t,n,s),++r>Ur){if(R)throw new Et({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});break}}while(xa);return e.child=ho(e,o)}finally{K.current=null}}function gm(e,t,n,i){let{render:s,propSyncs:o}=e;if(s){if(i){let a={...n};o?.forEach(l=>l(a))}return s(n)}let r=wt(t)(n);if(typeof r=="function"){if(e.subs?.forEach(Lt),e.render=r,i){let a={...n};o?.forEach(l=>l(a))}r=r(n)}else if(R&&ri.has(e))throw new Error("setup() must not be called inside a render function");return r}function mm(e){let{props:t,type:n}=e;return R&&xo(e),e.dom||(pt.current==="hydrate"?sa(e):e.dom=ia(e),R&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),n!=="#text"&&(e.child=ho(e,t.children),e.child&&pt.current==="hydrate"&&fe.push(e.dom)),e.child}function bm(){if(ya>Ur)throw new Et("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function go(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Ee,Me,ui,ga,mo,ma,ba,xa,ya,mu,va,bu,um,hn,Ue=M(()=>{"use strict";at();iu();q();ct();ai();xt();ta();pu();Xi();Me=[],ui=!1,ga=[],mo=[],ma=!1,ba=!1,xa=!1,ya=0,mu=[],va=[],bu=-1;um=(e,t)=>t.depth-e.depth,hn=null});var he,pe,di=M(()=>{"use strict";he=new Map,pe=new Map});function yo(e){let{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e,r;he.delete(t);let a=!!K.current&&!_t();a||(r=new Map,fi.stack.push(r));let l=i(...s.map(c=>c.value));if(!a){for(let[u,d]of n)r.has(u)||(d(),n.delete(u));let c=()=>{he.size||queueMicrotask(vo),he.set(t,o)};for(let[u,d]of r){if(n.has(u))continue;let f=d.subscribe(c);n.set(u,f)}fi.stack.pop()}return l}var fi,Ji=M(()=>{"use strict";xt();q();di();un();fi={enabled:!0,stack:new Array,current:function(){return this.stack[this.stack.length-1]}}});var wu,L,P,de=M(()=>{"use strict";q();at();ct();xt();Ue();di();Ji();L=class e{constructor(t,n){this[wu]=!0,this.$id=hi(),this.$value=t,n&&(this.displayName=n),R?(pe.set(this.$id,new Set),this.$initialValue=_u(t),this[te]={provide:()=>this,inject:s=>{rt&&window.__kiru.devtools?.untrack(s),pe.get(this.$id)?.clear?.(),pe.delete(this.$id),this.$id=s.$id,s.__next=this,this.$initialValue===s.$initialValue?this.$value=s.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set;let i=K.current;i&&ie(i,this.$id,e.dispose.bind(null,this))}get value(){if(R){let t=wt(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(R){let n=wt(this);if(Object.is(n.$value,t))return;n.$prevValue=n.$value,n.$value=t,n.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return R?wt(this).$value:this.$value}sneak(t){if(R){let n=wt(this);n.$prevValue=n.$value,n.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(R){let t=wt(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return R?(pe.get(this.$id).add(t),()=>pe.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(R)return pe.get(this.$id)?.forEach(n=>{if(t&&!t(n))return;let{$value:i,$prevValue:s}=wt(this);return n(i,s)});this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&jr in t}static subscribers(t){return R?pe.get(t.$id):t.$subs}static makeReadonly(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){if(fi.enabled===!1)return;let n=K.current,i=fi.current();if(i){(!n||n&&_t())&&i.set(t.$id,t);return}if(!n||!_t())return;let s=t.subscribe(()=>zt(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){if(t.$isDisposed=!0,R){pe.delete(t.$id),rt&&window.__kiru.devtools?.untrack(t);return}t.$subs.clear()}};wu=jr;P=(e,t)=>new L(e,t)});function Z(e,t=!1){return L.isSignal(e)?t?e.value:e.peek():e}function vo(){he.forEach(Lt),he.clear()}var un=M(()=>{"use strict";q();de();di();Ji()});function ut(...e){return e.filter(Boolean).join(" ")}function wo(e){return e.replace(xm,"&").replace(ym,"<").replace(vm,">").replace(_m,""").replace(wm,"'").replace(km,"/")}function Qr(e){switch(e){case"className":return"class";case"htmlFor":return"for";case"tabIndex":case"formAction":case"formMethod":case"formEncType":case"contentEditable":case"spellCheck":case"allowFullScreen":case"autoPlay":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"noModule":case"noValidate":case"popoverTarget":case"popoverTargetAction":case"playsInline":case"readOnly":case"itemscope":case"rowSpan":case"crossOrigin":return e.toLowerCase();default:return e.indexOf("-")>-1?e:e.startsWith("aria")?"aria-"+e.substring(4).toLowerCase():Ic.get(e)||e}}function Em(e){let t="";for(let n in e){let i=Z(e[n]);if(i==null)continue;let s=n.replace(Sm,"-$&").toLowerCase();t+=\`\${s}:\${i};\`}return t}function Mm(e){return typeof e=="string"?e:typeof e=="object"&&e?Em(e):""}function Eu(e){let t=[],{className:n,style:i,...s}=e;if(n){let r=Z(n);r&&t.push(\`class="\${r}"\`)}if(i){let r=Z(i);r&&t.push(\`style="\${Mm(r)}"\`)}let o=Object.keys(s).filter(Su.isStringRenderableProperty);for(let r=0;r<o.length;r++){let a=o[r],l=Z(e[a]);if(l==null)continue;a=a.split("bind:")[1]??a;let c=Qr(a);switch(typeof l){case"function":case"symbol":continue;case"boolean":if(so.has(c)){l&&t.push(c);continue}}t.push(\`\${c}="\${l}"\`)}return t.join(" ")}function _u(e,t={functions:!0}){let n=new WeakSet;return JSON.stringify(e,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[CIRCULAR]";n.add(s)}return typeof s=="function"?t.functions?s.toString():\`[FUNCTION (\${s.name||"anonymous"})]\`:s})}var xm,ym,vm,wm,_m,km,Sm,ku,Su,Mu=M(()=>{"use strict";un();at();xm=/&/g,ym=/</g,vm=/>/g,wm=/'/g,_m=/"/g,km=/\\//g,Sm=/[A-Z]/g;ku=new Set(["children","ref","key","innerHTML"]),Su={isInternalProp:e=>ku.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!ku.has(e)&&!Su.isEvent(e)}});function Lt(e){e()}function wt(e){let t=e;if(R)for(;"__next"in t;)t=t.__next;return t}function Ln(e,t){if(typeof e=="function"){e(t);return}if(L.isSignal(e)){e.value=t;return}e.current=t}function _t(){return pt.current==="dom"||pt.current==="hydrate"}var Zc,_a=M(()=>{"use strict";de();ct();xt();Zc=Object.freeze(()=>{})});function _o(e){return(e.flags&In)!==0}function Tu(e){return typeof e=="object"&&e!==null&&"type"in e}function ci(e){return typeof e=="object"&&e!==null&&"type"in e}function dn(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function bo(e){return e===Gt||e===Rn||e===je}function Nt(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function lo(e){let{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=~(ee|ne|In)}function fn(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&fn(n,t),n=n.sibling}function ea(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function vu(e){return ea(e,t=>t.type===je)}function xo(e){if("children"in e.props&&e.props.innerHTML)throw new Et({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new Et({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function ca(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}function Qi(e){let t=[],n=e;for(;n;)t.push(n.index),t.push(n.depth),n=n.parent;return\`k:\${BigInt(t.join("")).toString(36)}\`}function ie(e,t,n){(e.cleanups??(e.cleanups={}))[t]=n}function po(e,t,n){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!0;for(let o of i)if(!n?.includes(o)&&e[o]!==t[o])return!0;return!1}var ko=M(()=>{"use strict";at();V();ai();xt()});function hi(e=10,t=Tm){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}var Tm,Cu=M(()=>{"use strict";Tm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"});var q=M(()=>{"use strict";Nc();zc();Mu();_a();ko();Cu()});function Ki(){return ka}function Pu(e){return!!e&&(typeof e=="object"||typeof e=="function")&&te in e&&typeof e[te]=="object"&&!!e[te]}function Du(){let e=new Map,t=null,n=null,i=!1,s=()=>i,o=!1,r=[];return{register:d=>{if(n===null)throw new Error("[kiru]: HMR could not register: No active module");let f=new Set;for(let[p,b]of Object.entries(d)){let x=n.hotVars.get(p);if(b.value[Oc]=b.link,x?.value&&(x.value.__next=b.value),n.hotVars.set(p,b),!!x){if(Pu(x.value)&&Pu(b.value)){b.value[te].inject(x.value[te].provide()),x.value[te].destroy();continue}x.type==="component"&&b.type==="component"&&window.__kiru.apps.forEach(y=>{fn(y.rootNode,w=>{w.type===x.value&&(w.type=b.value,f.add(w))})})}}f.size&&(ka=!0,f.forEach(p=>zt(p)),pn(),ka=!1),i=!1,n=null,t=null},prepare:d=>{let f=e.get(d);if(i=!!f,!f)f={hotVars:new Map,unnamedEffects:[],hmrCallbacks:[]},e.set(d,f);else{for(;f.hmrCallbacks.length;)f.hmrCallbacks.shift()();for(;r.length;)r.shift()();for(let p of f.unnamedEffects)p.stop();f.unnamedEffects.length=0}n=f,t=d},isReplacement:s,moduleEffects:{registerNext(){o=!0},push(d){o&&(n.unnamedEffects.push(d),o=!1)}},onHmr:d=>{if(n){n.hmrCallbacks.push(d);return}r.push(d)},getCurrentFilePath(){return t}}}function Au(e){"window"in globalThis&&window.__kiru.HMRContext&&window.__kiru.HMRContext.onHmr(e)}var ka,Xi=M(()=>{"use strict";at();q();Ue();ka=!1});function Ou(){let e=new Map,t=new Map;return{appStats:t,emit:(n,i)=>{e.get(n)?.forEach(s=>s(i))},addEventListener:(n,i)=>{e.has(n)||e.set(n,new Set),e.get(n).add(i)},removeEventListener:(n,i)=>{e.has(n)&&e.get(n).delete(i)},mountDuration:n=>{let i=t.get(n);return i?i.mountDuration:0},totalTicks:n=>{let i=t.get(n);return i?i.totalTicks:0},lastTickDuration:n=>{let i=t.get(n);if(!i)return 1/0;let s=i.timestamps[i.timestamps.length-1];return!s||(s.end===1/0&&(s=i.timestamps[i.timestamps.length-2]),!s)?1/0:s.end-s.start},averageTickDuration:n=>{let i=t.get(n);if(!i)return 0;let s=i.timestamps.filter(o=>o.end!==1/0);return s.reduce((o,r)=>o+(r.end-r.start),0)/s.length},beginTick:n=>{t.has(n)||t.set(n,{mountDuration:1/0,timestamps:[],totalTicks:0});let i=t.get(n);i.totalTicks++,i.timestamps.push({start:performance.now(),end:1/0})},endTick:n=>{let i=t.get(n),s=i.timestamps[i.timestamps.length-1];s.end=performance.now(),i.mountDuration===1/0&&(i.mountDuration=s.end-s.start),i.timestamps.length>100&&i.timestamps.shift()}}}var Ru=M(()=>{"use strict"});var Iu,Nu=M(()=>{"use strict";Iu={current:null}});function Lu(){let e=new Set,t=new Map;function n(r,a,l){t.get(r)?.forEach(c=>c(a,l))}function i(r,a){t.has(r)||t.set(r,new Set),t.get(r).add(a)}function s(r,a){t.get(r)?.delete(a)}let o={get apps(){return Array.from(e)},emit:n,on:i,off:s};if(i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),R){o.HMRContext=Du(),o.profilingContext=Ou(),o.fileRouterInstance=Iu;let r=new Set,a=new Set;o.devtools={track:(l,c)=>{r.add({label:c??l.displayName??"Unnamed Signal",signal:l}),a.forEach(u=>u(r))},untrack:l=>{r.forEach(c=>{c.signal===l&&r.delete(c)}),a.forEach(c=>c(r))},subscribe:l=>(a.add(l),l(r),()=>a.delete(l))}}return o}var zu=M(()=>{"use strict";ct();Xi();Ru();Nu()});function Kt(e,t){return new ts(e,t)}var ts,Vu=M(()=>{"use strict";ct();at();q();di();Ji();de();ts=class e extends L{constructor(t,n){if(super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,R){let i=this[te].inject;this[te]={provide:()=>this,inject:s=>{i(s),e.stop(s),this.$isDirty=s.$isDirty},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}set value(t){}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),L.dispose(t)}static updateGetter(t,n){let i=wt(t);i.$getter=n,i.$isDirty=!0,e.run(i),!Object.is(i.$value,i.$prevValue)&&i.notify()}static stop(t){let{$id:n,$unsubs:i}=wt(t);he.delete(n),i.forEach(Lt),i.clear(),t.$isDirty=!0}static run(t){let n=wt(t),{$id:i,$getter:s,$unsubs:o}=n,r=yo({id:i,subs:o,fn:()=>s(n.$value),onDepChanged:()=>{if(n.$isDirty=!0,R){if(!pe?.get(i)?.size)return}else if(!t.$subs.size)return;e.run(n),!Object.is(n.$value,n.$prevValue)&&n.notify()}});n.sneak(r),n.$isDirty=!1}ensureNotDirty(){this.$isDirty&&(R&&this.$isDisposed||e.run(this))}}});function Vt(e,t){if(typeof e=="function")return new pi(e);let n=e,i=t;return new pi(i,n)}var pi,Sa=M(()=>{"use strict";ct();di();Ji();q();xt();pi=class e{constructor(t,n){this.id=hi(),this.callback=t,this.deps=n,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,R&&rt&&window.__kiru.HMRContext.moduleEffects.push(this);let i=K.current;if(i){if(!_t())return;ie(i,this.id,this.stop.bind(this))}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,R&&rt&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){he.delete(this.id),this.unsubs.forEach(Lt),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let n=wt(t),{id:i,callback:s,unsubs:o,deps:r}=n;n.cleanup=yo({id:i,subs:o,fn:s,deps:r,onDepChanged:()=>{n.cleanup?.(),e.run(n)}})??null}}});function Ge({each:e,fallback:t,children:n}){let i=Z(e,!0);return i.length===0?t:i.map(n)}function Cm({children:e,when:t,fallback:n}){return Z(t,!0)?e:n}var Fu=M(()=>{"use strict";un()});var Hu=M(()=>{"use strict"});var So=M(()=>{"use strict";de();Vu();Sa();un();Fu();Hu()});function Pm(e){return async(...t)=>{let{execute:n,onError:i}=e(...t);try{return{error:null,data:await n()}}catch(s){let o=new Eo(s);return i?.(o),{error:o,data:null}}}}var Eo,Bu=M(()=>{"use strict";Eo=class extends Error{constructor(t){super("Error occurred during action execution",{cause:t})}}});function Am(e,t,n){if(R&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let i=Om(t),s=Dm++,o={id:s,name:n?.name??\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props={children:l},wa(i)}function a(){i.props={children:null},wa(i),R&&(delete t.__kiruNode,delete i.app),window.__kiru.emit("unmount",o)}return R&&(i.app=o),r(e),window.__kiru.emit("mount",o),R&&!globalThis.__KIRU_READY__&&(globalThis.__KIRU_READY__=!0,queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))})),o}function Om(e){let t=co(e.nodeName.toLowerCase());return t.flags|=Yt,t.dom=e,R&&(e.__kiruNode=t),t}var Dm,Wu=M(()=>{"use strict";at();ct();Ue();ua();Dm=0});function ju({children:e,fallback:t,onError:n}){return m(je,{children:e,fallback:t,onError:n})}var $u=M(()=>{"use strict";at();V()});function Ft(e){if(!_t())return;let t=K.current;if(!t)throw new Error("Cannot queue onCleanup effect outside of a component");ie(t,hi(10),e)}var Mo=M(()=>{"use strict";xt();q()});function To(e){return typeof e=="object"&&!!e&&si in e}function Co(e){return e instanceof Promise&&"id"in e&&"state"in e}function Rm(e){let t=K.current;if(!t)throw new Error("statefulPromise must be called inside a Kiru component");let n=Qi(t),i=P(!0);i.value=!0;let s=new AbortController;Ft(()=>s.abort());let o=Uu.get(t)??0;Uu.set(t,o+1);let r=\`\${n}:data:\${o}\`,a;pt.current==="string"?a=Promise.resolve():pt.current==="hydrate"&&Vc.current==="dynamic"?a=Im(r,s.signal):a=e(s.signal);let c=Object.assign(a,{id:r,state:"pending"});return c.then(u=>{c.state="fulfilled",c.value=u,i.value=!1}).catch(u=>{c.state="rejected",c.error=u instanceof Error?u:new Error(u)}),Object.assign(c,{isPending:i})}function Im(e,t){return new Promise((n,i)=>{let s=window[oi]??(window[oi]=new Map),o=s.get(e);if(o){let{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}let r=a=>{let{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(oi,r);let{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(oi,r),t.addEventListener("abort",()=>{window.removeEventListener(oi,r),i()})})}var Uu,Po=M(()=>{"use strict";at();xt();de();ko();Mo();Uu=new WeakMap});function gn(e){return{current:e}}var Ea=M(()=>{"use strict"});var ge,Gu=M(()=>{"use strict";xt();at();Ue();So();q();Po();Ea();ge=()=>e=>{let{from:t,children:n,fallback:i,mode:s}=e,o=gn(null),r=new Set,a;if(Co(t))r.add(t),a=t.value;else if(L.isSignal(t))a=t.value;else{let l={};for(let c in t){let u=t[c];Co(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!_t())throw{[si]:{fallback:i,data:Array.from(r)}};for(let l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){let c=K.current;Promise.allSettled(r).then(()=>zt(c));let u=o.current;return s!=="fallback"&&u?n(u,!0):i}}return o.current=a,n(a,!1)}});function Nm(e){function t(n){let{fallback:i=null,...s}=n,o=K.current;if(!_t())return i;let r=Lm(e.toString()),a=Yu.get(r);if(!a){let l=e(),c={promise:l,result:null};return Yu.set(r,c),l.then(u=>{c.result=typeof u=="function"?u:u.default,zt(o)}),i}return a.result===null?(a.promise.then(()=>zt(o)),i):m(a.result,s)}return R&&(t.displayName="Kiru.lazy"),t}var Yu,Lm,Ku=M(()=>{"use strict";li();ct();_a();xt();Ue();Yu=rt?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;Lm=e=>e.replace(/import\\((["'])([^?"']+)\\?[^)"']*\\1\\)/g,(t,n,i)=>\`import(\${n}\${i}\${n})\`)});function zm({children:e,container:t}){let n=K.current;if(!n.dom)switch(n.flags|=Yt,pt.current){case"dom":if(n.dom=typeof t=="function"?t():t,!(n.dom instanceof HTMLElement)){if(R)throw new Et({message:\`Invalid portal container, expected HTMLElement, got \${n.dom}\`,vNode:n});return null}return e;case"hydrate":Zi(()=>zt(n));case"stream":case"string":return null}return e}var Xu=M(()=>{"use strict";at();ct();ai();xt();Ue()});function Vm(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??qu;case"exited":return t?.out??qu}}var gi,qu,Zu=M(()=>{"use strict";Mo();de();Sa();un();gi=e=>{let t=P(e.initialState||"exited"),n,i=o=>{clearTimeout(n),t.value=o,(o==="entered"||o==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(o)},s=o=>{n=window.setTimeout(()=>i(o),Vm(o,e.duration))};return Vt(()=>{let o=Z(e.in,!0),r=t.peek();o&&r!=="entered"&&r!=="entering"?(i("entering"),s("entered")):!o&&r!=="exited"&&r!=="exiting"&&(i("exiting"),s("exited"))}),Ft(()=>clearTimeout(n)),o=>o.element(t.value)},qu=150});var Ju=M(()=>{"use strict";$u();Gu();Ku();Xu();Zu()});function Fm(e){let t=Object.assign(({value:n,children:i})=>m(Rn,{value:n,ctx:t},i),{[Rn]:()=>e});return t.displayName="Anonymous Context",t}function Hm(e,t){let n=e.parent;for(;n;){if(n.type===Rn){let i=n,{ctx:s,value:o}=i.props;if(s===t)return o}n=n.parent}return t[Rn]()}function Bm(e){let t=K.current;if(!t)throw new Error("useContext must be called inside a Kiru component");return Hm(t,e)}var Qu=M(()=>{"use strict";at();li();xt()});var Ma,td=M(()=>{"use strict";Ma=class{constructor(){}static on(t,n){return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}static dispatch(t,n,i){(i||document).dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}});var Ta,ed=M(()=>{"use strict";(function(e){e.track=(t,n)=>{"window"in globalThis&&window.__kiru.devtools?.track(t,n)},e.untrack=t=>{"window"in globalThis&&window.__kiru.devtools?.untrack(t)},e.subscribe=t=>!("window"in globalThis)||!window.__kiru.devtools?()=>{}:window.__kiru.devtools.subscribe(t)})(Ta||(Ta={}))});function es(){let e=K.current;return e?e.hooks??(e.hooks={pre:[],preCleanups:[],post:[],postCleanups:[]}):null}function ns(e,t){return()=>{let n=e();typeof n=="function"&&t.push(n)}}var Do=M(()=>{"use strict";xt()});function Mt(e){if(!_t())return;let t=es();if(!t)throw new Error("Cannot queue onMount effect outside of a component");t.post.push(ns(e,t.postCleanups))}var nd=M(()=>{"use strict";q();Do()});function Ca(e){if(!_t())return;let t=es();if(!t)throw new Error("Cannot queue beforeMount effect outside of a component");t.pre.push(ns(e,t.preCleanups))}var id=M(()=>{"use strict";q();Do()});function Wm(){let e=K.current;if(R){if(!e)throw new Error("setup() must be called inside a Kiru component");if(e.render)throw new Error("setup() cannot be used inside a render function")}if(ri.has(e))return ri.get(e);let t=jm(e);return ri.set(e,t),t}function jm(e){let t,n=e.propSyncs=[],i=-1;return{derive(s){let o={...e.props},r=P(s(o));return n.push(a=>r.value=s(a)),r},get id(){return t||(t=P(Qi(e)),i=e.index,n.push(()=>{i!==e.index&&(t.value=Qi(e),i=e.index)})),t}}}var sd=M(()=>{"use strict";xt();So();ko();ct()});var od=M(()=>{"use strict";Mo();nd();id();sd();Do()});function Te(e,t,n,i){if(t===null||t===void 0||typeof t=="boolean")return;if(typeof t=="string")return e.write(wo(t));if(typeof t=="number"||typeof t=="bigint")return e.write(t.toString());if(t instanceof Array)return t.forEach((l,c)=>Te(e,l,n,c));if(L.isSignal(t)){let l=t.peek();if(!Lc(l)){R&&console.error(\`[kiru]: expected primitive child but received \${l}\`);return}dn(l)&&e.write(wo(String(l)));return}if(!Tu(t))return;t.parent=n,t.depth=(n?.depth??-1)+1,t.index=i;let{type:s,props:o={}}=t;if(s==="#text")return e.write(wo(o.nodeValue??""));let r=o.children;if(bo(s)){if(s===je){let l="",c=new Set,u={write(d){l+=d},onStreamData(d){d.forEach(f=>c.add(f))}};try{Te(u,r,t,i),e.write(l),e.onStreamData?.([...c])}catch(d){if(To(d))throw d;let f=d instanceof Error?d:new Error(String(d)),{fallback:p,onError:b}=o;b?.(f);let x=typeof p=="function"?p(f):p;Te(e,x,t,0)}return}Te(e,r,t,i);return}if(typeof s=="function")try{K.current=t;let l=s(o);typeof l=="function"&&(l=l(o)),Te(e,l,t,i);return}catch(l){if(To(l)){let{fallback:c,data:u}=l[si];return e.onStreamData?.(u),Te(e,c,t,0)}throw l}finally{K.current=null}R&&xo(t);let a=Eu(o);e.write(\`<\${s}\${a.length?\` \${a}\`:""}>\`),!Rc.has(s)&&("innerHTML"in o?e.write(String(L.isSignal(o.innerHTML)?o.innerHTML.peek():o.innerHTML)):Array.isArray(r)?r.forEach((l,c)=>Te(e,l,t,c)):Te(e,r,t,0),e.write(\`</\${s}>\`))}var rd=M(()=>{"use strict";xt();q();Po();de();at();ct()});function $m(e){let t=pt.current;pt.current="string";let n="";return Te({write(s){n+=s}},vt({children:e}),null,0),pt.current=t,n}var ad=M(()=>{"use strict";xt();li();rd()});var Pa,ld=M(()=>{"use strict";Ue();ct();(function(e){let t=[],n=!1,i=!1,s=null,o=rt&&typeof document.startViewTransition=="function";function r(u,d){let f=d?.signal;return new Promise(p=>{let b=async()=>{let x=await u();p(x)};t.push(b),f?.addEventListener("abort",()=>{let x=t.indexOf(b);x!==-1?t.splice(x,1):s?.skipTransition()},{once:!0}),l()})}e.run=r;function a(){s?.skipTransition(),s=null,t.length=0,n=!1,i=!1}e.stop=a;function l(){i||(i=!0,queueMicrotask(()=>{i=!1,c()}))}async function c(){if(n||t.length===0)return;n=!0;let u=[...t];t.length=0;let d=async()=>{await Promise.all(u.map(f=>f())),pn()};o?(s=document.startViewTransition(d),await s.finished):await d(),s=null,n=!1,t.length>0&&l()}})(Pa||(Pa={}))});var B={};Br(B,{ActionError:()=>Eo,ComputedSignal:()=>ts,CustomEvents:()=>Ma,Derive:()=>ge,DevTools:()=>Ta,Effect:()=>pi,ErrorBoundary:()=>ju,For:()=>Ge,Fragment:()=>vt,KiruError:()=>Et,Portal:()=>zm,Show:()=>Cm,Signal:()=>L,Transition:()=>gi,ViewTransitions:()=>Pa,computed:()=>Kt,createContext:()=>Fm,createElement:()=>m,defineAction:()=>Pm,effect:()=>Vt,flushSync:()=>pn,getVNodeLifecycleHooks:()=>es,isStatefulPromise:()=>Co,isStreamDataThrowValue:()=>To,lazy:()=>Nm,mount:()=>Am,nextIdle:()=>Zi,onBeforeMount:()=>Ca,onCleanup:()=>Ft,onHmr:()=>Au,onMount:()=>Mt,ref:()=>gn,renderToString:()=>$m,requestUpdate:()=>zt,setup:()=>Wm,signal:()=>P,statefulPromise:()=>Rm,tick:()=>vo,unwrap:()=>Z,useContext:()=>Bm,useRequestUpdate:()=>xu,wrapLifecycleHookCallback:()=>ns});var V=M(()=>{"use strict";zu();ct();So();Bu();Wu();Ju();Qu();td();ed();li();ai();Xi();od();ad();Ea();Ue();Po();ld();rt&&(window.__kiru??(window.__kiru=Lu()))});function Ye(e,t){if(!e)throw new Error(t)}function Vn(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function is(e){try{return e[Um]??null}catch{return null}}function se(e){return e.name==="kiru.devtools"}function Gm(e){return Array.from(e.entries())}function Ke(e,t,n){return Math.min(Math.max(e,t),n)}function Ym(e,t,n){if(e.key==="Tab"){let i=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],o=i[i.length-1];if(n&&!t.contains(n)&&s&&s instanceof HTMLElement)return s.focus();e.shiftKey?n===s&&o instanceof HTMLElement&&(o.focus(),e.preventDefault()):n===o&&s instanceof HTMLElement&&(s.focus(),e.preventDefault())}}function Km(){return J.rootRef.value?.matches(":focus-within, :focus")}function Da(e){let t=J.rootRef.value;return t?.matches(":focus-within, :focus")?e(t):null}function mi(e){let t=[],n=e;for(;n;){if(typeof n.type=="function"){let i=n.type,s=i.displayName??(i.name||"AnonymousFunction"),o=n.key!=null&&n.key!==void 0?\`k:\${String(n.key)}\`:\`i:\${n.index}\`;t.push(\`\${s}[\${o}]\`)}n=n.parent}return\`ch:\${t.join("/")}\`}function Aa(e,t){if(!e)return null;let n=[e];for(;n.length;){let i=n.pop();if(typeof i.type=="function"&&mi(i)===t)return i;i.child&&n.push(i.child),i.sibling&&n.push(i.sibling)}return null}var Um,Fn=M(()=>{"use strict";Ce();Um=Symbol.for("kiru.devFileLink")});function Xm(e,t){let n=new BroadcastChannel(e),i=(l,c)=>{if(l.type==="SET"){let{key:u,version:d}=l;return cd[u]=c,n.postMessage({type:"SET",key:u,version:d})}n.postMessage(l)},s={},o={},r={};for(let l in t){let c=o[l]=P(t[l]);s[l]=0,r[l]=u=>{if(u.type==="GET"){let d=c.value,f=s[l];return i({type:"SET",key:l,version:f},d)}u.version>s[l]&&(c.value=cd[l],s[l]=u.version)},c.subscribe(u=>{let d=++s[l];i({type:"SET",key:l,version:d},u)})}n.addEventListener("message",({data:l})=>{r[l.key](l)});for(let l in o)i({type:"GET",key:l});return[o,()=>{n.close(),Object.values(o).forEach(l=>L.dispose(l))}]}var ud,cd,dt,J,Ce=M(()=>{"use strict";V();Fn();q();cd=(ud=window.opener??window).__kiru_devtools_state_register??(ud.__kiru_devtools_state_register={}),dt=()=>window.opener?.__kiru??window.__kiru;[J]=Xm("kiru-devtools:syncedState",{apps:[],rootRef:null,appSearchTerm:"",appSearchInput:null,componentSelection:{enabled:!1,componentNode:null},devtoolsViewMode:"embedded",devtoolsTab:"Apps",popupWindow:null,selectedApp:null,selectedNode:null,viewerSettings:{objectKeysChunkSize:10,arrayChunkSize:10}});if("window"in globalThis){let{apps:e,componentSelection:t,selectedNode:n,selectedApp:i,viewerSettings:s}=J;window.addEventListener("kiru:ready",()=>{e.value=[...dt().apps],dt().on("mount",a=>{se(a)||(e.value=[...e.value,a])}),dt().on("unmount",a=>{se(a)||(e.value=e.value.filter(l=>l!==a))})});let o="kiru-devtools:viewerSettings";s.subscribe(a=>{localStorage.setItem("kiru-devtools:viewerSettings",JSON.stringify(a))});let r=localStorage.getItem(o);if(r)try{let a=JSON.parse(r);Ye(typeof a.objectKeysChunkSize=="number"&&a.objectKeysChunkSize>0,"invalid objectKeysChunkSize"),Ye(typeof a.arrayChunkSize=="number"&&a.arrayChunkSize>0,"invalid arrayChunkSize"),s.sneak({objectKeysChunkSize:a.objectKeysChunkSize,arrayChunkSize:a.arrayChunkSize})}catch{s.sneak({objectKeysChunkSize:10,arrayChunkSize:10})}t.subscribe(({componentNode:a})=>{n.value=a,i.value=a?Nt(a):null})}});function Oa(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),m("path",{d:"M12 9v11"}),m("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}var dd=M(()=>{"use strict";V()});function Xe(e){return m("svg",{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",...e},m("path",{d:"m9 18 6-6-6-6"}))}var Ao=M(()=>{"use strict";V()});function Ra(e){return m("svg",{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",...e},m("path",{d:"M18 6 6 18"}),m("path",{d:"m6 6 12 12"}))}var fd=M(()=>{"use strict";V()});function Ia(e){return m("svg",{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",...e},m("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),m("circle",{cx:"12",cy:"12",r:"3"}))}var hd=M(()=>{"use strict";V()});function qm(e){return m("svg",{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",...e},m("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),m("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}))}var pd=M(()=>{"use strict";V()});function ss(e){return m("svg",{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",...e},m("path",{d:"M15 3h6v6"}),m("path",{d:"M10 14 21 3"}),m("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}))}var gd=M(()=>{"use strict";V()});function Na(e){return m("svg",{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",...e},m("path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M3 5a2 2 0 0 0 2 2h3"}),m("path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}))}var md=M(()=>{"use strict";V()});function Zm(e){return m("svg",{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",...e},m("path",{d:"m15 15 6 6"}),m("path",{d:"m15 9 6-6"}),m("path",{d:"M21 16v5h-5"}),m("path",{d:"M21 8V3h-5"}),m("path",{d:"M3 16v5h5"}),m("path",{d:"m3 21 6-6"}),m("path",{d:"M3 8V3h5"}),m("path",{d:"M9 9 3 3"}))}var bd=M(()=>{"use strict";V()});function La(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}))}var xd=M(()=>{"use strict";V()});function os(e){return m("svg",{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",...e},m("path",{d:"m12 14 4-4"}),m("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}var yd=M(()=>{"use strict";V()});function Jm(e){return m("svg",{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",...e},m("circle",{cx:"12",cy:"5",r:"1"}),m("circle",{cx:"19",cy:"5",r:"1"}),m("circle",{cx:"5",cy:"5",r:"1"}),m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}),m("circle",{cx:"12",cy:"19",r:"1"}),m("circle",{cx:"19",cy:"19",r:"1"}),m("circle",{cx:"5",cy:"19",r:"1"}))}var vd=M(()=>{"use strict";V()});function rs(e){return m("svg",{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",...e},m("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"}))}var wd=M(()=>{"use strict";V()});function Qm(e){return m("svg",{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",...e},m("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),m("path",{d:"m21 3-9 9"}),m("path",{d:"M15 3h6v6"}))}var _d=M(()=>{"use strict";V()});function za(e){return m("svg",{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",...e},m("path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}),m("path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}),m("path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}),m("path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}),m("circle",{cx:"12",cy:"12",r:"2"}))}var kd=M(()=>{"use strict";V()});function Hn(e){return m("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",...e},m("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),m("line",{x1:"9",y1:"5",x2:"5",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}))}var Sd=M(()=>{"use strict";V()});function tb(e){return m("svg",{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",...e},m("path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}))}var Ed=M(()=>{"use strict";V()});var Md=M(()=>{"use strict";dd();Ao();fd();hd();pd();gd();md();bd();xd();yd();vd();wd();_d();kd();Sd();Ed()});function qe(e){let t=[],n=()=>t.forEach(f=>f()),i=P(null),s=P(null),o=P(eb(e)),r=Kt(()=>o.value.type==="snapped"?o.value.side:null),a=P([0,0]),l=P(!1);t.push(a.subscribe(([f,p])=>{let b=i.value;b.style.transform=\`translate(\${f}px, \${p}px)\`}));let c=f=>{if(f.button!==0)return;let p=i.value,[b,x]=[f.clientX,f.clientY],y=p.getBoundingClientRect(),[w,_]=[b-y.left,x-y.top];l.value=!1;let S=E=>{if(!l.peek()&&(Math.abs(E.clientX-b)>5||Math.abs(E.clientY-x)>5)&&(l.value=!0),!l.peek())return;let[D,O]=[E.clientX-w,E.clientY-_],[A,N]=e.getDraggableBounds(),{width:j,height:H}=p.getBoundingClientRect(),G=D,ot=A-(D+j),Ct=O,Q=N-(O+H),tt=Math.min(G,ot,Ct,Q),mt=D+j/2,ce=O+H/2;e.allowFloat&&tt>(e.snapDistance??0)?o.value={type:"floating",x:mt/A,y:ce/N}:tt===G?o.value={type:"snapped",side:"left",percent:ce/N}:tt===ot?o.value={type:"snapped",side:"right",percent:ce/N}:tt===Ct?o.value={type:"snapped",side:"top",percent:mt/A}:o.value={type:"snapped",side:"bottom",percent:mt/A},u()},T=()=>{if(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",T),!l.peek())return e.onclick?.();l.value=!1,e.storage.setItem(e.key,JSON.stringify(o.value))};window.addEventListener("mousemove",S),window.addEventListener("mouseup",T)},u=()=>{let f=i.value,{width:p,height:b}=f.getBoundingClientRect(),[x,y]=e.getDraggableBounds(),w=o.value;if(w.type==="floating"){let[D,O]=e.getPadding(null);a.value=[Ke(w.x*x-p/2,D,x-D-p),Ke(w.y*y-b/2,O,y-O-b)];return}let[_,S]=e.getPadding(w.side),T=0,E=0;switch(w.side){case"top":T=w.percent*x-p/2,E=0;break;case"bottom":T=w.percent*x-p/2,E=1/0;break;case"left":T=0,E=w.percent*y-b/2;break;case"right":T=1/0,E=w.percent*y-b/2;break}a.value=[Ke(T,_,x-_-p),Ke(E,S,y-S-b)]};return{init:()=>{let f=s.value;if(!f)return console.error("handle not found",new Error().stack);let p=i.value;if(!p)return console.error("container not found",new Error().stack);p.style.position="fixed",p.style.top="0",p.style.left="0",u();let b=new ResizeObserver(u);b.observe(p),window.addEventListener("resize",u),f.addEventListener("mousedown",c),t.push(()=>{b.disconnect(),window.removeEventListener("resize",u),f.removeEventListener("mousedown",c)})},isDragging:l,handleRef:s,containerRef:i,snapSide:r,containerPos:a,dispose:n}}function eb({storage:e,key:t,defaultPosition:n}){let i=e.getItem(t);if(i)try{let o=JSON.parse(i);if(o.type==="snapped")return Ye(["top","right","bottom","left"].includes(o.side),"invalid side"),Ye(typeof o.percent=="number"&&o.percent>=0&&o.percent<=1,"invalid percent"),o;if(o.type==="floating")return Ye(typeof o.x=="number"&&o.x>=0&&o.x<=1,"invalid x"),Ye(typeof o.y=="number"&&o.y>=0&&o.y<=1,"invalid y"),o}catch{}let s=n??{type:"floating",x:.5,y:.5};return e.setItem(t,JSON.stringify(s)),s}var Td=M(()=>{"use strict";V();Fn()});function Va(e,t={windowScroll:!0,windowResize:!0}){let n=[],i=()=>{n.forEach(_=>_()),n.length=0},s=t.windowScroll??!0,o=t.windowResize??!0,r=P(0),a=P(0),l=P(0),c=P(0),u=P(0),d=P(0),f=P(0),p=P(0),b=P(0),x=P(0),y=()=>{let _=e.current;if(!_){r.value=a.value=l.value=c.value=u.value=d.value=f.value=p.value=b.value=x.value=0;return}r.value=_.clientWidth,a.value=_.clientHeight;let S=_.getBoundingClientRect();l.value=S.top,c.value=S.left,u.value=S.right,d.value=S.bottom,f.value=S.x,p.value=S.y,b.value=window.scrollX,x.value=window.scrollY};return{state:{width:r,height:a,top:l,left:c,right:u,bottom:d,x:f,y:p,scrollX:b,scrollY:x},init:()=>{let _=e.current;if(!_)return console.error("element not found",new Error().stack);let S=new MutationObserver(y);S.observe(_,{attributeFilter:["style","class"],attributes:!0,childList:!0,subtree:!0}),n.push(()=>S.disconnect());let T=new ResizeObserver(y);T.observe(_),n.push(()=>T.disconnect()),s&&(window.addEventListener("scroll",y,{capture:!0,passive:!0}),n.push(()=>window.removeEventListener("scroll",y))),o&&(window.addEventListener("resize",y,{passive:!0}),n.push(()=>window.removeEventListener("resize",y))),y()},dispose:i}}var Cd=M(()=>{"use strict";V()});function Bn(e){let t=[],n=()=>t.forEach(d=>d()),i=P(null),s=P(null),o=P(!1),[r,a]=e.minSize??[0,0],l=e.aspectRatio??null,c=d=>{if(d.button!==0)return;d.stopPropagation(),d.preventDefault(),o.value=!0,document.body.style.cursor="se-resize",document.body.style.userSelect="none";let f=i.value,p=d.clientX,b=d.clientY,x=f.offsetWidth,y=f.offsetHeight,w=S=>{let T=S.clientX-p,E=S.clientY-b;if(l!==null){let D=(T*l+E)/(l*l+1),O=Math.max(r,x+D*l),A=O/l;A<a&&(A=a,O=A*l),f.style.width=\`\${O}px\`,f.style.height=\`\${A}px\`}else f.style.width=\`\${Math.max(r,x+T)}px\`,f.style.height=\`\${Math.max(a,y+E)}px\`},_=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",_),o.value=!1,document.body.style.cursor="",document.body.style.userSelect="",e.storage.setItem(e.key,JSON.stringify({w:f.offsetWidth,h:f.offsetHeight}))};window.addEventListener("mousemove",w),window.addEventListener("mouseup",_)};return{containerRef:i,handleRef:s,isResizing:o,init:()=>{let d=s.value;if(!d)return console.error("resize handle not found",new Error().stack);let f=i.value;if(!f)return console.error("resize container not found",new Error().stack);let p=nb(e.storage,e.key);if(p){let b=p[0],x=l!==null?b/l:p[1];f.style.width=\`\${b}px\`,f.style.height=\`\${x}px\`}d.addEventListener("mousedown",c),t.push(()=>d.removeEventListener("mousedown",c))},dispose:n}}function nb(e,t){let n=e.getItem(t);if(!n)return null;try{let i=JSON.parse(n);if(typeof i.w=="number"&&typeof i.h=="number")return[i.w,i.h]}catch{}return null}var Pd=M(()=>{"use strict";V()});function as(){let e=P({x:0,y:0}),t=n=>{e.value={x:n.clientX,y:n.clientY}};return window.addEventListener("mousemove",t),[e,()=>window.removeEventListener("mousemove",t)]}var Dd=M(()=>{"use strict";V()});function us(e){return e+.5|0}function ls(e){return mn(us(e*2.55),0,255)}function bn(e){return mn(us(e*255),0,255)}function Ze(e){return mn(us(e/2.55)/100,0,1)}function Ad(e){return mn(us(e*100),0,100)}function rb(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&oe[e[1]]*17,g:255&oe[e[2]]*17,b:255&oe[e[3]]*17,a:t===5?oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:oe[e[1]]<<4|oe[e[2]],g:oe[e[3]]<<4|oe[e[4]],b:oe[e[5]]<<4|oe[e[6]],a:t===9?oe[e[7]]<<4|oe[e[8]]:255})),n}function lb(e){var t=ob(e)?ib:sb;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ab(e.a,t):void 0}function Nd(e,t,n){let 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 ub(e,t,n){let 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 db(e,t,n){let i=Nd(e,1,.5),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 fb(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Ba(e){let n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=fb(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Wa(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(bn)}function ja(e,t,n){return Wa(Nd,e,t,n)}function hb(e,t,n){return Wa(db,e,t,n)}function pb(e,t,n){return Wa(ub,e,t,n)}function Ld(e){return(e%360+360)%360}function gb(e){let t=cb.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?ls(+t[5]):bn(+t[5]));let s=Ld(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=hb(s,o,r):t[1]==="hsv"?i=pb(s,o,r):i=ja(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function mb(e,t){var n=Ba(e);n[0]=Ld(n[0]+t),n=ja(n),e.r=n[0],e.g=n[1],e.b=n[2]}function bb(e){if(!e)return;let t=Ba(e),n=t[0],i=Ad(t[1]),s=Ad(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Ze(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}function xb(){let e={},t=Object.keys(Rd),n=Object.keys(Od),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,Od[o]);o=parseInt(Rd[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function yb(e){Ro||(Ro=xb(),Ro.transparent=[0,0,0,0]);let t=Ro[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function wb(e){let t=vb.exec(e),n=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];n=t[8]?ls(r):mn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ls(i):mn(i,0,255)),s=255&(t[4]?ls(s):mn(s,0,255)),o=255&(t[6]?ls(o):mn(o,0,255)),{r:i,g:s,b:o,a:n}}}function _b(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Ze(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}function kb(e,t,n){let i=bi(Ze(e.r)),s=bi(Ze(e.g)),o=bi(Ze(e.b));return{r:bn(Fa(i+n*(bi(Ze(t.r))-i))),g:bn(Fa(s+n*(bi(Ze(t.g))-s))),b:bn(Fa(o+n*(bi(Ze(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Io(e,t,n){if(e){let i=Ba(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=ja(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function zd(e,t){return e&&Object.assign(t||{},e)}function Id(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=bn(e[3]))):(t=zd(e,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function Sb(e){return e.charAt(0)==="r"?wb(e):gb(e)}var mn,oe,Ha,ib,sb,Oo,ob,ab,cb,Od,Rd,Ro,vb,Fa,bi,cs,Vd=M(()=>{mn=(e,t,n)=>Math.max(Math.min(e,n),t);oe={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},Ha=[..."0123456789ABCDEF"],ib=e=>Ha[e&15],sb=e=>Ha[(e&240)>>4]+Ha[e&15],Oo=e=>(e&240)>>4===(e&15),ob=e=>Oo(e.r)&&Oo(e.g)&&Oo(e.b)&&Oo(e.a);ab=(e,t)=>e<255?t(e):"";cb=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Od={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"},Rd={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"};vb=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Fa=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,bi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);cs=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Id(t):n==="string"&&(i=rb(t)||yb(t)||Sb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=zd(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=Id(t)}rgbString(){return this._valid?_b(this._rgb):void 0}hexString(){return this._valid?lb(this._rgb):void 0}hslString(){return this._valid?bb(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,o,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=kb(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=us(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Io(this._rgb,2,t),this}darken(t){return Io(this._rgb,2,-t),this}saturate(t){return Io(this._rgb,1,t),this}desaturate(t){return Io(this._rgb,1,-t),this}rotate(t){return mb(this._rgb,t),this}}});function be(){}function X(e){return e==null}function et(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function At(e,t){return ht(e)?e:t}function W(e,t){return typeof e>"u"?t:e}function z(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $(e,t,n,i){let s,o,r;if(et(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<o;s++)t.call(n,e[s],s);else if(Y(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function vi(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function fs(e){if(et(e))return e.map(fs);if(Y(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=fs(e[n[s]]);return t}return e}function Kd(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Xd(e,t,n,i){if(!Kd(e))return;let s=t[e],o=n[e];Y(s)&&Y(o)?$n(s,o,i):t[e]=fs(o)}function $n(e,t,n){let i=et(t)?t:[t],s=i.length;if(!Y(e))return e;n=n||{};let o=n.merger||Xd,r;for(let a=0;a<s;++a){if(r=i[a],!Y(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Un(e,t){return $n(e,t,{merger:qd})}function qd(e,t,n){if(!Kd(e))return;let i=t[e],s=n[e];Y(i)&&Y(s)?Un(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(s))}function Zd(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Eb(e){let t=Zd(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function wi(e,t){return(Fd[t]||(Fd[t]=Eb(t)))(e)}function gs(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Xa(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function Ae(e,t,n){return Math.abs(e-t)<n}function Bo(e){let t=Math.round(e);e=Ae(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(De(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function qa(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function Mb(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Gn(e){return!Mb(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Za(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Wo(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Oe(e){return e*(ft/180)}function ms(e){return e*(180/ft)}function jo(e){if(!ht(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ja(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*ft&&(o+=Ht),{angle:o,distance:s}}function ps(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function tf(e,t){return(e-t+Jd)%Ht-ft}function Xt(e){return(e%Ht+Ht)%Ht}function $o(e,t,n,i){let s=Xt(e),o=Xt(t),r=Xt(n),a=Xt(o-s),l=Xt(r-s),c=Xt(s-o),u=Xt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Bt(e,t,n){return Math.max(t,Math.min(n,e))}function Qa(e){return Bt(e,-32768,32767)}function Yn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function bs(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}function el(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}function nl(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ef.forEach(n=>{let i="_onData"+gs(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Uo(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ef.forEach(o=>{delete e[o]}),delete e._chartjs)}function il(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Yo(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Go.call(window,()=>{i=!1,e.apply(t,n)}))}}function sl(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}function rl(e,t,n){let i=t.length,s=0,o=i;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:d,max:f,minDefined:p,maxDefined:b}=r.getUserBounds();if(p){if(s=Math.min(Qe(l,u,d).lo,n?i:Qe(t,u,r.getPixelForValue(d)).lo),c){let x=l.slice(0,s+1).reverse().findIndex(y=>!X(y[a.axis]));s-=Math.max(0,x)}s=Bt(s,0,i-1)}if(b){let x=Math.max(Qe(l,r.axis,f,!0).hi+1,n?0:Qe(t,u,r.getPixelForValue(f),!0).hi+1);if(c){let y=l.slice(x-1).findIndex(w=>!X(w[a.axis]));x+=Math.max(0,y)}o=Bt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function al(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}function Xo(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qo(e){return Xo(e)?e:new cs(e)}function Vo(e){return Xo(e)?e:new cs(e).saturate(.5).darken(.1).hexString()}function Pb(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:Cb},numbers:{type:"number",properties:Tb}}),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 Db(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function Ab(e,t){t=t||{};let n=e+JSON.stringify(t),i=Wd.get(n);return i||(i=new Intl.NumberFormat(e,t),Wd.set(n,i)),i}function xs(e,t,n){return Ab(t,n).format(e)}function Ob(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}function Rb(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,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:ys.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"})}function ds(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function $a(e,t,n){return typeof t=="string"?$n(ds(e,t),n):$n(ds(e,""),t)}function sf(e){return!e||X(e.size)||X(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xi(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 ll(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,a=n.length,l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!et(d))r=xi(e,s,o,r,d);else if(et(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!et(f)&&(r=xi(e,s,o,r,f));e.restore();let p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return r}function tn(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Jo(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function vs(e,t,n,i){Qo(e,t,n,i,null)}function Qo(e,t,n,i,s){let o,r,a,l,c,u,d,f,p=t.pointStyle,b=t.rotation,x=t.radius,y=(b||0)*Qd;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,i,s/2,x,0,0,Ht):e.arc(n,i,x,0,Ht),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ua,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ua,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(y+xn)*l,d=Math.cos(y+xn)*(s?s/2-c:l),a=Math.sin(y+xn)*l,f=Math.sin(y+xn)*(s?s/2-c:l),e.arc(n-d,i-a,c,y-ft,y-Dt),e.arc(n+f,i-r,c,y-Dt,y),e.arc(n+d,i+a,c,y,y+Dt),e.arc(n-f,i+r,c,y+Dt,y+ft),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}y+=xn;case"rectRot":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+f,i-r),e.lineTo(n+d,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":y+=xn;case"cross":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),y+=xn,d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*x,a=Math.sin(y)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:x),i+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function qt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ws(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function _s(e){e.restore()}function cl(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function ul(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Ib(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),X(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Nb(e,t,n,i,s){if(s.strikethrough||s.underline){let o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Lb(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function _n(e,t,n,i,s,o={}){let r=et(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Ib(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Lb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),X(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Nb(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function ki(e,t){let{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*ft,ft,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,ft,Dt,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Dt,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Dt,!0),e.lineTo(n+r.topLeft,i)}function of(e,t){let n=(""+e).match(zb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}function tr(e,t){let n={},i=Y(t),s=i?Object.keys(t):t,o=Y(e)?i?r=>W(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)n[r]=Fb(o(r));return n}function dl(e){return tr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function kn(e){return tr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(e){let t=dl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function gt(e,t){e=e||{},t=t||it.font;let n=W(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=W(e.style,t.style);i&&!(""+i).match(Vb)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:W(e.family,t.family),lineHeight:of(W(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:W(e.weight,t.weight),string:""};return s.string=sf(s),s}function Si(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&et(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function fl(e,t,n){let{min:i,max:s}=e,o=Ka(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Re(e,t){return Object.assign(Object.create(e),t)}function ks(e,t=[""],n,i,s=()=>e[0]){let o=n||e;typeof i>"u"&&(i=lf("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>ks([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return rf(a,l,()=>Yb(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return $d(a).includes(l)},ownKeys(a){return $d(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function vn(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:er(e,i),setContext:o=>vn(e,o,n,i),override:o=>vn(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 rf(o,r,()=>Bb(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 er(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Pe(n)?n:()=>n,isIndexable:Pe(i)?i:()=>i}}function rf(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function Bb(e,t,n){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e,a=i[t];return Pe(a)&&r.isScriptable(t)&&(a=Wb(t,a,e,n)),et(a)&&a.length&&(a=jb(t,a,e,r.isIndexable)),hl(t,a)&&(a=vn(a,s,o&&o[t],r)),a}function Wb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),hl(e,l)&&(l=pl(s._scopes,s,e,l)),l}function jb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(Y(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let d=pl(c,s,e,u);t.push(vn(d,o,r&&r[e],a))}}return t}function af(e,t,n){return Pe(e)?e(t,n):e}function Ub(e,t,n,i,s){for(let o of t){let r=$b(n,o);if(r){e.add(r);let a=af(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function pl(e,t,n,i){let s=t._rootScopes,o=af(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=jd(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=jd(a,r,o,l,i),l===null)?!1:ks(Array.from(a),[""],s,o,()=>Gb(t,n,i))}function jd(e,t,n,i,s){for(;n;)n=Ub(e,t,n,i,s);return n}function Gb(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return et(s)&&Y(n)?n:s||{}}function Yb(e,t,n,i){let s;for(let o of t)if(s=lf(Hb(o,e),n),typeof s<"u")return hl(e,s)?pl(n,i,e,s):s}function lf(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function $d(e){let t=e._keys;return t||(t=e._keys=Kb(e._scopes)),t}function Kb(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function uf(e,t,n,i){let s=e.skip?t:e,o=t,r=n.skip?t:n,a=ps(o,s),l=ps(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let d=i*c,f=i*u;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function qb(e,t,n){let i=e.length,s,o,r,a,l,c=yi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=yi(e,u+1),!(!l||!c)){if(Ae(t[u],0,Xb)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function Zb(e,t,n="x"){let i=cf(n),s=e.length,o,r,a,l=yi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=yi(e,c+1),!a)continue;let u=a[n],d=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=d+o*t[c])}}function df(e,t="x"){let n=cf(t),i=e.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=yi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=yi(e,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?me(s[r-1])!==me(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}qb(e,s,o),Zb(e,o,t)}function Lo(e,t,n){return Math.max(Math.min(e,n),t)}function Jb(e,t){let n,i,s,o,r,a=qt(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&qt(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=Lo(s.cp1x,t.left,t.right),s.cp1y=Lo(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Lo(s.cp2x,t.left,t.right),s.cp2y=Lo(s.cp2y,t.top,t.bottom)))}function gl(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")df(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=uf(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Jb(e,n)}function Ss(){return typeof window<"u"&&typeof document<"u"}function Es(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Fo(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function ff(e,t){return nr(e).getPropertyValue(t)}function jn(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let o=Qb[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function ex(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(tx(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Zt(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=nr(n),o=s.boxSizing==="border-box",r=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=ex(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top),{width:p,height:b}=t;return o&&(p-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-f)/b*n.height/i)}}function nx(e,t,n){let i,s;if(t===void 0||n===void 0){let o=e&&Es(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let r=o.getBoundingClientRect(),a=nr(o),l=jn(a,"border","width"),c=jn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Fo(a.maxWidth,o,"clientWidth"),s=Fo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||hs,maxHeight:s||hs}}function ml(e,t,n,i){let s=nr(e),o=jn(s,"margin"),r=Fo(s.maxWidth,e,"clientWidth")||hs,a=Fo(s.maxHeight,e,"clientHeight")||hs,l=nx(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let f=jn(s,"border","width"),p=jn(s,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=yn(Math.min(c,r,l.maxWidth)),u=yn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=yn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=yn(Math.floor(u*i))),{width:c,height:u}}function ir(e,t,n){let i=t||1,s=yn(e.height*i),o=yn(e.width*i);e.height=yn(e.height),e.width=yn(e.width);let 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}function sr(e,t){let n=ff(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Je(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function xl(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function yl(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Je(e,s,n),a=Je(s,o,n),l=Je(o,t,n),c=Je(r,a,n),u=Je(a,l,n);return Je(c,u,n)}function Sn(e,t,n){return e?ix(t,n):sx()}function or(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 rr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function hf(e){return e==="angle"?{between:$o,compare:tf,normalize:Xt}:{between:Yn,compare:(t,n)=>t-n,normalize:t=>t}}function Ud({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function ox(e,t,n){let{property:i,start:s,end:o}=n,{between:r,normalize:a}=hf(i),l=t.length,{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function vl(e,t,n){if(!n)return[e];let{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=hf(i),{start:u,end:d,loop:f,style:p}=ox(e,t,n),b=[],x=!1,y=null,w,_,S,T=()=>l(s,S,w)&&a(s,S)!==0,E=()=>a(o,w)===0||l(o,S,w),D=()=>x||T(),O=()=>!x||E();for(let A=u,N=u;A<=d;++A)_=t[A%r],!_.skip&&(w=c(_[i]),w!==S&&(x=l(w,s,o),y===null&&D()&&(y=a(w,s)===0?A:N),y!==null&&O()&&(b.push(Ud({start:y,end:A,loop:f,count:r,style:p})),y=null),N=A,S=w));return y!==null&&b.push(Ud({start:y,end:d,loop:f,count:r,style:p})),b}function wl(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let o=vl(i[s],e.points,t);o.length&&n.push(...o)}return n}function rx(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function ax(e,t,n,i){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function _l(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=rx(n,s,o,i);if(i===!0)return Gd(e,[{start:r,end:a,loop:o}],n,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Gd(e,ax(n,r,l,c),n,t)}function Gd(e,t,n,i){return!i||!i.setContext||!n?t:lx(e,t,n,i)}function lx(e,t,n,i){let s=e._chart.getContext(),o=Yd(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[],u=o,d=t[0].start,f=d;function p(b,x,y,w){let _=a?-1:1;if(b!==x){for(b+=l;n[b%l].skip;)b-=_;for(;n[x%l].skip;)x+=_;b%l!==x%l&&(c.push({start:b%l,end:x%l,loop:y,style:w}),u=w,d=x%l)}}for(let b of t){d=a?d:b.start;let x=n[d%l],y;for(f=d+1;f<=b.end;f++){let w=n[f%l];y=Yd(i.setContext(Re(s,{type:"segment",p0:x,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),cx(y,u)&&p(d,f-1,b.loop,u),x=w,u=y}d<f-1&&p(d,f-1,b.loop,u)}return c}function Yd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function cx(e,t){if(!t)return!1;let n=[],i=function(s,o){return Xo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function zo(e,t,n){return e.options.clip?e[n]:t[n]}function ux(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:zo(n,t,"left"),right:zo(n,t,"right"),top:zo(i,t,"top"),bottom:zo(i,t,"bottom")}:t}function kl(e,t){let n=t._clip;if(n.disabled)return!1;let i=ux(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}var Ya,Ka,Fd,_i,Pe,Ho,ft,Ht,Jd,hs,Qd,Dt,xn,Ua,De,me,Qe,tl,ef,Go,Ko,Ot,ol,No,Hd,Bd,Wn,Tb,Cb,Wd,nf,ys,wn,Zo,Ga,it,zb,Vb,Fb,Hb,hl,$b,Xb,yi,cf,nr,Qb,tx,yn,bl,ix,sx,Sl=M(()=>{Vd();Ya=(()=>{let e=0;return()=>e++})();Ka=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;Fd={"":e=>e,x:e=>e.x,y:e=>e.y};_i=e=>typeof e<"u",Pe=e=>typeof e=="function",Ho=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};ft=Math.PI,Ht=2*ft,Jd=Ht+ft,hs=Number.POSITIVE_INFINITY,Qd=ft/180,Dt=ft/2,xn=ft/4,Ua=ft*2/3,De=Math.log10,me=Math.sign;Qe=(e,t,n,i)=>bs(e,n,i?s=>{let o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),tl=(e,t,n)=>bs(e,n,i=>e[i][t]>=n);ef=["push","pop","shift","splice","unshift"];Go=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Ko=e=>e==="start"?"left":e==="end"?"right":"center",Ot=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ol=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;No=e=>e===0||e===1,Hd=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ht/n)),Bd=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ht/n)+1,Wn={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*Dt)+1,easeOutSine:e=>Math.sin(e*Dt),easeInOutSine:e=>-.5*(Math.cos(ft*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=>No(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=>No(e)?e:Hd(e,.075,.3),easeOutElastic:e=>No(e)?e:Bd(e,.075,.3),easeInOutElastic(e){return No(e)?e:e<.5?.5*Hd(e*2,.1125,.45):.5+.5*Bd(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-Wn.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?Wn.easeInBounce(e*2)*.5:Wn.easeOutBounce(e*2-1)*.5+.5};Tb=["x","y","borderWidth","radius","tension"],Cb=["color","borderColor","backgroundColor"];Wd=new Map;nf={values(e){return et(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,o=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Ob(e,n)}let r=De(Math.abs(o)),a=isNaN(r)?1: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),xs(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(De(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?nf.numeric.call(this,e,t,n):""}};ys={formatters:nf};wn=Object.create(null),Zo=Object.create(null);Ga=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.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)=>Vo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Vo(s.borderColor),this.hoverColor=(i,s)=>Vo(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 $a(this,t,n)}get(t){return ds(this,t)}describe(t,n){return $a(Zo,t,n)}override(t,n){return $a(wn,t,n)}route(t,n,i,s){let o=ds(this,t),r=ds(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},it=new Ga({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pb,Db,Rb]);zb=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Vb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;Fb=e=>+e||0;Hb=(e,t)=>e?e+gs(t):t,hl=(e,t)=>Y(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);$b=(e,t)=>e===!0?t:typeof e=="string"?wi(t,e):void 0;Xb=Number.EPSILON||1e-14,yi=(e,t)=>t<e.length&&!e[t].skip&&e[t],cf=e=>e==="x"?"y":"x";nr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);Qb=["top","right","bottom","left"];tx=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);yn=e=>Math.round(e*10)/10;bl=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Ss()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();ix=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}}},sx=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function px(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function gx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function gf(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function mx(e,t,n){if(n===!1)return!1;let i=gf(e,n),s=gf(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function bx(e){let t,n,i,s;return Y(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function nh(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function mf(e,t,n,i={}){let s=e.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],ht(c)&&(o||t===0||me(t)===me(c))&&(t+=c)}return!u&&!i.all?0:t}function xx(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function El(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function yx(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function vx(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function wx(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function bf(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function xf(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=yx(o,r,i),d=t.length,f;for(let p=0;p<d;++p){let b=t[p],{[l]:x,[c]:y}=b,w=b._stacks||(b._stacks={});f=w[c]=wx(s,u,x),f[a]=y,f._top=bf(f,r,!0,i.type),f._bottom=bf(f,r,!1,i.type);let _=f._visualValues||(f._visualValues={});_[a]=y}}function Ml(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function _x(e,t){return Re(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function kx(e,t,n){return Re(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ms(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let 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]}}}function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Mx(e,t,n,i){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?tl:Qe;if(i){if(s._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{let u=c(o,t,n);if(l){let{vScale:d}=s._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(x=>!X(x[d.axis]));u.lo-=Math.max(0,p);let b=f.slice(u.hi).findIndex(x=>!X(x[d.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:o.length-1}}function Ls(e,t,n,i,s){let o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:d,hi:f}=Mx(o[a],t,r,s);for(let p=d;p<=f;++p){let b=u[p];b.skip||i(b,c,p)}}}function Tx(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Cl(e,t,n,i,s){let o=[];return!s&&!e.isPointInArea(t)||Ls(e,n,t,function(a,l,c){!s&&!qt(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Cx(e,t,n,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:d}=Ja(r,{x:t.x,y:t.y});$o(d,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Ls(e,n,t,o),s}function Px(e,t,n,i,s,o){let r=[],a=Tx(n),l=Number.POSITIVE_INFINITY;function c(u,d,f){let p=u.inRange(t.x,t.y,s);if(i&&!p)return;let b=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(b))&&!p)return;let y=a(t,b);y<l?(r=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&r.push({element:u,datasetIndex:d,index:f})}return Ls(e,n,t,c),r}function Pl(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Cx(e,t,n,s):Px(e,t,n,i,s,o)}function vf(e,t,n,i,s){let o=[],r=n==="x"?"inXRange":"inYRange",a=!1;return Ls(e,n,t,(l,c,u)=>{l[r]&&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}function Ts(e,t){return e.filter(n=>n.pos===t)}function wf(e,t){return e.filter(n=>ih.indexOf(n.pos)===-1&&n.box.axis===t)}function Cs(e,t){return e.sort((n,i)=>{let s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ax(e){let t=[],n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Ox(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:o}=n;if(!i||!ih.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Rx(e,t){let n=Ox(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Ix(e){let t=Ax(e),n=Cs(t.filter(c=>c.box.fullSize),!0),i=Cs(Ts(t,"left"),!0),s=Cs(Ts(t,"right")),o=Cs(Ts(t,"top"),!0),r=Cs(Ts(t,"bottom")),a=wf(t,"x"),l=wf(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ts(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function _f(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function sh(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 Nx(e,t,n,i){let{pos:s,box:o}=n,r=e.maxPadding;if(!Y(s)){n.size&&(e[s]-=n.size);let d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&sh(r,o.getPadding());let a=Math.max(0,t.outerWidth-_f(r,e,"left","right")),l=Math.max(0,t.outerHeight-_f(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 Lx(e){let t=e.maxPadding;function n(i){let 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 zx(e,t){let n=t.maxPadding;function i(s){let 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 As(e,t,n,i){let s=[],o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,zx(a.horizontal,t));let{same:d,other:f}=Nx(t,n,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&As(s,t,n,i)||u}function ar(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function kf(e,t,n,i){let s=n.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*u,f=c.size||l.height;_i(c.start)&&(r=c.start),l.fullSize?ar(l,s.left,r,n.outerWidth-s.right-s.left,f):ar(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*u,f=c.size||l.width;_i(c.start)&&(o=c.start),l.fullSize?ar(l,o,s.top,f,n.outerHeight-s.bottom-s.top):ar(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}function Fx(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[pr]={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",Sf(s)){let o=sr(e,"width");o!==void 0&&(e.width=o)}if(Sf(i))if(e.style.height==="")e.height=e.width/(t||2);else{let o=sr(e,"height");o!==void 0&&(e.height=o)}return e}function Hx(e,t,n){e&&e.addEventListener(t,n,oh)}function Bx(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,oh)}function Wx(e,t){let n=Vx[e.type]||e.type,{x:i,y:s}=Zt(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function xr(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function jx(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||xr(a.addedNodes,i),r=r&&!xr(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function $x(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||xr(a.removedNodes,i),r=r&&!xr(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function rh(){let e=window.devicePixelRatio;e!==Ef&&(Ef=e,Is.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ux(e,t){Is.size||window.addEventListener("resize",rh),Is.set(e,t)}function Gx(e){Is.delete(e),Is.size||window.removeEventListener("resize",rh)}function Yx(e,t,n){let i=e.canvas,s=i&&Es(i);if(!s)return;let o=Yo((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Ux(e,o),r}function Dl(e,t,n){n&&n.disconnect(),t==="resize"&&Gx(e)}function Kx(e,t,n){let i=e.canvas,s=Yo(o=>{e.ctx!==null&&n(Wx(o,e))},e);return Hx(i,t,s),s}function Xx(e){return!Ss()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Il:Nl}function qx(e,t){let n=e.options.ticks,i=Zx(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Qx(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return t0(t,c,o,r/s),c;let u=Jx(o,t,s);if(r>0){let d,f,p=r>1?Math.round((l-a)/(r-1)):null;for(lr(t,c,u,X(p)?0:a-p,a),d=0,f=r-1;d<f;d++)lr(t,c,u,o[d],o[d+1]);return lr(t,c,u,l,X(p)?t.length:l+p),c}return lr(t,c,u),c}function Zx(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Jx(e,t,n){let i=e0(e),s=t.length/n;if(!i)return Math.max(s,1);let o=qa(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Qx(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function t0(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function lr(e,t,n,i,s){let o=W(i,0),r=Math.min(W(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function e0(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}function Cf(e,t){let n=[],i=e.length/t,s=e.length,o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function i0(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function s0(e,t){$(e,n=>{let i=n.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ps(e){return e.drawTicks?e.tickLength:0}function Pf(e,t){if(!e.display)return 0;let n=gt(e.font,t),i=kt(e.padding);return(et(e.text)?e.text.length:1)*n.lineHeight+i.height}function o0(e,t){return Re(e,{scale:t,type:"scale"})}function r0(e,t,n){return Re(e,{tick:n,index:t,type:"tick"})}function a0(e,t,n){let i=Ko(e);return(n&&t!=="right"||!n&&t==="right")&&(i=n0(i)),i}function l0(e,t,n,i){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l,d=0,f,p,b,x=r-s,y=a-o;if(e.isHorizontal()){if(p=Ot(i,o,a),Y(n)){let w=Object.keys(n)[0],_=n[w];b=u[w].getPixelForValue(_)+x-t}else n==="center"?b=(c.bottom+c.top)/2+x-t:b=Mf(e,n,t);f=a-o}else{if(Y(n)){let w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Mf(e,n,t);b=Ot(i,r,s),d=n==="left"?-Dt:Dt}return{titleX:p,titleY:b,maxWidth:f,rotation:d}}function c0(e,t,n){let i=$n(Object.create(null),[n?it.get(n):{},it.get(t),e.defaults]);it.set(t,i),e.defaultRoutes&&u0(t,e.defaultRoutes),e.descriptors&&it.describe(t,e.descriptors)}function u0(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");it.route(o,s,l,a)})}function d0(e){return"id"in e&&"defaults"in e}function f0(e){let t={},n=[],i=Object.keys(Ne.plugins.items);for(let o=0;o<i.length;o++)n.push(Ne.getPlugin(i[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function h0(e,t){return!t&&e===!1?null:e===!0?{}:e}function p0(e,{plugins:t,localIds:n},i,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=h0(i[l],s);c!==null&&o.push({plugin:a,options:g0(e.config,{plugin:a,local:n[l]},c,r)})}return o}function g0(e,{plugin:t,local:n},i,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Vl(e,t){let n=it.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function m0(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function b0(e,t){return e===t?"_index_":"_value_"}function Df(e){if(e==="x"||e==="y"||e==="r")return e}function x0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Fl(e,...t){if(Df(e))return e;for(let n of t){let i=n.axis||x0(n.position)||e.length>1&&Df(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Af(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function y0(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Af(e,"x",n[0])||Af(e,"y",n[0])}return{}}function v0(e,t){let n=wn[e.type]||{scales:{}},i=t.scales||{},s=Vl(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!Y(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);let l=Fl(r,a,y0(r,e),it.scales[a.type]),c=b0(l,s),u=n.scales||{};o[r]=Un(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Vl(a,t),u=(wn[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=m0(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Un(o[p],[{axis:f},i[p],u[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Un(a,[it.scales[a.type],it.scale])}),o}function ah(e){let t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=v0(e,t)}function lh(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function w0(e){return e=e||{},e.data=lh(e.data),ah(e),e}function cr(e,t){let n=Of.get(e);return n||(n=t(),Of.set(e,n),ch.add(n)),n}function Rf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),o=i.get(s);return o||(o={resolver:ks(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}function k0(e,t){let{isScriptable:n,isIndexable:i}=er(e);for(let s of t){let o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Pe(a)||_0(a))||r&&et(a))return!0}return!1}function If(e,t){return e==="top"||e==="bottom"||E0.indexOf(e)===-1&&t==="x"}function Nf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Lf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),z(n&&n.onComplete,[e],t)}function M0(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function uh(e){return Ss()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function T0(e,t,n){let i=Object.keys(e);for(let s of i){let o=+s;if(o>=t){let r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function C0(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Vf(){return $(re.instances,e=>e._plugins.invalidate())}function dh(e,t,n=t){e.lineCap=W(n.borderCapStyle,t.borderCapStyle),e.setLineDash(W(n.borderDash,t.borderDash)),e.lineDashOffset=W(n.borderDashOffset,t.borderDashOffset),e.lineJoin=W(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(n.borderWidth,t.borderWidth),e.strokeStyle=W(n.borderColor,t.borderColor)}function P0(e,t,n){e.lineTo(n.x,n.y)}function D0(e){return e.stepped?cl:e.tension||e.cubicInterpolationMode==="monotone"?ul:P0}function fh(e,t,n={}){let i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function A0(e,t,n,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=fh(s,n,i),u=D0(o),{move:d=!0,reverse:f}=i||{},p,b,x;for(p=0;p<=c;++p)b=s[(a+(f?c-p:p))%r],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,x,b,f,o.stepped),x=b);return l&&(b=s[(a+(f?c:0))%r],u(e,x,b,f,o.stepped)),!!l}function O0(e,t,n,i){let s=t.points,{count:o,start:r,ilen:a}=fh(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,d=0,f,p,b,x,y,w,_=T=>(r+(c?a-T:T))%o,S=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(p=s[_(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=s[_(f)],p.skip)continue;let T=p.x,E=p.y,D=T|0;D===b?(E<x?x=E:E>y&&(y=E),u=(d*u+T)/++d):(S(),e.lineTo(T,E),b=D,d=0,x=y=E),w=E}S()}function Bl(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?O0:A0}function R0(e){return e.stepped?xl:e.tension||e.cubicInterpolationMode==="monotone"?yl:Je}function I0(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),dh(e,t.options),e.stroke(s)}function N0(e,t,n,i){let{segments:s,options:o}=t,r=Bl(t);for(let a of s)dh(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}function z0(e,t,n,i){L0&&!t.options.segment?I0(e,t,n,i):N0(e,t,n,i)}function Ff(e,t,n,i){let s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}function F0(e,t,n,i,s){let o=H0(i,e,t,n),r=B0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function H0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function B0(e,t,n){let i=e;return typeof t.text!="string"&&(i=hh(t,n)),i}function hh(e,t){let n=e.text?e.text.length:0;return t*n}function W0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function Ie(e,t){return t&&(et(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function nn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
|
|
5416
|
+
\`}function Qg(e){let t=Zc(e);if(R){let n=tm(e);n&&(t=\`\${t} (\${n})\`)}return t}function Zc(e){return e.displayName??(e.name||"Anonymous Function")}function tm(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var qc,Et,ai=M(()=>{"use strict";at();ct();Z();Et=class extends Error{constructor(t){let n=typeof t=="string"?t:t.message;super(n),this[qc]=!0,typeof t!="string"&&(R&&t?.vNode&&(this.customNodeStack=Jg(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ur]===!0}};qc=Ur});function oa(e){let t=e.type;return t=="#text"?sm(e):Yr.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function ra(e){let t=e.type==="#text"?im(e):he.getCurrentChild();if(he.bumpChildIndex(),!t)throw new Et({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Yr.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Et({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&Kt)){lo(e);return}L.isSignal(e.props.nodeValue)&&sa(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){let o=s;he.bumpChildIndex();let r=String(q(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,L.isSignal(o.props.nodeValue)&&sa(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Qc(e){let t=e.parent,n=t?.dom;for(;t&&!n;)t=t.parent,n=t?.dom;if(!n||!t){if(!e.parent&&e.dom)return e;throw new Et({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function tu(e,t){let{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}let o=em(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function em(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(ie|Kt))){let s=nm(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&Kt||n===t)return}}function nm(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&Kt)return;t=t.child}}function im(e){let t=e.props.nodeValue;if(!L.isSignal(t))return he.getCurrentChild();let n=t.peek();if(un(n))return he.getCurrentChild();let i=eu(e,t),s=he.getCurrentChild();return s?(s.before(i),i):he.getCurrentParent().appendChild(i)}function sa(e,t,n){let i=n.subscribe((s,o)=>{s!==o&&(t.nodeValue=s,R&&rt&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Lt(e)))});se(e,"nodeValue",i)}function sm(e){let{nodeValue:t}=e.props;return L.isSignal(t)?eu(e,t):document.createTextNode(t)}function eu(e,t){let n=t.peek()??"",i=document.createTextNode(n);return sa(e,i,t),i}var aa=M(()=>{"use strict";at();fe();Ln();na();Z();ai();ct();ta()});function ca(e){if(pt.current==="hydrate")return dn(e,uo);let t={node:e.dom?e:Qc(e)};la(e,t,(e.flags&ie)>0),e.dom&&!(e.flags&Kt)&&nu(e,t,!1),uo(e)}function la(e,t,n){let i=e.child;for(;i;)i.dom?(la(i,{node:i},!1),i.flags&Kt||nu(i,t,n)):la(i,t,(i.flags&ie)>0||n),uo(i),i=i.sibling}function nu(e,t,n){if((n||!e.dom.isConnected||e.flags&ie)&&tu(e,t),R&&e.prev&&Xi()){let{dom:i,prev:s,cleanups:o}=e;jc(e,i,s.props,o),e.prev=null}(!e.prev||e.flags&ne)&&lo(e),t.lastChild=e.dom}function ua(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;R&&(t=Lt(e)),dn(e,n=>{let{subs:i,cleanups:s,dom:o,props:{ref:r},hooks:a}=n;if(i?.forEach(l=>l()),s&&Object.values(s).forEach(l=>l()),a){let{preCleanups:l,postCleanups:c}=a;ro.push(...c),l.forEach(zt),l.length=c.length=0}R&&(window.__kiru.profilingContext?.emit("removeNode",t),o instanceof Element&&delete o.__kiruNode),o&&(o.isConnected&&!(n.flags&Kt)&&o.remove(),r&&Nn(r,null),delete n.dom)}),e.parent=null}var iu=M(()=>{"use strict";Z();at();ct();xt();qi();ta();aa()});var su=M(()=>{"use strict";iu();Zr();aa()});function m(e,t=null,...n){e===vt&&(e=Yt);let i=t===null?{}:t,s=da(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function vt({children:e,key:t}){return{type:Yt,key:da(t),props:{children:e}}}var li=M(()=>{"use strict";at();Z()});function fo(e,t=null,n={},i=null,s=0){e===vt&&(e=Yt);let o=t?t.depth+1:0;return{type:e,key:i,props:n,parent:t,index:s,depth:o,flags:0,child:null,sibling:null,prev:null,deletions:null}}var fa=M(()=>{"use strict";at();li()});function go(e,t){return R&&(ga=Lt(e)),Array.isArray(t)?(R&&(uu in t&&cm(e,t),lm(e,t)),rm(e,t)):om(e,t)}function om(e,t){let n=e.child;if(n===null)return lu(e,t);let i=n.sibling,s=ru(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?pa(e,n):i&&pa(e,i),s;{let o=du(n),r=cu(o,e,0,t);if(r!==null){let a=r.prev;if(a!==null){let l=a.key;o.delete(l===null?a.index:l)}ho(r,0,0)}return o.forEach(a=>po(e,a)),r}}function rm(e,t){let n=null,i=null,s=e.child,o=null,r=0,a=0;for(;s!==null&&a<t.length;a++){s.index>a?(o=s,s=null):o=s.sibling;let c=ru(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&po(e,s),r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return pa(e,s),n;if(s===null){for(;a<t.length;a++){let c=lu(e,t[a]);c!==null&&(r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}let l=du(s);for(;a<t.length;a++){let c=cu(l,e,a,t[a]);if(c!==null){let u=c.prev;if(u!==null){let d=u.key;l.delete(d===null?u.index:d)}r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>po(e,c)),n}function ru(e,t,n){let i=t===null?null:t.key;return un(n)?i!==null||t?.type==="#text"&&L.isSignal(t.props.nodeValue)?null:ou(e,t,""+n):L.isSignal(n)?t&&t.props.nodeValue!==n?null:ou(e,t,n):ci(n)?n.key!==i?null:am(e,t,n):Array.isArray(n)?i!==null?null:(R&&ma(n),au(e,t,n)):null}function ou(e,t,n){return t===null||t.type!=="#text"?Se(e,"#text",{nodeValue:n}):(R&&Zi(),t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ne),t.sibling=null,t)}function am(e,t,n){let{type:i,props:s,key:o}=n;return R&&typeof i=="function"&&(i=wt(i)),i===Yt?au(e,t,s.children||[],s):t?.type===i?(R&&Zi(),t.index=0,t.sibling=null,typeof i=="string"?pu(t.props,s)&&(t.flags|=ne):t.flags|=ne,t.props=s,t):Se(e,i,s,o)}function au(e,t,n,i={}){return t===null||t.type!==Yt?Se(e,Yt,{children:n,...i}):(R&&Zi(),t.props={...t.props,...i,children:n},t.flags|=ne,t.sibling=null,t)}function lu(e,t){return un(t)?Se(e,"#text",{nodeValue:""+t}):L.isSignal(t)?Se(e,"#text",{nodeValue:t}):ci(t)?Se(e,t.type,t.props,t.key):Array.isArray(t)?(R&&ma(t),Se(e,Yt,{children:t})):null}function ho(e,t,n){e.index=n;let i=e.prev;if(i!==null){let s=i.index;return s<t?(e.flags|=ie,t):s}else return e.flags|=ie,t}function cu(e,t,n,i){if(L.isSignal(i)||un(i)){let o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&L.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Se(t,"#text",{nodeValue:i},null,n)}if(ci(i)){let{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(R&&Zi(),typeof o=="string"?pu(l.props,r)&&(l.flags|=ne):l.flags|=ne,l.props=r,l.sibling=null,l.index=n,l):Se(t,o,r,a,n)}if(Array.isArray(i)){let o={children:i},r=e.get(n);return R&&ma(i),r?(R&&Zi(),r.flags|=ne,r.props=o,r):Se(t,Yt,o,null,n)}return null}function Zi(){rt&&window.__kiru.profilingContext?.emit("updateNode",ga)}function ma(e){Object.assign(e,{[uu]:!0})}function du(e){let t=new Map;for(;e;){let n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function po(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function pa(e,t){for(;t;)po(e,t),t=t.sibling}function lm(e,t){let n=new Set,i=!1;for(let s of t){if(!ci(s))continue;let o=s.key;if(typeof o=="string"){if(!i&&n.has(o)){let r=hu(e);fu(\`\${r} component produced a child in a list with a duplicate key prop: "\${o}". Keys should be unique so that components maintain their identity across updates\`),i=!0}n.add(o)}}}function cm(e,t){let n=!1,i=!1;for(let s of t)ci(s)&&(typeof s.key=="string"?n=!0:i=!0);if(i&&n){let s=hu(e);fu(\`\${s} component produced a child in a list without a valid key prop\`)}}function fu(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}function hu(e){if(ha.has(e))return ha.get(e);let t=e.parent,n;for(;!n&&t;)typeof t.type=="function"&&(n=t.type),t=t.parent;let i=\`<\${n?.displayName||n?.name||"Anonymous Function"} />\`;return ha.set(e,i),i}function Se(e,t,n,i=null,s=0){let o=fo(t,e,n,i,s);return o.flags|=ie,R&&rt&&window.__kiru.profilingContext?.emit("createNode",ga),o}function pu(e,t){return mo(e,t,um)}var ga,uu,ha,um,gu=M(()=>{"use strict";at();Z();fe();ct();fa();uu=Symbol("kiru:marked-list-child");ha=new WeakMap;um=["children","key"]});function Ji(e){if(ui){ba.push(e);return}e()}function hn(){ui&&(window.cancelAnimationFrame(xu),vu())}function ka(e){e.flags|=$e,Me.push(e),ui=!0,hn()}function Vt(e){if(pt.current==="hydrate")return Ji(()=>mu(e));mu(e)}function yu(){let e=K.current;if(!e)throw new Error("useRequestUpdate must be called inside a Kiru component");return()=>Vt(e)}function mu(e){if(xa&&(ya=!0),K.current===e){R&&window.__kiru.profilingContext?.emit("updateDirtied",Ee),va=!0;return}if(!(e.flags&($e|Rn))){if(e.flags|=$e,!Me.length){Me.push(e),ui||(ui=!0,xu=window.requestAnimationFrame(vu));return}Me.push(e)}}function dm(e){dn(e,t=>t.flags|=Rn),xo.push(e)}function vu(){if(R){let t=xo[0]??Me[0];t?(Ee=Lt(t),window.__kiru.profilingContext?.beginTick(Ee)):Ee=null}let e=1;for(Kr();Me.length;){Me.length>e&&Me.sort(fm),fn=Me.shift(),e=Me.length;let t=fn.flags;if(!(t&Rn)&&t&$e){let n=fn;for(;n=hm(n););for(;xo.length;)ua(xo.pop());ca(fn),fn.flags&=~$e}}if(Xr(),xa=!0,bo(bu),xa=!1,ya)return ym(),bo(_a),ya=!1,wa++,R&&(window.__kiru.profilingContext?.endTick(Ee),window.__kiru.profilingContext?.emit("updateDirtied",Ee)),hn();for(wa=0,ui=!1;ba.length;)ba.shift()();queueMicrotask(()=>{bo(ro),bo(_a)}),R&&(window.__kiru.emit("update",Ee),window.__kiru.profilingContext?.emit("update",Ee),window.__kiru.profilingContext?.endTick(Ee))}function hm(e){let t=pm(e);if(e.deletions!==null&&(e.deletions.forEach(dm),e.deletions=null),t)return t;let n=e;for(;n;){let{hooks:i}=n;if(i&&(bu.push(...i.pre),_a.push(...i.post),i.pre.length=0,i.post.length=0),n===fn)return null;if(n.sibling)return n.sibling;n=n.parent,pt.current==="hydrate"&&n?.dom&&he.pop()}return null}function pm(e){let{type:t,props:n,prev:i,flags:s}=e;if(!(R&&Xi())){if(i&&(s&$e)===0&&(i.props===n||!mo(i.props,n)))return null}try{return typeof t=="string"?xm(e):yo(t)?gm(e):mm(e)}catch(o){R&&window.__kiru.emit("error",Ee,o instanceof Error?o:new Error(String(o)));let r=wu(e);if(r){let a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<fn.depth&&(fn=r),r}if(Et.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function gm(e){let{props:t,type:n}=e,i=t.children;if(n===je){let s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=go(e,i)}function mm(e){let{type:t,props:n,subs:i}=e,s=(e.flags&$e)===0;try{K.current=e;let o,r=0;do{if(e.flags&=~$e,va=!1,i&&(i.forEach(zt),i.clear()),R&&Xi()){let{hooks:a,cleanups:l}=e;if(l&&(Object.values(l).forEach(zt),delete e.cleanups),a){let{preCleanups:c,postCleanups:u}=a;c.forEach(zt),u.forEach(zt),c.length=u.length=0}delete e.propSyncs,delete e.render}if(o=bm(e,t,n,s),++r>Gr){if(R)throw new Et({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});break}}while(va);return e.child=go(e,o)}finally{K.current=null}}function bm(e,t,n,i){let{render:s,propSyncs:o}=e;if(s){if(i){let a={...n};o?.forEach(l=>l(a))}return s(n)}let r=wt(t)(n);if(typeof r=="function"){if(e.subs?.forEach(zt),e.render=r,i){let a={...n};o?.forEach(l=>l(a))}r=r(n)}else if(R&&ri.has(e))throw new Error("setup() must not be called inside a render function");return r}function xm(e){let{props:t,type:n}=e;return R&&vo(e),e.dom||(pt.current==="hydrate"?ra(e):e.dom=oa(e),R&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),n!=="#text"&&(e.child=go(e,t.children),e.child&&pt.current==="hydrate"&&he.push(e.dom)),e.child}function ym(){if(wa>Gr)throw new Et("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function bo(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Ee,Me,ui,ba,xo,xa,ya,va,wa,bu,_a,xu,fm,fn,Ue=M(()=>{"use strict";at();su();Z();ct();ai();xt();na();gu();qi();Me=[],ui=!1,ba=[],xo=[],xa=!1,ya=!1,va=!1,wa=0,bu=[],_a=[],xu=-1;fm=(e,t)=>t.depth-e.depth,fn=null});var Xt,pe,di=M(()=>{"use strict";Xt=new Map,pe=new Map});function wo(e){let{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e,r;Xt.delete(t);let a=!!K.current&&!_t();a||(r=new Map,fi.stack.push(r));let l=i(...s.map(c=>c.value));if(!a){for(let[u,d]of n)r.has(u)||(d(),n.delete(u));let c=()=>{Xt.size||queueMicrotask(_o),Xt.set(t,o)};for(let[u,d]of r){if(n.has(u))continue;let f=d.subscribe(c);n.set(u,f)}fi.stack.pop()}return l}var fi,Qi=M(()=>{"use strict";xt();Z();di();Ln();fi={enabled:!0,stack:new Array,current:function(){return this.stack[this.stack.length-1]}}});var _u,L,D,fe=M(()=>{"use strict";Z();at();ct();xt();Ue();di();Qi();L=class e{constructor(t,n){this[_u]=!0,this.$id=hi(),this.$value=t,n&&(this.displayName=n),R?(pe.set(this.$id,new Set),this.$initialValue=ku(t),this[ee]={provide:()=>this,inject:s=>{rt&&window.__kiru.devtools?.untrack(s),pe.get(this.$id)?.clear?.(),pe.delete(this.$id),this.$id=s.$id,s.__next=this,this.$initialValue===s.$initialValue?this.$value=s.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set;let i=K.current;i&&se(i,this.$id,e.dispose.bind(null,this))}get value(){if(R){let t=wt(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(R){let n=wt(this);if(Object.is(n.$value,t))return;n.$prevValue=n.$value,n.$value=t,n.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return R?wt(this).$value:this.$value}sneak(t){if(R){let n=wt(this);n.$prevValue=n.$value,n.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(R){let t=wt(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return R?(pe.get(this.$id).add(t),()=>pe.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(R)return pe.get(this.$id)?.forEach(n=>{if(t&&!t(n))return;let{$value:i,$prevValue:s}=wt(this);return n(i,s)});this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&$r in t}static subscribers(t){return R?pe.get(t.$id):t.$subs}static makeReadonly(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){if(fi.enabled===!1)return;let n=K.current,i=fi.current();if(i){(!n||n&&_t())&&i.set(t.$id,t);return}if(!n||!_t())return;let s=t.subscribe(()=>Vt(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){if(t.$isDisposed=!0,R){pe.delete(t.$id),rt&&window.__kiru.devtools?.untrack(t);return}t.$subs.clear()}};_u=$r;D=(e,t)=>new L(e,t)});function q(e,t=!1){return L.isSignal(e)?t?e.value:e.peek():e}function _o(){Xt.forEach(zt),Xt.clear()}var Ln=M(()=>{"use strict";Z();fe();di();Qi()});function ut(...e){return e.filter(Boolean).join(" ")}function ko(e){return e.replace(vm,"&").replace(wm,"<").replace(_m,">").replace(Sm,""").replace(km,"'").replace(Em,"/")}function ea(e){switch(e){case"className":return"class";case"htmlFor":return"for";case"tabIndex":case"formAction":case"formMethod":case"formEncType":case"contentEditable":case"spellCheck":case"allowFullScreen":case"autoPlay":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"noModule":case"noValidate":case"popoverTarget":case"popoverTargetAction":case"playsInline":case"readOnly":case"itemscope":case"rowSpan":case"crossOrigin":return e.toLowerCase();default:return e.indexOf("-")>-1?e:e.startsWith("aria")?"aria-"+e.substring(4).toLowerCase():zc.get(e)||e}}function Tm(e){let t="";for(let n in e){let i=q(e[n]);if(i==null)continue;let s=n.replace(Mm,"-$&").toLowerCase();t+=\`\${s}:\${i};\`}return t}function Cm(e){return typeof e=="string"?e:typeof e=="object"&&e?Tm(e):""}function Mu(e){let t=[],{className:n,style:i,...s}=e;if(n){let r=q(n);r&&t.push(\`class="\${r}"\`)}if(i){let r=q(i);r&&t.push(\`style="\${Cm(r)}"\`)}let o=Object.keys(s).filter(Eu.isStringRenderableProperty);for(let r=0;r<o.length;r++){let a=o[r],l=q(e[a]);if(l==null)continue;a=a.split("bind:")[1]??a;let c=ea(a);switch(typeof l){case"function":case"symbol":continue;case"boolean":if(oo.has(c)){l&&t.push(c);continue}}t.push(\`\${c}="\${l}"\`)}return t.join(" ")}function ku(e,t={functions:!0}){let n=new WeakSet;return JSON.stringify(e,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[CIRCULAR]";n.add(s)}return typeof s=="function"?t.functions?s.toString():\`[FUNCTION (\${s.name||"anonymous"})]\`:s})}var vm,wm,_m,km,Sm,Em,Mm,Su,Eu,Tu=M(()=>{"use strict";Ln();at();vm=/&/g,wm=/</g,_m=/>/g,km=/'/g,Sm=/"/g,Em=/\\//g,Mm=/[A-Z]/g;Su=new Set(["children","ref","key","innerHTML"]),Eu={isInternalProp:e=>Su.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!Su.has(e)&&!Eu.isEvent(e)}});function zt(e){e()}function wt(e){let t=e;if(R)for(;"__next"in t;)t=t.__next;return t}function Nn(e,t){if(typeof e=="function"){e(t);return}if(L.isSignal(e)){e.value=t;return}e.current=t}function _t(){return pt.current==="dom"||pt.current==="hydrate"}var Jc,Sa=M(()=>{"use strict";fe();ct();xt();Jc=Object.freeze(()=>{})});function So(e){return(e.flags&Rn)!==0}function Cu(e){return typeof e=="object"&&e!==null&&"type"in e}function ci(e){return typeof e=="object"&&e!==null&&"type"in e}function un(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function yo(e){return e===Yt||e===On||e===je}function Lt(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function uo(e){let{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=~(ne|ie|Rn)}function dn(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&dn(n,t),n=n.sibling}function ia(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function wu(e){return ia(e,t=>t.type===je)}function vo(e){if("children"in e.props&&e.props.innerHTML)throw new Et({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new Et({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function da(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}function ts(e){let t=[],n=e;for(;n;)t.push(n.index),t.push(n.depth),n=n.parent;return\`k:\${BigInt(t.join("")).toString(36)}\`}function se(e,t,n){(e.cleanups??(e.cleanups={}))[t]=n}function mo(e,t,n){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!0;for(let o of i)if(!n?.includes(o)&&e[o]!==t[o])return!0;return!1}var Eo=M(()=>{"use strict";at();V();ai();xt()});function hi(e=10,t=Pm){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}var Pm,Pu=M(()=>{"use strict";Pm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"});var Z=M(()=>{"use strict";Vc();Hc();Tu();Sa();Eo();Pu()});function Xi(){return Ea}function Du(e){return!!e&&(typeof e=="object"||typeof e=="function")&&ee in e&&typeof e[ee]=="object"&&!!e[ee]}function Au(){let e=new Map,t=null,n=null,i=!1,s=()=>i,o=!1,r=[];return{register:d=>{if(n===null)throw new Error("[kiru]: HMR could not register: No active module");let f=new Set;for(let[p,b]of Object.entries(d)){let x=n.hotVars.get(p);if(b.value[Nc]=b.link,x?.value&&(x.value.__next=b.value),n.hotVars.set(p,b),!!x){if(Du(x.value)&&Du(b.value)){b.value[ee].inject(x.value[ee].provide()),x.value[ee].destroy();continue}x.type==="component"&&b.type==="component"&&window.__kiru.apps.forEach(y=>{dn(y.rootNode,w=>{w.type===x.value&&(w.type=b.value,f.add(w))})})}}f.size&&(Ea=!0,f.forEach(p=>Vt(p)),hn(),Ea=!1),i=!1,n=null,t=null},prepare:d=>{let f=e.get(d);if(i=!!f,!f)f={hotVars:new Map,unnamedEffects:[],hmrCallbacks:[]},e.set(d,f);else{for(;f.hmrCallbacks.length;)f.hmrCallbacks.shift()();for(;r.length;)r.shift()();for(let p of f.unnamedEffects)p.stop();f.unnamedEffects.length=0}n=f,t=d},isReplacement:s,moduleEffects:{registerNext(){o=!0},push(d){o&&(n.unnamedEffects.push(d),o=!1)}},onHmr:d=>{if(n){n.hmrCallbacks.push(d);return}r.push(d)},getCurrentFilePath(){return t}}}function Ou(e){"window"in globalThis&&window.__kiru.HMRContext&&window.__kiru.HMRContext.onHmr(e)}var Ea,qi=M(()=>{"use strict";at();Z();Ue();Ea=!1});function Ru(){let e=new Map,t=new Map;return{appStats:t,emit:(n,i)=>{e.get(n)?.forEach(s=>s(i))},addEventListener:(n,i)=>{e.has(n)||e.set(n,new Set),e.get(n).add(i)},removeEventListener:(n,i)=>{e.has(n)&&e.get(n).delete(i)},mountDuration:n=>{let i=t.get(n);return i?i.mountDuration:0},totalTicks:n=>{let i=t.get(n);return i?i.totalTicks:0},lastTickDuration:n=>{let i=t.get(n);if(!i)return 1/0;let s=i.timestamps[i.timestamps.length-1];return!s||(s.end===1/0&&(s=i.timestamps[i.timestamps.length-2]),!s)?1/0:s.end-s.start},averageTickDuration:n=>{let i=t.get(n);if(!i)return 0;let s=i.timestamps.filter(o=>o.end!==1/0);return s.reduce((o,r)=>o+(r.end-r.start),0)/s.length},beginTick:n=>{t.has(n)||t.set(n,{mountDuration:1/0,timestamps:[],totalTicks:0});let i=t.get(n);i.totalTicks++,i.timestamps.push({start:performance.now(),end:1/0})},endTick:n=>{let i=t.get(n),s=i.timestamps[i.timestamps.length-1];s.end=performance.now(),i.mountDuration===1/0&&(i.mountDuration=s.end-s.start),i.timestamps.length>100&&i.timestamps.shift()}}}var Iu=M(()=>{"use strict"});var Nu,Lu=M(()=>{"use strict";Nu={current:null}});function zu(){let e=new Set,t=new Map;function n(r,a,l){t.get(r)?.forEach(c=>c(a,l))}function i(r,a){t.has(r)||t.set(r,new Set),t.get(r).add(a)}function s(r,a){t.get(r)?.delete(a)}let o={get apps(){return Array.from(e)},emit:n,on:i,off:s};if(i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),R){o.HMRContext=Au(),o.profilingContext=Ru(),o.fileRouterInstance=Nu;let r=new Set,a=new Set;o.devtools={track:(l,c)=>{r.add({label:c??l.displayName??"Unnamed Signal",signal:l}),a.forEach(u=>u(r))},untrack:l=>{r.forEach(c=>{c.signal===l&&r.delete(c)}),a.forEach(c=>c(r))},subscribe:l=>(a.add(l),l(r),()=>a.delete(l))}}return o}var Vu=M(()=>{"use strict";ct();qi();Iu();Lu()});function Mt(e,t){return new es(e,t)}var es,Fu=M(()=>{"use strict";ct();at();Z();di();Qi();fe();es=class e extends L{constructor(t,n){if(super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,R){let i=this[ee].inject;this[ee]={provide:()=>this,inject:s=>{i(s),e.stop(s),this.$isDirty=s.$isDirty},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}set value(t){super.value=t}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),L.dispose(t)}static stop(t){R&&(t=wt(t));let{$id:n,$unsubs:i}=t;Xt.delete(n),i.forEach(zt),i.clear(),t.$isDirty=!0}static run(t){R&&(t=wt(t));let{$id:n,$getter:i,$unsubs:s}=t,o=wo({id:n,subs:s,fn:()=>i(t.$value),onDepChanged:()=>{if(t.$isDirty=!0,R){if(!pe?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(t),!Object.is(t.$value,t.$prevValue)&&t.notify()}});t.sneak(o),t.$isDirty=!1}ensureNotDirty(){let t=this;if(R&&(t=wt(this)),!t.$isDirty){let n=Xt.get(t.$id);n&&(n(),Xt.delete(t.$id))}t.$isDirty&&(R&&t.$isDisposed||e.run(t))}}});function Ft(e,t){if(typeof e=="function")return new pi(e);let n=e,i=t;return new pi(i,n)}var pi,Ma=M(()=>{"use strict";ct();di();Qi();Z();xt();pi=class e{constructor(t,n){this.id=hi(),this.callback=t,this.deps=n,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,R&&rt&&window.__kiru.HMRContext.moduleEffects.push(this);let i=K.current;if(i){if(!_t())return;se(i,this.id,this.stop.bind(this))}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,R&&rt&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){Xt.delete(this.id),this.unsubs.forEach(zt),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let n=wt(t),{id:i,callback:s,unsubs:o,deps:r}=n;n.cleanup=wo({id:i,subs:o,fn:s,deps:r,onDepChanged:()=>{n.cleanup?.(),e.run(n)}})??null}}});var Hu=M(()=>{"use strict"});var gi=M(()=>{"use strict";fe();Fu();Ma();Ln();Hu()});function Dm(e){return async(...t)=>{let{execute:n,onError:i}=e(...t);try{return{error:null,data:await n()}}catch(s){let o=new Mo(s);return i?.(o),{error:o,data:null}}}}var Mo,Bu=M(()=>{"use strict";Mo=class extends Error{constructor(t){super("Error occurred during action execution",{cause:t})}}});function Om(e,t,n){if(R&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let i=Rm(t),s=Am++,o={id:s,name:n?.name??\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props={children:l},ka(i)}function a(){i.props={children:null},ka(i),R&&(delete t.__kiruNode,delete i.app),window.__kiru.emit("unmount",o)}return R&&(i.app=o),r(e),window.__kiru.emit("mount",o),R&&!globalThis.__KIRU_READY__&&(globalThis.__KIRU_READY__=!0,queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))})),o}function Rm(e){let t=fo(e.nodeName.toLowerCase());return t.flags|=Kt,t.dom=e,R&&(e.__kiruNode=t),t}var Am,Wu=M(()=>{"use strict";at();ct();Ue();fa();Am=0});function ju({children:e,fallback:t,onError:n}){return m(je,{children:e,fallback:t,onError:n})}var $u=M(()=>{"use strict";at();V()});function pn(e){return{current:e}}var Ta=M(()=>{"use strict"});function Ht(e){if(!_t())return;let t=K.current;if(!t)throw new Error("Cannot queue onCleanup effect outside of a component");se(t,hi(10),e)}var To=M(()=>{"use strict";xt();Z()});function Co(e){return typeof e=="object"&&!!e&&si in e}function Po(e){return e instanceof Promise&&"id"in e&&"state"in e}function Im(e){let t=K.current;if(!t)throw new Error("statefulPromise must be called inside a Kiru component");let n=ts(t),i=D(!0);i.value=!0;let s=new AbortController;Ht(()=>s.abort());let o=Uu.get(t)??0;Uu.set(t,o+1);let r=\`\${n}:data:\${o}\`,a;pt.current==="string"?a=Promise.resolve():pt.current==="hydrate"&&Bc.current==="dynamic"?a=Nm(r,s.signal):a=e(s.signal);let c=Object.assign(a,{id:r,state:"pending"});return c.then(u=>{c.state="fulfilled",c.value=u,i.value=!1}).catch(u=>{c.state="rejected",c.error=u instanceof Error?u:new Error(u)}),Object.assign(c,{isPending:i})}function Nm(e,t){return new Promise((n,i)=>{let s=window[oi]??(window[oi]=new Map),o=s.get(e);if(o){let{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}let r=a=>{let{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(oi,r);let{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(oi,r),t.addEventListener("abort",()=>{window.removeEventListener(oi,r),i()})})}var Uu,Do=M(()=>{"use strict";at();xt();fe();Eo();To();Uu=new WeakMap});var ge,Gu=M(()=>{"use strict";Z();gi();at();xt();Ta();Ue();Do();ge=()=>e=>{let{from:t,children:n,fallback:i,mode:s}=e,o=pn(null),r=new Set,a;if(Po(t))r.add(t),a=t.value;else if(L.isSignal(t))a=t.value;else{let l={};for(let c in t){let u=t[c];Po(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!_t())throw{[si]:{fallback:i,data:Array.from(r)}};for(let l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){let c=K.current;Promise.allSettled(r).then(()=>Vt(c));let u=o.current;return s!=="fallback"&&u?n(u,!0):i}}return o.current=a,n(a,!1)}});function Ge({each:e,fallback:t,children:n}){let i=q(e,!0);return i.length===0?t:i.map(n)}var Yu=M(()=>{"use strict";gi()});function Lm(e){function t(n){let{fallback:i=null,...s}=n,o=K.current;if(!_t())return i;let r=zm(e.toString()),a=Ku.get(r);if(!a){let l=e(),c={promise:l,result:null};return Ku.set(r,c),l.then(u=>{c.result=typeof u=="function"?u:u.default,Vt(o)}),i}return a.result===null?(a.promise.then(()=>Vt(o)),i):m(a.result,s)}return R&&(t.displayName="Kiru.lazy"),t}var Ku,zm,Xu=M(()=>{"use strict";li();ct();Sa();xt();Ue();Ku=rt?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;zm=e=>e.replace(/import\\((["'])([^?"']+)\\?[^)"']*\\1\\)/g,(t,n,i)=>\`import(\${n}\${i}\${n})\`)});function Vm({children:e,container:t}){let n=K.current;if(!n.dom)switch(n.flags|=Kt,pt.current){case"dom":if(n.dom=typeof t=="function"?t():t,!(n.dom instanceof HTMLElement)){if(R)throw new Et({message:\`Invalid portal container, expected HTMLElement, got \${n.dom}\`,vNode:n});return null}return e;case"hydrate":Ji(()=>Vt(n));case"stream":case"string":return null}return e}var qu=M(()=>{"use strict";at();ct();ai();xt();Ue()});function Fm({children:e,when:t,fallback:n}){let i=q(t,!0);return i?typeof e=="function"?e(i):e:n}var Zu=M(()=>{"use strict";gi()});function Hm(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??Ju;case"exited":return t?.out??Ju}}var mi,Ju,Qu=M(()=>{"use strict";To();fe();Ma();Ln();mi=e=>{let t=D(e.initialState||"exited"),n,i=o=>{clearTimeout(n),t.value=o,(o==="entered"||o==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(o)},s=o=>{n=window.setTimeout(()=>i(o),Hm(o,e.duration))};return Ft(()=>{let o=q(e.in,!0),r=t.peek();o&&r!=="entered"&&r!=="entering"?(i("entering"),s("entered")):!o&&r!=="exited"&&r!=="exiting"&&(i("exiting"),s("exited"))}),Ht(()=>clearTimeout(n)),o=>o.element(t.value)},Ju=150});var td=M(()=>{"use strict";$u();Gu();Yu();Xu();qu();Zu();Qu()});function Bm(e){let t=Object.assign(({value:n,children:i})=>m(On,{value:n,ctx:t},i),{[On]:()=>e});return t.displayName="Anonymous Context",t}function Wm(e,t){let n=e.parent;for(;n;){if(n.type===On){let i=n,{ctx:s,value:o}=i.props;if(s===t)return o}n=n.parent}return t[On]()}function jm(e){let t=K.current;if(!t)throw new Error("useContext must be called inside a Kiru component");return Wm(t,e)}var ed=M(()=>{"use strict";at();li();xt()});var Ca,nd=M(()=>{"use strict";Ca=class{constructor(){}static on(t,n){return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}static dispatch(t,n,i){(i||document).dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}});var Pa,id=M(()=>{"use strict";(function(e){e.track=(t,n)=>{"window"in globalThis&&window.__kiru.devtools?.track(t,n)},e.untrack=t=>{"window"in globalThis&&window.__kiru.devtools?.untrack(t)},e.subscribe=t=>!("window"in globalThis)||!window.__kiru.devtools?()=>{}:window.__kiru.devtools.subscribe(t)})(Pa||(Pa={}))});function ns(){let e=K.current;return e?e.hooks??(e.hooks={pre:[],preCleanups:[],post:[],postCleanups:[]}):null}function is(e,t){return()=>{let n=e();typeof n=="function"&&t.push(n)}}var Ao=M(()=>{"use strict";xt()});function Tt(e){if(!_t())return;let t=ns();if(!t)throw new Error("Cannot queue onMount effect outside of a component");t.post.push(is(e,t.postCleanups))}var sd=M(()=>{"use strict";Z();Ao()});function Da(e){if(!_t())return;let t=ns();if(!t)throw new Error("Cannot queue beforeMount effect outside of a component");t.pre.push(is(e,t.preCleanups))}var od=M(()=>{"use strict";Z();Ao()});function Aa(){let e=K.current;if(R){if(!e)throw new Error("setup() must be called inside a Kiru component");if(e.render)throw new Error("setup() cannot be used inside a render function")}if(ri.has(e))return ri.get(e);let t=$m(e);return ri.set(e,t),t}function $m(e){let t,n=e.propSyncs=[],i=-1;return{derive(s){let o={...e.props},r=Mt(()=>s(o));return n.push(a=>r.value=s(a)),r},get id(){return t||(t=D(ts(e)),i=e.index,n.push(()=>{i!==e.index&&(t.value=ts(e),i=e.index)})),t}}}var rd=M(()=>{"use strict";gi();Eo();ct();xt()});var ad=M(()=>{"use strict";To();sd();od();rd();Ao()});function Te(e,t,n,i){if(t===null||t===void 0||typeof t=="boolean")return;if(typeof t=="string")return e.write(ko(t));if(typeof t=="number"||typeof t=="bigint")return e.write(t.toString());if(t instanceof Array)return t.forEach((l,c)=>Te(e,l,n,c));if(L.isSignal(t)){let l=t.peek();if(!Fc(l)){R&&console.error(\`[kiru]: expected primitive child but received \${l}\`);return}un(l)&&e.write(ko(String(l)));return}if(!Cu(t))return;t.parent=n,t.depth=(n?.depth??-1)+1,t.index=i;let{type:s,props:o={}}=t;if(s==="#text")return e.write(ko(o.nodeValue??""));let r=o.children;if(yo(s)){if(s===je){let l="",c=new Set,u={write(d){l+=d},onStreamData(d){d.forEach(f=>c.add(f))}};try{Te(u,r,t,i),e.write(l),e.onStreamData?.([...c])}catch(d){if(Co(d))throw d;let f=d instanceof Error?d:new Error(String(d)),{fallback:p,onError:b}=o;b?.(f);let x=typeof p=="function"?p(f):p;Te(e,x,t,0)}return}Te(e,r,t,i);return}if(typeof s=="function")try{K.current=t;let l=s(o);typeof l=="function"&&(l=l(o)),Te(e,l,t,i);return}catch(l){if(Co(l)){let{fallback:c,data:u}=l[si];return e.onStreamData?.(u),Te(e,c,t,0)}throw l}finally{K.current=null}R&&vo(t);let a=Mu(o);e.write(\`<\${s}\${a.length?\` \${a}\`:""}>\`),!Lc.has(s)&&("innerHTML"in o?e.write(String(L.isSignal(o.innerHTML)?o.innerHTML.peek():o.innerHTML)):Array.isArray(r)?r.forEach((l,c)=>Te(e,l,t,c)):Te(e,r,t,0),e.write(\`</\${s}>\`))}var ld=M(()=>{"use strict";xt();Z();Do();fe();at();ct()});function Um(e){let t=pt.current;pt.current="string";let n="";return Te({write(s){n+=s}},vt({children:e}),null,0),pt.current=t,n}var cd=M(()=>{"use strict";xt();li();ld()});var Oa,ud=M(()=>{"use strict";Ue();ct();(function(e){let t=[],n=!1,i=!1,s=null,o=rt&&typeof document.startViewTransition=="function";function r(u,d){let f=d?.signal;return new Promise(p=>{let b=async()=>{let x=await u();p(x)};t.push(b),f?.addEventListener("abort",()=>{let x=t.indexOf(b);x!==-1?t.splice(x,1):s?.skipTransition()},{once:!0}),l()})}e.run=r;function a(){s?.skipTransition(),s=null,t.length=0,n=!1,i=!1}e.stop=a;function l(){i||(i=!0,queueMicrotask(()=>{i=!1,c()}))}async function c(){if(n||t.length===0)return;n=!0;let u=[...t];t.length=0;let d=async()=>{await Promise.all(u.map(f=>f())),hn()};o?(s=document.startViewTransition(d),await s.finished):await d(),s=null,n=!1,t.length>0&&l()}})(Oa||(Oa={}))});var B={};Wr(B,{ActionError:()=>Mo,ComputedSignal:()=>es,CustomEvents:()=>Ca,Derive:()=>ge,DevTools:()=>Pa,Effect:()=>pi,ErrorBoundary:()=>ju,For:()=>Ge,Fragment:()=>vt,KiruError:()=>Et,Portal:()=>Vm,Show:()=>Fm,Signal:()=>L,Transition:()=>mi,ViewTransitions:()=>Oa,computed:()=>Mt,createContext:()=>Bm,createElement:()=>m,defineAction:()=>Dm,effect:()=>Ft,flushSync:()=>hn,getVNodeLifecycleHooks:()=>ns,isStatefulPromise:()=>Po,isStreamDataThrowValue:()=>Co,lazy:()=>Lm,mount:()=>Om,nextIdle:()=>Ji,onBeforeMount:()=>Da,onCleanup:()=>Ht,onHmr:()=>Ou,onMount:()=>Tt,ref:()=>pn,renderToString:()=>Um,requestUpdate:()=>Vt,setup:()=>Aa,signal:()=>D,statefulPromise:()=>Im,tick:()=>_o,unwrap:()=>q,useContext:()=>jm,useRequestUpdate:()=>yu,wrapLifecycleHookCallback:()=>is});var V=M(()=>{"use strict";Vu();ct();gi();Bu();Wu();td();ed();nd();id();li();ai();qi();ad();cd();Ta();Ue();Do();ud();rt&&(window.__kiru??(window.__kiru=zu()))});function Ye(e,t){if(!e)throw new Error(t)}function Vn(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function ss(e){try{return e[Gm]??null}catch{return null}}function oe(e){return e.name==="kiru.devtools"}function Ym(e){return Array.from(e.entries())}function Ke(e,t,n){return Math.min(Math.max(e,t),n)}function Km(e,t,n){if(e.key==="Tab"){let i=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],o=i[i.length-1];if(n&&!t.contains(n)&&s&&s instanceof HTMLElement)return s.focus();e.shiftKey?n===s&&o instanceof HTMLElement&&(o.focus(),e.preventDefault()):n===o&&s instanceof HTMLElement&&(s.focus(),e.preventDefault())}}function Xm(){return J.rootRef.value?.matches(":focus-within, :focus")}function Ra(e){let t=J.rootRef.value;return t?.matches(":focus-within, :focus")?e(t):null}function bi(e){let t=[],n=e;for(;n;){if(typeof n.type=="function"){let i=n.type,s=i.displayName??(i.name||"AnonymousFunction"),o=n.key!=null&&n.key!==void 0?\`k:\${String(n.key)}\`:\`i:\${n.index}\`;t.push(\`\${s}[\${o}]\`)}n=n.parent}return\`ch:\${t.join("/")}\`}function Ia(e,t){if(!e)return null;let n=[e];for(;n.length;){let i=n.pop();if(typeof i.type=="function"&&bi(i)===t)return i;i.child&&n.push(i.child),i.sibling&&n.push(i.sibling)}return null}var Gm,Fn=M(()=>{"use strict";Ce();Gm=Symbol.for("kiru.devFileLink")});function qm(e,t){let n=new BroadcastChannel(e),i=(l,c)=>{if(l.type==="SET"){let{key:u,version:d}=l;return dd[u]=c,n.postMessage({type:"SET",key:u,version:d})}n.postMessage(l)},s={},o={},r={};for(let l in t){let c=o[l]=D(t[l]);s[l]=0,r[l]=u=>{if(u.type==="GET"){let d=c.value,f=s[l];return i({type:"SET",key:l,version:f},d)}u.version>s[l]&&(c.value=dd[l],s[l]=u.version)},c.subscribe(u=>{let d=++s[l];i({type:"SET",key:l,version:d},u)})}n.addEventListener("message",({data:l})=>{r[l.key](l)});for(let l in o)i({type:"GET",key:l});return[o,()=>{n.close(),Object.values(o).forEach(l=>L.dispose(l))}]}var fd,dd,dt,J,Ce=M(()=>{"use strict";V();Fn();Z();dd=(fd=window.opener??window).__kiru_devtools_state_register??(fd.__kiru_devtools_state_register={}),dt=()=>window.opener?.__kiru??window.__kiru;[J]=qm("kiru-devtools:syncedState",{apps:[],rootRef:null,appSearchTerm:"",appSearchInput:null,componentSelection:{enabled:!1,componentNode:null},devtoolsViewMode:"embedded",devtoolsTab:"Apps",popupWindow:null,selectedApp:null,selectedNode:null,viewerSettings:{objectKeysChunkSize:10,arrayChunkSize:10}});if("window"in globalThis){let{apps:e,componentSelection:t,selectedNode:n,selectedApp:i,viewerSettings:s}=J;window.addEventListener("kiru:ready",()=>{e.value=[...dt().apps],dt().on("mount",a=>{oe(a)||(e.value=[...e.value,a])}),dt().on("unmount",a=>{oe(a)||(e.value=e.value.filter(l=>l!==a))})});let o="kiru-devtools:viewerSettings";s.subscribe(a=>{localStorage.setItem("kiru-devtools:viewerSettings",JSON.stringify(a))});let r=localStorage.getItem(o);if(r)try{let a=JSON.parse(r);Ye(typeof a.objectKeysChunkSize=="number"&&a.objectKeysChunkSize>0,"invalid objectKeysChunkSize"),Ye(typeof a.arrayChunkSize=="number"&&a.arrayChunkSize>0,"invalid arrayChunkSize"),s.sneak({objectKeysChunkSize:a.objectKeysChunkSize,arrayChunkSize:a.arrayChunkSize})}catch{s.sneak({objectKeysChunkSize:10,arrayChunkSize:10})}t.subscribe(({componentNode:a})=>{n.value=a,i.value=a?Lt(a):null})}});function Na(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),m("path",{d:"M12 9v11"}),m("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}var hd=M(()=>{"use strict";V()});function Xe(e){return m("svg",{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",...e},m("path",{d:"m9 18 6-6-6-6"}))}var Oo=M(()=>{"use strict";V()});function La(e){return m("svg",{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",...e},m("path",{d:"M18 6 6 18"}),m("path",{d:"m6 6 12 12"}))}var pd=M(()=>{"use strict";V()});function za(e){return m("svg",{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",...e},m("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),m("circle",{cx:"12",cy:"12",r:"3"}))}var gd=M(()=>{"use strict";V()});function Zm(e){return m("svg",{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",...e},m("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),m("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}))}var md=M(()=>{"use strict";V()});function os(e){return m("svg",{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",...e},m("path",{d:"M15 3h6v6"}),m("path",{d:"M10 14 21 3"}),m("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}))}var bd=M(()=>{"use strict";V()});function Va(e){return m("svg",{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",...e},m("path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M3 5a2 2 0 0 0 2 2h3"}),m("path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}))}var xd=M(()=>{"use strict";V()});function Jm(e){return m("svg",{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",...e},m("path",{d:"m15 15 6 6"}),m("path",{d:"m15 9 6-6"}),m("path",{d:"M21 16v5h-5"}),m("path",{d:"M21 8V3h-5"}),m("path",{d:"M3 16v5h5"}),m("path",{d:"m3 21 6-6"}),m("path",{d:"M3 8V3h5"}),m("path",{d:"M9 9 3 3"}))}var yd=M(()=>{"use strict";V()});function Fa(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}))}var vd=M(()=>{"use strict";V()});function rs(e){return m("svg",{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",...e},m("path",{d:"m12 14 4-4"}),m("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}var wd=M(()=>{"use strict";V()});function Qm(e){return m("svg",{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",...e},m("circle",{cx:"12",cy:"5",r:"1"}),m("circle",{cx:"19",cy:"5",r:"1"}),m("circle",{cx:"5",cy:"5",r:"1"}),m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}),m("circle",{cx:"12",cy:"19",r:"1"}),m("circle",{cx:"19",cy:"19",r:"1"}),m("circle",{cx:"5",cy:"19",r:"1"}))}var _d=M(()=>{"use strict";V()});function as(e){return m("svg",{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",...e},m("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"}))}var kd=M(()=>{"use strict";V()});function tb(e){return m("svg",{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",...e},m("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),m("path",{d:"m21 3-9 9"}),m("path",{d:"M15 3h6v6"}))}var Sd=M(()=>{"use strict";V()});function Ha(e){return m("svg",{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",...e},m("path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}),m("path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}),m("path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}),m("path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}),m("circle",{cx:"12",cy:"12",r:"2"}))}var Ed=M(()=>{"use strict";V()});function Hn(e){return m("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",...e},m("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),m("line",{x1:"9",y1:"5",x2:"5",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}))}var Md=M(()=>{"use strict";V()});function eb(e){return m("svg",{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",...e},m("path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}))}var Td=M(()=>{"use strict";V()});var Cd=M(()=>{"use strict";hd();Oo();pd();gd();md();bd();xd();yd();vd();wd();_d();kd();Sd();Ed();Md();Td()});function qe(e){let t=[],n=()=>t.forEach(f=>f()),i=D(null),s=D(null),o=D(nb(e)),r=Mt(()=>o.value.type==="snapped"?o.value.side:null),a=D([0,0]),l=D(!1);t.push(a.subscribe(([f,p])=>{let b=i.value;b.style.transform=\`translate(\${f}px, \${p}px)\`}));let c=f=>{if(f.button!==0)return;let p=i.value,[b,x]=[f.clientX,f.clientY],y=p.getBoundingClientRect(),[w,_]=[b-y.left,x-y.top];l.value=!1;let S=E=>{if(!l.peek()&&(Math.abs(E.clientX-b)>5||Math.abs(E.clientY-x)>5)&&(l.value=!0),!l.peek())return;let[P,O]=[E.clientX-w,E.clientY-_],[A,N]=e.getDraggableBounds(),{width:j,height:H}=p.getBoundingClientRect(),G=P,ot=A-(P+j),Pt=O,Q=N-(O+H),tt=Math.min(G,ot,Pt,Q),mt=P+j/2,ue=O+H/2;e.allowFloat&&tt>(e.snapDistance??0)?o.value={type:"floating",x:mt/A,y:ue/N}:tt===G?o.value={type:"snapped",side:"left",percent:ue/N}:tt===ot?o.value={type:"snapped",side:"right",percent:ue/N}:tt===Pt?o.value={type:"snapped",side:"top",percent:mt/A}:o.value={type:"snapped",side:"bottom",percent:mt/A},u()},T=()=>{if(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",T),!l.peek())return e.onclick?.();l.value=!1,e.storage.setItem(e.key,JSON.stringify(o.value))};window.addEventListener("mousemove",S),window.addEventListener("mouseup",T)},u=()=>{let f=i.value,{width:p,height:b}=f.getBoundingClientRect(),[x,y]=e.getDraggableBounds(),w=o.value;if(w.type==="floating"){let[P,O]=e.getPadding(null);a.value=[Ke(w.x*x-p/2,P,x-P-p),Ke(w.y*y-b/2,O,y-O-b)];return}let[_,S]=e.getPadding(w.side),T=0,E=0;switch(w.side){case"top":T=w.percent*x-p/2,E=0;break;case"bottom":T=w.percent*x-p/2,E=1/0;break;case"left":T=0,E=w.percent*y-b/2;break;case"right":T=1/0,E=w.percent*y-b/2;break}a.value=[Ke(T,_,x-_-p),Ke(E,S,y-S-b)]};return{init:()=>{let f=s.value;if(!f)return console.error("handle not found",new Error().stack);let p=i.value;if(!p)return console.error("container not found",new Error().stack);p.style.position="fixed",p.style.top="0",p.style.left="0",u();let b=new ResizeObserver(u);b.observe(p),window.addEventListener("resize",u),f.addEventListener("mousedown",c),t.push(()=>{b.disconnect(),window.removeEventListener("resize",u),f.removeEventListener("mousedown",c)})},isDragging:l,handleRef:s,containerRef:i,snapSide:r,containerPos:a,dispose:n}}function nb({storage:e,key:t,defaultPosition:n}){let i=e.getItem(t);if(i)try{let o=JSON.parse(i);if(o.type==="snapped")return Ye(["top","right","bottom","left"].includes(o.side),"invalid side"),Ye(typeof o.percent=="number"&&o.percent>=0&&o.percent<=1,"invalid percent"),o;if(o.type==="floating")return Ye(typeof o.x=="number"&&o.x>=0&&o.x<=1,"invalid x"),Ye(typeof o.y=="number"&&o.y>=0&&o.y<=1,"invalid y"),o}catch{}let s=n??{type:"floating",x:.5,y:.5};return e.setItem(t,JSON.stringify(s)),s}var Pd=M(()=>{"use strict";V();Fn()});function Ba(e,t={windowScroll:!0,windowResize:!0}){let n=[],i=()=>{n.forEach(_=>_()),n.length=0},s=t.windowScroll??!0,o=t.windowResize??!0,r=D(0),a=D(0),l=D(0),c=D(0),u=D(0),d=D(0),f=D(0),p=D(0),b=D(0),x=D(0),y=()=>{let _=e.current;if(!_){r.value=a.value=l.value=c.value=u.value=d.value=f.value=p.value=b.value=x.value=0;return}r.value=_.clientWidth,a.value=_.clientHeight;let S=_.getBoundingClientRect();l.value=S.top,c.value=S.left,u.value=S.right,d.value=S.bottom,f.value=S.x,p.value=S.y,b.value=window.scrollX,x.value=window.scrollY};return{state:{width:r,height:a,top:l,left:c,right:u,bottom:d,x:f,y:p,scrollX:b,scrollY:x},init:()=>{let _=e.current;if(!_)return console.error("element not found",new Error().stack);let S=new MutationObserver(y);S.observe(_,{attributeFilter:["style","class"],attributes:!0,childList:!0,subtree:!0}),n.push(()=>S.disconnect());let T=new ResizeObserver(y);T.observe(_),n.push(()=>T.disconnect()),s&&(window.addEventListener("scroll",y,{capture:!0,passive:!0}),n.push(()=>window.removeEventListener("scroll",y))),o&&(window.addEventListener("resize",y,{passive:!0}),n.push(()=>window.removeEventListener("resize",y))),y()},dispose:i}}var Dd=M(()=>{"use strict";V()});function Bn(e){let t=[],n=()=>t.forEach(d=>d()),i=D(null),s=D(null),o=D(!1),[r,a]=e.minSize??[0,0],l=e.aspectRatio??null,c=d=>{if(d.button!==0)return;d.stopPropagation(),d.preventDefault(),o.value=!0,document.body.style.cursor="se-resize",document.body.style.userSelect="none";let f=i.value,p=d.clientX,b=d.clientY,x=f.offsetWidth,y=f.offsetHeight,w=S=>{let T=S.clientX-p,E=S.clientY-b;if(l!==null){let P=(T*l+E)/(l*l+1),O=Math.max(r,x+P*l),A=O/l;A<a&&(A=a,O=A*l),f.style.width=\`\${O}px\`,f.style.height=\`\${A}px\`}else f.style.width=\`\${Math.max(r,x+T)}px\`,f.style.height=\`\${Math.max(a,y+E)}px\`},_=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",_),o.value=!1,document.body.style.cursor="",document.body.style.userSelect="",e.storage.setItem(e.key,JSON.stringify({w:f.offsetWidth,h:f.offsetHeight}))};window.addEventListener("mousemove",w),window.addEventListener("mouseup",_)};return{containerRef:i,handleRef:s,isResizing:o,init:()=>{let d=s.value;if(!d)return console.error("resize handle not found",new Error().stack);let f=i.value;if(!f)return console.error("resize container not found",new Error().stack);let p=ib(e.storage,e.key);if(p){let b=p[0],x=l!==null?b/l:p[1];f.style.width=\`\${b}px\`,f.style.height=\`\${x}px\`}d.addEventListener("mousedown",c),t.push(()=>d.removeEventListener("mousedown",c))},dispose:n}}function ib(e,t){let n=e.getItem(t);if(!n)return null;try{let i=JSON.parse(n);if(typeof i.w=="number"&&typeof i.h=="number")return[i.w,i.h]}catch{}return null}var Ad=M(()=>{"use strict";V()});function ls(){let e=D({x:0,y:0}),t=n=>{e.value={x:n.clientX,y:n.clientY}};return window.addEventListener("mousemove",t),[e,()=>window.removeEventListener("mousemove",t)]}var Od=M(()=>{"use strict";V()});function ds(e){return e+.5|0}function cs(e){return gn(ds(e*2.55),0,255)}function mn(e){return gn(ds(e*255),0,255)}function Ze(e){return gn(ds(e/2.55)/100,0,1)}function Rd(e){return gn(ds(e*100),0,100)}function ab(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&re[e[1]]*17,g:255&re[e[2]]*17,b:255&re[e[3]]*17,a:t===5?re[e[4]]*17:255}:(t===7||t===9)&&(n={r:re[e[1]]<<4|re[e[2]],g:re[e[3]]<<4|re[e[4]],b:re[e[5]]<<4|re[e[6]],a:t===9?re[e[7]]<<4|re[e[8]]:255})),n}function cb(e){var t=rb(e)?sb:ob;return e?"#"+t(e.r)+t(e.g)+t(e.b)+lb(e.a,t):void 0}function zd(e,t,n){let 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 db(e,t,n){let 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 fb(e,t,n){let i=zd(e,1,.5),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 hb(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function $a(e){let n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=hb(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Ua(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(mn)}function Ga(e,t,n){return Ua(zd,e,t,n)}function pb(e,t,n){return Ua(fb,e,t,n)}function gb(e,t,n){return Ua(db,e,t,n)}function Vd(e){return(e%360+360)%360}function mb(e){let t=ub.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?cs(+t[5]):mn(+t[5]));let s=Vd(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=pb(s,o,r):t[1]==="hsv"?i=gb(s,o,r):i=Ga(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function bb(e,t){var n=$a(e);n[0]=Vd(n[0]+t),n=Ga(n),e.r=n[0],e.g=n[1],e.b=n[2]}function xb(e){if(!e)return;let t=$a(e),n=t[0],i=Rd(t[1]),s=Rd(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Ze(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}function yb(){let e={},t=Object.keys(Nd),n=Object.keys(Id),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,Id[o]);o=parseInt(Nd[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function vb(e){Io||(Io=yb(),Io.transparent=[0,0,0,0]);let t=Io[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function _b(e){let t=wb.exec(e),n=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];n=t[8]?cs(r):gn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?cs(i):gn(i,0,255)),s=255&(t[4]?cs(s):gn(s,0,255)),o=255&(t[6]?cs(o):gn(o,0,255)),{r:i,g:s,b:o,a:n}}}function kb(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Ze(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}function Sb(e,t,n){let i=xi(Ze(e.r)),s=xi(Ze(e.g)),o=xi(Ze(e.b));return{r:mn(Wa(i+n*(xi(Ze(t.r))-i))),g:mn(Wa(s+n*(xi(Ze(t.g))-s))),b:mn(Wa(o+n*(xi(Ze(t.b))-o))),a:e.a+n*(t.a-e.a)}}function No(e,t,n){if(e){let i=$a(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Ga(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Fd(e,t){return e&&Object.assign(t||{},e)}function Ld(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=mn(e[3]))):(t=Fd(e,{r:0,g:0,b:0,a:1}),t.a=mn(t.a)),t}function Eb(e){return e.charAt(0)==="r"?_b(e):mb(e)}var gn,re,ja,sb,ob,Ro,rb,lb,ub,Id,Nd,Io,wb,Wa,xi,us,Hd=M(()=>{gn=(e,t,n)=>Math.max(Math.min(e,n),t);re={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},ja=[..."0123456789ABCDEF"],sb=e=>ja[e&15],ob=e=>ja[(e&240)>>4]+ja[e&15],Ro=e=>(e&240)>>4===(e&15),rb=e=>Ro(e.r)&&Ro(e.g)&&Ro(e.b)&&Ro(e.a);lb=(e,t)=>e<255?t(e):"";ub=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Id={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"},Nd={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"};wb=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Wa=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,xi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);us=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Ld(t):n==="string"&&(i=ab(t)||vb(t)||Eb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Fd(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=Ld(t)}rgbString(){return this._valid?kb(this._rgb):void 0}hexString(){return this._valid?cb(this._rgb):void 0}hslString(){return this._valid?xb(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,o,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=Sb(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=mn(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=ds(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return No(this._rgb,2,t),this}darken(t){return No(this._rgb,2,-t),this}saturate(t){return No(this._rgb,1,t),this}desaturate(t){return No(this._rgb,1,-t),this}rotate(t){return bb(this._rgb,t),this}}});function be(){}function X(e){return e==null}function et(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ot(e,t){return ht(e)?e:t}function W(e,t){return typeof e>"u"?t:e}function z(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $(e,t,n,i){let s,o,r;if(et(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<o;s++)t.call(n,e[s],s);else if(Y(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function wi(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function hs(e){if(et(e))return e.map(hs);if(Y(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=hs(e[n[s]]);return t}return e}function qd(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Zd(e,t,n,i){if(!qd(e))return;let s=t[e],o=n[e];Y(s)&&Y(o)?$n(s,o,i):t[e]=hs(o)}function $n(e,t,n){let i=et(t)?t:[t],s=i.length;if(!Y(e))return e;n=n||{};let o=n.merger||Zd,r;for(let a=0;a<s;++a){if(r=i[a],!Y(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Un(e,t){return $n(e,t,{merger:Jd})}function Jd(e,t,n){if(!qd(e))return;let i=t[e],s=n[e];Y(i)&&Y(s)?Un(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=hs(s))}function Qd(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Mb(e){let t=Qd(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function _i(e,t){return(Bd[t]||(Bd[t]=Mb(t)))(e)}function ms(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ja(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function Ae(e,t,n){return Math.abs(e-t)<n}function Wo(e){let t=Math.round(e);e=Ae(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(De(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Qa(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function Tb(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Gn(e){return!Tb(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function tl(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function jo(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Oe(e){return e*(ft/180)}function bs(e){return e*(180/ft)}function $o(e){if(!ht(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function el(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*ft&&(o+=Bt),{angle:o,distance:s}}function gs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function nf(e,t){return(e-t+tf)%Bt-ft}function qt(e){return(e%Bt+Bt)%Bt}function Uo(e,t,n,i){let s=qt(e),o=qt(t),r=qt(n),a=qt(o-s),l=qt(r-s),c=qt(s-o),u=qt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Wt(e,t,n){return Math.max(t,Math.min(n,e))}function nl(e){return Wt(e,-32768,32767)}function Yn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function xs(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}function sl(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}function ol(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),sf.forEach(n=>{let i="_onData"+ms(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Go(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(sf.forEach(o=>{delete e[o]}),delete e._chartjs)}function rl(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Ko(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Yo.call(window,()=>{i=!1,e.apply(t,n)}))}}function al(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}function cl(e,t,n){let i=t.length,s=0,o=i;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:d,max:f,minDefined:p,maxDefined:b}=r.getUserBounds();if(p){if(s=Math.min(Qe(l,u,d).lo,n?i:Qe(t,u,r.getPixelForValue(d)).lo),c){let x=l.slice(0,s+1).reverse().findIndex(y=>!X(y[a.axis]));s-=Math.max(0,x)}s=Wt(s,0,i-1)}if(b){let x=Math.max(Qe(l,r.axis,f,!0).hi+1,n?0:Qe(t,u,r.getPixelForValue(f),!0).hi+1);if(c){let y=l.slice(x-1).findIndex(w=>!X(w[a.axis]));x+=Math.max(0,y)}o=Wt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function ul(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}function qo(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Zo(e){return qo(e)?e:new us(e)}function Fo(e){return qo(e)?e:new us(e).saturate(.5).darken(.1).hexString()}function Db(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:Pb},numbers:{type:"number",properties:Cb}}),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 Ab(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function Ob(e,t){t=t||{};let n=e+JSON.stringify(t),i=$d.get(n);return i||(i=new Intl.NumberFormat(e,t),$d.set(n,i)),i}function ys(e,t,n){return Ob(t,n).format(e)}function Rb(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}function Ib(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,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:vs.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"})}function fs(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Ya(e,t,n){return typeof t=="string"?$n(fs(e,t),n):$n(fs(e,""),t)}function rf(e){return!e||X(e.size)||X(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function yi(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 dl(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,a=n.length,l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!et(d))r=yi(e,s,o,r,d);else if(et(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!et(f)&&(r=yi(e,s,o,r,f));e.restore();let p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return r}function tn(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Qo(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ws(e,t,n,i){tr(e,t,n,i,null)}function tr(e,t,n,i,s){let o,r,a,l,c,u,d,f,p=t.pointStyle,b=t.rotation,x=t.radius,y=(b||0)*ef;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,i,s/2,x,0,0,Bt):e.arc(n,i,x,0,Bt),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ka,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ka,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(y+bn)*l,d=Math.cos(y+bn)*(s?s/2-c:l),a=Math.sin(y+bn)*l,f=Math.sin(y+bn)*(s?s/2-c:l),e.arc(n-d,i-a,c,y-ft,y-At),e.arc(n+f,i-r,c,y-At,y),e.arc(n+d,i+a,c,y,y+At),e.arc(n-f,i+r,c,y+At,y+ft),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}y+=bn;case"rectRot":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+f,i-r),e.lineTo(n+d,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":y+=bn;case"cross":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),y+=bn,d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*x,a=Math.sin(y)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:x),i+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Zt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function _s(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ks(e){e.restore()}function fl(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function hl(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Nb(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),X(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Lb(e,t,n,i,s){if(s.strikethrough||s.underline){let o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function zb(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function wn(e,t,n,i,s,o={}){let r=et(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Nb(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&zb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),X(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Lb(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Si(e,t){let{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*ft,ft,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,ft,At,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,At,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-At,!0),e.lineTo(n+r.topLeft,i)}function af(e,t){let n=(""+e).match(Vb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}function er(e,t){let n={},i=Y(t),s=i?Object.keys(t):t,o=Y(e)?i?r=>W(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)n[r]=Hb(o(r));return n}function pl(e){return er(e,{top:"y",right:"x",bottom:"y",left:"x"})}function _n(e){return er(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(e){let t=pl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function gt(e,t){e=e||{},t=t||it.font;let n=W(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=W(e.style,t.style);i&&!(""+i).match(Fb)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:W(e.family,t.family),lineHeight:af(W(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:W(e.weight,t.weight),string:""};return s.string=rf(s),s}function Ei(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&et(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function gl(e,t,n){let{min:i,max:s}=e,o=Za(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Re(e,t){return Object.assign(Object.create(e),t)}function Ss(e,t=[""],n,i,s=()=>e[0]){let o=n||e;typeof i>"u"&&(i=uf("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ss([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return lf(a,l,()=>Kb(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Gd(a).includes(l)},ownKeys(a){return Gd(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function yn(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:nr(e,i),setContext:o=>yn(e,o,n,i),override:o=>yn(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 lf(o,r,()=>Wb(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 nr(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Pe(n)?n:()=>n,isIndexable:Pe(i)?i:()=>i}}function lf(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function Wb(e,t,n){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e,a=i[t];return Pe(a)&&r.isScriptable(t)&&(a=jb(t,a,e,n)),et(a)&&a.length&&(a=$b(t,a,e,r.isIndexable)),ml(t,a)&&(a=yn(a,s,o&&o[t],r)),a}function jb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),ml(e,l)&&(l=bl(s._scopes,s,e,l)),l}function $b(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(Y(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let d=bl(c,s,e,u);t.push(yn(d,o,r&&r[e],a))}}return t}function cf(e,t,n){return Pe(e)?e(t,n):e}function Gb(e,t,n,i,s){for(let o of t){let r=Ub(n,o);if(r){e.add(r);let a=cf(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function bl(e,t,n,i){let s=t._rootScopes,o=cf(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Ud(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Ud(a,r,o,l,i),l===null)?!1:Ss(Array.from(a),[""],s,o,()=>Yb(t,n,i))}function Ud(e,t,n,i,s){for(;n;)n=Gb(e,t,n,i,s);return n}function Yb(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return et(s)&&Y(n)?n:s||{}}function Kb(e,t,n,i){let s;for(let o of t)if(s=uf(Bb(o,e),n),typeof s<"u")return ml(e,s)?bl(n,i,e,s):s}function uf(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function Gd(e){let t=e._keys;return t||(t=e._keys=Xb(e._scopes)),t}function Xb(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ff(e,t,n,i){let s=e.skip?t:e,o=t,r=n.skip?t:n,a=gs(o,s),l=gs(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let d=i*c,f=i*u;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function Zb(e,t,n){let i=e.length,s,o,r,a,l,c=vi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=vi(e,u+1),!(!l||!c)){if(Ae(t[u],0,qb)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function Jb(e,t,n="x"){let i=df(n),s=e.length,o,r,a,l=vi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=vi(e,c+1),!a)continue;let u=a[n],d=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=d+o*t[c])}}function hf(e,t="x"){let n=df(t),i=e.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=vi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=vi(e,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?me(s[r-1])!==me(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Zb(e,s,o),Jb(e,o,t)}function zo(e,t,n){return Math.max(Math.min(e,n),t)}function Qb(e,t){let n,i,s,o,r,a=Zt(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Zt(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=zo(s.cp1x,t.left,t.right),s.cp1y=zo(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=zo(s.cp2x,t.left,t.right),s.cp2y=zo(s.cp2y,t.top,t.bottom)))}function xl(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")hf(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=ff(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Qb(e,n)}function Es(){return typeof window<"u"&&typeof document<"u"}function Ms(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ho(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function pf(e,t){return ir(e).getPropertyValue(t)}function jn(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let o=tx[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function nx(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(ex(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Jt(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=ir(n),o=s.boxSizing==="border-box",r=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=nx(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top),{width:p,height:b}=t;return o&&(p-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-f)/b*n.height/i)}}function ix(e,t,n){let i,s;if(t===void 0||n===void 0){let o=e&&Ms(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let r=o.getBoundingClientRect(),a=ir(o),l=jn(a,"border","width"),c=jn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Ho(a.maxWidth,o,"clientWidth"),s=Ho(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ps,maxHeight:s||ps}}function yl(e,t,n,i){let s=ir(e),o=jn(s,"margin"),r=Ho(s.maxWidth,e,"clientWidth")||ps,a=Ho(s.maxHeight,e,"clientHeight")||ps,l=ix(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let f=jn(s,"border","width"),p=jn(s,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=xn(Math.min(c,r,l.maxWidth)),u=xn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=xn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=xn(Math.floor(u*i))),{width:c,height:u}}function sr(e,t,n){let i=t||1,s=xn(e.height*i),o=xn(e.width*i);e.height=xn(e.height),e.width=xn(e.width);let 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}function or(e,t){let n=pf(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Je(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function wl(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function _l(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Je(e,s,n),a=Je(s,o,n),l=Je(o,t,n),c=Je(r,a,n),u=Je(a,l,n);return Je(c,u,n)}function kn(e,t,n){return e?sx(t,n):ox()}function rr(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 ar(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function gf(e){return e==="angle"?{between:Uo,compare:nf,normalize:qt}:{between:Yn,compare:(t,n)=>t-n,normalize:t=>t}}function Yd({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function rx(e,t,n){let{property:i,start:s,end:o}=n,{between:r,normalize:a}=gf(i),l=t.length,{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function kl(e,t,n){if(!n)return[e];let{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=gf(i),{start:u,end:d,loop:f,style:p}=rx(e,t,n),b=[],x=!1,y=null,w,_,S,T=()=>l(s,S,w)&&a(s,S)!==0,E=()=>a(o,w)===0||l(o,S,w),P=()=>x||T(),O=()=>!x||E();for(let A=u,N=u;A<=d;++A)_=t[A%r],!_.skip&&(w=c(_[i]),w!==S&&(x=l(w,s,o),y===null&&P()&&(y=a(w,s)===0?A:N),y!==null&&O()&&(b.push(Yd({start:y,end:A,loop:f,count:r,style:p})),y=null),N=A,S=w));return y!==null&&b.push(Yd({start:y,end:d,loop:f,count:r,style:p})),b}function Sl(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let o=kl(i[s],e.points,t);o.length&&n.push(...o)}return n}function ax(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function lx(e,t,n,i){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function El(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=ax(n,s,o,i);if(i===!0)return Kd(e,[{start:r,end:a,loop:o}],n,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Kd(e,lx(n,r,l,c),n,t)}function Kd(e,t,n,i){return!i||!i.setContext||!n?t:cx(e,t,n,i)}function cx(e,t,n,i){let s=e._chart.getContext(),o=Xd(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[],u=o,d=t[0].start,f=d;function p(b,x,y,w){let _=a?-1:1;if(b!==x){for(b+=l;n[b%l].skip;)b-=_;for(;n[x%l].skip;)x+=_;b%l!==x%l&&(c.push({start:b%l,end:x%l,loop:y,style:w}),u=w,d=x%l)}}for(let b of t){d=a?d:b.start;let x=n[d%l],y;for(f=d+1;f<=b.end;f++){let w=n[f%l];y=Xd(i.setContext(Re(s,{type:"segment",p0:x,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),ux(y,u)&&p(d,f-1,b.loop,u),x=w,u=y}d<f-1&&p(d,f-1,b.loop,u)}return c}function Xd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function ux(e,t){if(!t)return!1;let n=[],i=function(s,o){return qo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Vo(e,t,n){return e.options.clip?e[n]:t[n]}function dx(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:Vo(n,t,"left"),right:Vo(n,t,"right"),top:Vo(i,t,"top"),bottom:Vo(i,t,"bottom")}:t}function Ml(e,t){let n=t._clip;if(n.disabled)return!1;let i=dx(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}var qa,Za,Bd,ki,Pe,Bo,ft,Bt,tf,ps,ef,At,bn,Ka,De,me,Qe,il,sf,Yo,Xo,Rt,ll,Lo,Wd,jd,Wn,Cb,Pb,$d,of,vs,vn,Jo,Xa,it,Vb,Fb,Hb,Bb,ml,Ub,qb,vi,df,ir,tx,ex,xn,vl,sx,ox,Tl=M(()=>{Hd();qa=(()=>{let e=0;return()=>e++})();Za=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;Bd={"":e=>e,x:e=>e.x,y:e=>e.y};ki=e=>typeof e<"u",Pe=e=>typeof e=="function",Bo=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};ft=Math.PI,Bt=2*ft,tf=Bt+ft,ps=Number.POSITIVE_INFINITY,ef=ft/180,At=ft/2,bn=ft/4,Ka=ft*2/3,De=Math.log10,me=Math.sign;Qe=(e,t,n,i)=>xs(e,n,i?s=>{let o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),il=(e,t,n)=>xs(e,n,i=>e[i][t]>=n);sf=["push","pop","shift","splice","unshift"];Yo=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Xo=e=>e==="start"?"left":e==="end"?"right":"center",Rt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ll=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;Lo=e=>e===0||e===1,Wd=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Bt/n)),jd=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Bt/n)+1,Wn={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*At)+1,easeOutSine:e=>Math.sin(e*At),easeInOutSine:e=>-.5*(Math.cos(ft*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=>Lo(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=>Lo(e)?e:Wd(e,.075,.3),easeOutElastic:e=>Lo(e)?e:jd(e,.075,.3),easeInOutElastic(e){return Lo(e)?e:e<.5?.5*Wd(e*2,.1125,.45):.5+.5*jd(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-Wn.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?Wn.easeInBounce(e*2)*.5:Wn.easeOutBounce(e*2-1)*.5+.5};Cb=["x","y","borderWidth","radius","tension"],Pb=["color","borderColor","backgroundColor"];$d=new Map;of={values(e){return et(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,o=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Rb(e,n)}let r=De(Math.abs(o)),a=isNaN(r)?1: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),ys(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(De(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?of.numeric.call(this,e,t,n):""}};vs={formatters:of};vn=Object.create(null),Jo=Object.create(null);Xa=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.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)=>Fo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Fo(s.borderColor),this.hoverColor=(i,s)=>Fo(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 Ya(this,t,n)}get(t){return fs(this,t)}describe(t,n){return Ya(Jo,t,n)}override(t,n){return Ya(vn,t,n)}route(t,n,i,s){let o=fs(this,t),r=fs(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},it=new Xa({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Db,Ab,Ib]);Vb=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Fb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;Hb=e=>+e||0;Bb=(e,t)=>e?e+ms(t):t,ml=(e,t)=>Y(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);Ub=(e,t)=>e===!0?t:typeof e=="string"?_i(t,e):void 0;qb=Number.EPSILON||1e-14,vi=(e,t)=>t<e.length&&!e[t].skip&&e[t],df=e=>e==="x"?"y":"x";ir=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);tx=["top","right","bottom","left"];ex=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);xn=e=>Math.round(e*10)/10;vl=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Es()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();sx=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}}},ox=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function gx(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function mx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function bf(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function bx(e,t,n){if(n===!1)return!1;let i=bf(e,n),s=bf(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function xx(e){let t,n,i,s;return Y(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function sh(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function xf(e,t,n,i={}){let s=e.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],ht(c)&&(o||t===0||me(t)===me(c))&&(t+=c)}return!u&&!i.all?0:t}function yx(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function Cl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function vx(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function wx(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function _x(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function yf(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function vf(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=vx(o,r,i),d=t.length,f;for(let p=0;p<d;++p){let b=t[p],{[l]:x,[c]:y}=b,w=b._stacks||(b._stacks={});f=w[c]=_x(s,u,x),f[a]=y,f._top=yf(f,r,!0,i.type),f._bottom=yf(f,r,!1,i.type);let _=f._visualValues||(f._visualValues={});_[a]=y}}function Pl(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function kx(e,t){return Re(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Sx(e,t,n){return Re(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ts(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let 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]}}}function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Tx(e,t,n,i){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?il:Qe;if(i){if(s._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{let u=c(o,t,n);if(l){let{vScale:d}=s._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(x=>!X(x[d.axis]));u.lo-=Math.max(0,p);let b=f.slice(u.hi).findIndex(x=>!X(x[d.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:o.length-1}}function zs(e,t,n,i,s){let o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:d,hi:f}=Tx(o[a],t,r,s);for(let p=d;p<=f;++p){let b=u[p];b.skip||i(b,c,p)}}}function Cx(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Al(e,t,n,i,s){let o=[];return!s&&!e.isPointInArea(t)||zs(e,n,t,function(a,l,c){!s&&!Zt(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Px(e,t,n,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:d}=el(r,{x:t.x,y:t.y});Uo(d,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return zs(e,n,t,o),s}function Dx(e,t,n,i,s,o){let r=[],a=Cx(n),l=Number.POSITIVE_INFINITY;function c(u,d,f){let p=u.inRange(t.x,t.y,s);if(i&&!p)return;let b=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(b))&&!p)return;let y=a(t,b);y<l?(r=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&r.push({element:u,datasetIndex:d,index:f})}return zs(e,n,t,c),r}function Ol(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Px(e,t,n,s):Dx(e,t,n,i,s,o)}function _f(e,t,n,i,s){let o=[],r=n==="x"?"inXRange":"inYRange",a=!1;return zs(e,n,t,(l,c,u)=>{l[r]&&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}function Cs(e,t){return e.filter(n=>n.pos===t)}function kf(e,t){return e.filter(n=>oh.indexOf(n.pos)===-1&&n.box.axis===t)}function Ps(e,t){return e.sort((n,i)=>{let s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ox(e){let t=[],n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Rx(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:o}=n;if(!i||!oh.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Ix(e,t){let n=Rx(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Nx(e){let t=Ox(e),n=Ps(t.filter(c=>c.box.fullSize),!0),i=Ps(Cs(t,"left"),!0),s=Ps(Cs(t,"right")),o=Ps(Cs(t,"top"),!0),r=Ps(Cs(t,"bottom")),a=kf(t,"x"),l=kf(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Cs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Sf(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function rh(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 Lx(e,t,n,i){let{pos:s,box:o}=n,r=e.maxPadding;if(!Y(s)){n.size&&(e[s]-=n.size);let d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&rh(r,o.getPadding());let a=Math.max(0,t.outerWidth-Sf(r,e,"left","right")),l=Math.max(0,t.outerHeight-Sf(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 zx(e){let t=e.maxPadding;function n(i){let 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 Vx(e,t){let n=t.maxPadding;function i(s){let 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 Os(e,t,n,i){let s=[],o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Vx(a.horizontal,t));let{same:d,other:f}=Lx(t,n,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&Os(s,t,n,i)||u}function lr(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function Ef(e,t,n,i){let s=n.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*u,f=c.size||l.height;ki(c.start)&&(r=c.start),l.fullSize?lr(l,s.left,r,n.outerWidth-s.right-s.left,f):lr(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*u,f=c.size||l.width;ki(c.start)&&(o=c.start),l.fullSize?lr(l,o,s.top,f,n.outerHeight-s.bottom-s.top):lr(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}function Hx(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[gr]={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",Mf(s)){let o=or(e,"width");o!==void 0&&(e.width=o)}if(Mf(i))if(e.style.height==="")e.height=e.width/(t||2);else{let o=or(e,"height");o!==void 0&&(e.height=o)}return e}function Bx(e,t,n){e&&e.addEventListener(t,n,ah)}function Wx(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ah)}function jx(e,t){let n=Fx[e.type]||e.type,{x:i,y:s}=Jt(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function yr(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function $x(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||yr(a.addedNodes,i),r=r&&!yr(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ux(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||yr(a.removedNodes,i),r=r&&!yr(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function lh(){let e=window.devicePixelRatio;e!==Tf&&(Tf=e,Ns.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Gx(e,t){Ns.size||window.addEventListener("resize",lh),Ns.set(e,t)}function Yx(e){Ns.delete(e),Ns.size||window.removeEventListener("resize",lh)}function Kx(e,t,n){let i=e.canvas,s=i&&Ms(i);if(!s)return;let o=Ko((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Gx(e,o),r}function Rl(e,t,n){n&&n.disconnect(),t==="resize"&&Yx(e)}function Xx(e,t,n){let i=e.canvas,s=Ko(o=>{e.ctx!==null&&n(jx(o,e))},e);return Bx(i,t,s),s}function qx(e){return!Es()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?zl:Vl}function Zx(e,t){let n=e.options.ticks,i=Jx(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?t0(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return e0(t,c,o,r/s),c;let u=Qx(o,t,s);if(r>0){let d,f,p=r>1?Math.round((l-a)/(r-1)):null;for(cr(t,c,u,X(p)?0:a-p,a),d=0,f=r-1;d<f;d++)cr(t,c,u,o[d],o[d+1]);return cr(t,c,u,l,X(p)?t.length:l+p),c}return cr(t,c,u),c}function Jx(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Qx(e,t,n){let i=n0(e),s=t.length/n;if(!i)return Math.max(s,1);let o=Qa(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function t0(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function e0(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function cr(e,t,n,i,s){let o=W(i,0),r=Math.min(W(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function n0(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}function Df(e,t){let n=[],i=e.length/t,s=e.length,o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function s0(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function o0(e,t){$(e,n=>{let i=n.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ds(e){return e.drawTicks?e.tickLength:0}function Af(e,t){if(!e.display)return 0;let n=gt(e.font,t),i=kt(e.padding);return(et(e.text)?e.text.length:1)*n.lineHeight+i.height}function r0(e,t){return Re(e,{scale:t,type:"scale"})}function a0(e,t,n){return Re(e,{tick:n,index:t,type:"tick"})}function l0(e,t,n){let i=Xo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=i0(i)),i}function c0(e,t,n,i){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l,d=0,f,p,b,x=r-s,y=a-o;if(e.isHorizontal()){if(p=Rt(i,o,a),Y(n)){let w=Object.keys(n)[0],_=n[w];b=u[w].getPixelForValue(_)+x-t}else n==="center"?b=(c.bottom+c.top)/2+x-t:b=Cf(e,n,t);f=a-o}else{if(Y(n)){let w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Cf(e,n,t);b=Rt(i,r,s),d=n==="left"?-At:At}return{titleX:p,titleY:b,maxWidth:f,rotation:d}}function u0(e,t,n){let i=$n(Object.create(null),[n?it.get(n):{},it.get(t),e.defaults]);it.set(t,i),e.defaultRoutes&&d0(t,e.defaultRoutes),e.descriptors&&it.describe(t,e.descriptors)}function d0(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");it.route(o,s,l,a)})}function f0(e){return"id"in e&&"defaults"in e}function h0(e){let t={},n=[],i=Object.keys(Ne.plugins.items);for(let o=0;o<i.length;o++)n.push(Ne.getPlugin(i[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function p0(e,t){return!t&&e===!1?null:e===!0?{}:e}function g0(e,{plugins:t,localIds:n},i,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=p0(i[l],s);c!==null&&o.push({plugin:a,options:m0(e.config,{plugin:a,local:n[l]},c,r)})}return o}function m0(e,{plugin:t,local:n},i,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Bl(e,t){let n=it.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function b0(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function x0(e,t){return e===t?"_index_":"_value_"}function Of(e){if(e==="x"||e==="y"||e==="r")return e}function y0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Wl(e,...t){if(Of(e))return e;for(let n of t){let i=n.axis||y0(n.position)||e.length>1&&Of(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Rf(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function v0(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Rf(e,"x",n[0])||Rf(e,"y",n[0])}return{}}function w0(e,t){let n=vn[e.type]||{scales:{}},i=t.scales||{},s=Bl(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!Y(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);let l=Wl(r,a,v0(r,e),it.scales[a.type]),c=x0(l,s),u=n.scales||{};o[r]=Un(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Bl(a,t),u=(vn[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=b0(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Un(o[p],[{axis:f},i[p],u[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Un(a,[it.scales[a.type],it.scale])}),o}function ch(e){let t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=w0(e,t)}function uh(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function _0(e){return e=e||{},e.data=uh(e.data),ch(e),e}function ur(e,t){let n=If.get(e);return n||(n=t(),If.set(e,n),dh.add(n)),n}function Nf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),o=i.get(s);return o||(o={resolver:Ss(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}function S0(e,t){let{isScriptable:n,isIndexable:i}=nr(e);for(let s of t){let o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Pe(a)||k0(a))||r&&et(a))return!0}return!1}function Lf(e,t){return e==="top"||e==="bottom"||M0.indexOf(e)===-1&&t==="x"}function zf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Vf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),z(n&&n.onComplete,[e],t)}function T0(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function fh(e){return Es()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function C0(e,t,n){let i=Object.keys(e);for(let s of i){let o=+s;if(o>=t){let r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function P0(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Hf(){return $(ae.instances,e=>e._plugins.invalidate())}function hh(e,t,n=t){e.lineCap=W(n.borderCapStyle,t.borderCapStyle),e.setLineDash(W(n.borderDash,t.borderDash)),e.lineDashOffset=W(n.borderDashOffset,t.borderDashOffset),e.lineJoin=W(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(n.borderWidth,t.borderWidth),e.strokeStyle=W(n.borderColor,t.borderColor)}function D0(e,t,n){e.lineTo(n.x,n.y)}function A0(e){return e.stepped?fl:e.tension||e.cubicInterpolationMode==="monotone"?hl:D0}function ph(e,t,n={}){let i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function O0(e,t,n,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ph(s,n,i),u=A0(o),{move:d=!0,reverse:f}=i||{},p,b,x;for(p=0;p<=c;++p)b=s[(a+(f?c-p:p))%r],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,x,b,f,o.stepped),x=b);return l&&(b=s[(a+(f?c:0))%r],u(e,x,b,f,o.stepped)),!!l}function R0(e,t,n,i){let s=t.points,{count:o,start:r,ilen:a}=ph(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,d=0,f,p,b,x,y,w,_=T=>(r+(c?a-T:T))%o,S=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(p=s[_(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=s[_(f)],p.skip)continue;let T=p.x,E=p.y,P=T|0;P===b?(E<x?x=E:E>y&&(y=E),u=(d*u+T)/++d):(S(),e.lineTo(T,E),b=P,d=0,x=y=E),w=E}S()}function $l(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?R0:O0}function I0(e){return e.stepped?wl:e.tension||e.cubicInterpolationMode==="monotone"?_l:Je}function N0(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),hh(e,t.options),e.stroke(s)}function L0(e,t,n,i){let{segments:s,options:o}=t,r=$l(t);for(let a of s)hh(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}function V0(e,t,n,i){z0&&!t.options.segment?N0(e,t,n,i):L0(e,t,n,i)}function Bf(e,t,n,i){let s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}function H0(e,t,n,i,s){let o=B0(i,e,t,n),r=W0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function B0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function W0(e,t,n){let i=e;return typeof t.text!="string"&&(i=gh(t,n)),i}function gh(e,t){let n=e.text?e.text.length:0;return t*n}function j0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function Ie(e,t){return t&&(et(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function nn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
|
|
5417
5417
|
\`)>-1?e.split(\`
|
|
5418
|
-
\`):e}function j0(e,t){let{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 Bf(e,t){let n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=gt(t.bodyFont),c=gt(t.titleFont),u=gt(t.footerFont),d=o.length,f=s.length,p=i.length,b=kt(t.padding),x=b.height,y=0,w=i.reduce((T,E)=>T+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){let T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*T+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0,S=function(T){y=Math.max(y,n.measureText(T).width+_)};return n.save(),n.font=c.string,$(e.title,S),n.font=l.string,$(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?r+2+t.boxPadding:0,$(i,T=>{$(T.before,S),$(T.lines,S),$(T.after,S)}),_=0,n.font=u.string,$(e.footer,S),n.restore(),y+=b.width,{width:y,height:x}}function $0(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function U0(e,t,n,i){let{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 G0(e,t,n,i){let{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),U0(c,e,t,n)&&(c="center"),c}function Wf(e,t,n){let i=n.yAlign||t.yAlign||$0(e,n);return{xAlign:n.xAlign||t.xAlign||G0(e,t,n,i),yAlign:i}}function Y0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function K0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function jf(e,t,n,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=kn(r),b=Y0(t,a),x=K0(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,f)+s:a==="right"&&(b+=Math.max(d,p)+s),{x:Bt(b,0,i.width-t.width),y:Bt(x,0,i.height-t.height)}}function ur(e,t,n){let 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 $f(e){return Ie([],nn(e))}function X0(e,t,n){return Re(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Uf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}function Wt(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?gh[t].call(n,i):s}function Z0(e,t,n,i){let s=e.indexOf(t);if(s===-1)return q0(e,t,n,i);let o=e.lastIndexOf(t);return s!==o?n:s}function Gf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function Q0(e,t){let n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,b=u-1,{min:x,max:y}=t,w=!X(r),_=!X(a),S=!X(c),T=(y-x)/(d+1),E=Bo((y-x)/b/p)*p,D,O,A,N;if(E<1e-14&&!w&&!_)return[{value:x},{value:y}];N=Math.ceil(y/E)-Math.floor(x/E),N>b&&(E=Bo(N*E/b/p)*p),X(l)||(D=Math.pow(10,l),E=Math.ceil(E*D)/D),s==="ticks"?(O=Math.floor(x/E)*E,A=Math.ceil(y/E)*E):(O=x,A=y),w&&_&&o&&Za((a-r)/o,E/1e3)?(N=Math.round(Math.min((a-r)/E,u)),E=(a-r)/N,O=r,A=a):S?(O=w?r:O,A=_?a:A,N=c-1,E=(A-O)/N):(N=(A-O)/E,Ae(N,Math.round(N),E/1e3)?N=Math.round(N):N=Math.ceil(N));let j=Math.max(jo(E),jo(O));D=Math.pow(10,X(l)?j:l),O=Math.round(O*D)/D,A=Math.round(A*D)/D;let H=0;for(w&&(f&&O!==r?(n.push({value:r}),O<r&&H++,Ae(Math.round((O+H*E)*D)/D,r,Yf(r,T,e))&&H++):O<r&&H++);H<N;++H){let G=Math.round((O+H*E)*D)/D;if(_&&G>a)break;n.push({value:G})}return _&&f&&A!==a?n.length&&Ae(n[n.length-1].value,a,Yf(a,T,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function Yf(e,t,{horizontal:n,minRotation:i}){let s=Oe(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function Kf(e){return e/Math.pow(10,Ns(e))===1}function Xf(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function ty(e,t){let n=t-e,i=Ns(n);for(;Xf(e,t,i)>10;)i++;for(;Xf(e,t,i)<10;)i--;return Math.min(i,Ns(e))}function ey(e,{min:t,max:n}){t=At(e.min,t);let i=[],s=Ns(t),o=ty(t,n),r=o<0?Math.pow(10,Math.abs(o)):1,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,d=Math.floor((c-u)/Math.pow(10,o)),f=At(e.min,Math.round((l+u+d*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:Kf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+u+d*Math.pow(10,o))*r)/r;let p=At(e.max,f);return i.push({value:p,major:Kf(p),significand:d}),i}function Wl(e){let t=e.ticks;if(t.display&&e.display){let n=kt(t.backdropPadding);return W(t.font&&t.font.size,it.font.size)+n.height}return 0}function ny(e,t,n){return n=et(n)?n:[n],{w:ll(e,t.string,n),h:n.length*t.lineHeight}}function qf(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function iy(e){let 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?ft/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),d=gt(c.font),f=ny(e.ctx,d,e._pointLabels[l]);i[l]=f;let p=Xt(e.getIndexAngle(l)+a),b=Math.round(ms(p)),x=qf(b,u.x,f.w,0,180),y=qf(b,u.y,f.h,90,270);sy(n,t,p,x,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ay(e,i,s)}function sy(e,t,n,i,s){let o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function oy(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(ms(Xt(l.angle+Dt))),u=uy(l.y,a.h,c),d=ly(c),f=cy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ry(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:o}=e;return!(qt({x:n,y:i},t)||qt({x:n,y:o},t)||qt({x:s,y:i},t)||qt({x:s,y:o},t))}function ay(e,t,n){let i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Wl(o)/2,additionalAngle:r?ft/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let d=oy(e,u,l);i.push(d),a==="auto"&&(d.visible=ry(d,c),d.visible&&(c=d))}return i}function ly(e){return e===0||e===180?"center":e<180?"left":"right"}function cy(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function uy(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function dy(e,t,n){let{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!X(a)){let l=kn(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=a;let u=i-c.left,d=s-c.top,f=o-i+c.width,p=r-s+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),ki(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function fy(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(e.getPointLabelContext(s));dy(n,r,o);let a=gt(r.font),{x:l,y:c,textAlign:u}=o;_n(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function bh(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Ht);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function hy(e,t,n,i,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),bh(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function py(e,t,n){return Re(e,{label:n,index:t,type:"pointLabel"})}function Zf(e,t){return e-t}function Jf(e,t){if(X(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),ht(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function Qf(e,t,n,i){let s=jt.length;for(let o=jt.indexOf(e);o<s-1;++o){let r=vr[jt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return jt[o]}return jt[s-1]}function gy(e,t,n,i,s){for(let o=jt.length-1;o>=jt.indexOf(n);o--){let r=jt[o];if(vr[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return jt[n?jt.indexOf(n):0]}function my(e){for(let t=jt.indexOf(e)+1,n=jt.length;t<n;++t)if(vr[jt[t]].common)return jt[t]}function th(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=bs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function by(e,t,n,i){let s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,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 eh(e,t,n){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:by(e,i,s,n)}function fr(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Qe(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}=Qe(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Al,en,pf,hx,Ol,mr,Tl,yf,Sx,qn,Zn,Rl,Ex,Dx,ih,Mn,br,Il,pr,Vx,Sf,oh,Is,Ef,Nl,Le,n0,Mf,Tf,Qn,Mi,Ll,Ne,zl,Of,ch,Ds,Hl,_0,S0,E0,gr,zf,re,L0,En,Jn,Hf,V0,yr,ph,Os,gh,Rs,mh,q0,J0,Ti,Di,Ci,Ns,Xn,dr,Ei,vr,jt,Pi,hr,xh=M(()=>{Sl();Al=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let 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=Go.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;let o=i.items,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){let n=this._charts,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){let 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;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,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)}},en=new Al,pf="transparent",hx={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=qo(e||pf),s=i.valid&&qo(t||pf);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Ol=class{constructor(t,n,i,s){let o=n[i];s=Si([t.to,s,o,t.from]);let r=Si([t.from,o,s]);this._active=!0,this._fn=t.fn||hx[t.type||typeof r],this._easing=Wn[t.easing]||Wn.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);let 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=Si([t.to,n,s,t.from]),this._from=Si([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},mr=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Y(t))return;let n=Object.keys(it.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!Y(o))return;let r={};for(let a of n)r[a]=o[a];(et(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){let i=n.options,s=gx(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&px(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],d=o[c],f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Ol(f,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return en.add(this._chart,i),!0}};Tl=e=>e==="reset"||e==="none",yf=(e,t)=>t?e:Object.assign({},e),Sx=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:nh(n,!0),values:null},qn=class{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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=El(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&&Ms(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,f,p,b)=>d==="x"?f:d==="r"?b:p,o=n.xAxisID=W(i.xAxisID,Ml(t,"x")),r=n.yAxisID=W(i.yAxisID,Ml(t,"y")),a=n.rAxisID=W(i.rAxisID,Ml(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){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Uo(this._data,this),t._stacked&&Ms(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Y(n)){let s=this._cachedMeta;this._data=xx(n,s)}else if(i!==n){if(i){Uo(i,this);let s=this._cachedMeta;Ms(s),s._parsed=[]}n&&Object.isExtensible(n)&&nl(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=El(n.vScale,n),n.stack!==i.stack&&(s=!0,Ms(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(xf(this,n._parsed),n._stacked=El(n.vScale,n))}configure(){let 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){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{et(s[t])?f=this.parseArrayData(i,s,t,n):Y(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);let p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&xf(this,f)}parsePrimitiveData(t,n,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,d=new Array(s),f,p,b;for(f=0,p=s;f<p;++f)b=f+i,d[f]={[a]:u||o.parse(c[b],b),[l]:r.parse(n[b],b)};return d}parseArrayData(t,n,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=n[u],a[l]={x:o.parse(d[0],u),y:r.parse(d[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,d,f,p;for(u=0,d=s;u<d;++u)f=u+i,p=n[f],c[u]={x:o.parse(wi(p,a),f),y:r.parse(wi(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:nh(s,!0),values:n._stacks[t.axis]._visualValues};return mf(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let o=i[n.axis],r=o===null?NaN:o,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=mf(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Sx(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vx(a),f,p;function b(){p=s[f];let x=p[a.axis];return!ht(p[t.axis])||u>x||d<x}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],ht(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=bx(W(this.options.clip,mx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let d=s[u];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=kx(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=_x(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&_i(i);if(a)return yf(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(it.elements[t]),b=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(f,p,b,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(yf(x,l))),x}_resolveAnimations(t,n,i){let s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,n))}let c=new mr(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||Tl(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let 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){Tl(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Tl(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let 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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let 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<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){let s=this._cachedMeta,o=s.data,r=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&Ms(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(qn,"defaults",{}),F(qn,"datasetElementType",null),F(qn,"dataElementType",null);Zn=class extends qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled,{start:a,count:l}=rl(n,s,r);this._drawStart=a,this._drawCount=l,al(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,y=Gn(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",_=n+i,S=t.length,T=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){let D=t[E],O=w?D:{};if(E<n||E>=_){O.skip=!0;continue}let A=this.getParsed(E),N=X(A[p]),j=O[f]=r.getPixelForValue(A[f],E),H=O[p]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],E);O.skip=isNaN(j)||isNaN(H)||N,O.stop=E>0&&Math.abs(A[f]-T[f])>y,x&&(O.parsed=A,O.raw=c.data[E]),d&&(O.options=u||this.resolveDataElementOptions(E,D.active?"active":s)),w||this.updateElement(D,E,O,s),T=A}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(Zn,"id","line"),F(Zn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Zn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});Rl=class e{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}},Ex={_date:Rl};Dx={evaluateInteractionItems:Ls,modes:{index(e,t,n,i){let s=Zt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Cl(e,s,o,i,r):Pl(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1,a=n.intersect?Cl(e,s,o,i,r):Pl(e,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Cl(e,s,o,i,r)},nearest(e,t,n,i){let s=Zt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Pl(e,s,o,n.intersect,i,r)},x(e,t,n,i){let s=Zt(t,e);return vf(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=Zt(t,e);return vf(e,s,"y",n.intersect,i)}}},ih=["left","top","right","bottom"];Mn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=kt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Ix(e.boxes),l=a.vertical,c=a.horizontal;$(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});let u=l.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);sh(f,kt(i));let p=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),b=Rx(l.concat(c),d);As(a.fullSize,p,d,b),As(l,p,d,b),As(c,p,d,b)&&As(l,p,d,b),Lx(p),kf(a.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,kf(a.rightAndBottom,p,d,b),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$(a.chartArea,x=>{let y=x.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},br=class{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){}},Il=class extends br{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},pr="$chartjs",Vx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sf=e=>e===null||e==="";oh=bl?{passive:!0}:!1;Is=new Map,Ef=0;Nl=class extends br{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Fx(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[pr])return!1;let i=n[pr].initial;["height","width"].forEach(o=>{let r=i[o];X(r)?n.removeAttribute(o):n.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[pr],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),r={attach:jx,detach:$x,resize:Yx}[n]||Kx;s[n]=r(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Dl,detach:Dl,resize:Dl}[n]||Bx)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return ml(t,n,i,s)}isAttached(t){let n=t&&Es(t);return!!(n&&n.isConnected)}};Le=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Gn(this.x)&&Gn(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};F(Le,"defaults",{}),F(Le,"defaultRoutes");n0=e=>e==="left"?"right":e==="right"?"left":e,Mf=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Tf=(e,t)=>Math.min(t||e,e);Qn=class e extends Le{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=At(t,Number.POSITIVE_INFINITY),n=At(n,Number.NEGATIVE_INFINITY),i=At(i,Number.POSITIVE_INFINITY),s=At(s,Number.NEGATIVE_INFINITY),{min:At(t,i),max:At(n,s),minDefined:ht(t),maxDefined:ht(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:At(n,At(i,n)),max:At(i,At(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(){let 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(){z(this.options.beforeUpdate,[this])}update(t,n,i){let{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=fl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Cf(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qx(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Tf(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation,r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Bt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),d+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-Ps(t.grid)-n.padding-Pf(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ms(Math.min(Math.asin(Bt((u.highest.height+6)/a,-1,1)),Math.asin(Bt(l/c,-1,1))-Math.asin(Bt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Pf(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ps(o)+l):(t.height=this.maxHeight,t.width=Ps(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,b=Oe(this.labelRotation),x=Math.cos(b),y=Math.sin(b);if(a){let w=i.mirror?0:y*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{let w=i.mirror?0:x*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,y,x)}}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){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;l?c?(f=s*t.width,p=i*n.height):(f=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+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(){z(this.options.afterFit,[this])}isHorizontal(){let{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<i;n++)X(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=Cf(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Tf(n,i)),c=0,u=0,d,f,p,b,x,y,w,_,S,T,E;for(d=0;d<n;d+=l){if(b=t[d].label,x=this._resolveTickFontOptions(d),s.font=y=x.string,w=o[y]=o[y]||{data:{},gc:[]},_=x.lineHeight,S=T=0,!X(b)&&!et(b))S=xi(s,w.data,w.gc,S,b),T=_;else if(et(b))for(f=0,p=b.length;f<p;++f)E=b[f],!X(E)&&!et(E)&&(S=xi(s,w.data,w.gc,S,E),T+=_);r.push(S),a.push(T),c=Math.max(S,c),u=Math.max(T,u)}s0(o,n);let D=r.indexOf(c),O=a.indexOf(u),A=N=>({width:r[N]||0,height:a[N]||0});return{first:A(0),last:A(n-1),widest:A(D),highest:A(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return Qa(this._alignToPixels?tn(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=r0(this.getContext(),t,i))}return this.$context||(this.$context=o0(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Oe(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ps(o),p=[],b=a.setContext(this.getContext()),x=b.display?b.width:0,y=x/2,w=function(tt){return tn(i,tt,x)},_,S,T,E,D,O,A,N,j,H,G,ot;if(r==="top")_=w(this.bottom),O=this.bottom-f,N=_-y,H=w(t.top)+y,ot=t.bottom;else if(r==="bottom")_=w(this.top),H=t.top,ot=w(t.bottom)-y,O=_+y,N=this.top+f;else if(r==="left")_=w(this.right),D=this.right-f,A=_-y,j=w(t.left)+y,G=t.right;else if(r==="right")_=w(this.left),j=t.left,G=w(t.right)-y,D=_+y,A=this.left+f;else if(n==="x"){if(r==="center")_=w((t.top+t.bottom)/2+.5);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}H=t.top,ot=t.bottom,O=_+y,N=O+f}else if(n==="y"){if(r==="center")_=w((t.left+t.right)/2);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}D=_-y,A=D-f,j=t.left,G=t.right}let Ct=W(s.ticks.maxTicksLimit,d),Q=Math.max(1,Math.ceil(d/Ct));for(S=0;S<d;S+=Q){let tt=this.getContext(S),mt=o.setContext(tt),ce=a.setContext(tt),ni=mt.lineWidth,rn=mt.color,ve=ce.dash||[],an=ce.dashOffset,Ve=mt.tickWidth,Fe=mt.tickColor,Pn=mt.tickBorderDash||[],nt=mt.tickBorderDashOffset;T=i0(this,S,l),T!==void 0&&(E=tn(i,T,ni),c?D=A=j=G=E:O=N=H=ot=E,p.push({tx1:D,ty1:O,tx2:A,ty2:N,x1:j,y1:H,x2:G,y2:ot,width:ni,color:rn,borderDash:ve,borderDashOffset:an,tickWidth:Ve,tickColor:Fe,tickBorderDash:Pn,tickBorderDashOffset:nt}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Ps(i.grid),p=f+u,b=d?-u:p,x=-Oe(this.labelRotation),y=[],w,_,S,T,E,D,O,A,N,j,H,G,ot="middle";if(s==="top")D=this.bottom-b,O=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+b,O=this._getXAxisLabelAlignment();else if(s==="left"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(s==="right"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(n==="x"){if(s==="center")D=(t.top+t.bottom)/2+p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];D=this.chart.scales[Q].getPixelForValue(tt)+p}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")E=(t.left+t.right)/2-p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];E=this.chart.scales[Q].getPixelForValue(tt)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?ot="top":l==="end"&&(ot="bottom"));let Ct=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],T=S.label;let Q=o.setContext(this.getContext(w));A=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),j=N.lineHeight,H=et(T)?T.length:1;let tt=H/2,mt=Q.color,ce=Q.textStrokeColor,ni=Q.textStrokeWidth,rn=O;r?(E=A,O==="inner"&&(w===_-1?rn=this.options.reverse?"left":"right":w===0?rn=this.options.reverse?"right":"left":rn="center"),s==="top"?c==="near"||x!==0?G=-H*j+j/2:c==="center"?G=-Ct.highest.height/2-tt*j+j:G=-Ct.highest.height+j/2:c==="near"||x!==0?G=j/2:c==="center"?G=Ct.highest.height/2-tt*j:G=Ct.highest.height-H*j,d&&(G*=-1),x!==0&&!Q.showLabelBackdrop&&(E+=j/2*Math.sin(x))):(D=A,G=(1-H)*j/2);let ve;if(Q.showLabelBackdrop){let an=kt(Q.backdropPadding),Ve=Ct.heights[w],Fe=Ct.widths[w],Pn=G-an.top,nt=0-an.left;switch(ot){case"middle":Pn-=Ve/2;break;case"bottom":Pn-=Ve;break}switch(O){case"center":nt-=Fe/2;break;case"right":nt-=Fe;break;case"inner":w===_-1?nt-=Fe:w>0&&(nt-=Fe/2);break}ve={left:nt,top:Pn,width:Fe+an.width,height:Ve+an.height,color:Q.backdropColor}}y.push({label:T,font:N,textOffset:G,options:{rotation:x,color:mt,strokeColor:ce,strokeWidth:ni,textAlign:rn,textBaseline:ot,translation:[E,D],backdrop:ve}})}return y}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Oe(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,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<r;++o){let l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,d,f;this.isHorizontal()?(c=tn(t,this.left,r)-r/2,u=tn(t,this.right,a)+a/2,d=f=l):(d=tn(t,this.top,r)-r/2,f=tn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&ws(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;_n(i,c,0,u,l,a)}s&&_s(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let o=gt(i.font),r=kt(i.padding),a=i.align,l=o.lineHeight/2;n==="bottom"||n==="center"||Y(n)?(l+=r.bottom,et(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:d,rotation:f}=l0(this,l,n,a);_n(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:f,textAlign:a0(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),s=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw: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){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=n.length;o<r;++o){let a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return gt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Mi=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;d0(n)&&(i=this.register(n));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,c0(t,r,i),this.override&&it.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in it[s]&&(delete it[s][i],this.override&&delete wn[i])}};Ll=class{constructor(){this.controllers=new Mi(qn,"datasets",!0),this.elements=new Mi(Le,"elements"),this.plugins=new Mi(Object,"plugins"),this.scales=new Mi(Qn,"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=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):$(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){let s=gs(t);z(i["before"+s],[],i),n[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Ne=new Ll,zl=class{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[n,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){X(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=W(i.options&&i.options.plugins,{}),o=f0(i);return s===!1&&!n?[]:p0(t,o,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(o,r)=>o.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")}};Of=new Map,ch=new Set;Ds=(e,t,n)=>{let i=wi(t,n);i!==void 0&&e.add(i)},Hl=class{constructor(t){this._config=w0(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=lh(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),ah(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cr(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return cr(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return cr(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return cr(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ds(l,t,d))),u.forEach(d=>Ds(l,s,d)),u.forEach(d=>Ds(l,wn[o]||{},d)),u.forEach(d=>Ds(l,it,d)),u.forEach(d=>Ds(l,Zo,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ch.has(n)&&r.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,wn[n]||{},it.datasets[n]||{},{type:n},it,Zo]}resolveNamedOptions(t,n,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Rf(this._resolverCache,t,s),l=r;if(k0(r,n)){o.$shared=!1,i=Pe(i)?i():i;let c=this.createResolver(t,i,a);l=vn(r,i,c)}for(let c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){let{resolver:o}=Rf(this._resolverCache,t,i);return Y(n)?vn(o,n,void 0,s):o}};_0=e=>Y(e)&&Object.getOwnPropertyNames(e).some(t=>Pe(e[t]));S0="4.5.1",E0=["top","bottom","left","right","chartArea"];gr={},zf=e=>{let t=uh(e);return Object.values(gr).filter(n=>n.canvas===t).pop()};re=class{static register(...t){Ne.add(...t),Vf()}static unregister(...t){Ne.remove(...t),Vf()}constructor(t,n){let i=this.config=new Hl(n),s=uh(t),o=zf(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.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Xx(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ya(),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 zl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=sl(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],gr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Lf),en.listen(this,"progress",M0),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return X(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 Ne}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ir(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jo(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,n){en.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let 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,ir(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};$(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];n&&(o=o.concat(Object.keys(n).map(r=>{let a=n[r],l=Fl(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$(o,r=>{let a=r.options,l=a.id,c=Fl(l,a),u=W(a.type,r.dtype);(a.position===void 0||If(a.position,c)!==If(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{let f=Ne.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),$(s,(r,a)=>{r||delete i[a]}),$(i,r=>{Mn.configure(this,r,r.options),Mn.addBox(this,r)})}_updateMetasets(){let 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;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Nf("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let o=n[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Vl(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Ne.getController(a),{datasetElementType:c,dataElementType:u}=it.datasets[a];Object.assign(l,{dataElementType:Ne.getElement(u),datasetElementType:c&&Ne.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){$(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let 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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||$(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nf("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$(this.scales,t=>{Mn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ho(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of n){let r=i==="_removeElements"?-o:o;T0(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let 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;o<n;o++)if(!Ho(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Mn.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],$(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<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Pe(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Lf({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,o;for(s=0,o=n.length;s<o;++s){let r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=kl(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ws(n,s),t.controller.draw(),s&&_s(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let o=Dx.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,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=Re(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let 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){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);_i(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){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),en.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jo(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete gr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};$(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let 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)},r,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(){$(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!vi(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){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.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){let 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;let 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){let{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Xa(t),c=C0(t,this._lastEvent,i,l);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let u=!vi(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;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};F(re,"defaults",it),F(re,"instances",gr),F(re,"overrides",wn),F(re,"registry",Ne),F(re,"version",S0),F(re,"getChart",zf);L0=typeof Path2D=="function";En=class extends Le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;gl(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_l(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],o=this.points,r=wl(this,{property:n,start:s,end:s});if(!r.length)return;let a=[],l=R0(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:d,end:f}=r[c],p=o[d],b=o[f];if(p===b){a.push(p);continue}let x=Math.abs((s-p[n])/(b[n]-p[n])),y=l(p,b,x,i.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Bl(this)(t,this,n,i)}path(t,n,i){let s=this.segments,o=Bl(this),r=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),z0(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(En,"id","line"),F(En,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(En,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(En,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Jn=class extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Ff(this,n,"x",i)}inYRange(n,i){return Ff(this,n,"y",i)}getCenterPoint(n){let{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);let s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){let s=this.options;this.skip||s.radius<.1||!qt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,vs(n,s,this.x,this.y))}getRange(){let n=this.options||{};return n.radius+n.hitRadius}};F(Jn,"id","point"),F(Jn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Jn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Hf=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},V0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,yr=class extends Le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=z(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=gt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Hf(i,o),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((b,x)=>{let y=i+n/2+o.measureText(b.text).width;(x===0||c[c.length-1]+y+2*a>r)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(t,n,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,d=a,f=0,p=0,b=0,x=0;return this.legendItems.forEach((y,w)=>{let{itemWidth:_,itemHeight:S}=F0(i,n,o,y,s);w>0&&p+S+2*a>u&&(d+=f+a,c.push({width:f,height:p}),b+=f+a,x++,f=p=0),l[w]={left:b,top:p,col:x,width:_,height:S},f=Math.max(f,_),p+=S+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Sn(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ot(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=Ot(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=Ot(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=Ot(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;ws(t,this),this._draw(),_s(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=it.color,l=Sn(t.rtl,this.left,this.width),c=gt(r.font),{padding:u}=r,d=c.size,f=d/2,p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:b,boxHeight:x,itemHeight:y}=Hf(r,d),w=function(D,O,A){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();let N=W(A.lineWidth,1);if(s.fillStyle=W(A.fillStyle,a),s.lineCap=W(A.lineCap,"butt"),s.lineDashOffset=W(A.lineDashOffset,0),s.lineJoin=W(A.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=W(A.strokeStyle,a),s.setLineDash(W(A.lineDash,[])),r.usePointStyle){let j={radius:x*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:N},H=l.xPlus(D,b/2),G=O+f;Qo(s,j,H,G,r.pointStyleWidth&&b)}else{let j=O+Math.max((d-x)/2,0),H=l.leftForLtr(D,b),G=kn(A.borderRadius);s.beginPath(),Object.values(G).some(ot=>ot!==0)?ki(s,{x:H,y:j,w:b,h:x,radius:G}):s.rect(H,j,b,x),s.fill(),N!==0&&s.stroke()}s.restore()},_=function(D,O,A){_n(s,A.text,D,O+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},S=this.isHorizontal(),T=this._computeTitleHeight();S?p={x:Ot(o,this.left+u,this.right-i[0]),y:this.top+u+T,line:0}:p={x:this.left+u,y:Ot(o,this.top+T+u,this.bottom-n[0].height),line:0},or(this.ctx,t.textDirection);let E=y+u;this.legendItems.forEach((D,O)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;let A=s.measureText(D.text).width,N=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),j=b+f+A,H=p.x,G=p.y;l.setWidth(this.width),S?O>0&&H+j+u>this.right&&(G=p.y+=E,p.line++,H=p.x=Ot(o,this.left+u,this.right-i[p.line])):O>0&&G+E>this.bottom&&(H=p.x=H+n[p.line].width+u,p.line++,G=p.y=Ot(o,this.top+T+u,this.bottom-n[p.line].height));let ot=l.x(H);if(w(ot,G,D),H=ol(N,H+b+f,S?H+j:this.right,t.rtl),_(l.x(H),G,D),S)p.x+=j+u;else if(typeof D.text!="string"){let Ct=c.lineHeight;p.y+=hh(D,Ct)+u}else p.y+=E}),rr(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=gt(n.font),s=kt(n.padding);if(!n.display)return;let o=Sn(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Ot(t.align,d,this.right-f);else{let b=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=c+Ot(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let p=Ot(a,d,d+f);r.textAlign=o.textAlign(Ko(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,_n(r,n.text,p,u,i)}_computeTitleHeight(){let t=this.options.title,n=gt(t.font),i=kt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Yn(t,this.left,this.right)&&Yn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Yn(t,s.left,s.left+s.width)&&Yn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!W0(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=V0(s,i);s&&!o&&z(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&z(n.onHover,[t,i,this],this)}else i&&z(n.onClick,[t,i,this],this)}};ph={id:"legend",_element:yr,start(e,t,n){let i=e.legend=new yr({ctx:e.ctx,options:n,chart:e});Mn.configure(e,i,n),Mn.addBox(e,i)},stop(e){Mn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;Mn.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Os={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=ps(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};gh={beforeTitle:be,title(e){if(e.length>0){let 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<i)return n[t.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return X(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};Rs=class extends Le{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(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new mr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=X0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=Wt(i,"beforeTitle",this,t),o=Wt(i,"title",this,t),r=Wt(i,"afterTitle",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}getBeforeBody(t,n){return $f(Wt(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return $(t,o=>{let r={before:[],lines:[],after:[]},a=Uf(i,o);Ie(r.before,nn(Wt(a,"beforeLabel",this,o))),Ie(r.lines,Wt(a,"label",this,o)),Ie(r.after,nn(Wt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return $f(Wt(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=Wt(i,"beforeFooter",this,t),o=Wt(i,"footer",this,t),r=Wt(i,"afterFooter",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(j0(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),$(a,u=>{let d=Uf(t.callbacks,u);s.push(Wt(d,"labelColor",this,u)),o.push(Wt(d,"labelPointStyle",this,u)),r.push(Wt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Os[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);let l=this._size=Bf(this,i),c=Object.assign({},a,l),u=Wf(this.chart,i,c),d=jf(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.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){let 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){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=kn(a),{x:f,y:p}=t,{width:b,height:x}=n,y,w,_,S,T,E;return o==="center"?(T=p+x/2,s==="left"?(y=f,w=y-r,S=T+r,E=T-r):(y=f+b,w=y+r,S=T-r,E=T+r),_=y):(s==="left"?w=f+Math.max(l,u)+r:s==="right"?w=f+b-Math.max(c,d)-r:w=this.caretX,o==="top"?(S=p,T=S-r,y=w-r,_=w+r):(S=p+x,T=S+r,y=w+r,_=w-r),E=S),{x1:y,x2:w,x3:_,y1:S,y2:T,y3:E}}drawTitle(t,n,i){let s=this.title,o=s.length,r,a,l;if(o){let c=Sn(i.rtl,this.x,this.width);for(t.x=ur(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=gt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=gt(o.bodyFont),d=ur(this,"left",o),f=s.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(o.usePointStyle){let x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,w=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,vs(t,x,y,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,vs(t,x,y,w)}else{t.lineWidth=Y(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let x=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),w=kn(r.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ki(t,{x,y:b,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ki(t,{x:y,y:b+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,b,c,l),t.strokeRect(x,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(y,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=gt(i.bodyFont),f=d.lineHeight,p=0,b=Sn(i.rtl,this.x,this.width),x=function(A){n.fillText(A,b.x(t.x+p),t.y+f/2),t.y+=f+o},y=b.textAlign(r),w,_,S,T,E,D,O;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=ur(this,y,i),n.fillStyle=i.bodyColor,$(this.beforeBody,x),p=a&&y!=="right"?r==="center"?c/2+u:c+2+u:0,T=0,D=s.length;T<D;++T){for(w=s[T],_=this.labelTextColors[T],n.fillStyle=_,$(w.before,x),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,T,b,i),f=Math.max(d.lineHeight,l)),E=0,O=S.length;E<O;++E)x(S[E]),f=d.lineHeight;$(w.after,x)}p=0,f=d.lineHeight,$(this.afterBody,x),t.y-=o}drawFooter(t,n,i){let s=this.footer,o=s.length,r,a;if(o){let l=Sn(i.rtl,this.x,this.width);for(t.x=ur(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=gt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:b}=kn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Os[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=Bf(this,t),l=Object.assign({},r,this._size),c=Wf(n,t,l),u=jf(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){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let 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),or(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),rr(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!vi(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;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!vi(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){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){let{caretX:i,caretY:s,options:o}=this,r=Os[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}};F(Rs,"positioners",Os);mh={id:"tooltip",_element:Rs,positioners:Os,afterInit(e,t,n){n&&(e.tooltip=new Rs({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){let t=e.tooltip;if(t&&t._willRender()){let 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){let 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:gh},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"]},q0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);J0=(e,t)=>e===null?null:Bt(Math.round(e),0,t);Ti=class extends Qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(X(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:Z0(i,t,W(n,t),this._addedLabels),J0(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return Gf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(Ti,"id","category"),F(Ti,"defaults",{ticks:{callback:Gf}});Di=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){let l=me(s),c=me(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(){let t=this.options.ticks,{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(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let 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=Q0(s,o);return t.bounds==="ticks"&&Wo(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(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let 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 xs(t,this.chart.options.locale,this.options.ticks.format)}},Ci=class extends Di{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?t:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=Oe(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}};F(Ci,"id","linear"),F(Ci,"defaults",{ticks:{callback:ys.formatters.numeric}});Ns=e=>Math.floor(De(e)),Xn=(e,t)=>Math.pow(10,Ns(e)+t);dr=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Di.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ht(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?Math.max(0,t):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Xn(i,-1)),r(Xn(s,1)))),i<=0&&o(Xn(s,-1)),s<=0&&r(Xn(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=ey(n,this);return t.bounds==="ticks"&&Wo(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":xs(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=De(t),this._valueRange=De(this.max)-De(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(De(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(dr,"id","logarithmic"),F(dr,"defaults",{ticks:{callback:ys.formatters.logarithmic,major:{enabled:!0}}});Ei=class extends Di{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=kt(Wl(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=ht(t)&&!isNaN(t)?t:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wl(this.options))}generateTickLabels(t){Di.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=z(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?iy(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){let n=Ht/(this._pointLabels.length||1),i=this.options.startAngle||0;return Xt(t*n+Oe(i))}getDistanceFromCenterForValue(t){if(X(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(X(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return py(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-Dt+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),bh(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&fy(this,r),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),p=s.setContext(f),b=o.setContext(f);hy(this,p,l,r,b)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),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&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=gt(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;let d=kt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-u.size/2-d.top,r+d.width,u.size+d.height)}_n(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};F(Ei,"id","radialLinear"),F(Ei,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ys.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(Ei,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(Ei,"descriptors",{angleLines:{_fallback:"grid"}});vr={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}},jt=Object.keys(vr);Pi=class extends Qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Ex._date(t.adapters.date);s.init(n),Un(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Jf(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ht(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=ht(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=el(s,o,r);return this._unit=n.unit||(i.autoSkip?Qf(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):gy(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:my(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),eh(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+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);let r=t.length<3?.5:.25;n=Bt(n,0,r),i=Bt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Qf(o.minUnit,n,i,this._getLabelCapacity(n)),a=W(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Gn(l)||l===!0,u={},d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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);let b=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<i;f=+t.add(f,a,r),p++)th(u,f,b);return(f===i||s.bounds==="ticks"||p===1)&&th(u,f,b),Object.keys(u).sort(Zf).map(x=>+x)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,n,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[n],p=c&&d&&f&&f.major;return this._adapter.format(t,s||(p?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=Oe(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,eh(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(Jf(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return il(t.sort(Zf))}};F(Pi,"id","time"),F(Pi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});hr=class extends Pi{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=fr(n,this.min),this._tableRange=fr(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=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<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(fr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return fr(this._table,i*this._tableRange+this._minPos,!0)}};F(hr,"id","timeseries"),F(hr,"defaults",Pi.defaults)});var yh=Ig((pE,wr)=>{(function(e,t,n,i){"use strict";var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,l=Math.abs,c=Date.now;function u(h,g,v){return setTimeout(_(h,v),g)}function d(h,g,v){return Array.isArray(h)?(f(h,v[g],v),!0):!1}function f(h,g,v){var k;if(h)if(h.forEach)h.forEach(g,v);else if(h.length!==i)for(k=0;k<h.length;)g.call(v,h[k],k,h),k++;else for(k in h)h.hasOwnProperty(k)&&g.call(v,h[k],k,h)}function p(h,g,v){var k="DEPRECATED METHOD: "+g+\`
|
|
5418
|
+
\`):e}function $0(e,t){let{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 jf(e,t){let n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=gt(t.bodyFont),c=gt(t.titleFont),u=gt(t.footerFont),d=o.length,f=s.length,p=i.length,b=kt(t.padding),x=b.height,y=0,w=i.reduce((T,E)=>T+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){let T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*T+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0,S=function(T){y=Math.max(y,n.measureText(T).width+_)};return n.save(),n.font=c.string,$(e.title,S),n.font=l.string,$(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?r+2+t.boxPadding:0,$(i,T=>{$(T.before,S),$(T.lines,S),$(T.after,S)}),_=0,n.font=u.string,$(e.footer,S),n.restore(),y+=b.width,{width:y,height:x}}function U0(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function G0(e,t,n,i){let{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 Y0(e,t,n,i){let{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),G0(c,e,t,n)&&(c="center"),c}function $f(e,t,n){let i=n.yAlign||t.yAlign||U0(e,n);return{xAlign:n.xAlign||t.xAlign||Y0(e,t,n,i),yAlign:i}}function K0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function X0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Uf(e,t,n,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(r),b=K0(t,a),x=X0(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,f)+s:a==="right"&&(b+=Math.max(d,p)+s),{x:Wt(b,0,i.width-t.width),y:Wt(x,0,i.height-t.height)}}function dr(e,t,n){let 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 Gf(e){return Ie([],nn(e))}function q0(e,t,n){return Re(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}function jt(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?bh[t].call(n,i):s}function J0(e,t,n,i){let s=e.indexOf(t);if(s===-1)return Z0(e,t,n,i);let o=e.lastIndexOf(t);return s!==o?n:s}function Kf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function ty(e,t){let n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,b=u-1,{min:x,max:y}=t,w=!X(r),_=!X(a),S=!X(c),T=(y-x)/(d+1),E=Wo((y-x)/b/p)*p,P,O,A,N;if(E<1e-14&&!w&&!_)return[{value:x},{value:y}];N=Math.ceil(y/E)-Math.floor(x/E),N>b&&(E=Wo(N*E/b/p)*p),X(l)||(P=Math.pow(10,l),E=Math.ceil(E*P)/P),s==="ticks"?(O=Math.floor(x/E)*E,A=Math.ceil(y/E)*E):(O=x,A=y),w&&_&&o&&tl((a-r)/o,E/1e3)?(N=Math.round(Math.min((a-r)/E,u)),E=(a-r)/N,O=r,A=a):S?(O=w?r:O,A=_?a:A,N=c-1,E=(A-O)/N):(N=(A-O)/E,Ae(N,Math.round(N),E/1e3)?N=Math.round(N):N=Math.ceil(N));let j=Math.max($o(E),$o(O));P=Math.pow(10,X(l)?j:l),O=Math.round(O*P)/P,A=Math.round(A*P)/P;let H=0;for(w&&(f&&O!==r?(n.push({value:r}),O<r&&H++,Ae(Math.round((O+H*E)*P)/P,r,Xf(r,T,e))&&H++):O<r&&H++);H<N;++H){let G=Math.round((O+H*E)*P)/P;if(_&&G>a)break;n.push({value:G})}return _&&f&&A!==a?n.length&&Ae(n[n.length-1].value,a,Xf(a,T,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function Xf(e,t,{horizontal:n,minRotation:i}){let s=Oe(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function qf(e){return e/Math.pow(10,Ls(e))===1}function Zf(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function ey(e,t){let n=t-e,i=Ls(n);for(;Zf(e,t,i)>10;)i++;for(;Zf(e,t,i)<10;)i--;return Math.min(i,Ls(e))}function ny(e,{min:t,max:n}){t=Ot(e.min,t);let i=[],s=Ls(t),o=ey(t,n),r=o<0?Math.pow(10,Math.abs(o)):1,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,d=Math.floor((c-u)/Math.pow(10,o)),f=Ot(e.min,Math.round((l+u+d*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:qf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+u+d*Math.pow(10,o))*r)/r;let p=Ot(e.max,f);return i.push({value:p,major:qf(p),significand:d}),i}function Ul(e){let t=e.ticks;if(t.display&&e.display){let n=kt(t.backdropPadding);return W(t.font&&t.font.size,it.font.size)+n.height}return 0}function iy(e,t,n){return n=et(n)?n:[n],{w:dl(e,t.string,n),h:n.length*t.lineHeight}}function Jf(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function sy(e){let 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?ft/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),d=gt(c.font),f=iy(e.ctx,d,e._pointLabels[l]);i[l]=f;let p=qt(e.getIndexAngle(l)+a),b=Math.round(bs(p)),x=Jf(b,u.x,f.w,0,180),y=Jf(b,u.y,f.h,90,270);oy(n,t,p,x,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ly(e,i,s)}function oy(e,t,n,i,s){let o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function ry(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(bs(qt(l.angle+At))),u=dy(l.y,a.h,c),d=cy(c),f=uy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ay(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:o}=e;return!(Zt({x:n,y:i},t)||Zt({x:n,y:o},t)||Zt({x:s,y:i},t)||Zt({x:s,y:o},t))}function ly(e,t,n){let i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Ul(o)/2,additionalAngle:r?ft/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let d=ry(e,u,l);i.push(d),a==="auto"&&(d.visible=ay(d,c),d.visible&&(c=d))}return i}function cy(e){return e===0||e===180?"center":e<180?"left":"right"}function uy(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function dy(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function fy(e,t,n){let{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!X(a)){let l=_n(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=a;let u=i-c.left,d=s-c.top,f=o-i+c.width,p=r-s+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Si(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function hy(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(e.getPointLabelContext(s));fy(n,r,o);let a=gt(r.font),{x:l,y:c,textAlign:u}=o;wn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function yh(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Bt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function py(e,t,n,i,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),yh(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function gy(e,t,n){return Re(e,{label:n,index:t,type:"pointLabel"})}function Qf(e,t){return e-t}function th(e,t){if(X(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),ht(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function eh(e,t,n,i){let s=$t.length;for(let o=$t.indexOf(e);o<s-1;++o){let r=wr[$t[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return $t[o]}return $t[s-1]}function my(e,t,n,i,s){for(let o=$t.length-1;o>=$t.indexOf(n);o--){let r=$t[o];if(wr[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return $t[n?$t.indexOf(n):0]}function by(e){for(let t=$t.indexOf(e)+1,n=$t.length;t<n;++t)if(wr[$t[t]].common)return $t[t]}function nh(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=xs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function xy(e,t,n,i){let s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,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 ih(e,t,n){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:xy(e,i,s,n)}function hr(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Qe(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}=Qe(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Il,en,mf,px,Nl,br,Dl,wf,Ex,qn,Zn,Ll,Mx,Ax,oh,En,xr,zl,gr,Fx,Mf,ah,Ns,Tf,Vl,Le,i0,Cf,Pf,Qn,Ti,Fl,Ne,Hl,If,dh,As,jl,k0,E0,M0,mr,Ff,ae,z0,Sn,Jn,Wf,F0,vr,mh,Rs,bh,Is,xh,Z0,Q0,Ci,Ai,Pi,Ls,Xn,fr,Mi,wr,$t,Di,pr,vh=M(()=>{Tl();Il=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let 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=Yo.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;let o=i.items,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){let n=this._charts,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){let 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;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,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)}},en=new Il,mf="transparent",px={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=Zo(e||mf),s=i.valid&&Zo(t||mf);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Nl=class{constructor(t,n,i,s){let o=n[i];s=Ei([t.to,s,o,t.from]);let r=Ei([t.from,o,s]);this._active=!0,this._fn=t.fn||px[t.type||typeof r],this._easing=Wn[t.easing]||Wn.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);let 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=Ei([t.to,n,s,t.from]),this._from=Ei([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},br=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Y(t))return;let n=Object.keys(it.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!Y(o))return;let r={};for(let a of n)r[a]=o[a];(et(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){let i=n.options,s=mx(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&gx(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],d=o[c],f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Nl(f,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return en.add(this._chart,i),!0}};Dl=e=>e==="reset"||e==="none",wf=(e,t)=>t?e:Object.assign({},e),Ex=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:sh(n,!0),values:null},qn=class{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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Cl(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&&Ts(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,f,p,b)=>d==="x"?f:d==="r"?b:p,o=n.xAxisID=W(i.xAxisID,Pl(t,"x")),r=n.yAxisID=W(i.yAxisID,Pl(t,"y")),a=n.rAxisID=W(i.rAxisID,Pl(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){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Go(this._data,this),t._stacked&&Ts(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Y(n)){let s=this._cachedMeta;this._data=yx(n,s)}else if(i!==n){if(i){Go(i,this);let s=this._cachedMeta;Ts(s),s._parsed=[]}n&&Object.isExtensible(n)&&ol(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=Cl(n.vScale,n),n.stack!==i.stack&&(s=!0,Ts(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(vf(this,n._parsed),n._stacked=Cl(n.vScale,n))}configure(){let 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){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{et(s[t])?f=this.parseArrayData(i,s,t,n):Y(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);let p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&vf(this,f)}parsePrimitiveData(t,n,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,d=new Array(s),f,p,b;for(f=0,p=s;f<p;++f)b=f+i,d[f]={[a]:u||o.parse(c[b],b),[l]:r.parse(n[b],b)};return d}parseArrayData(t,n,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=n[u],a[l]={x:o.parse(d[0],u),y:r.parse(d[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,d,f,p;for(u=0,d=s;u<d;++u)f=u+i,p=n[f],c[u]={x:o.parse(_i(p,a),f),y:r.parse(_i(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:sh(s,!0),values:n._stacks[t.axis]._visualValues};return xf(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let o=i[n.axis],r=o===null?NaN:o,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=xf(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Ex(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=wx(a),f,p;function b(){p=s[f];let x=p[a.axis];return!ht(p[t.axis])||u>x||d<x}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],ht(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=xx(W(this.options.clip,bx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let d=s[u];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=Sx(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=kx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&ki(i);if(a)return wf(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(it.elements[t]),b=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(f,p,b,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(wf(x,l))),x}_resolveAnimations(t,n,i){let s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,n))}let c=new br(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||Dl(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let 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){Dl(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Dl(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let 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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let 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<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){let s=this._cachedMeta,o=s.data,r=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&Ts(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(qn,"defaults",{}),F(qn,"datasetElementType",null),F(qn,"dataElementType",null);Zn=class extends qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled,{start:a,count:l}=cl(n,s,r);this._drawStart=a,this._drawCount=l,ul(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,y=Gn(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",_=n+i,S=t.length,T=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){let P=t[E],O=w?P:{};if(E<n||E>=_){O.skip=!0;continue}let A=this.getParsed(E),N=X(A[p]),j=O[f]=r.getPixelForValue(A[f],E),H=O[p]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],E);O.skip=isNaN(j)||isNaN(H)||N,O.stop=E>0&&Math.abs(A[f]-T[f])>y,x&&(O.parsed=A,O.raw=c.data[E]),d&&(O.options=u||this.resolveDataElementOptions(E,P.active?"active":s)),w||this.updateElement(P,E,O,s),T=A}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(Zn,"id","line"),F(Zn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Zn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});Ll=class e{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}},Mx={_date:Ll};Ax={evaluateInteractionItems:zs,modes:{index(e,t,n,i){let s=Jt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Al(e,s,o,i,r):Ol(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1,a=n.intersect?Al(e,s,o,i,r):Ol(e,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Al(e,s,o,i,r)},nearest(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Ol(e,s,o,n.intersect,i,r)},x(e,t,n,i){let s=Jt(t,e);return _f(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=Jt(t,e);return _f(e,s,"y",n.intersect,i)}}},oh=["left","top","right","bottom"];En={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=kt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Nx(e.boxes),l=a.vertical,c=a.horizontal;$(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});let u=l.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);rh(f,kt(i));let p=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),b=Ix(l.concat(c),d);Os(a.fullSize,p,d,b),Os(l,p,d,b),Os(c,p,d,b)&&Os(l,p,d,b),zx(p),Ef(a.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,Ef(a.rightAndBottom,p,d,b),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$(a.chartArea,x=>{let y=x.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},xr=class{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){}},zl=class extends xr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},gr="$chartjs",Fx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mf=e=>e===null||e==="";ah=vl?{passive:!0}:!1;Ns=new Map,Tf=0;Vl=class extends xr{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Hx(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[gr])return!1;let i=n[gr].initial;["height","width"].forEach(o=>{let r=i[o];X(r)?n.removeAttribute(o):n.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[gr],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),r={attach:$x,detach:Ux,resize:Kx}[n]||Xx;s[n]=r(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Rl,detach:Rl,resize:Rl}[n]||Wx)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return yl(t,n,i,s)}isAttached(t){let n=t&&Ms(t);return!!(n&&n.isConnected)}};Le=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Gn(this.x)&&Gn(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};F(Le,"defaults",{}),F(Le,"defaultRoutes");i0=e=>e==="left"?"right":e==="right"?"left":e,Cf=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Pf=(e,t)=>Math.min(t||e,e);Qn=class e extends Le{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=Ot(t,Number.POSITIVE_INFINITY),n=Ot(n,Number.NEGATIVE_INFINITY),i=Ot(i,Number.POSITIVE_INFINITY),s=Ot(s,Number.NEGATIVE_INFINITY),{min:Ot(t,i),max:Ot(n,s),minDefined:ht(t),maxDefined:ht(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:Ot(n,Ot(i,n)),max:Ot(i,Ot(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(){let 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(){z(this.options.beforeUpdate,[this])}update(t,n,i){let{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=gl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Df(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Zx(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Pf(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation,r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Wt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),d+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-Ds(t.grid)-n.padding-Af(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=bs(Math.min(Math.asin(Wt((u.highest.height+6)/a,-1,1)),Math.asin(Wt(l/c,-1,1))-Math.asin(Wt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Af(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ds(o)+l):(t.height=this.maxHeight,t.width=Ds(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,b=Oe(this.labelRotation),x=Math.cos(b),y=Math.sin(b);if(a){let w=i.mirror?0:y*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{let w=i.mirror?0:x*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,y,x)}}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){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;l?c?(f=s*t.width,p=i*n.height):(f=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+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(){z(this.options.afterFit,[this])}isHorizontal(){let{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<i;n++)X(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=Df(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Pf(n,i)),c=0,u=0,d,f,p,b,x,y,w,_,S,T,E;for(d=0;d<n;d+=l){if(b=t[d].label,x=this._resolveTickFontOptions(d),s.font=y=x.string,w=o[y]=o[y]||{data:{},gc:[]},_=x.lineHeight,S=T=0,!X(b)&&!et(b))S=yi(s,w.data,w.gc,S,b),T=_;else if(et(b))for(f=0,p=b.length;f<p;++f)E=b[f],!X(E)&&!et(E)&&(S=yi(s,w.data,w.gc,S,E),T+=_);r.push(S),a.push(T),c=Math.max(S,c),u=Math.max(T,u)}o0(o,n);let P=r.indexOf(c),O=a.indexOf(u),A=N=>({width:r[N]||0,height:a[N]||0});return{first:A(0),last:A(n-1),widest:A(P),highest:A(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return nl(this._alignToPixels?tn(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=a0(this.getContext(),t,i))}return this.$context||(this.$context=r0(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Oe(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ds(o),p=[],b=a.setContext(this.getContext()),x=b.display?b.width:0,y=x/2,w=function(tt){return tn(i,tt,x)},_,S,T,E,P,O,A,N,j,H,G,ot;if(r==="top")_=w(this.bottom),O=this.bottom-f,N=_-y,H=w(t.top)+y,ot=t.bottom;else if(r==="bottom")_=w(this.top),H=t.top,ot=w(t.bottom)-y,O=_+y,N=this.top+f;else if(r==="left")_=w(this.right),P=this.right-f,A=_-y,j=w(t.left)+y,G=t.right;else if(r==="right")_=w(this.left),j=t.left,G=w(t.right)-y,P=_+y,A=this.left+f;else if(n==="x"){if(r==="center")_=w((t.top+t.bottom)/2+.5);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}H=t.top,ot=t.bottom,O=_+y,N=O+f}else if(n==="y"){if(r==="center")_=w((t.left+t.right)/2);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}P=_-y,A=P-f,j=t.left,G=t.right}let Pt=W(s.ticks.maxTicksLimit,d),Q=Math.max(1,Math.ceil(d/Pt));for(S=0;S<d;S+=Q){let tt=this.getContext(S),mt=o.setContext(tt),ue=a.setContext(tt),ni=mt.lineWidth,rn=mt.color,ve=ue.dash||[],an=ue.dashOffset,Ve=mt.tickWidth,Fe=mt.tickColor,Cn=mt.tickBorderDash||[],nt=mt.tickBorderDashOffset;T=s0(this,S,l),T!==void 0&&(E=tn(i,T,ni),c?P=A=j=G=E:O=N=H=ot=E,p.push({tx1:P,ty1:O,tx2:A,ty2:N,x1:j,y1:H,x2:G,y2:ot,width:ni,color:rn,borderDash:ve,borderDashOffset:an,tickWidth:Ve,tickColor:Fe,tickBorderDash:Cn,tickBorderDashOffset:nt}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Ds(i.grid),p=f+u,b=d?-u:p,x=-Oe(this.labelRotation),y=[],w,_,S,T,E,P,O,A,N,j,H,G,ot="middle";if(s==="top")P=this.bottom-b,O=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+b,O=this._getXAxisLabelAlignment();else if(s==="left"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(s==="right"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(n==="x"){if(s==="center")P=(t.top+t.bottom)/2+p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];P=this.chart.scales[Q].getPixelForValue(tt)+p}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")E=(t.left+t.right)/2-p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];E=this.chart.scales[Q].getPixelForValue(tt)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?ot="top":l==="end"&&(ot="bottom"));let Pt=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],T=S.label;let Q=o.setContext(this.getContext(w));A=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),j=N.lineHeight,H=et(T)?T.length:1;let tt=H/2,mt=Q.color,ue=Q.textStrokeColor,ni=Q.textStrokeWidth,rn=O;r?(E=A,O==="inner"&&(w===_-1?rn=this.options.reverse?"left":"right":w===0?rn=this.options.reverse?"right":"left":rn="center"),s==="top"?c==="near"||x!==0?G=-H*j+j/2:c==="center"?G=-Pt.highest.height/2-tt*j+j:G=-Pt.highest.height+j/2:c==="near"||x!==0?G=j/2:c==="center"?G=Pt.highest.height/2-tt*j:G=Pt.highest.height-H*j,d&&(G*=-1),x!==0&&!Q.showLabelBackdrop&&(E+=j/2*Math.sin(x))):(P=A,G=(1-H)*j/2);let ve;if(Q.showLabelBackdrop){let an=kt(Q.backdropPadding),Ve=Pt.heights[w],Fe=Pt.widths[w],Cn=G-an.top,nt=0-an.left;switch(ot){case"middle":Cn-=Ve/2;break;case"bottom":Cn-=Ve;break}switch(O){case"center":nt-=Fe/2;break;case"right":nt-=Fe;break;case"inner":w===_-1?nt-=Fe:w>0&&(nt-=Fe/2);break}ve={left:nt,top:Cn,width:Fe+an.width,height:Ve+an.height,color:Q.backdropColor}}y.push({label:T,font:N,textOffset:G,options:{rotation:x,color:mt,strokeColor:ue,strokeWidth:ni,textAlign:rn,textBaseline:ot,translation:[E,P],backdrop:ve}})}return y}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Oe(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,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<r;++o){let l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,d,f;this.isHorizontal()?(c=tn(t,this.left,r)-r/2,u=tn(t,this.right,a)+a/2,d=f=l):(d=tn(t,this.top,r)-r/2,f=tn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&_s(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;wn(i,c,0,u,l,a)}s&&ks(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let o=gt(i.font),r=kt(i.padding),a=i.align,l=o.lineHeight/2;n==="bottom"||n==="center"||Y(n)?(l+=r.bottom,et(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:d,rotation:f}=c0(this,l,n,a);wn(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:f,textAlign:l0(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),s=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw: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){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=n.length;o<r;++o){let a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return gt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ti=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;f0(n)&&(i=this.register(n));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,u0(t,r,i),this.override&&it.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in it[s]&&(delete it[s][i],this.override&&delete vn[i])}};Fl=class{constructor(){this.controllers=new Ti(qn,"datasets",!0),this.elements=new Ti(Le,"elements"),this.plugins=new Ti(Object,"plugins"),this.scales=new Ti(Qn,"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=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):$(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){let s=ms(t);z(i["before"+s],[],i),n[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Ne=new Fl,Hl=class{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[n,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){X(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=W(i.options&&i.options.plugins,{}),o=h0(i);return s===!1&&!n?[]:g0(t,o,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(o,r)=>o.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")}};If=new Map,dh=new Set;As=(e,t,n)=>{let i=_i(t,n);i!==void 0&&e.add(i)},jl=class{constructor(t){this._config=_0(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=uh(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),ch(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ur(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return ur(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return ur(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return ur(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>As(l,t,d))),u.forEach(d=>As(l,s,d)),u.forEach(d=>As(l,vn[o]||{},d)),u.forEach(d=>As(l,it,d)),u.forEach(d=>As(l,Jo,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),dh.has(n)&&r.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,vn[n]||{},it.datasets[n]||{},{type:n},it,Jo]}resolveNamedOptions(t,n,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Nf(this._resolverCache,t,s),l=r;if(S0(r,n)){o.$shared=!1,i=Pe(i)?i():i;let c=this.createResolver(t,i,a);l=yn(r,i,c)}for(let c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){let{resolver:o}=Nf(this._resolverCache,t,i);return Y(n)?yn(o,n,void 0,s):o}};k0=e=>Y(e)&&Object.getOwnPropertyNames(e).some(t=>Pe(e[t]));E0="4.5.1",M0=["top","bottom","left","right","chartArea"];mr={},Ff=e=>{let t=fh(e);return Object.values(mr).filter(n=>n.canvas===t).pop()};ae=class{static register(...t){Ne.add(...t),Hf()}static unregister(...t){Ne.remove(...t),Hf()}constructor(t,n){let i=this.config=new jl(n),s=fh(t),o=Ff(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.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||qx(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=qa(),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 Hl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=al(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Vf),en.listen(this,"progress",T0),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return X(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 Ne}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qo(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,n){en.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let 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,sr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};$(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];n&&(o=o.concat(Object.keys(n).map(r=>{let a=n[r],l=Wl(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$(o,r=>{let a=r.options,l=a.id,c=Wl(l,a),u=W(a.type,r.dtype);(a.position===void 0||Lf(a.position,c)!==Lf(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{let f=Ne.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),$(s,(r,a)=>{r||delete i[a]}),$(i,r=>{En.configure(this,r,r.options),En.addBox(this,r)})}_updateMetasets(){let 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;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(zf("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let o=n[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Bl(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Ne.getController(a),{datasetElementType:c,dataElementType:u}=it.datasets[a];Object.assign(l,{dataElementType:Ne.getElement(u),datasetElementType:c&&Ne.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){$(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let 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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||$(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zf("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$(this.scales,t=>{En.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Bo(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of n){let r=i==="_removeElements"?-o:o;C0(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let 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;o<n;o++)if(!Bo(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;En.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],$(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<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Pe(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Vf({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,o;for(s=0,o=n.length;s<o;++s){let r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Ml(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&_s(n,s),t.controller.draw(),s&&ks(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Zt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let o=Ax.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,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=Re(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let 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){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);ki(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){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),en.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qo(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};$(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let 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)},r,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(){$(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!wi(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){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.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){let 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;let 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){let{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Ja(t),c=P0(t,this._lastEvent,i,l);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let u=!wi(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;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};F(ae,"defaults",it),F(ae,"instances",mr),F(ae,"overrides",vn),F(ae,"registry",Ne),F(ae,"version",E0),F(ae,"getChart",Ff);z0=typeof Path2D=="function";Sn=class extends Le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;xl(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],o=this.points,r=Sl(this,{property:n,start:s,end:s});if(!r.length)return;let a=[],l=I0(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:d,end:f}=r[c],p=o[d],b=o[f];if(p===b){a.push(p);continue}let x=Math.abs((s-p[n])/(b[n]-p[n])),y=l(p,b,x,i.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,i){return $l(this)(t,this,n,i)}path(t,n,i){let s=this.segments,o=$l(this),r=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),V0(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(Sn,"id","line"),F(Sn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(Sn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(Sn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Jn=class extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Bf(this,n,"x",i)}inYRange(n,i){return Bf(this,n,"y",i)}getCenterPoint(n){let{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);let s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){let s=this.options;this.skip||s.radius<.1||!Zt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,ws(n,s,this.x,this.y))}getRange(){let n=this.options||{};return n.radius+n.hitRadius}};F(Jn,"id","point"),F(Jn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Jn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Wf=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},F0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,vr=class extends Le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=z(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=gt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wf(i,o),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((b,x)=>{let y=i+n/2+o.measureText(b.text).width;(x===0||c[c.length-1]+y+2*a>r)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(t,n,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,d=a,f=0,p=0,b=0,x=0;return this.legendItems.forEach((y,w)=>{let{itemWidth:_,itemHeight:S}=H0(i,n,o,y,s);w>0&&p+S+2*a>u&&(d+=f+a,c.push({width:f,height:p}),b+=f+a,x++,f=p=0),l[w]={left:b,top:p,col:x,width:_,height:S},f=Math.max(f,_),p+=S+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=kn(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Rt(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=Rt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=Rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=Rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;_s(t,this),this._draw(),ks(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=it.color,l=kn(t.rtl,this.left,this.width),c=gt(r.font),{padding:u}=r,d=c.size,f=d/2,p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:b,boxHeight:x,itemHeight:y}=Wf(r,d),w=function(P,O,A){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();let N=W(A.lineWidth,1);if(s.fillStyle=W(A.fillStyle,a),s.lineCap=W(A.lineCap,"butt"),s.lineDashOffset=W(A.lineDashOffset,0),s.lineJoin=W(A.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=W(A.strokeStyle,a),s.setLineDash(W(A.lineDash,[])),r.usePointStyle){let j={radius:x*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:N},H=l.xPlus(P,b/2),G=O+f;tr(s,j,H,G,r.pointStyleWidth&&b)}else{let j=O+Math.max((d-x)/2,0),H=l.leftForLtr(P,b),G=_n(A.borderRadius);s.beginPath(),Object.values(G).some(ot=>ot!==0)?Si(s,{x:H,y:j,w:b,h:x,radius:G}):s.rect(H,j,b,x),s.fill(),N!==0&&s.stroke()}s.restore()},_=function(P,O,A){wn(s,A.text,P,O+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},S=this.isHorizontal(),T=this._computeTitleHeight();S?p={x:Rt(o,this.left+u,this.right-i[0]),y:this.top+u+T,line:0}:p={x:this.left+u,y:Rt(o,this.top+T+u,this.bottom-n[0].height),line:0},rr(this.ctx,t.textDirection);let E=y+u;this.legendItems.forEach((P,O)=>{s.strokeStyle=P.fontColor,s.fillStyle=P.fontColor;let A=s.measureText(P.text).width,N=l.textAlign(P.textAlign||(P.textAlign=r.textAlign)),j=b+f+A,H=p.x,G=p.y;l.setWidth(this.width),S?O>0&&H+j+u>this.right&&(G=p.y+=E,p.line++,H=p.x=Rt(o,this.left+u,this.right-i[p.line])):O>0&&G+E>this.bottom&&(H=p.x=H+n[p.line].width+u,p.line++,G=p.y=Rt(o,this.top+T+u,this.bottom-n[p.line].height));let ot=l.x(H);if(w(ot,G,P),H=ll(N,H+b+f,S?H+j:this.right,t.rtl),_(l.x(H),G,P),S)p.x+=j+u;else if(typeof P.text!="string"){let Pt=c.lineHeight;p.y+=gh(P,Pt)+u}else p.y+=E}),ar(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=gt(n.font),s=kt(n.padding);if(!n.display)return;let o=kn(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Rt(t.align,d,this.right-f);else{let b=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=c+Rt(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let p=Rt(a,d,d+f);r.textAlign=o.textAlign(Xo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,wn(r,n.text,p,u,i)}_computeTitleHeight(){let t=this.options.title,n=gt(t.font),i=kt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Yn(t,this.left,this.right)&&Yn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Yn(t,s.left,s.left+s.width)&&Yn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!j0(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=F0(s,i);s&&!o&&z(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&z(n.onHover,[t,i,this],this)}else i&&z(n.onClick,[t,i,this],this)}};mh={id:"legend",_element:vr,start(e,t,n){let i=e.legend=new vr({ctx:e.ctx,options:n,chart:e});En.configure(e,i,n),En.addBox(e,i)},stop(e){En.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;En.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Rs={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=gs(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};bh={beforeTitle:be,title(e){if(e.length>0){let 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<i)return n[t.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return X(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};Is=class extends Le{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(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new br(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=q0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=jt(i,"beforeTitle",this,t),o=jt(i,"title",this,t),r=jt(i,"afterTitle",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}getBeforeBody(t,n){return Gf(jt(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return $(t,o=>{let r={before:[],lines:[],after:[]},a=Yf(i,o);Ie(r.before,nn(jt(a,"beforeLabel",this,o))),Ie(r.lines,jt(a,"label",this,o)),Ie(r.after,nn(jt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Gf(jt(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=jt(i,"beforeFooter",this,t),o=jt(i,"footer",this,t),r=jt(i,"afterFooter",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push($0(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),$(a,u=>{let d=Yf(t.callbacks,u);s.push(jt(d,"labelColor",this,u)),o.push(jt(d,"labelPointStyle",this,u)),r.push(jt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Rs[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);let l=this._size=jf(this,i),c=Object.assign({},a,l),u=$f(this.chart,i,c),d=Uf(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.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){let 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){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_n(a),{x:f,y:p}=t,{width:b,height:x}=n,y,w,_,S,T,E;return o==="center"?(T=p+x/2,s==="left"?(y=f,w=y-r,S=T+r,E=T-r):(y=f+b,w=y+r,S=T-r,E=T+r),_=y):(s==="left"?w=f+Math.max(l,u)+r:s==="right"?w=f+b-Math.max(c,d)-r:w=this.caretX,o==="top"?(S=p,T=S-r,y=w-r,_=w+r):(S=p+x,T=S+r,y=w+r,_=w-r),E=S),{x1:y,x2:w,x3:_,y1:S,y2:T,y3:E}}drawTitle(t,n,i){let s=this.title,o=s.length,r,a,l;if(o){let c=kn(i.rtl,this.x,this.width);for(t.x=dr(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=gt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=gt(o.bodyFont),d=dr(this,"left",o),f=s.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(o.usePointStyle){let x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,w=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ws(t,x,y,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ws(t,x,y,w)}else{t.lineWidth=Y(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let x=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),w=_n(r.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Si(t,{x,y:b,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Si(t,{x:y,y:b+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,b,c,l),t.strokeRect(x,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(y,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=gt(i.bodyFont),f=d.lineHeight,p=0,b=kn(i.rtl,this.x,this.width),x=function(A){n.fillText(A,b.x(t.x+p),t.y+f/2),t.y+=f+o},y=b.textAlign(r),w,_,S,T,E,P,O;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=dr(this,y,i),n.fillStyle=i.bodyColor,$(this.beforeBody,x),p=a&&y!=="right"?r==="center"?c/2+u:c+2+u:0,T=0,P=s.length;T<P;++T){for(w=s[T],_=this.labelTextColors[T],n.fillStyle=_,$(w.before,x),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,T,b,i),f=Math.max(d.lineHeight,l)),E=0,O=S.length;E<O;++E)x(S[E]),f=d.lineHeight;$(w.after,x)}p=0,f=d.lineHeight,$(this.afterBody,x),t.y-=o}drawFooter(t,n,i){let s=this.footer,o=s.length,r,a;if(o){let l=kn(i.rtl,this.x,this.width);for(t.x=dr(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=gt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:b}=_n(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Rs[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=jf(this,t),l=Object.assign({},r,this._size),c=$f(n,t,l),u=Uf(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){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let 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),rr(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),ar(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!wi(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;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!wi(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){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){let{caretX:i,caretY:s,options:o}=this,r=Rs[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}};F(Is,"positioners",Rs);xh={id:"tooltip",_element:Is,positioners:Rs,afterInit(e,t,n){n&&(e.tooltip=new Is({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){let t=e.tooltip;if(t&&t._willRender()){let 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){let 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:bh},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"]},Z0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);Q0=(e,t)=>e===null?null:Wt(Math.round(e),0,t);Ci=class extends Qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(X(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:J0(i,t,W(n,t),this._addedLabels),Q0(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return Kf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(Ci,"id","category"),F(Ci,"defaults",{ticks:{callback:Kf}});Ai=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){let l=me(s),c=me(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(){let t=this.options.ticks,{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(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let 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=ty(s,o);return t.bounds==="ticks"&&jo(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(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let 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 ys(t,this.chart.options.locale,this.options.ticks.format)}},Pi=class extends Ai{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?t:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=Oe(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}};F(Pi,"id","linear"),F(Pi,"defaults",{ticks:{callback:vs.formatters.numeric}});Ls=e=>Math.floor(De(e)),Xn=(e,t)=>Math.pow(10,Ls(e)+t);fr=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Ai.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ht(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?Math.max(0,t):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Xn(i,-1)),r(Xn(s,1)))),i<=0&&o(Xn(s,-1)),s<=0&&r(Xn(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=ny(n,this);return t.bounds==="ticks"&&jo(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":ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=De(t),this._valueRange=De(this.max)-De(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(De(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(fr,"id","logarithmic"),F(fr,"defaults",{ticks:{callback:vs.formatters.logarithmic,major:{enabled:!0}}});Mi=class extends Ai{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=kt(Ul(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=ht(t)&&!isNaN(t)?t:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ul(this.options))}generateTickLabels(t){Ai.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=z(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?sy(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){let n=Bt/(this._pointLabels.length||1),i=this.options.startAngle||0;return qt(t*n+Oe(i))}getDistanceFromCenterForValue(t){if(X(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(X(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return gy(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-At+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),yh(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&hy(this,r),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),p=s.setContext(f),b=o.setContext(f);py(this,p,l,r,b)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),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&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=gt(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;let d=kt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-u.size/2-d.top,r+d.width,u.size+d.height)}wn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};F(Mi,"id","radialLinear"),F(Mi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(Mi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(Mi,"descriptors",{angleLines:{_fallback:"grid"}});wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$t=Object.keys(wr);Di=class extends Qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Mx._date(t.adapters.date);s.init(n),Un(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:th(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ht(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=ht(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=sl(s,o,r);return this._unit=n.unit||(i.autoSkip?eh(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):my(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:by(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ih(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+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);let r=t.length<3?.5:.25;n=Wt(n,0,r),i=Wt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||eh(o.minUnit,n,i,this._getLabelCapacity(n)),a=W(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Gn(l)||l===!0,u={},d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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);let b=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<i;f=+t.add(f,a,r),p++)nh(u,f,b);return(f===i||s.bounds==="ticks"||p===1)&&nh(u,f,b),Object.keys(u).sort(Qf).map(x=>+x)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,n,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[n],p=c&&d&&f&&f.major;return this._adapter.format(t,s||(p?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=Oe(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ih(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(th(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rl(t.sort(Qf))}};F(Di,"id","time"),F(Di,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});pr=class extends Di{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=hr(n,this.min),this._tableRange=hr(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=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<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(hr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return hr(this._table,i*this._tableRange+this._minPos,!0)}};F(pr,"id","timeseries"),F(pr,"defaults",Di.defaults)});var wh=Lg((vE,_r)=>{(function(e,t,n,i){"use strict";var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,l=Math.abs,c=Date.now;function u(h,g,v){return setTimeout(_(h,v),g)}function d(h,g,v){return Array.isArray(h)?(f(h,v[g],v),!0):!1}function f(h,g,v){var k;if(h)if(h.forEach)h.forEach(g,v);else if(h.length!==i)for(k=0;k<h.length;)g.call(v,h[k],k,h),k++;else for(k in h)h.hasOwnProperty(k)&&g.call(v,h[k],k,h)}function p(h,g,v){var k="DEPRECATED METHOD: "+g+\`
|
|
5419
5419
|
\`+v+\` AT
|
|
5420
|
-
\`;return function(){var C=new Error("get-stack-trace"),I=C&&C.stack?C.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=e.console&&(e.console.warn||e.console.log);return U&&U.call(e.console,k,I),h.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(g){if(g===i||g===null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(g),k=1;k<arguments.length;k++){var C=arguments[k];if(C!==i&&C!==null)for(var I in C)C.hasOwnProperty(I)&&(v[I]=C[I])}return v}:b=Object.assign;var x=p(function(g,v,k){for(var C=Object.keys(v),I=0;I<C.length;)(!k||k&&g[C[I]]===i)&&(g[C[I]]=v[C[I]]),I++;return g},"extend","Use \`assign\`."),y=p(function(g,v){return x(g,v,!0)},"merge","Use \`assign\`.");function w(h,g,v){var k=g.prototype,C;C=h.prototype=Object.create(k),C.constructor=h,C._super=k,v&&b(C,v)}function _(h,g){return function(){return h.apply(g,arguments)}}function S(h,g){return typeof h==r?h.apply(g&&g[0]||i,g):h}function T(h,g){return h===i?g:h}function E(h,g,v){f(N(g),function(k){h.addEventListener(k,v,!1)})}function D(h,g,v){f(N(g),function(k){h.removeEventListener(k,v,!1)})}function O(h,g){for(;h;){if(h==g)return!0;h=h.parentNode}return!1}function A(h,g){return h.indexOf(g)>-1}function N(h){return h.trim().split(/\\s+/g)}function j(h,g,v){if(h.indexOf&&!v)return h.indexOf(g);for(var k=0;k<h.length;){if(v&&h[k][v]==g||!v&&h[k]===g)return k;k++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function G(h,g,v){for(var k=[],C=[],I=0;I<h.length;){var U=g?h[I][g]:h[I];j(C,U)<0&&k.push(h[I]),C[I]=U,I++}return v&&(g?k=k.sort(function(yt,Pt){return yt[g]>Pt[g]}):k=k.sort()),k}function ot(h,g){for(var v,k,C=g[0].toUpperCase()+g.slice(1),I=0;I<s.length;){if(v=s[I],k=v?v+C:g,k in h)return k;I++}return i}var Ct=1;function Q(){return Ct++}function tt(h){var g=h.ownerDocument||h;return g.defaultView||g.parentWindow||e}var mt=/mobile|tablet|ip(ad|hone|od)|android/i,ce="ontouchstart"in e,ni=ot(e,"PointerEvent")!==i,rn=ce&&mt.test(navigator.userAgent),ve="touch",an="pen",Ve="mouse",Fe="kinect",Pn=25,nt=1,Dn=2,lt=4,It=8,Ys=1,Ni=2,Li=4,zi=8,Vi=16,we=Ni|Li,An=zi|Vi,fc=we|An,hc=["x","y"],Ks=["clientX","clientY"];function Jt(h,g){var v=this;this.manager=h,this.callback=g,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(k){S(h.options.enable,[h])&&v.handler(k)},this.init()}Jt.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(tt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(tt(this.element),this.evWin,this.domHandler)}};function eg(h){var g,v=h.options.inputClass;return v?g=v:ni?g=Or:rn?g=Zs:ce?g=Rr:g=qs,new g(h,ng)}function ng(h,g,v){var k=v.pointers.length,C=v.changedPointers.length,I=g&nt&&k-C===0,U=g&(lt|It)&&k-C===0;v.isFirst=!!I,v.isFinal=!!U,I&&(h.session={}),v.eventType=g,ig(h,v),h.emit("hammer.input",v),h.recognize(v),h.session.prevInput=v}function ig(h,g){var v=h.session,k=g.pointers,C=k.length;v.firstInput||(v.firstInput=pc(g)),C>1&&!v.firstMultiple?v.firstMultiple=pc(g):C===1&&(v.firstMultiple=!1);var I=v.firstInput,U=v.firstMultiple,bt=U?U.center:I.center,yt=g.center=gc(k);g.timeStamp=c(),g.deltaTime=g.timeStamp-I.timeStamp,g.angle=Ar(bt,yt),g.distance=Xs(bt,yt),sg(v,g),g.offsetDirection=bc(g.deltaX,g.deltaY);var Pt=mc(g.deltaTime,g.deltaX,g.deltaY);g.overallVelocityX=Pt.x,g.overallVelocityY=Pt.y,g.overallVelocity=l(Pt.x)>l(Pt.y)?Pt.x:Pt.y,g.scale=U?ag(U.pointers,k):1,g.rotation=U?rg(U.pointers,k):0,g.maxPointers=v.prevInput?g.pointers.length>v.prevInput.maxPointers?g.pointers.length:v.prevInput.maxPointers:g.pointers.length,og(v,g);var ke=h.element;O(g.srcEvent.target,ke)&&(ke=g.srcEvent.target),g.target=ke}function sg(h,g){var v=g.center,k=h.offsetDelta||{},C=h.prevDelta||{},I=h.prevInput||{};(g.eventType===nt||I.eventType===lt)&&(C=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},k=h.offsetDelta={x:v.x,y:v.y}),g.deltaX=C.x+(v.x-k.x),g.deltaY=C.y+(v.y-k.y)}function og(h,g){var v=h.lastInterval||g,k=g.timeStamp-v.timeStamp,C,I,U,bt;if(g.eventType!=It&&(k>Pn||v.velocity===i)){var yt=g.deltaX-v.deltaX,Pt=g.deltaY-v.deltaY,ke=mc(k,yt,Pt);I=ke.x,U=ke.y,C=l(ke.x)>l(ke.y)?ke.x:ke.y,bt=bc(yt,Pt),h.lastInterval=g}else C=v.velocity,I=v.velocityX,U=v.velocityY,bt=v.direction;g.velocity=C,g.velocityX=I,g.velocityY=U,g.direction=bt}function pc(h){for(var g=[],v=0;v<h.pointers.length;)g[v]={clientX:a(h.pointers[v].clientX),clientY:a(h.pointers[v].clientY)},v++;return{timeStamp:c(),pointers:g,center:gc(g),deltaX:h.deltaX,deltaY:h.deltaY}}function gc(h){var g=h.length;if(g===1)return{x:a(h[0].clientX),y:a(h[0].clientY)};for(var v=0,k=0,C=0;C<g;)v+=h[C].clientX,k+=h[C].clientY,C++;return{x:a(v/g),y:a(k/g)}}function mc(h,g,v){return{x:g/h||0,y:v/h||0}}function bc(h,g){return h===g?Ys:l(h)>=l(g)?h<0?Ni:Li:g<0?zi:Vi}function Xs(h,g,v){v||(v=hc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.sqrt(k*k+C*C)}function Ar(h,g,v){v||(v=hc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.atan2(C,k)*180/Math.PI}function rg(h,g){return Ar(g[1],g[0],Ks)+Ar(h[1],h[0],Ks)}function ag(h,g){return Xs(g[0],g[1],Ks)/Xs(h[0],h[1],Ks)}var lg={mousedown:nt,mousemove:Dn,mouseup:lt},cg="mousedown",ug="mousemove mouseup";function qs(){this.evEl=cg,this.evWin=ug,this.pressed=!1,Jt.apply(this,arguments)}w(qs,Jt,{handler:function(g){var v=lg[g.type];v&nt&&g.button===0&&(this.pressed=!0),v&Dn&&g.which!==1&&(v=lt),this.pressed&&(v<&&(this.pressed=!1),this.callback(this.manager,v,{pointers:[g],changedPointers:[g],pointerType:Ve,srcEvent:g}))}});var dg={pointerdown:nt,pointermove:Dn,pointerup:lt,pointercancel:It,pointerout:It},fg={2:ve,3:an,4:Ve,5:Fe},xc="pointerdown",yc="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(xc="MSPointerDown",yc="MSPointerMove MSPointerUp MSPointerCancel");function Or(){this.evEl=xc,this.evWin=yc,Jt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Or,Jt,{handler:function(g){var v=this.store,k=!1,C=g.type.toLowerCase().replace("ms",""),I=dg[C],U=fg[g.pointerType]||g.pointerType,bt=U==ve,yt=j(v,g.pointerId,"pointerId");I&nt&&(g.button===0||bt)?yt<0&&(v.push(g),yt=v.length-1):I&(lt|It)&&(k=!0),!(yt<0)&&(v[yt]=g,this.callback(this.manager,I,{pointers:v,changedPointers:[g],pointerType:U,srcEvent:g}),k&&v.splice(yt,1))}});var hg={touchstart:nt,touchmove:Dn,touchend:lt,touchcancel:It},pg="touchstart",gg="touchstart touchmove touchend touchcancel";function vc(){this.evTarget=pg,this.evWin=gg,this.started=!1,Jt.apply(this,arguments)}w(vc,Jt,{handler:function(g){var v=hg[g.type];if(v===nt&&(this.started=!0),!!this.started){var k=mg.call(this,g,v);v&(lt|It)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}}});function mg(h,g){var v=H(h.touches),k=H(h.changedTouches);return g&(lt|It)&&(v=G(v.concat(k),"identifier",!0)),[v,k]}var bg={touchstart:nt,touchmove:Dn,touchend:lt,touchcancel:It},xg="touchstart touchmove touchend touchcancel";function Zs(){this.evTarget=xg,this.targetIds={},Jt.apply(this,arguments)}w(Zs,Jt,{handler:function(g){var v=bg[g.type],k=yg.call(this,g,v);k&&this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}});function yg(h,g){var v=H(h.touches),k=this.targetIds;if(g&(nt|Dn)&&v.length===1)return k[v[0].identifier]=!0,[v,v];var C,I,U=H(h.changedTouches),bt=[],yt=this.target;if(I=v.filter(function(Pt){return O(Pt.target,yt)}),g===nt)for(C=0;C<I.length;)k[I[C].identifier]=!0,C++;for(C=0;C<U.length;)k[U[C].identifier]&&bt.push(U[C]),g&(lt|It)&&delete k[U[C].identifier],C++;if(bt.length)return[G(I.concat(bt),"identifier",!0),bt]}var vg=2500,wc=25;function Rr(){Jt.apply(this,arguments);var h=_(this.handler,this);this.touch=new Zs(this.manager,h),this.mouse=new qs(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}w(Rr,Jt,{handler:function(g,v,k){var C=k.pointerType==ve,I=k.pointerType==Ve;if(!(I&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(C)wg.call(this,v,k);else if(I&&_g.call(this,k))return;this.callback(g,v,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function wg(h,g){h&nt?(this.primaryTouch=g.changedPointers[0].identifier,_c.call(this,g)):h&(lt|It)&&_c.call(this,g)}function _c(h){var g=h.changedPointers[0];if(g.identifier===this.primaryTouch){var v={x:g.clientX,y:g.clientY};this.lastTouches.push(v);var k=this.lastTouches,C=function(){var I=k.indexOf(v);I>-1&&k.splice(I,1)};setTimeout(C,vg)}}function _g(h){for(var g=h.srcEvent.clientX,v=h.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var C=this.lastTouches[k],I=Math.abs(g-C.x),U=Math.abs(v-C.y);if(I<=wc&&U<=wc)return!0}return!1}var kc=ot(o.style,"touchAction"),Sc=kc!==i,Ec="compute",Mc="auto",Ir="manipulation",On="none",Fi="pan-x",Hi="pan-y",Js=Sg();function Nr(h,g){this.manager=h,this.set(g)}Nr.prototype={set:function(h){h==Ec&&(h=this.compute()),Sc&&this.manager.element.style&&Js[h]&&(this.manager.element.style[kc]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return f(this.manager.recognizers,function(g){S(g.options.enable,[g])&&(h=h.concat(g.getTouchAction()))}),kg(h.join(" "))},preventDefaults:function(h){var g=h.srcEvent,v=h.offsetDirection;if(this.manager.session.prevented){g.preventDefault();return}var k=this.actions,C=A(k,On)&&!Js[On],I=A(k,Hi)&&!Js[Hi],U=A(k,Fi)&&!Js[Fi];if(C){var bt=h.pointers.length===1,yt=h.distance<2,Pt=h.deltaTime<250;if(bt&&yt&&Pt)return}if(!(U&&I)&&(C||I&&v&we||U&&v&An))return this.preventSrc(g)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function kg(h){if(A(h,On))return On;var g=A(h,Fi),v=A(h,Hi);return g&&v?On:g||v?g?Fi:Hi:A(h,Ir)?Ir:Mc}function Sg(){if(!Sc)return!1;var h={},g=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(v){h[v]=g?e.CSS.supports("touch-action",v):!0}),h}var Qs=1,Qt=2,ii=4,ln=8,He=ln,Bi=16,_e=32;function Be(h){this.options=b({},this.defaults,h||{}),this.id=Q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=Qs,this.simultaneous={},this.requireFail=[]}Be.prototype={defaults:{},set:function(h){return b(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var g=this.simultaneous;return h=to(h,this),g[h.id]||(g[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=to(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var g=this.requireFail;return h=to(h,this),j(g,h)===-1&&(g.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=to(h,this);var g=j(this.requireFail,h);return g>-1&&this.requireFail.splice(g,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var g=this,v=this.state;function k(C){g.manager.emit(C,h)}v<ln&&k(g.options.event+Tc(v)),k(g.options.event),h.additionalEvent&&k(h.additionalEvent),v>=ln&&k(g.options.event+Tc(v))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=_e},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(_e|Qs)))return!1;h++}return!0},recognize:function(h){var g=b({},h);if(!S(this.options.enable,[this,g])){this.reset(),this.state=_e;return}this.state&(He|Bi|_e)&&(this.state=Qs),this.state=this.process(g),this.state&(Qt|ii|ln|Bi)&&this.tryEmit(g)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Tc(h){return h&Bi?"cancel":h&ln?"end":h&ii?"move":h&Qt?"start":""}function Cc(h){return h==Vi?"down":h==zi?"up":h==Ni?"left":h==Li?"right":""}function to(h,g){var v=g.manager;return v?v.get(h):h}function ue(){Be.apply(this,arguments)}w(ue,Be,{defaults:{pointers:1},attrTest:function(h){var g=this.options.pointers;return g===0||h.pointers.length===g},process:function(h){var g=this.state,v=h.eventType,k=g&(Qt|ii),C=this.attrTest(h);return k&&(v&It||!C)?g|Bi:k||C?v<?g|ln:g&Qt?g|ii:Qt:_e}});function eo(){ue.apply(this,arguments),this.pX=null,this.pY=null}w(eo,ue,{defaults:{event:"pan",threshold:10,pointers:1,direction:fc},getTouchAction:function(){var h=this.options.direction,g=[];return h&we&&g.push(Hi),h&An&&g.push(Fi),g},directionTest:function(h){var g=this.options,v=!0,k=h.distance,C=h.direction,I=h.deltaX,U=h.deltaY;return C&g.direction||(g.direction&we?(C=I===0?Ys:I<0?Ni:Li,v=I!=this.pX,k=Math.abs(h.deltaX)):(C=U===0?Ys:U<0?zi:Vi,v=U!=this.pY,k=Math.abs(h.deltaY))),h.direction=C,v&&k>g.threshold&&C&g.direction},attrTest:function(h){return ue.prototype.attrTest.call(this,h)&&(this.state&Qt||!(this.state&Qt)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var g=Cc(h.direction);g&&(h.additionalEvent=this.options.event+g),this._super.emit.call(this,h)}});function Lr(){ue.apply(this,arguments)}w(Lr,ue,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&Qt)},emit:function(h){if(h.scale!==1){var g=h.scale<1?"in":"out";h.additionalEvent=this.options.event+g}this._super.emit.call(this,h)}});function zr(){Be.apply(this,arguments),this._timer=null,this._input=null}w(zr,Be,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Mc]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime>g.time;if(this._input=h,!k||!v||h.eventType&(lt|It)&&!C)this.reset();else if(h.eventType&nt)this.reset(),this._timer=u(function(){this.state=He,this.tryEmit()},g.time,this);else if(h.eventType<)return He;return _e},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===He&&(h&&h.eventType<?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Vr(){ue.apply(this,arguments)}w(Vr,ue,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&Qt)}});function Fr(){ue.apply(this,arguments)}w(Fr,ue,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:we|An,pointers:1},getTouchAction:function(){return eo.prototype.getTouchAction.call(this)},attrTest:function(h){var g=this.options.direction,v;return g&(we|An)?v=h.overallVelocity:g&we?v=h.overallVelocityX:g&An&&(v=h.overallVelocityY),this._super.attrTest.call(this,h)&&g&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&l(v)>this.options.velocity&&h.eventType<},emit:function(h){var g=Cc(h.offsetDirection);g&&this.manager.emit(this.options.event+g,h),this.manager.emit(this.options.event,h)}});function no(){Be.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(no,Be,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ir]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime<g.time;if(this.reset(),h.eventType&nt&&this.count===0)return this.failTimeout();if(k&&C&&v){if(h.eventType!=lt)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<g.interval:!0,U=!this.pCenter||Xs(this.pCenter,h.center)<g.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!U||!I?this.count=1:this.count+=1,this._input=h;var bt=this.count%g.taps;if(bt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=He,this.tryEmit()},g.interval,this),Qt):He}return _e},failTimeout:function(){return this._timer=u(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==He&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function We(h,g){return g=g||{},g.recognizers=T(g.recognizers,We.defaults.preset),new Hr(h,g)}We.VERSION="2.0.7",We.defaults={domEvents:!1,touchAction:Ec,enable:!0,inputTarget:null,inputClass:null,preset:[[Vr,{enable:!1}],[Lr,{enable:!1},["rotate"]],[Fr,{direction:we}],[eo,{direction:we},["swipe"]],[no],[no,{event:"doubletap",taps:2},["tap"]],[zr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Eg=1,Pc=2;function Hr(h,g){this.options=b({},We.defaults,g||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=eg(this),this.touchAction=new Nr(this,this.options.touchAction),Dc(this,!0),f(this.options.recognizers,function(v){var k=this.add(new v[0](v[1]));v[2]&&k.recognizeWith(v[2]),v[3]&&k.requireFailure(v[3])},this)}Hr.prototype={set:function(h){return b(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Pc:Eg},recognize:function(h){var g=this.session;if(!g.stopped){this.touchAction.preventDefaults(h);var v,k=this.recognizers,C=g.curRecognizer;(!C||C&&C.state&He)&&(C=g.curRecognizer=null);for(var I=0;I<k.length;)v=k[I],g.stopped!==Pc&&(!C||v==C||v.canRecognizeWith(C))?v.recognize(h):v.reset(),!C&&v.state&(Qt|ii|ln)&&(C=g.curRecognizer=v),I++}},get:function(h){if(h instanceof Be)return h;for(var g=this.recognizers,v=0;v<g.length;v++)if(g[v].options.event==h)return g[v];return null},add:function(h){if(d(h,"add",this))return this;var g=this.get(h.options.event);return g&&this.remove(g),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(d(h,"remove",this))return this;if(h=this.get(h),h){var g=this.recognizers,v=j(g,h);v!==-1&&(g.splice(v,1),this.touchAction.update())}return this},on:function(h,g){if(h!==i&&g!==i){var v=this.handlers;return f(N(h),function(k){v[k]=v[k]||[],v[k].push(g)}),this}},off:function(h,g){if(h!==i){var v=this.handlers;return f(N(h),function(k){g?v[k]&&v[k].splice(j(v[k],g),1):delete v[k]}),this}},emit:function(h,g){this.options.domEvents&&Mg(h,g);var v=this.handlers[h]&&this.handlers[h].slice();if(!(!v||!v.length)){g.type=h,g.preventDefault=function(){g.srcEvent.preventDefault()};for(var k=0;k<v.length;)v[k](g),k++}},destroy:function(){this.element&&Dc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Dc(h,g){var v=h.element;if(v.style){var k;f(h.options.cssProps,function(C,I){k=ot(v.style,I),g?(h.oldCssProps[k]=v.style[k],v.style[k]=C):v.style[k]=h.oldCssProps[k]||""}),g||(h.oldCssProps={})}}function Mg(h,g){var v=t.createEvent("Event");v.initEvent(h,!0,!0),v.gesture=g,g.target.dispatchEvent(v)}b(We,{INPUT_START:nt,INPUT_MOVE:Dn,INPUT_END:lt,INPUT_CANCEL:It,STATE_POSSIBLE:Qs,STATE_BEGAN:Qt,STATE_CHANGED:ii,STATE_ENDED:ln,STATE_RECOGNIZED:He,STATE_CANCELLED:Bi,STATE_FAILED:_e,DIRECTION_NONE:Ys,DIRECTION_LEFT:Ni,DIRECTION_RIGHT:Li,DIRECTION_UP:zi,DIRECTION_DOWN:Vi,DIRECTION_HORIZONTAL:we,DIRECTION_VERTICAL:An,DIRECTION_ALL:fc,Manager:Hr,Input:Jt,TouchAction:Nr,TouchInput:Zs,MouseInput:qs,PointerEventInput:Or,TouchMouseInput:Rr,SingleTouchInput:vc,Recognizer:Be,AttrRecognizer:ue,Tap:no,Pan:eo,Swipe:Fr,Pinch:Lr,Rotate:Vr,Press:zr,on:E,off:D,each:f,merge:y,extend:x,assign:b,inherit:w,bindFn:_,prefixed:ot});var Tg=typeof e<"u"?e:typeof self<"u"?self:{};Tg.Hammer=We,typeof define=="function"&&define.amd?define(function(){return We}):typeof wr<"u"&&wr.exports?wr.exports=We:e[n]=We})(window,document,"Hammer")});var vh=M(()=>{Sl();});var wh=M(()=>{vh()});function Tn(e,t,n){return e===void 0?!0:typeof e=="string"?e.indexOf(t)!==-1:typeof e=="function"?e({chart:n}).indexOf(t)!==-1:!1}function jl(e,t){return typeof e=="function"&&(e=e({chart:t})),typeof e=="string"?{x:e.indexOf("x")!==-1,y:e.indexOf("y")!==-1}:{x:!1,y:!1}}function xy(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function yy({x:e,y:t},n){let i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){let r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function Nh(e,t,n){let{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=yy(t,n),a=jl(i,n),l=jl(s,n);if(o){let u=jl(o,n);for(let d of["x","y"])u[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];let c=[];return $(n.scales,function(u){a[u.axis]&&c.push(u)}),c}function st(e){let t=$l.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},$l.set(e,t)),t}function vy(e){$l.delete(e)}function Lh(e,t,n,i){let s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function zh(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Vh(e,t,n){let i=e.max-e.min,s=i*(t-1),o=zh(e,n);return Lh(o,e.min,i,s)}function wy(e,t,n){let i=zh(e,n);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Lh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function _y(e,t){return t&&(t[e.id]||t[e.axis])||{}}function _h(e,t,n,i,s){let o=n[i];if(o==="original"){let r=e.originalScaleLimits[t.id][i];o=W(r.options,r.scale)}return W(o,s)}function ky(e,t,n){let i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Sy(e,{min:t,max:n,minLimit:i,maxLimit:s},o){let r=(e-n+t)/2;t-=r,n+=r;let a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return Ae(t,a,c)&&(t=a),Ae(n,l,c)&&(n=l),t<i?(t=i,n=Math.min(i+e,s)):n>s&&(n=s,t=Math.max(s-e,i)),{min:t,max:n}}function ti(e,{min:t,max:n},i,s=!1){let o=st(e.chart),{options:r}=e,a=_y(e,i),{minRange:l=0}=a,c=_h(o,e,a,"min",-1/0),u=_h(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;let d=e.max-e.min,f=s?Math.max(n-t,l):d;if(s&&f===l&&d<=l)return!0;let p=Sy(f,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=p.min,r.max=p.max,o.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function Ey(e,t,n,i){let s=Vh(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return ti(e,o,i,!0)}function My(e,t,n,i){let s=wy(e,t,n);return ti(e,s,i,!0)}function Ty(e,t,n,i){ti(e,ky(e,t,n),i,!0)}function Cy(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Py(e,t,n,i){let s=Vh(e,t,n);e.min===e.max&&t<1&&Cy(e);let o={min:e.min+kh(s.min),max:e.max-kh(s.max)};return ti(e,o,i,!0)}function Dy(e){return e.isHorizontal()?e.width:e.height}function Ay(e,t,n){let s=e.getLabels().length-1,{min:o,max:r}=e,a=Math.max(r-o,1),l=Math.round(Dy(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l)),u;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,u=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,u=o===0),ti(e,{min:o,max:r},n)||u}function Fh(e,t,n,i=!1){let{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Oy[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:ti(e,{min:c,max:u},n,i?"pan":!1)}function Sh(e,t,n){return Fh(e,t,n,!0)}function Ry(e,t,n){let{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;let r=n[i];return r.min!==s||r.max!==o}function Eh(e,t){$(e,(n,i)=>{t[i]||delete e[i]})}function Oi(e,t){let{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return $(n,function(o){Ry(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Eh(i,n),Eh(s,n),i}function Mh(e,t,n,i){let s=Ul[e.type]||Ul.default;z(s,[e,t,n,i])}function Th(e,t,n,i){let s=Gl[e.type]||Gl.default;z(s,[e,t,n,i])}function Iy(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Zl(e,t,n="none",i="api"){let{x:s=1,y:o=1,focalPoint:r=Iy(e)}=typeof t=="number"?{x:t,y:t}:t,a=st(e),{options:{limits:l,zoom:c}}=a;Oi(e,a);let u=s!==1,d=o!==1,f=Nh(c,r,e);$(f||e.scales,function(p){p.isHorizontal()&&u?Mh(p,s,r,l):!p.isHorizontal()&&d&&Mh(p,o,r,l)}),e.update(n),z(c.onZoom,[{chart:e,trigger:i}])}function Hh(e,t,n,i="none",s="api"){let o=st(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Oi(e,o);let c=Tn(l,"x",e),u=Tn(l,"y",e);$(e.scales,function(d){d.isHorizontal()&&c?Th(d,t.x,n.x,r):!d.isHorizontal()&&u&&Th(d,t.y,n.y,r)}),e.update(i),z(a.onZoom,[{chart:e,trigger:s}])}function Ny(e,t,n,i="none",s="api"){let o=st(e);Oi(e,o);let r=e.scales[t];ti(r,n,void 0,!0),e.update(i),z(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Ly(e,t="default"){let n=st(e),i=Oi(e,n);$(e.scales,function(s){let o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[s.id]}),e.update(t),z(n.options.zoom.onZoomComplete,[{chart:e}])}function zy(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:i,max:s}=n;return W(s.options,s.scale)-W(i.options,i.scale)}function Vy(e){let t=st(e),n=1,i=1;return $(e.scales,function(s){let o=zy(t,s.id);if(o){let r=Math.round(o/(s.max-s.min)*100)/100;n=Math.min(n,r),i=Math.max(i,r)}}),n<1?n:i}function Ch(e,t,n,i){let{panDelta:s}=i,o=s[e.id]||0;me(o)===me(t)&&(t+=o);let r=Yl[e.type]||Yl.default;z(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function Bh(e,t,n,i="none"){let{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=st(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Oi(e,r);let u=s!==0,d=o!==0;$(n||e.scales,function(f){f.isHorizontal()&&u?Ch(f,s,l,r):!f.isHorizontal()&&d&&Ch(f,o,l,r)}),e.update(i),z(c,[{chart:e}])}function Wh(e){let t=st(e);Oi(e,t);let n={};for(let i of Object.keys(e.scales)){let{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Fy(e){let t=st(e),n={};for(let i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function Hy(e){let t=Wh(e);for(let n of Object.keys(e.scales)){let{min:i,max:s}=t[n];if(i!==void 0&&e.scales[n].min!==i||s!==void 0&&e.scales[n].max!==s)return!0}return!1}function Ph(e){let t=st(e);return t.panning||t.dragging}function $t(e,t){let{handlers:n}=st(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function zs(e,t,n,i){let{handlers:s,options:o}=st(e),r=s[n];if(r&&r.target===t)return;$t(e,n),s[n]=l=>i(e,l,o),s[n].target=t;let a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function By(e,t){let n=st(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Wy(e,t){let n=st(e);!n.dragStart||t.key!=="Escape"||($t(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Kl(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Zt(e,t)}function jh(e,t,n){let{onZoomStart:i,onZoomRejected:s}=n;if(i){let o=Kl(t,e);if(z(i,[{chart:e,event:t,point:o}])===!1)return z(s,[{chart:e,event:t}]),!1}}function jy(e,t){if(e.legend){let o=Zt(t,e);if(qt(o,e.legend))return}let n=st(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Ih(Vs(i),t)||ql(Vs(s.drag),t))return z(s.onZoomRejected,[{chart:e,event:t}]);jh(e,t,s)!==!1&&(n.dragStart=t,zs(e,e.canvas.ownerDocument,"mousemove",By),zs(e,window.document,"keydown",Wy))}function $y({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y,o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function Ah(e,t,n,{min:i,max:s,prop:o}){e[i]=Dh(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Dh(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Uy(e,t,n){let i={begin:Kl(t.dragStart,e),end:Kl(t.dragEnd,e)};if(n){let s=e.chartArea.width/e.chartArea.height;$y(i,s)}return i}function $h(e,t,n,i){let s=Tn(t,"x",e),o=Tn(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:d}=e.chartArea,f={top:r,left:a,right:l,bottom:c},p=Uy(e,n,i&&s&&o);s&&Ah(f,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&Ah(f,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});let b=f.right-f.left,x=f.bottom-f.top;return{...f,width:b,height:x,zoomX:s&&b?1+(u-b)/u:1,zoomY:o&&x?1+(d-x)/d:1}}function Gy(e,t){let n=st(e);if(!n.dragStart)return;$t(e,"mousemove");let{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=$h(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Tn(i,"x",e)?a.width:0,c=Tn(i,"y",e)?a.height:0,u=Math.sqrt(l*l+c*c);if(n.dragStart=n.dragEnd=null,u<=o){n.dragging=!1,e.update("none");return}Hh(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,z(s,[{chart:e}])}function Yy(e,t,n){if(ql(Vs(n.wheel),t)){z(n.onZoomRejected,[{chart:e,event:t}]);return}if(jh(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Ky(e,t){let{handlers:{onZoomComplete:n},options:{zoom:i}}=st(e);if(!Yy(e,t,i))return;let s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};Zl(e,a,"zoom","wheel"),z(n,[{chart:e}])}function Xy(e,t,n,i){n&&(st(e).handlers[t]=xy(()=>z(n,[{chart:e}]),i))}function qy(e,t){let n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(zs(e,n,"wheel",Ky),Xy(e,"onZoomComplete",o,250)):$t(e,"wheel"),s.enabled?(zs(e,n,"mousedown",jy),zs(e,n.ownerDocument,"mouseup",Gy)):($t(e,"mousedown"),$t(e,"mousemove"),$t(e,"mouseup"),$t(e,"keydown"))}function Zy(e){$t(e,"mousedown"),$t(e,"mousemove"),$t(e,"mouseup"),$t(e,"wheel"),$t(e,"click"),$t(e,"keydown")}function Jy(e,t){return function(n,i){let{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;let r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(ql(Vs(s),r)||Ih(Vs(o.drag),r))?(z(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Qy(e,t){let n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i,o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function Uh(e,t,n){if(t.scale){let{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=Qy(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Tn(l,"x",e)?o:1,y:a.y&&Tn(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Zl(e,c,"zoom","pinch"),t.scale=n.scale}}function tv(e,t,n){if(t.options.zoom.pinch.enabled){let i=Zt(n,e);z(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,z(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function ev(e,t,n){t.scale&&(Uh(e,t,n),t.scale=null,z(t.options.zoom.onZoomComplete,[{chart:e}]))}function Gh(e,t,n){let i=t.delta;i&&(t.panning=!0,Bh(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function nv(e,t,n){let{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;let r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(z(s,[{chart:e,event:n,point:a}])===!1)return z(o,[{chart:e,event:n}]);t.panScales=Nh(t.options.pan,a,e),t.delta={x:0,y:0},Gh(e,t,n)}function iv(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,z(t.options.pan.onPanComplete,[{chart:e}]))}function Oh(e,t){let n=st(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Ai.default.Manager(i);o&&o.pinch.enabled&&(r.add(new Ai.default.Pinch),r.on("pinchstart",a=>tv(e,n,a)),r.on("pinch",a=>Uh(e,n,a)),r.on("pinchend",a=>ev(e,n,a))),s&&s.enabled&&(r.add(new Ai.default.Pan({threshold:s.threshold,enable:Jy(e,n)})),r.on("panstart",a=>nv(e,n,a)),r.on("panmove",a=>Gh(e,n,a)),r.on("panend",()=>iv(e,n))),Xl.set(e,r)}function Rh(e){let t=Xl.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Xl.delete(e))}function sv(e,t){let{pan:n,zoom:i}=e,{pan:s,zoom:o}=t;return i?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==s?.enabled||n?.threshold!==s?.threshold}function _r(e,t,n){let i=n.zoom.drag,{dragStart:s,dragEnd:o}=st(e);if(i.drawTime!==t||!o)return;let{left:r,top:a,width:l,height:c}=$h(e,n.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),u=e.ctx;u.save(),u.beginPath(),u.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",u.fillRect(r,a,l,c),i.borderWidth>0&&(u.lineWidth=i.borderWidth,u.strokeStyle=i.borderColor||"rgba(225,225,225)",u.strokeRect(r,a,l,c)),u.restore()}var Ai,Vs,Ih,ql,$l,kh,Oy,Ul,Gl,Yl,Dh,Xl,ov,Yh,Kh=M(()=>{Ai=Lg(yh());wh();Vs=e=>e&&e.enabled&&e.modifierKey,Ih=(e,t)=>e&&t[e+"Key"],ql=(e,t)=>e&&!t[e+"Key"];$l=new WeakMap;kh=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);Oy={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};Ul={category:Py,default:Ey,logarithmic:My},Gl={default:Ty},Yl={category:Ay,default:Fh,logarithmic:Sh,timeseries:Sh};Dh=(e,t,n)=>Math.min(n,Math.max(t,e));Xl=new WeakMap;ov="2.2.0";Yh={id:"zoom",version:ov,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let i=st(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Ai.default&&Oh(e,n),e.pan=(s,o,r)=>Bh(e,s,o,r),e.zoom=(s,o)=>Zl(e,s,o),e.zoomRect=(s,o,r)=>Hh(e,s,o,r),e.zoomScale=(s,o,r)=>Ny(e,s,o,r),e.resetZoom=s=>Ly(e,s),e.getZoomLevel=()=>Vy(e),e.getInitialScaleBounds=()=>Wh(e),e.getZoomedScaleBounds=()=>Fy(e),e.isZoomedOrPanned=()=>Hy(e),e.isZoomingOrPanning=()=>Ph(e)},beforeEvent(e,{event:t}){if(Ph(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=st(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let i=st(e),s=i.options;i.options=n,sv(s,n)&&(Rh(e),Oh(e,n)),qy(e,n)},beforeDatasetsDraw(e,t,n){_r(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){_r(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){_r(e,"beforeDraw",n)},afterDraw(e,t,n){_r(e,"afterDraw",n)},stop:function(e){Zy(e),Ai.default&&Rh(e),vy(e)},panFunctions:Yl,zoomFunctions:Ul,zoomRectFunctions:Gl}});function Jl(e){let t=[],n=()=>t.forEach(l=>l()),i=P(null),s=null;return{canvasRef:i,init:()=>{let l=i.value;if(!l)return console.error("createLineChart: canvas ref not set",new Error().stack),n;re.register(Yh,Ci,Zn,Ti,Jn,En,ph,mh),s=new re(l,{type:"line",data:e.data.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{align:"start",position:"bottom"},title:{display:!1}}}});let c=e.data.subscribe(d=>{s&&(s.data=d,s.update())}),u=new ResizeObserver(()=>s?.resize());return u.observe(l.parentElement),t.push(()=>{u.disconnect(),s?.destroy(),s=null,c()}),()=>n()},resetZoom:()=>s?.resetZoom(),getZoomLevel:()=>s?.getZoomLevel()??0}}var Xh=M(()=>{"use strict";V();xh();Kh()});var kr=M(()=>{"use strict";Td();Cd();Pd();Dd();Xh()});var Ql,qh=M(()=>{"use strict";V();q();kr();Ql=e=>{let t=e.minContainerWidth??250,n=[],i=()=>{n.forEach(y=>y()),n.length=0},s=P(null),o=P(0),r=P(0),a=gn(null),l=gn(null),[c,u]=as(),d=Va(a);n.push(u);let f=y=>{y.preventDefault(),s.value={...c.value},o.value=r.value,console.log("onMouseDown",{startMouse:s.value,prevFirstContainerWidth:o.value,firstContainerWidth:r.value})},p=()=>s.value=null,b=y=>{if(s.value==null||l.current==null)return;let w=Math.max(o.value+y.x-s.value.x,t);r.value=Math.min(w,l.current.clientWidth-t),console.log("onMouseMove",w,r.value)},x=()=>{l.current!=null&&l.current.clientWidth-t<r.value&&(r.value=Math.max(l.current.clientWidth-t,t))};return window.addEventListener("mouseup",p),window.addEventListener("mousemove",b),window.addEventListener("resize",x),n.push(()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",b),window.removeEventListener("resize",x)}),Ca(()=>{if(l.current)return r.value=l.current.clientWidth/2,d.init(),()=>{d.dispose()}}),d.state.width.subscribe(y=>{console.log("width",y)}),Ft(()=>i()),({children:y,className:w,..._})=>{let[S,T]=Array.isArray(y)?y:[];return m("div",{className:ut("flex-grow grid gap-2 items-start w-full relative",Z(w)),ref:l,style:{gridTemplateColumns:\`\${r}px 1fr\`},..._},m("div",{ref:a,className:"firstContainer w-full h-full"},S),d.state.width.value!=0&&m("div",{className:"w-8 flex justify-center h-full absolute top-0 -translate-x-1/2 cursor-col-resize z-[9999]",style:{left:\`\${d.state.width.value}px\`},onmousedown:f},m("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m("div",{className:"secondContainer h-full"},T))}}});function Cn({root:e,className:t}){let{objectKeysChunkSize:n}=J.viewerSettings.value,i=e.page.value,s=e.children.slice(0,(i+1)*n),o=s.length<e.children.length;return m(vt,null,m("div",{className:ut("flex flex-col items-start w-full",Z(t))},s.map(r=>m("div",{key:r.path,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},m(Sr,{node:r})))),o&&m("button",{onclick:()=>e.page.value++,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}))))}function Sr({node:e}){switch(e.kind){case"null":case"undefined":case"string":case"number":case"bigint":case"boolean":case"symbol":case"function":case"dom-node":case"error":return m(rv,{node:e});case"object":return m(lv,{node:e});case"array":return m(cv,{node:e});case"array-chunk":return m(uv,{node:e});case"signal":return m(dv,{node:e})}}function rv({node:e}){let{label:t,path:n,raw:i,kind:s}=e;return m(Er,null,m("label",{className:"text-xs truncate",title:n},t),m(av,{kind:s,raw:i}))}function av({kind:e,raw:t}){switch(e){case"null":return m("small",{className:"text-neutral-300"},"null");case"undefined":return m("small",{className:"text-neutral-300"},"undefined");case"dom-node":return m("small",{className:"text-neutral-300"},"<",m("span",{style:"color: #f0a05e"},t.nodeName),"/>");case"error":{let n=t;return m("small",{className:"text-neutral-300"},n.message,"cause"in n&&!!n.cause&&\` (\${String(n.cause)})\`)}case"string":return m("small",{className:"text-neutral-300"},\`"\${t}"\`);case"number":case"bigint":return m("small",{className:"text-neutral-300"},t);case"boolean":return m("small",{className:"text-neutral-300"},t?"true":"false");case"symbol":return m("small",{className:"text-neutral-300"},t.toString());case"function":return m("small",{className:"text-neutral-300 italic"},\`\\u0192 \${t.name??"anonymous"}()\`)}}function lv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Er,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n!==null&&m(Cn,{root:{children:n,page:e.page}}))}function cv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Er,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),t?m("small",{className:"text-neutral-300"},\`Array(\${e.length})\`):n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Sr,{node:i}))))}function uv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m("div",{className:"flex flex-col items-start gap-1 w-full"},m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Sr,{node:i}))))}function dv({node:e}){let t=e.viewerNode.value;return m(Er,null,m("div",{className:"flex items-center gap-2"},m("label",{className:"text-xs truncate",title:e.path},e.label),m("span",{className:"text-[10px] italic text-primary border border-primary/40 px-1 rounded leading-none py-px"},"signal")),m("div",{className:"pl-2 w-full"},m(Sr,{node:t})))}function Er({children:e}){return m("div",{className:"flex flex-col items-start gap-1 w-full"},e)}var tc=M(()=>{"use strict";V();V();q();Ao();Ce()});function Tt(){return{collapsed:new Map,page:new Map,children:new Map,signalNodes:new Map}}function xe(e,t,n){n.page.set(t,e.page),Hs(e.children,n)}function Hs(e,t){for(let n of e)if(n.kind==="object"){t.collapsed.set(n.path,n.collapsed),t.page.set(n.path,n.page),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Hs(i,t)}else if(n.kind==="array"||n.kind==="array-chunk"){t.collapsed.set(n.path,n.collapsed),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Hs(i,t)}else n.kind==="signal"&&(t.signalNodes.set(n.path,n),Hs([n.viewerNode.peek()],t))}function ae(e){for(let t of e.collapsed.values())L.dispose(t);for(let t of e.page.values())L.dispose(t);for(let t of e.children.values())L.dispose(t);for(let t of e.signalNodes.values())t.unsubscribe(),L.dispose(t.viewerNode)}function fv(e){if(e===null)return"null";if(e===void 0)return"undefined";let t=window.opener?window.opener.Node:window.Node;if(e instanceof t)return"dom-node";let n=window.opener?window.opener.Error:window.Error;if(e instanceof n)return"error";let i=typeof e;return i==="string"?"string":i==="number"?"number":i==="bigint"?"bigint":i==="boolean"?"boolean":i==="symbol"?"symbol":i==="function"?"function":null}function Fs(e,t,n,i,s){let o=fv(e);if(o!==null)return{kind:o,label:t,path:n,raw:e};if(L.isSignal(e)){let d=e,f=\`\${n}.$value\`,p=Fs(d.peek(),"value",f,i,s),b=P(p),x=d.subscribe(y=>{let w=Tt();Hs([b.peek()],w),b.value=Fs(y,"value",f,w,s),ae(w)});return{kind:"signal",label:t,path:n,signal:d,viewerNode:b,unsubscribe:x}}if(Array.isArray(e)){let d=i.collapsed.get(n)??P(!0);i.collapsed.delete(n);let f=P(null);return{kind:"array",label:t,path:n,collapsed:d,length:e.length,children:f,buildChildren:()=>{if(f.peek()===null)if(e.length>s.arrayChunkSize){let b=Math.ceil(e.length/s.arrayChunkSize);f.value=Array.from({length:b},(x,y)=>{let w=y*s.arrayChunkSize,_=Math.min((y+1)*s.arrayChunkSize,e.length),S=\`\${n}[\${w}..\${_-1}]\`,T=P(!0),E=P(null),D=e.slice(w,_);return{kind:"array-chunk",label:\`[\${w}..\${_-1}]\`,path:S,collapsed:T,range:{start:w,end:_},children:E,buildChildren:()=>{E.peek()===null&&(E.value=D.map((A,N)=>Fs(A,(w+N).toString(),\`\${n}[\${w+N}]\`,Tt(),s)))}}})}else f.value=e.map((b,x)=>Fs(b,x.toString(),\`\${n}[\${x}]\`,Tt(),s))}}}let r=i.collapsed.get(n)??P(!0);i.collapsed.delete(n);let a=i.page.get(n)??P(0);i.page.delete(n);let l=P(null),c=e;return{kind:"object",label:t,path:n,collapsed:r,page:a,children:l,buildChildren:()=>{l.peek()===null&&(l.value=Zh(c,n,Tt(),s))}}}function Zh(e,t,n,i){return Object.keys(e).map(s=>Fs(e[s],s,\`\${t}.\${s}\`,n,i))}function sn(e,t,n,i){let s=n.page.get(t)??P(0);n.page.delete(t);let o=Zh(e,t,n,i);return{page:s,children:o}}var ec=M(()=>{"use strict";V()});var Bs=M(()=>{"use strict";Md();qh();tc();ec()});function Mr(e){e&&("nodes"in e?e.nodes.forEach(Mr):(Mr(e.child),Mr(e.sibling)))}function Jh(e,t,n){let i=new Map;Tr(n,i);let s=e.rootNode,o=ic();if(s){let r=t.trim().toLowerCase(),a=r?r.split(/\\s+/):[];o.nodes.push(...ep(s,a,i))}for(let{collapsed:r}of i.values())L.dispose(r);return o}function Tr(e,t){if(e)if("nodes"in e)for(let n of e.nodes)Tr(n,t);else{let{id:n,collapsed:i}=e;t.set(e.kiruNode,{id:n,collapsed:i}),Tr(e.child,t),Tr(e.sibling,t)}}function ep(e,t,n=new Map){let i=[],s=e;for(;s;){let o=ep(s.child,t,n);if(typeof s.type!="function")i.push(...o);else{let r=Vn(s);if(gv(t,r)){let a=mv(s,r,n);a.child=o[0]??null;for(let l=0;l<o.length;l++)o[l].parent=a,o[l].sibling=o[l+1]??null;i.push(a)}else i.push(...o)}s=s.sibling}return i}function gv(e,t){let n=t.toLowerCase();return e.every(i=>n.includes(i))}function ic(...e){return{value:"ROOT",nodes:e}}function mv(e,t,n=new Map){let{id:i,collapsed:s}=n.get(e)??{id:crypto.randomUUID(),collapsed:P(!0)};return n.delete(e),{id:i,name:t,kiruNode:e,collapsed:s,parent:null,child:null,sibling:null}}function nc(e){let t=Ri.peek();if(!t)return;let n=sc(e,t);if(!n)return;let i=n.parent;for(;i;)i.collapsed.value=!1,i=i.parent}function np(e){e&&nc(Ut.peek())}function bv(e){let t=Ri.peek();if(!t)return;let n=sc(Ut.peek(),t);n?.child&&(n.collapsed.value=e)}function xv(e,t){let n=Array.from(e.querySelectorAll("[data-graph-node-id]"));if(n.length===0)return;let i=Ri.peek(),s=-1;if(i){let c=sc(Ut.peek(),i);c&&(s=n.findIndex(u=>u.dataset.graphNodeId===c.id))}let r=s===-1?t==="down"?0:n.length-1:(s+(t==="up"?-1:1)+n.length)%n.length,a=n[r];if(!a)return;let l=yv(Ut.peek(),a);l&&(Ri.sneak(l.kiruNode),Ri.notify(c=>c!==np))}function yv(e,t){let n=t.dataset.graphNodeId;if(!n)return null;let i=s=>s?s.id===n?s:i(s.child)??i(s.sibling):null;for(let s of e.nodes){let o=i(s);if(o)return o}return null}function sc(e,t){let n=i=>i?i.kiruNode===t?i:n(i.child)??n(i.sibling):null;for(let i of e.nodes){let s=n(i);if(s)return s}return null}var hv,Ri,pv,Ut,tp,Qh,ip=M(()=>{"use strict";V();Ce();Fn();({selectedApp:hv,selectedNode:Ri,appSearchTerm:pv}=J),Ut=P(ic()),tp=()=>(window.addEventListener("keydown",Qh),()=>window.removeEventListener("keydown",Qh));Vt(()=>{let e=hv.value,t=pv.value;if(!e){Mr(Ut.peek()),Ut.value=ic();return}Ut.value=Jh(e,t,Ut.peek()),nc(Ut.peek());let n=i=>{i===e&&(Ut.value=Jh(i,t,Ut.peek()),nc(Ut.peek()))};return dt().on("update",n),()=>dt().off("update",n)});Ri.subscribe(np);Qh=e=>{Da(t=>{if(e.key==="l"&&e.ctrlKey){e.preventDefault(),J.appSearchInput.value?.focus(),J.appSearchInput.value?.select();return}if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;if(J.appSearchInput.value?.matches(":focus")){if(!e.altKey)return;e.preventDefault()}let n=e.key==="ArrowUp"?"up":e.key==="ArrowDown"?"down":e.key==="ArrowLeft"?"left":"right";if(n==="left"||n==="right"){bv(n==="left");return}xv(t,n)})}});function op(){return Mt(()=>tp()),()=>m("div",{className:"flex-grow p-2 sticky top-0"},m("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},m("input",{autofocus:!0,ref:wv,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text","bind:value":vv})),m("div",{className:"flex flex-col"},m(ge,{from:Ut},e=>m(_v,{root:e}))))}function _v({root:e}){return e.nodes.map(t=>m(oc,{node:t,traverseSiblings:!0}))}function oc({node:e,traverseSiblings:t=!0}){let n=e.collapsed.value,i=sp.value===e.kiruNode,s=o=>{o.preventDefault(),o.stopPropagation(),e.collapsed.value=!e.collapsed.value};return m(vt,null,m("div",{"data-graph-node-id":e.id,className:"pl-4 mb-1 w-full"},m("button",{className:ut("flex gap-2 items-center px-2 py-0.5 w-full",i?"bg-crimson text-white":""),onclick:()=>sp.value=e.kiruNode},e.child&&m(Xe,{className:ut("transition-transform duration-200 w-4 h-4",n?"":"rotate-90"),onclick:s}),m("div",{className:e.child?"":"ml-6"},m("span",{className:i?"":"text-neutral-400"},"<"),m("span",{className:ut("font-medium",i?"":"text-crimson")},e.name),m("span",{className:i?"":"text-neutral-400"},">"))),!n&&e.child&&m(oc,{node:e.child})),t&&m(kv,{node:e}))}function kv({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m(vt,null,t.map(i=>m(oc,{node:i,traverseSiblings:!1})))}var sp,vv,wv,rp=M(()=>{"use strict";V();Ce();ip();Bs();q();({selectedNode:sp,appSearchTerm:vv,appSearchInput:wv}=J)});function cp(e,t){let n=Ws.peek();if(!e){n&&up(n.props),Ws.value=null;return}let i=n?.node===e,s=Tt();i&&n?xe(n.props.root,"props",s):n&&up(n.props);let o={...e.props};delete o.children;let r=i?n?.props.collapsed??P(!0):P(!0),a=sn(o,"props",s,t);ae(s),Ws.value={node:e,name:Vn(e),props:{root:a,collapsed:r}}}function up(e){L.dispose(e.collapsed),L.dispose(e.root.page);let t=Tt();xe(e.root,"props",t),ae(t)}var ap,Sv,lp,Ws,dp=M(()=>{"use strict";V();q();Ce();Fn();ec();({selectedNode:ap,selectedApp:Sv,viewerSettings:lp}=J),Ws=P(null);Vt(()=>{let e=ap.value,t=Sv.value,n=lp.value;if(cp(e,n),!e||!t)return;let i=s=>{if(s===t){if(_o(e)){ap.value=null;return}cp(e,lp.peek())}};return dt().on("update",i),()=>dt().off("update",i)})});function fp(){let e=Ws.value;if(!e)return null;let{name:t,props:n}=e,i=n.collapsed.value;return m("div",{className:"flex-grow p-2 sticky top-0"},m("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},m("div",{className:"flex gap-2 items-center"},"<"+t+">")),m("div",{className:"flex flex-col"},m("button",{onclick:()=>n.collapsed.value=!n.collapsed.value,className:n.root.children.length===0?"opacity-50 cursor-default":"cursor-pointer"},m("span",{className:"flex items-center gap-2 font-medium"},m(Xe,{className:\`transition \${i?"":"rotate-90"}\`}),"props")),i?null:m("div",{className:"p-2",...n},m(Cn,{root:n.root}))))}var hp=M(()=>{"use strict";V();tc();Ao();dp()});function rc(){let e=gp.value;return m(vt,null,m("div",{className:"flex items-center justify-between gap-4 p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m("div",{className:"flex items-center gap-4"},m("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:t=>gp.value=pp.peek().find(n=>n.name===t.currentTarget.value)??null},m("option",{value:"",disabled:!0},"Select App"),m(Ge,{each:pp},t=>m("option",{key:t.id,value:t.name},t.name))),m("button",{title:"Toggle Component Inspection",onclick:Ev,className:\`p-1 rounded \${Mv.value?"bg-neutral-900":""}\`},m(rs,null)))),m(Ql,{minContainerWidth:100,className:"min-w-[480px]"},m(op,null),m(fp,null)))}var pp,gp,Cr,Ev,Mv,mp=M(()=>{"use strict";V();Ce();Bs();rp();hp();({apps:pp,selectedApp:gp,componentSelection:Cr}=J),Ev=()=>{Cr.value={enabled:!Cr.value.enabled,componentNode:Cr.value.componentNode}},Mv=Kt(()=>Cr.value.enabled)});function _p(e){if(xp)return;xp=!0;let t=e.profilingContext,n=s=>{if(se(s)||ze.value.find(a=>a.app.name===s.name))return;let r=vp(e,t,s);ze.value=[...ze.value,r]},i=s=>{se(s)||(console.log("onAppUnmounted",s),ze.value.find(o=>o.app.name===s.name)?.dispose())};t.appStats.forEach((s,o)=>{if(se(o))return;let r=vp(e,t,o);ze.value=[...ze.value,r]}),e.on("mount",n),e.on("unmount",i)}function yp(e,t){return{mountDuration:e.mountDuration(t).toFixed(2),totalTicks:e.totalTicks(t).toLocaleString(),avgTickDuration:e.averageTickDuration(t).toFixed(2),lastTickDuration:e.lastTickDuration(t).toFixed(2)}}function vp(e,t,n){let i=[],s=()=>{i.forEach(u=>u()),ze.value=ze.value.filter(u=>u.app.name!==n.name)},o=Tv(),r=P({labels:[(performance.now()/1e3).toFixed(2)],datasets:wp(o)});i.push(()=>L.dispose(r)),Object.entries(o).forEach(([u,{values:d}])=>{let f=b=>{b.name===n.name&&d[d.length-1]++},p=u;t.addEventListener(p,f),i.push(()=>t.removeEventListener(p,f))});let a=setInterval(()=>{Object.values(o).forEach(d=>{d.values.push(0),d.values.length>bp&&d.values.shift()});let u=[...r.value.labels,(performance.now()/1e3).toFixed(2)];u.length>bp&&u.shift(),r.value={labels:u,datasets:wp(o)}},100);i.push(()=>clearInterval(a));let l=P(yp(t,n)),c=u=>{u.name===n.name&&(l.value=yp(t,u))};return e.on("update",c),i.push(()=>e.off("update",c)),{app:n,stats:l,chartData:r,dispose:s}}function wp(e){return Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:[...n],fill:!1,borderColor:i,tension:.1}))}function Tv(){return{update:{values:[0],color:"#ad981f"},updateDirtied:{values:[0],color:"#b21f3a"},createNode:{values:[0],color:"#198019"},removeNode:{values:[0],color:"#5F3691"},updateNode:{values:[0],color:"#2f2f9d"},signalAttrUpdate:{values:[0],color:"#28888f"},signalTextUpdate:{values:[0],color:"#9b3b98"}}}var bp,ze,xp,kp=M(()=>{"use strict";V();Fn();bp=100,ze=P([]),xp=!1});function Sp(e){return m("svg",{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",...e},m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M12 16v-4"}),m("path",{d:"M12 8h.01"}))}var Ep=M(()=>{"use strict";V()});function js({pauseWhen:e}){let t=dt();return Mt(()=>_p(t)),m("div",{className:"flex flex-col gap-2"},m(Ge,{each:ze},n=>m(Cv,{item:n,pauseWhen:e})))}function Cv({item:e,pauseWhen:t}){let n=P(!1),i=P(e.chartData.peek()),s=Jl({data:i}),o=e.chartData.subscribe(c=>{n.peek()||t?.peek()||(i.value=c)});Ft(()=>o()),Mt(()=>s.init());let r=P(!1),a=()=>{n.value=!0},l=()=>{t?.peek()||(n.value=!1,i.value=e.chartData.peek(),s.resetZoom())};return()=>m("div",{title:e.app.name,className:"flex overflow-hidden"},m("canvas",{ref:s.canvasRef,className:"w-full max-w-full h-80 overflow-hidden",onmouseover:a,onmouseout:l,onmousedown:c=>{s.getZoomLevel()<=1||(c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation())}}),m("div",{className:"absolute top-1 right-1 flex flex-col gap-1 items-end"},m("button",{className:"p-1",onclick:()=>r.value=!r.value},m(Sp,{className:"w-4 h-4"})),m(ge,{from:{stats:e.stats,showStatsTooltip:r}},({stats:c,showStatsTooltip:u})=>u&&m("div",{className:"text-xs grid grid-cols-2 gap-x-4 bg-neutral-800 bg-opacity-60 hover:bg-opacity-80 rounded-md p-2",style:"grid-template-columns: auto auto;"},m("span",{className:"text-right"},"Mount duration:"),c.mountDuration," ms",m("span",{className:"text-right"},"Total updates:"),m("span",null,c.totalTicks),m("span",{className:"text-right"},"Avg. update duration:"),c.avgTickDuration," ms",m("span",{className:"text-right"},"Latest update:"),m("span",null,c.lastTickDuration," ms")))))}var Mp=M(()=>{"use strict";V();kr();Ce();kp();Ep()});var ac=M(()=>{"use strict";mp();Mp()});var Pr,Tp=M(()=>{"use strict";V();Bs();ac();Pr={Apps:{Icon:Oa,View:rc},FileRouter:{Icon:Na,View:()=>m("div",null,"FileRouter")},Profiling:{Icon:os,View:js},Settings:{Icon:Ia,View:()=>m("div",null,"Settings")}}});function Dv(){return m("button",{ref:J.rootRef,className:"flex gap-2 cursor-default"},m("nav",{className:"flex flex-col gap-2 justify-between"},m("div",{className:"flex flex-col gap-2"},Object.keys(Pr).map(e=>m(Av,{key:e,id:e})))),m("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto p-2 bg-neutral-400/5 rounded"},m(ge,{from:Pv},e=>m(e.View,null))))}function Av({id:e}){let{Icon:t}=Pr[e];return m("button",{key:e,onclick:()=>J.devtoolsTab.value=e,className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(J.devtoolsTab.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},m(t,{className:"text-primary"}),m("span",{className:"hidden sm:inline"},e))}var Pv,Cp=M(()=>{"use strict";V();Ce();Tp();Pv=Kt(()=>Pr[J.devtoolsTab.value])});var Pp={};Br(Pp,{AppsIcon:()=>Oa,AppsTabView:()=>rc,ChevronRightIcon:()=>Xe,CloseIcon:()=>Ra,CogIcon:()=>Ia,ComponentIcon:()=>qm,DevtoolsApp:()=>Dv,ExpandIcon:()=>Zm,ExternalLinkIcon:()=>ss,FlameIcon:()=>La,FolderTreeIcon:()=>Na,GaugeIcon:()=>os,GripIcon:()=>Jm,MouseIcon:()=>rs,OpenIcon:()=>Qm,ProfilingTabView:()=>js,RadioIcon:()=>za,ResizableSplit:()=>Ql,ResizeGripIcon:()=>Hn,ValueViewer:()=>Cn,ZapIcon:()=>tb,assert:()=>Ye,buildViewerRoot:()=>sn,clamp:()=>Ke,collectFromRoot:()=>xe,computeComponentHash:()=>mi,createDraggableController:()=>qe,createElementBoundingTracker:()=>Va,createLineChart:()=>Jl,createMousePositionTracker:()=>as,createResizableController:()=>Bn,devtoolsAppRootHasFocus:()=>Km,devtoolsState:()=>J,disposeCache:()=>ae,emptyCache:()=>Tt,findComponentByHash:()=>Aa,getFileLink:()=>is,getNodeName:()=>Vn,ifDevtoolsAppRootHasFocus:()=>Da,isDevtoolsApp:()=>se,kiruGlobal:()=>dt,trapFocus:()=>Ym,typedMapEntries:()=>Gm});var ei=M(()=>{"use strict";Cp();Bs();kr();Ce();ac();Fn()});var BM,$s,Us,ye,St,Dp,on,le,Ii=M(()=>{"use strict";V();BM=P(!1),$s=P(!1),Us=P(!1),ye=P(!1),St=P([]),Dp=Kt(()=>St.value.length>0),on=50,le=P(null)});var Gs=M(()=>{"use strict"});var Ov,Rv,Rp,Iv,Nv,Lv,Ip=M(()=>{"use strict";V();q();ei();Gs();Ii();Ov="kiru.devtools.debuggerPosition",Rv="kiru.devtools.debuggerSize",Rp=()=>{let e=qe({key:Ov,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Rv,storage:sessionStorage,minSize:[320,180]});Mt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:le.value==="debugger"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>le.value="debugger"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"auto",scrollbarWidth:"thin",minHeight:0}},m(Iv,null)),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))},Iv=()=>{let e=P([]);return Mt(()=>{let t=dt().devtools.subscribe(n=>{e.value=Array.from(n).map(i=>({...i,link:is(i.signal)}))});return()=>t()}),m("div",{className:"flex flex-col gap-2 p-2"},m(Ge,{each:e,fallback:m("div",{className:"flex flex-col items-center justify-center gap-2 py-8 px-4 text-center text-neutral-400 text-sm"},m("p",{className:"font-medium"},"No signals tracked"),m("p",{className:"text-xs text-neutral-500 max-w-[240px]"},"Use"," ",m("code",{className:"px-1 py-0.5 rounded bg-neutral-800 text-neutral-300 font-mono text-[11px]"},"DevTools.track(signal, label)")," ","in your app to inspect signal values here."))},t=>m(Nv,{key:\`\${t.signal.$id}:\${t.label}\${t.link}\`,entry:t})))},Nv=({entry:e})=>{let t=J.viewerSettings.peek(),n=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{value:s},i=P(sn(n(e.signal.peek()),e.label,Tt(),t));return Mt(()=>{let s=e.signal.subscribe(o=>{let r=Tt();xe(i.peek(),e.label,r),i.value=sn(n(o),e.label,r,t),ae(r)});return()=>{s();let o=Tt();xe(i.peek(),e.label,o),ae(o)}}),()=>m("div",{className:"rounded border border-neutral-700 text-xs"},m("div",{className:"flex items-center justify-between px-2 py-1 border-b border-neutral-700 font-medium text-neutral-300"},e.label,m(Lv,{link:e.link})),m(ge,{from:i},s=>m(Cn,{root:s})))},Lv=({link:e})=>e?m("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:e,onclick:t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),window.open(e)},title:"Open in editor"},"Open in editor",m(ss,{width:"0.65rem",height:"0.65rem"})):null});var zv,Vv,zp,Vp=M(()=>{"use strict";V();q();ei();Gs();Ii();zv="kiru.devtools.profilerPosition",Vv="kiru.devtools.profilerSize",zp=()=>{let e=qe({key:zv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Vv,storage:sessionStorage,minSize:[320,180],aspectRatio:2/1});Mt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:le.value==="profiler"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>le.value="profiler"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"hidden",minHeight:0}},m(js,{pauseWhen:e.isDragging})),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))}});function Dr({style:e,top:t,left:n,width:i,height:s,...o}){return m("div",{style:{...e,position:"absolute",zIndex:50,top:t+window.scrollY+"px",left:n+window.scrollX+"px",width:i+"px",height:s+"px",background:"linear-gradient(135deg, rgb(164 11 32 / 66%) 0%, rgb(82 14 47 / 80%) 80%)"},...o})}var lc=M(()=>{"use strict";V()});function Fv(e){let t=null,n=e;for(;n;){if(typeof n.type=="function"){let i=n,s=is(i.type);if(s){t={component:i,link:s};break}}n=n.parent}return t?{...t,elements:Hp(t.component.child)}:null}function Hp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Hp(n.child,t),n=n.sibling;return t}var Fp,Bp=M(()=>{"use strict";V();ei();Ii();lc();q();Fp=()=>{let[e,t]=as();Ft(()=>t());let n=P(null),i=null,s=()=>{let u=ye.value,{x:d,y:f}=e.value;if(!u){n.value=null;return}let p=document.elementsFromPoint(d,f),b=null;for(let E of p){let D=E.__kiruNode;if(D&&(b=Fv(D),b))break}if(!b){n.value=null;return}let x=1/0,y=1/0,w=-1/0,_=-1/0;for(let E of b.elements){let{top:D,left:O,width:A,height:N}=E.getBoundingClientRect();x=Math.min(x,O),y=Math.min(y,D),w=Math.max(w,O+A),_=Math.max(_,D+N)}let S=w-x,T=_-y;n.value={name:Vn(b.component),top:y,left:x,width:S,height:T,link:b.link,component:b.component}},o=()=>{i==null&&(i=requestAnimationFrame(()=>{i=null,s()}))};Vt([ye,e],o);let r=u=>{if(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),!ye.value||!n.value)return;let{name:d,link:f,component:p}=n.value;if(!f)return;let b=mi(p);ye.value=!1;let x=St.value,y=x.findIndex(w=>w.hash===b&&w.link===f);if(y!==-1){let w=x[y],_={...w,pulseGeneration:(w.pulseGeneration??0)+1},S=x.filter(T=>T.id!==w.id);St.value=[...S,_],le.value="componentInfo";return}St.value=[...x,{id:crypto.randomUUID(),name:d,link:f,component:p,unmounted:!1,hash:b,pulseGeneration:0}],le.value="componentInfo"},a=u=>{se(u)||o()};dt().on("update",a),window.addEventListener("resize",o),window.addEventListener("scroll",o);let l=new MutationObserver(o);l.observe(document.body,{childList:!0,subtree:!0});let c=new ResizeObserver(o);return c.observe(document.body),Ft(()=>{dt().off("update",a),window.removeEventListener("resize",o),window.removeEventListener("scroll",o),l.disconnect(),c.disconnect()}),({state:u})=>{let d=ye.value,f=n.value;return!d||!f||u==="exited"?null:m(Dr,{top:f.top+window.scrollY,left:f.left+window.scrollX,width:f.width,height:f.height,className:ut("text-white flex items-center justify-center",u==="entered"?"opacity-100":"opacity-90",u==="entered"?"scale-100":"scale-90"),title:"Click to open in editor",onclick:r},m("span",{className:"font-medium text-sm truncate max-w-full"},\`<\${f.name}>\`))}}});function $p(e){let t={...e.props};return delete t.children,t}function cc(e){let t=Tt();xe(e,"props",t),ae(t)}function Up(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Up(n.child,t),n=n.sibling;return t}function jv(e){if(!e.child)return null;let t=Up(e.child);if(t.size===0)return null;let n=1/0,i=1/0,s=-1/0,o=-1/0;for(let l of t){let{top:c,left:u,width:d,height:f}=l.getBoundingClientRect();n=Math.min(n,u),i=Math.min(i,c),s=Math.max(s,u+d),o=Math.max(o,c+f)}let r=s-n,a=o-i;return{top:i,left:n,width:r,height:a}}var Hv,Bv,Wv,$v,Gp,Yp=M(()=>{"use strict";V();q();ei();Gs();Ii();lc();Hv="kiru.devtools.componentInfoPosition",Bv="kiru.devtools.componentInfoSize",Wv=300;$v=()=>{let e=P(null),t=P(null),n=P(null),i=P(!1),s=P(!1),o=-1;Vt(()=>{let u=n.value;if(!u){let _=e.peek();_&&(cc(_),e.value=null);return}let d=St.value,f=d.find(_=>_.id===u);if(!f){let _=e.peek();_&&(cc(_),e.value=null);return}if(f.pulseGeneration!==o&&(o=f.pulseGeneration,f.pulseGeneration>0&&(s.value=!0,setTimeout(()=>{o===f.pulseGeneration&&(s.value=!1)},Wv))),!f.unmounted){let _=mi(f.component);t.value=_,f.hash!==_&&(St.value=d.map(S=>S.id===u?{...S,hash:_}:S))}if(f.unmounted)return;let p=e.peek(),b=Tt();p&&xe(p,"props",b);let x=J.viewerSettings.peek(),y=$p(f.component),w=sn(y,"props",b,x);e.value=w,ae(b)}),Ft(()=>{let u=e.peek();u&&(cc(u),e.value=null)});let r=qe({key:Hv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),a=Bn({key:Bv,storage:sessionStorage,minSize:[320,200]});Mt(()=>{r.init(),a.init();let u=d=>{let f=n.value;if(!f)return;let p=St.value,b=p.find(S=>S.id===f);if(!b||se(d))return;let x=Nt(b.component);if(x&&x!==d)return;if(b.unmounted){let S=t.value;if(!S)return;let T=Aa(d.rootNode,S);if(!T)return;St.value=p.map(E=>E.id===f?{...E,component:T,unmounted:!1}:E);return}if(_o(b.component)){St.value=p.map(S=>S.id===f?{...S,unmounted:!0}:S);return}let y=e.peek();if(!y)return;let w=J.viewerSettings.peek(),_=Tt();xe(y,"props",_),e.value=sn($p(b.component),"props",_,w),ae(_)};return dt().on("update",u),()=>{r.dispose(),a.dispose(),dt().off("update",u)}});let l=u=>{r.containerRef.value=u,r.handleRef.value=u,a.containerRef.value=u},c=u=>{a.handleRef.value=u};return({panel:u,state:d})=>{n.value||(n.value=u.id);let p=St.value.find(_=>_.id===u.id);if(!p)return null;let b=()=>{let _=St.value,S=_.find(T=>T.id===u.id);S&&(St.value=[..._.filter(T=>T.id!==u.id),S],le.value="componentInfo")},x=i.value,y=s.value,w=x&&!p.unmounted?jv(p.component):null;return m(vt,null,w&&m(Dr,{top:w.top+window.scrollY,left:w.left+window.scrollX,width:w.width,height:w.height,className:ut("pointer-events-none",d==="entered"?"opacity-100":"opacity-90")}),m("div",{ref:l,className:"fixed p-0.5 flex flex-col gap-2 select-none z-index-1001",style:{zIndex:le.value==="componentInfo"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${200}px\`,opacity:d==="entered"?1:0,cursor:a.isResizing.value?"se-resize":r.isDragging.value?"grabbing":"grab"},onclick:b,onmousedown:b,onmouseenter:()=>i.value=!0,onmouseleave:()=>i.value=!1},m("div",{style:{transition:"80ms ease-in-out",opacity:y?1:.75,flex:1,scrollbarWidth:"thin",minHeight:0,overflow:"hidden",boxShadow:y?"0 0 8px crimson":void 0},className:"rounded-lg bg-neutral-900 opacity-75 hover:opacity-100! shadow-lg"},m("div",{className:"flex flex-col text-sm overflow-auto"},m("div",{className:"flex items-center justify-between gap-2 p-2"},m("a",{href:p.link,className:ut("flex items-center justify-center gap-2","text-neutral-400 hover:text-neutral-200"),onclick:_=>{_.preventDefault(),_.stopPropagation(),window.open(p.link)},onmousedown:_=>_.stopPropagation(),title:"Open in editor"},\`<\${p.name}>\`,m(ss,{className:"w-4 h-4 shrink-0 pointer-events-none"})),m("div",{className:"flex items-center gap-2"},p.unmounted&&m("span",{className:"rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400"},"Unmounted"),m("button",{type:"button",className:"p-1 text-neutral-400 hover:text-neutral-200",onclick:()=>{St.value=St.value.filter(_=>_.id!==u.id)},title:"Close"},m(Ra,{className:"w-4 h-4 shrink-0 pointer-events-none"})))),m("div",{className:"pt-2 px-4"},m("div",{className:"mb-1.5 font-medium text-neutral-300 text-xs"},"Props"),m(ge,{from:e},_=>_?_.children.length===0?m("div",{className:"text-neutral-500 text-xs italic py-1"},"No props"):m(Cn,{root:_,className:"text-xs"}):null)))),m("div",{ref:c,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"}))))}},Gp=({state:e})=>m(Ge,{each:St},(t,n)=>m($v,{key:t.id,panel:t,index:n,state:e}))});var Kp=M(()=>{"use strict";Ip();Vp();Bp();Yp()});var Qp={};Br(Qp,{default:()=>Jp});function Jp(){let e=qe({storage:localStorage,key:Uv,defaultPosition:{type:"snapped",side:"bottom",percent:.5},getPadding:()=>[10,10],getDraggableBounds:()=>[window.innerWidth,window.innerHeight],onclick:()=>uc.value=!uc.value}),t=Kt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"column":"row"}),n=Kt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"row":"column"});return Mt(()=>{e.init();let i=e.containerRef.value,s=Zp.current;Vt([uc,e.snapSide,e.containerPos],(o,r,[a,l])=>{let[c,u]=[s.offsetWidth,s.offsetHeight],d=e.handleRef.value,f=d?.offsetWidth??0,p=d?.offsetHeight??0,b=0,x=0;if(r==="top"||r==="bottom"){let D=a+i.offsetWidth/2-c/2;b=Ke(D,10,window.innerWidth-10-c)-D}else{let D=l+i.offsetHeight/2-u/2;x=Ke(D,10,window.innerHeight-10-u)-D}let y=f/2+8+c/2,w=p/2+8+u/2,_=0,S=0;r==="left"?_=o?y:-y:r==="right"?_=o?-y:y:r==="top"?S=o?w:-w:S=o?-w:w;let T=-c/2+b+_,E=-u/2+x+S;s.style.transform=\`scale(\${o?1:0}) translate(\${T}px, \${E}px)\`,setTimeout(()=>{qp.value=!0},50)})}),()=>m(vt,null,m("div",{ref:e.containerRef,style:{transition:"80ms",opacity:qp.value?1:0,flexDirection:n},className:"z-999999 top-0 left-0 flex items-center justify-center"},m("button",{ref:e.handleRef,className:"rounded-full p-2 z-10",style:{background:"linear-gradient(135deg, rgb(143 1 1 / 90%) 0%, rgba(119, 14, 103, 0.89) 75%)"}},m(La,{className:"w-5 h-5"})),m("div",{ref:Zp,style:{transition:"80ms ease-in-out",transformOrigin:"0 0",flexDirection:t},className:ut("absolute left-1/2 top-1/2 z-0 flex p-1 gap-1","bg-neutral-900 rounded-xl shadow-sm")},m(dc,{active:$s,title:"Toggle Profiler",onclick:()=>$s.value=!$s.value},m(os,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Profiler")),m(dc,{active:Us,title:"Toggle Debugger",onclick:()=>Us.value=!Us.value},m(za,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Tracking")),m(dc,{active:ye,title:"Select Component",onclick:()=>{ye.value=!ye.value}},m(rs,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Inspect")))),m(gi,{in:$s,duration:{in:0,out:150},element:i=>i==="exited"?null:m(zp,{state:i})}),m(gi,{in:Us,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Rp,{state:i})}),m(gi,{in:ye,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Fp,{state:i})}),m(gi,{in:Dp,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Gp,{state:i})}))}function dc({className:e,active:t,...n}){let i=!!t?.value;return m("button",{className:ut("flex items-center px-1.5 py-0.5 gap-2","text-sm rounded-lg border border-white/10",i&&"bg-white/5 text-neutral-100",!i&&"bg-white/2.5 hover:bg-white/5 text-neutral-400",Z(e)),...n})}var Uv,qp,uc,Zp,tg=M(()=>{"use strict";V();q();ei();Ii();Gs();Kp();Uv="kiru.devtools.anchorPosition",qp=P(!1),uc=P(!1),Zp=gn(null)});var Ac=\`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
|
|
5420
|
+
\`;return function(){var C=new Error("get-stack-trace"),I=C&&C.stack?C.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=e.console&&(e.console.warn||e.console.log);return U&&U.call(e.console,k,I),h.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(g){if(g===i||g===null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(g),k=1;k<arguments.length;k++){var C=arguments[k];if(C!==i&&C!==null)for(var I in C)C.hasOwnProperty(I)&&(v[I]=C[I])}return v}:b=Object.assign;var x=p(function(g,v,k){for(var C=Object.keys(v),I=0;I<C.length;)(!k||k&&g[C[I]]===i)&&(g[C[I]]=v[C[I]]),I++;return g},"extend","Use \`assign\`."),y=p(function(g,v){return x(g,v,!0)},"merge","Use \`assign\`.");function w(h,g,v){var k=g.prototype,C;C=h.prototype=Object.create(k),C.constructor=h,C._super=k,v&&b(C,v)}function _(h,g){return function(){return h.apply(g,arguments)}}function S(h,g){return typeof h==r?h.apply(g&&g[0]||i,g):h}function T(h,g){return h===i?g:h}function E(h,g,v){f(N(g),function(k){h.addEventListener(k,v,!1)})}function P(h,g,v){f(N(g),function(k){h.removeEventListener(k,v,!1)})}function O(h,g){for(;h;){if(h==g)return!0;h=h.parentNode}return!1}function A(h,g){return h.indexOf(g)>-1}function N(h){return h.trim().split(/\\s+/g)}function j(h,g,v){if(h.indexOf&&!v)return h.indexOf(g);for(var k=0;k<h.length;){if(v&&h[k][v]==g||!v&&h[k]===g)return k;k++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function G(h,g,v){for(var k=[],C=[],I=0;I<h.length;){var U=g?h[I][g]:h[I];j(C,U)<0&&k.push(h[I]),C[I]=U,I++}return v&&(g?k=k.sort(function(yt,Dt){return yt[g]>Dt[g]}):k=k.sort()),k}function ot(h,g){for(var v,k,C=g[0].toUpperCase()+g.slice(1),I=0;I<s.length;){if(v=s[I],k=v?v+C:g,k in h)return k;I++}return i}var Pt=1;function Q(){return Pt++}function tt(h){var g=h.ownerDocument||h;return g.defaultView||g.parentWindow||e}var mt=/mobile|tablet|ip(ad|hone|od)|android/i,ue="ontouchstart"in e,ni=ot(e,"PointerEvent")!==i,rn=ue&&mt.test(navigator.userAgent),ve="touch",an="pen",Ve="mouse",Fe="kinect",Cn=25,nt=1,Pn=2,lt=4,Nt=8,Ks=1,Li=2,zi=4,Vi=8,Fi=16,we=Li|zi,Dn=Vi|Fi,gc=we|Dn,mc=["x","y"],Xs=["clientX","clientY"];function Qt(h,g){var v=this;this.manager=h,this.callback=g,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(k){S(h.options.enable,[h])&&v.handler(k)},this.init()}Qt.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(tt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(tt(this.element),this.evWin,this.domHandler)}};function ig(h){var g,v=h.options.inputClass;return v?g=v:ni?g=Rr:rn?g=Js:ue?g=Ir:g=Zs,new g(h,sg)}function sg(h,g,v){var k=v.pointers.length,C=v.changedPointers.length,I=g&nt&&k-C===0,U=g&(lt|Nt)&&k-C===0;v.isFirst=!!I,v.isFinal=!!U,I&&(h.session={}),v.eventType=g,og(h,v),h.emit("hammer.input",v),h.recognize(v),h.session.prevInput=v}function og(h,g){var v=h.session,k=g.pointers,C=k.length;v.firstInput||(v.firstInput=bc(g)),C>1&&!v.firstMultiple?v.firstMultiple=bc(g):C===1&&(v.firstMultiple=!1);var I=v.firstInput,U=v.firstMultiple,bt=U?U.center:I.center,yt=g.center=xc(k);g.timeStamp=c(),g.deltaTime=g.timeStamp-I.timeStamp,g.angle=Or(bt,yt),g.distance=qs(bt,yt),rg(v,g),g.offsetDirection=vc(g.deltaX,g.deltaY);var Dt=yc(g.deltaTime,g.deltaX,g.deltaY);g.overallVelocityX=Dt.x,g.overallVelocityY=Dt.y,g.overallVelocity=l(Dt.x)>l(Dt.y)?Dt.x:Dt.y,g.scale=U?cg(U.pointers,k):1,g.rotation=U?lg(U.pointers,k):0,g.maxPointers=v.prevInput?g.pointers.length>v.prevInput.maxPointers?g.pointers.length:v.prevInput.maxPointers:g.pointers.length,ag(v,g);var ke=h.element;O(g.srcEvent.target,ke)&&(ke=g.srcEvent.target),g.target=ke}function rg(h,g){var v=g.center,k=h.offsetDelta||{},C=h.prevDelta||{},I=h.prevInput||{};(g.eventType===nt||I.eventType===lt)&&(C=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},k=h.offsetDelta={x:v.x,y:v.y}),g.deltaX=C.x+(v.x-k.x),g.deltaY=C.y+(v.y-k.y)}function ag(h,g){var v=h.lastInterval||g,k=g.timeStamp-v.timeStamp,C,I,U,bt;if(g.eventType!=Nt&&(k>Cn||v.velocity===i)){var yt=g.deltaX-v.deltaX,Dt=g.deltaY-v.deltaY,ke=yc(k,yt,Dt);I=ke.x,U=ke.y,C=l(ke.x)>l(ke.y)?ke.x:ke.y,bt=vc(yt,Dt),h.lastInterval=g}else C=v.velocity,I=v.velocityX,U=v.velocityY,bt=v.direction;g.velocity=C,g.velocityX=I,g.velocityY=U,g.direction=bt}function bc(h){for(var g=[],v=0;v<h.pointers.length;)g[v]={clientX:a(h.pointers[v].clientX),clientY:a(h.pointers[v].clientY)},v++;return{timeStamp:c(),pointers:g,center:xc(g),deltaX:h.deltaX,deltaY:h.deltaY}}function xc(h){var g=h.length;if(g===1)return{x:a(h[0].clientX),y:a(h[0].clientY)};for(var v=0,k=0,C=0;C<g;)v+=h[C].clientX,k+=h[C].clientY,C++;return{x:a(v/g),y:a(k/g)}}function yc(h,g,v){return{x:g/h||0,y:v/h||0}}function vc(h,g){return h===g?Ks:l(h)>=l(g)?h<0?Li:zi:g<0?Vi:Fi}function qs(h,g,v){v||(v=mc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.sqrt(k*k+C*C)}function Or(h,g,v){v||(v=mc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.atan2(C,k)*180/Math.PI}function lg(h,g){return Or(g[1],g[0],Xs)+Or(h[1],h[0],Xs)}function cg(h,g){return qs(g[0],g[1],Xs)/qs(h[0],h[1],Xs)}var ug={mousedown:nt,mousemove:Pn,mouseup:lt},dg="mousedown",fg="mousemove mouseup";function Zs(){this.evEl=dg,this.evWin=fg,this.pressed=!1,Qt.apply(this,arguments)}w(Zs,Qt,{handler:function(g){var v=ug[g.type];v&nt&&g.button===0&&(this.pressed=!0),v&Pn&&g.which!==1&&(v=lt),this.pressed&&(v<&&(this.pressed=!1),this.callback(this.manager,v,{pointers:[g],changedPointers:[g],pointerType:Ve,srcEvent:g}))}});var hg={pointerdown:nt,pointermove:Pn,pointerup:lt,pointercancel:Nt,pointerout:Nt},pg={2:ve,3:an,4:Ve,5:Fe},wc="pointerdown",_c="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(wc="MSPointerDown",_c="MSPointerMove MSPointerUp MSPointerCancel");function Rr(){this.evEl=wc,this.evWin=_c,Qt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Rr,Qt,{handler:function(g){var v=this.store,k=!1,C=g.type.toLowerCase().replace("ms",""),I=hg[C],U=pg[g.pointerType]||g.pointerType,bt=U==ve,yt=j(v,g.pointerId,"pointerId");I&nt&&(g.button===0||bt)?yt<0&&(v.push(g),yt=v.length-1):I&(lt|Nt)&&(k=!0),!(yt<0)&&(v[yt]=g,this.callback(this.manager,I,{pointers:v,changedPointers:[g],pointerType:U,srcEvent:g}),k&&v.splice(yt,1))}});var gg={touchstart:nt,touchmove:Pn,touchend:lt,touchcancel:Nt},mg="touchstart",bg="touchstart touchmove touchend touchcancel";function kc(){this.evTarget=mg,this.evWin=bg,this.started=!1,Qt.apply(this,arguments)}w(kc,Qt,{handler:function(g){var v=gg[g.type];if(v===nt&&(this.started=!0),!!this.started){var k=xg.call(this,g,v);v&(lt|Nt)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}}});function xg(h,g){var v=H(h.touches),k=H(h.changedTouches);return g&(lt|Nt)&&(v=G(v.concat(k),"identifier",!0)),[v,k]}var yg={touchstart:nt,touchmove:Pn,touchend:lt,touchcancel:Nt},vg="touchstart touchmove touchend touchcancel";function Js(){this.evTarget=vg,this.targetIds={},Qt.apply(this,arguments)}w(Js,Qt,{handler:function(g){var v=yg[g.type],k=wg.call(this,g,v);k&&this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}});function wg(h,g){var v=H(h.touches),k=this.targetIds;if(g&(nt|Pn)&&v.length===1)return k[v[0].identifier]=!0,[v,v];var C,I,U=H(h.changedTouches),bt=[],yt=this.target;if(I=v.filter(function(Dt){return O(Dt.target,yt)}),g===nt)for(C=0;C<I.length;)k[I[C].identifier]=!0,C++;for(C=0;C<U.length;)k[U[C].identifier]&&bt.push(U[C]),g&(lt|Nt)&&delete k[U[C].identifier],C++;if(bt.length)return[G(I.concat(bt),"identifier",!0),bt]}var _g=2500,Sc=25;function Ir(){Qt.apply(this,arguments);var h=_(this.handler,this);this.touch=new Js(this.manager,h),this.mouse=new Zs(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}w(Ir,Qt,{handler:function(g,v,k){var C=k.pointerType==ve,I=k.pointerType==Ve;if(!(I&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(C)kg.call(this,v,k);else if(I&&Sg.call(this,k))return;this.callback(g,v,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function kg(h,g){h&nt?(this.primaryTouch=g.changedPointers[0].identifier,Ec.call(this,g)):h&(lt|Nt)&&Ec.call(this,g)}function Ec(h){var g=h.changedPointers[0];if(g.identifier===this.primaryTouch){var v={x:g.clientX,y:g.clientY};this.lastTouches.push(v);var k=this.lastTouches,C=function(){var I=k.indexOf(v);I>-1&&k.splice(I,1)};setTimeout(C,_g)}}function Sg(h){for(var g=h.srcEvent.clientX,v=h.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var C=this.lastTouches[k],I=Math.abs(g-C.x),U=Math.abs(v-C.y);if(I<=Sc&&U<=Sc)return!0}return!1}var Mc=ot(o.style,"touchAction"),Tc=Mc!==i,Cc="compute",Pc="auto",Nr="manipulation",An="none",Hi="pan-x",Bi="pan-y",Qs=Mg();function Lr(h,g){this.manager=h,this.set(g)}Lr.prototype={set:function(h){h==Cc&&(h=this.compute()),Tc&&this.manager.element.style&&Qs[h]&&(this.manager.element.style[Mc]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return f(this.manager.recognizers,function(g){S(g.options.enable,[g])&&(h=h.concat(g.getTouchAction()))}),Eg(h.join(" "))},preventDefaults:function(h){var g=h.srcEvent,v=h.offsetDirection;if(this.manager.session.prevented){g.preventDefault();return}var k=this.actions,C=A(k,An)&&!Qs[An],I=A(k,Bi)&&!Qs[Bi],U=A(k,Hi)&&!Qs[Hi];if(C){var bt=h.pointers.length===1,yt=h.distance<2,Dt=h.deltaTime<250;if(bt&&yt&&Dt)return}if(!(U&&I)&&(C||I&&v&we||U&&v&Dn))return this.preventSrc(g)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Eg(h){if(A(h,An))return An;var g=A(h,Hi),v=A(h,Bi);return g&&v?An:g||v?g?Hi:Bi:A(h,Nr)?Nr:Pc}function Mg(){if(!Tc)return!1;var h={},g=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(v){h[v]=g?e.CSS.supports("touch-action",v):!0}),h}var to=1,te=2,ii=4,ln=8,He=ln,Wi=16,_e=32;function Be(h){this.options=b({},this.defaults,h||{}),this.id=Q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=to,this.simultaneous={},this.requireFail=[]}Be.prototype={defaults:{},set:function(h){return b(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var g=this.simultaneous;return h=eo(h,this),g[h.id]||(g[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=eo(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var g=this.requireFail;return h=eo(h,this),j(g,h)===-1&&(g.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=eo(h,this);var g=j(this.requireFail,h);return g>-1&&this.requireFail.splice(g,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var g=this,v=this.state;function k(C){g.manager.emit(C,h)}v<ln&&k(g.options.event+Dc(v)),k(g.options.event),h.additionalEvent&&k(h.additionalEvent),v>=ln&&k(g.options.event+Dc(v))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=_e},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(_e|to)))return!1;h++}return!0},recognize:function(h){var g=b({},h);if(!S(this.options.enable,[this,g])){this.reset(),this.state=_e;return}this.state&(He|Wi|_e)&&(this.state=to),this.state=this.process(g),this.state&(te|ii|ln|Wi)&&this.tryEmit(g)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Dc(h){return h&Wi?"cancel":h&ln?"end":h&ii?"move":h&te?"start":""}function Ac(h){return h==Fi?"down":h==Vi?"up":h==Li?"left":h==zi?"right":""}function eo(h,g){var v=g.manager;return v?v.get(h):h}function de(){Be.apply(this,arguments)}w(de,Be,{defaults:{pointers:1},attrTest:function(h){var g=this.options.pointers;return g===0||h.pointers.length===g},process:function(h){var g=this.state,v=h.eventType,k=g&(te|ii),C=this.attrTest(h);return k&&(v&Nt||!C)?g|Wi:k||C?v<?g|ln:g&te?g|ii:te:_e}});function no(){de.apply(this,arguments),this.pX=null,this.pY=null}w(no,de,{defaults:{event:"pan",threshold:10,pointers:1,direction:gc},getTouchAction:function(){var h=this.options.direction,g=[];return h&we&&g.push(Bi),h&Dn&&g.push(Hi),g},directionTest:function(h){var g=this.options,v=!0,k=h.distance,C=h.direction,I=h.deltaX,U=h.deltaY;return C&g.direction||(g.direction&we?(C=I===0?Ks:I<0?Li:zi,v=I!=this.pX,k=Math.abs(h.deltaX)):(C=U===0?Ks:U<0?Vi:Fi,v=U!=this.pY,k=Math.abs(h.deltaY))),h.direction=C,v&&k>g.threshold&&C&g.direction},attrTest:function(h){return de.prototype.attrTest.call(this,h)&&(this.state&te||!(this.state&te)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var g=Ac(h.direction);g&&(h.additionalEvent=this.options.event+g),this._super.emit.call(this,h)}});function zr(){de.apply(this,arguments)}w(zr,de,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[An]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&te)},emit:function(h){if(h.scale!==1){var g=h.scale<1?"in":"out";h.additionalEvent=this.options.event+g}this._super.emit.call(this,h)}});function Vr(){Be.apply(this,arguments),this._timer=null,this._input=null}w(Vr,Be,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Pc]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime>g.time;if(this._input=h,!k||!v||h.eventType&(lt|Nt)&&!C)this.reset();else if(h.eventType&nt)this.reset(),this._timer=u(function(){this.state=He,this.tryEmit()},g.time,this);else if(h.eventType<)return He;return _e},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===He&&(h&&h.eventType<?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Fr(){de.apply(this,arguments)}w(Fr,de,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[An]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&te)}});function Hr(){de.apply(this,arguments)}w(Hr,de,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:we|Dn,pointers:1},getTouchAction:function(){return no.prototype.getTouchAction.call(this)},attrTest:function(h){var g=this.options.direction,v;return g&(we|Dn)?v=h.overallVelocity:g&we?v=h.overallVelocityX:g&Dn&&(v=h.overallVelocityY),this._super.attrTest.call(this,h)&&g&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&l(v)>this.options.velocity&&h.eventType<},emit:function(h){var g=Ac(h.offsetDirection);g&&this.manager.emit(this.options.event+g,h),this.manager.emit(this.options.event,h)}});function io(){Be.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(io,Be,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nr]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime<g.time;if(this.reset(),h.eventType&nt&&this.count===0)return this.failTimeout();if(k&&C&&v){if(h.eventType!=lt)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<g.interval:!0,U=!this.pCenter||qs(this.pCenter,h.center)<g.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!U||!I?this.count=1:this.count+=1,this._input=h;var bt=this.count%g.taps;if(bt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=He,this.tryEmit()},g.interval,this),te):He}return _e},failTimeout:function(){return this._timer=u(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==He&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function We(h,g){return g=g||{},g.recognizers=T(g.recognizers,We.defaults.preset),new Br(h,g)}We.VERSION="2.0.7",We.defaults={domEvents:!1,touchAction:Cc,enable:!0,inputTarget:null,inputClass:null,preset:[[Fr,{enable:!1}],[zr,{enable:!1},["rotate"]],[Hr,{direction:we}],[no,{direction:we},["swipe"]],[io],[io,{event:"doubletap",taps:2},["tap"]],[Vr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Tg=1,Oc=2;function Br(h,g){this.options=b({},We.defaults,g||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=ig(this),this.touchAction=new Lr(this,this.options.touchAction),Rc(this,!0),f(this.options.recognizers,function(v){var k=this.add(new v[0](v[1]));v[2]&&k.recognizeWith(v[2]),v[3]&&k.requireFailure(v[3])},this)}Br.prototype={set:function(h){return b(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Oc:Tg},recognize:function(h){var g=this.session;if(!g.stopped){this.touchAction.preventDefaults(h);var v,k=this.recognizers,C=g.curRecognizer;(!C||C&&C.state&He)&&(C=g.curRecognizer=null);for(var I=0;I<k.length;)v=k[I],g.stopped!==Oc&&(!C||v==C||v.canRecognizeWith(C))?v.recognize(h):v.reset(),!C&&v.state&(te|ii|ln)&&(C=g.curRecognizer=v),I++}},get:function(h){if(h instanceof Be)return h;for(var g=this.recognizers,v=0;v<g.length;v++)if(g[v].options.event==h)return g[v];return null},add:function(h){if(d(h,"add",this))return this;var g=this.get(h.options.event);return g&&this.remove(g),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(d(h,"remove",this))return this;if(h=this.get(h),h){var g=this.recognizers,v=j(g,h);v!==-1&&(g.splice(v,1),this.touchAction.update())}return this},on:function(h,g){if(h!==i&&g!==i){var v=this.handlers;return f(N(h),function(k){v[k]=v[k]||[],v[k].push(g)}),this}},off:function(h,g){if(h!==i){var v=this.handlers;return f(N(h),function(k){g?v[k]&&v[k].splice(j(v[k],g),1):delete v[k]}),this}},emit:function(h,g){this.options.domEvents&&Cg(h,g);var v=this.handlers[h]&&this.handlers[h].slice();if(!(!v||!v.length)){g.type=h,g.preventDefault=function(){g.srcEvent.preventDefault()};for(var k=0;k<v.length;)v[k](g),k++}},destroy:function(){this.element&&Rc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Rc(h,g){var v=h.element;if(v.style){var k;f(h.options.cssProps,function(C,I){k=ot(v.style,I),g?(h.oldCssProps[k]=v.style[k],v.style[k]=C):v.style[k]=h.oldCssProps[k]||""}),g||(h.oldCssProps={})}}function Cg(h,g){var v=t.createEvent("Event");v.initEvent(h,!0,!0),v.gesture=g,g.target.dispatchEvent(v)}b(We,{INPUT_START:nt,INPUT_MOVE:Pn,INPUT_END:lt,INPUT_CANCEL:Nt,STATE_POSSIBLE:to,STATE_BEGAN:te,STATE_CHANGED:ii,STATE_ENDED:ln,STATE_RECOGNIZED:He,STATE_CANCELLED:Wi,STATE_FAILED:_e,DIRECTION_NONE:Ks,DIRECTION_LEFT:Li,DIRECTION_RIGHT:zi,DIRECTION_UP:Vi,DIRECTION_DOWN:Fi,DIRECTION_HORIZONTAL:we,DIRECTION_VERTICAL:Dn,DIRECTION_ALL:gc,Manager:Br,Input:Qt,TouchAction:Lr,TouchInput:Js,MouseInput:Zs,PointerEventInput:Rr,TouchMouseInput:Ir,SingleTouchInput:kc,Recognizer:Be,AttrRecognizer:de,Tap:io,Pan:no,Swipe:Hr,Pinch:zr,Rotate:Fr,Press:Vr,on:E,off:P,each:f,merge:y,extend:x,assign:b,inherit:w,bindFn:_,prefixed:ot});var Pg=typeof e<"u"?e:typeof self<"u"?self:{};Pg.Hammer=We,typeof define=="function"&&define.amd?define(function(){return We}):typeof _r<"u"&&_r.exports?_r.exports=We:e[n]=We})(window,document,"Hammer")});var _h=M(()=>{Tl();});var kh=M(()=>{_h()});function Mn(e,t,n){return e===void 0?!0:typeof e=="string"?e.indexOf(t)!==-1:typeof e=="function"?e({chart:n}).indexOf(t)!==-1:!1}function Gl(e,t){return typeof e=="function"&&(e=e({chart:t})),typeof e=="string"?{x:e.indexOf("x")!==-1,y:e.indexOf("y")!==-1}:{x:!1,y:!1}}function yy(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function vy({x:e,y:t},n){let i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){let r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function zh(e,t,n){let{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=vy(t,n),a=Gl(i,n),l=Gl(s,n);if(o){let u=Gl(o,n);for(let d of["x","y"])u[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];let c=[];return $(n.scales,function(u){a[u.axis]&&c.push(u)}),c}function st(e){let t=Yl.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Yl.set(e,t)),t}function wy(e){Yl.delete(e)}function Vh(e,t,n,i){let s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function Fh(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Hh(e,t,n){let i=e.max-e.min,s=i*(t-1),o=Fh(e,n);return Vh(o,e.min,i,s)}function _y(e,t,n){let i=Fh(e,n);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Vh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function ky(e,t){return t&&(t[e.id]||t[e.axis])||{}}function Sh(e,t,n,i,s){let o=n[i];if(o==="original"){let r=e.originalScaleLimits[t.id][i];o=W(r.options,r.scale)}return W(o,s)}function Sy(e,t,n){let i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Ey(e,{min:t,max:n,minLimit:i,maxLimit:s},o){let r=(e-n+t)/2;t-=r,n+=r;let a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return Ae(t,a,c)&&(t=a),Ae(n,l,c)&&(n=l),t<i?(t=i,n=Math.min(i+e,s)):n>s&&(n=s,t=Math.max(s-e,i)),{min:t,max:n}}function ti(e,{min:t,max:n},i,s=!1){let o=st(e.chart),{options:r}=e,a=ky(e,i),{minRange:l=0}=a,c=Sh(o,e,a,"min",-1/0),u=Sh(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;let d=e.max-e.min,f=s?Math.max(n-t,l):d;if(s&&f===l&&d<=l)return!0;let p=Ey(f,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=p.min,r.max=p.max,o.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function My(e,t,n,i){let s=Hh(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return ti(e,o,i,!0)}function Ty(e,t,n,i){let s=_y(e,t,n);return ti(e,s,i,!0)}function Cy(e,t,n,i){ti(e,Sy(e,t,n),i,!0)}function Py(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Dy(e,t,n,i){let s=Hh(e,t,n);e.min===e.max&&t<1&&Py(e);let o={min:e.min+Eh(s.min),max:e.max-Eh(s.max)};return ti(e,o,i,!0)}function Ay(e){return e.isHorizontal()?e.width:e.height}function Oy(e,t,n){let s=e.getLabels().length-1,{min:o,max:r}=e,a=Math.max(r-o,1),l=Math.round(Ay(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l)),u;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,u=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,u=o===0),ti(e,{min:o,max:r},n)||u}function Bh(e,t,n,i=!1){let{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Ry[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:ti(e,{min:c,max:u},n,i?"pan":!1)}function Mh(e,t,n){return Bh(e,t,n,!0)}function Iy(e,t,n){let{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;let r=n[i];return r.min!==s||r.max!==o}function Th(e,t){$(e,(n,i)=>{t[i]||delete e[i]})}function Ri(e,t){let{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return $(n,function(o){Iy(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Th(i,n),Th(s,n),i}function Ch(e,t,n,i){let s=Kl[e.type]||Kl.default;z(s,[e,t,n,i])}function Ph(e,t,n,i){let s=Xl[e.type]||Xl.default;z(s,[e,t,n,i])}function Ny(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function tc(e,t,n="none",i="api"){let{x:s=1,y:o=1,focalPoint:r=Ny(e)}=typeof t=="number"?{x:t,y:t}:t,a=st(e),{options:{limits:l,zoom:c}}=a;Ri(e,a);let u=s!==1,d=o!==1,f=zh(c,r,e);$(f||e.scales,function(p){p.isHorizontal()&&u?Ch(p,s,r,l):!p.isHorizontal()&&d&&Ch(p,o,r,l)}),e.update(n),z(c.onZoom,[{chart:e,trigger:i}])}function Wh(e,t,n,i="none",s="api"){let o=st(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Ri(e,o);let c=Mn(l,"x",e),u=Mn(l,"y",e);$(e.scales,function(d){d.isHorizontal()&&c?Ph(d,t.x,n.x,r):!d.isHorizontal()&&u&&Ph(d,t.y,n.y,r)}),e.update(i),z(a.onZoom,[{chart:e,trigger:s}])}function Ly(e,t,n,i="none",s="api"){let o=st(e);Ri(e,o);let r=e.scales[t];ti(r,n,void 0,!0),e.update(i),z(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function zy(e,t="default"){let n=st(e),i=Ri(e,n);$(e.scales,function(s){let o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[s.id]}),e.update(t),z(n.options.zoom.onZoomComplete,[{chart:e}])}function Vy(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:i,max:s}=n;return W(s.options,s.scale)-W(i.options,i.scale)}function Fy(e){let t=st(e),n=1,i=1;return $(e.scales,function(s){let o=Vy(t,s.id);if(o){let r=Math.round(o/(s.max-s.min)*100)/100;n=Math.min(n,r),i=Math.max(i,r)}}),n<1?n:i}function Dh(e,t,n,i){let{panDelta:s}=i,o=s[e.id]||0;me(o)===me(t)&&(t+=o);let r=ql[e.type]||ql.default;z(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function jh(e,t,n,i="none"){let{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=st(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Ri(e,r);let u=s!==0,d=o!==0;$(n||e.scales,function(f){f.isHorizontal()&&u?Dh(f,s,l,r):!f.isHorizontal()&&d&&Dh(f,o,l,r)}),e.update(i),z(c,[{chart:e}])}function $h(e){let t=st(e);Ri(e,t);let n={};for(let i of Object.keys(e.scales)){let{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Hy(e){let t=st(e),n={};for(let i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function By(e){let t=$h(e);for(let n of Object.keys(e.scales)){let{min:i,max:s}=t[n];if(i!==void 0&&e.scales[n].min!==i||s!==void 0&&e.scales[n].max!==s)return!0}return!1}function Ah(e){let t=st(e);return t.panning||t.dragging}function Ut(e,t){let{handlers:n}=st(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function Vs(e,t,n,i){let{handlers:s,options:o}=st(e),r=s[n];if(r&&r.target===t)return;Ut(e,n),s[n]=l=>i(e,l,o),s[n].target=t;let a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function Wy(e,t){let n=st(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function jy(e,t){let n=st(e);!n.dragStart||t.key!=="Escape"||(Ut(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Zl(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Jt(e,t)}function Uh(e,t,n){let{onZoomStart:i,onZoomRejected:s}=n;if(i){let o=Zl(t,e);if(z(i,[{chart:e,event:t,point:o}])===!1)return z(s,[{chart:e,event:t}]),!1}}function $y(e,t){if(e.legend){let o=Jt(t,e);if(Zt(o,e.legend))return}let n=st(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Lh(Fs(i),t)||Ql(Fs(s.drag),t))return z(s.onZoomRejected,[{chart:e,event:t}]);Uh(e,t,s)!==!1&&(n.dragStart=t,Vs(e,e.canvas.ownerDocument,"mousemove",Wy),Vs(e,window.document,"keydown",jy))}function Uy({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y,o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function Rh(e,t,n,{min:i,max:s,prop:o}){e[i]=Oh(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Oh(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Gy(e,t,n){let i={begin:Zl(t.dragStart,e),end:Zl(t.dragEnd,e)};if(n){let s=e.chartArea.width/e.chartArea.height;Uy(i,s)}return i}function Gh(e,t,n,i){let s=Mn(t,"x",e),o=Mn(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:d}=e.chartArea,f={top:r,left:a,right:l,bottom:c},p=Gy(e,n,i&&s&&o);s&&Rh(f,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&Rh(f,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});let b=f.right-f.left,x=f.bottom-f.top;return{...f,width:b,height:x,zoomX:s&&b?1+(u-b)/u:1,zoomY:o&&x?1+(d-x)/d:1}}function Yy(e,t){let n=st(e);if(!n.dragStart)return;Ut(e,"mousemove");let{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=Gh(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Mn(i,"x",e)?a.width:0,c=Mn(i,"y",e)?a.height:0,u=Math.sqrt(l*l+c*c);if(n.dragStart=n.dragEnd=null,u<=o){n.dragging=!1,e.update("none");return}Wh(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,z(s,[{chart:e}])}function Ky(e,t,n){if(Ql(Fs(n.wheel),t)){z(n.onZoomRejected,[{chart:e,event:t}]);return}if(Uh(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Xy(e,t){let{handlers:{onZoomComplete:n},options:{zoom:i}}=st(e);if(!Ky(e,t,i))return;let s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};tc(e,a,"zoom","wheel"),z(n,[{chart:e}])}function qy(e,t,n,i){n&&(st(e).handlers[t]=yy(()=>z(n,[{chart:e}]),i))}function Zy(e,t){let n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(Vs(e,n,"wheel",Xy),qy(e,"onZoomComplete",o,250)):Ut(e,"wheel"),s.enabled?(Vs(e,n,"mousedown",$y),Vs(e,n.ownerDocument,"mouseup",Yy)):(Ut(e,"mousedown"),Ut(e,"mousemove"),Ut(e,"mouseup"),Ut(e,"keydown"))}function Jy(e){Ut(e,"mousedown"),Ut(e,"mousemove"),Ut(e,"mouseup"),Ut(e,"wheel"),Ut(e,"click"),Ut(e,"keydown")}function Qy(e,t){return function(n,i){let{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;let r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(Ql(Fs(s),r)||Lh(Fs(o.drag),r))?(z(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function tv(e,t){let n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i,o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function Yh(e,t,n){if(t.scale){let{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=tv(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Mn(l,"x",e)?o:1,y:a.y&&Mn(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};tc(e,c,"zoom","pinch"),t.scale=n.scale}}function ev(e,t,n){if(t.options.zoom.pinch.enabled){let i=Jt(n,e);z(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,z(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function nv(e,t,n){t.scale&&(Yh(e,t,n),t.scale=null,z(t.options.zoom.onZoomComplete,[{chart:e}]))}function Kh(e,t,n){let i=t.delta;i&&(t.panning=!0,jh(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function iv(e,t,n){let{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;let r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(z(s,[{chart:e,event:n,point:a}])===!1)return z(o,[{chart:e,event:n}]);t.panScales=zh(t.options.pan,a,e),t.delta={x:0,y:0},Kh(e,t,n)}function sv(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,z(t.options.pan.onPanComplete,[{chart:e}]))}function Ih(e,t){let n=st(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Oi.default.Manager(i);o&&o.pinch.enabled&&(r.add(new Oi.default.Pinch),r.on("pinchstart",a=>ev(e,n,a)),r.on("pinch",a=>Yh(e,n,a)),r.on("pinchend",a=>nv(e,n,a))),s&&s.enabled&&(r.add(new Oi.default.Pan({threshold:s.threshold,enable:Qy(e,n)})),r.on("panstart",a=>iv(e,n,a)),r.on("panmove",a=>Kh(e,n,a)),r.on("panend",()=>sv(e,n))),Jl.set(e,r)}function Nh(e){let t=Jl.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Jl.delete(e))}function ov(e,t){let{pan:n,zoom:i}=e,{pan:s,zoom:o}=t;return i?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==s?.enabled||n?.threshold!==s?.threshold}function kr(e,t,n){let i=n.zoom.drag,{dragStart:s,dragEnd:o}=st(e);if(i.drawTime!==t||!o)return;let{left:r,top:a,width:l,height:c}=Gh(e,n.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),u=e.ctx;u.save(),u.beginPath(),u.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",u.fillRect(r,a,l,c),i.borderWidth>0&&(u.lineWidth=i.borderWidth,u.strokeStyle=i.borderColor||"rgba(225,225,225)",u.strokeRect(r,a,l,c)),u.restore()}var Oi,Fs,Lh,Ql,Yl,Eh,Ry,Kl,Xl,ql,Oh,Jl,rv,Xh,qh=M(()=>{Oi=Vg(wh());kh();Fs=e=>e&&e.enabled&&e.modifierKey,Lh=(e,t)=>e&&t[e+"Key"],Ql=(e,t)=>e&&!t[e+"Key"];Yl=new WeakMap;Eh=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);Ry={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};Kl={category:Dy,default:My,logarithmic:Ty},Xl={default:Cy},ql={category:Oy,default:Bh,logarithmic:Mh,timeseries:Mh};Oh=(e,t,n)=>Math.min(n,Math.max(t,e));Jl=new WeakMap;rv="2.2.0";Xh={id:"zoom",version:rv,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let i=st(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Oi.default&&Ih(e,n),e.pan=(s,o,r)=>jh(e,s,o,r),e.zoom=(s,o)=>tc(e,s,o),e.zoomRect=(s,o,r)=>Wh(e,s,o,r),e.zoomScale=(s,o,r)=>Ly(e,s,o,r),e.resetZoom=s=>zy(e,s),e.getZoomLevel=()=>Fy(e),e.getInitialScaleBounds=()=>$h(e),e.getZoomedScaleBounds=()=>Hy(e),e.isZoomedOrPanned=()=>By(e),e.isZoomingOrPanning=()=>Ah(e)},beforeEvent(e,{event:t}){if(Ah(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=st(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let i=st(e),s=i.options;i.options=n,ov(s,n)&&(Nh(e),Ih(e,n)),Zy(e,n)},beforeDatasetsDraw(e,t,n){kr(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){kr(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){kr(e,"beforeDraw",n)},afterDraw(e,t,n){kr(e,"afterDraw",n)},stop:function(e){Jy(e),Oi.default&&Nh(e),wy(e)},panFunctions:ql,zoomFunctions:Kl,zoomRectFunctions:Xl}});function ec(e){let t=[],n=()=>t.forEach(l=>l()),i=D(null),s=null;return{canvasRef:i,init:()=>{let l=i.value;if(!l)return console.error("createLineChart: canvas ref not set",new Error().stack),n;ae.register(Xh,Pi,Zn,Ci,Jn,Sn,mh,xh),s=new ae(l,{type:"line",data:e.data.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{align:"start",position:"bottom"},title:{display:!1}}}});let c=e.data.subscribe(d=>{s&&(s.data=d,s.update())}),u=new ResizeObserver(()=>s?.resize());return u.observe(l.parentElement),t.push(()=>{u.disconnect(),s?.destroy(),s=null,c()}),()=>n()},resetZoom:()=>s?.resetZoom(),getZoomLevel:()=>s?.getZoomLevel()??0}}var Zh=M(()=>{"use strict";V();vh();qh()});var Sr=M(()=>{"use strict";Pd();Dd();Ad();Od();Zh()});var nc,Jh=M(()=>{"use strict";V();Z();Sr();nc=e=>{let t=e.minContainerWidth??250,n=[],i=()=>{n.forEach(y=>y()),n.length=0},s=D(null),o=D(0),r=D(0),a=pn(null),l=pn(null),[c,u]=ls(),d=Ba(a);n.push(u);let f=y=>{y.preventDefault(),s.value={...c.value},o.value=r.value,console.log("onMouseDown",{startMouse:s.value,prevFirstContainerWidth:o.value,firstContainerWidth:r.value})},p=()=>s.value=null,b=y=>{if(s.value==null||l.current==null)return;let w=Math.max(o.value+y.x-s.value.x,t);r.value=Math.min(w,l.current.clientWidth-t),console.log("onMouseMove",w,r.value)},x=()=>{l.current!=null&&l.current.clientWidth-t<r.value&&(r.value=Math.max(l.current.clientWidth-t,t))};return window.addEventListener("mouseup",p),window.addEventListener("mousemove",b),window.addEventListener("resize",x),n.push(()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",b),window.removeEventListener("resize",x)}),Da(()=>{if(l.current)return r.value=l.current.clientWidth/2,d.init(),()=>{d.dispose()}}),d.state.width.subscribe(y=>{console.log("width",y)}),Ht(()=>i()),({children:y,className:w,..._})=>{let[S,T]=Array.isArray(y)?y:[];return m("div",{className:ut("flex-grow grid gap-2 items-start w-full relative",q(w)),ref:l,style:{gridTemplateColumns:\`\${r}px 1fr\`},..._},m("div",{ref:a,className:"firstContainer w-full h-full"},S),d.state.width.value!=0&&m("div",{className:"w-8 flex justify-center h-full absolute top-0 -translate-x-1/2 cursor-col-resize z-[9999]",style:{left:\`\${d.state.width.value}px\`},onmousedown:f},m("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m("div",{className:"secondContainer h-full"},T))}}});function Tn({root:e,className:t}){let{objectKeysChunkSize:n}=J.viewerSettings.value,i=e.page.value,s=e.children.slice(0,(i+1)*n),o=s.length<e.children.length;return m(vt,null,m("div",{className:ut("flex flex-col items-start w-full",q(t))},s.map(r=>m("div",{key:r.path,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},m(Er,{node:r})))),o&&m("button",{onclick:()=>e.page.value++,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}))))}function Er({node:e}){switch(e.kind){case"null":case"undefined":case"string":case"number":case"bigint":case"boolean":case"symbol":case"function":case"dom-node":case"error":return m(av,{node:e});case"object":return m(cv,{node:e});case"array":return m(uv,{node:e});case"array-chunk":return m(dv,{node:e});case"signal":return m(fv,{node:e})}}function av({node:e}){let{label:t,path:n,raw:i,kind:s}=e;return m(Mr,null,m("label",{className:"text-xs truncate",title:n},t),m(lv,{kind:s,raw:i}))}function lv({kind:e,raw:t}){switch(e){case"null":return m("small",{className:"text-neutral-300"},"null");case"undefined":return m("small",{className:"text-neutral-300"},"undefined");case"dom-node":return m("small",{className:"text-neutral-300"},"<",m("span",{style:"color: #f0a05e"},t.nodeName),"/>");case"error":{let n=t;return m("small",{className:"text-neutral-300"},n.message,"cause"in n&&!!n.cause&&\` (\${String(n.cause)})\`)}case"string":return m("small",{className:"text-neutral-300"},\`"\${t}"\`);case"number":case"bigint":return m("small",{className:"text-neutral-300"},t);case"boolean":return m("small",{className:"text-neutral-300"},t?"true":"false");case"symbol":return m("small",{className:"text-neutral-300"},t.toString());case"function":return m("small",{className:"text-neutral-300 italic"},\`\\u0192 \${t.name??"anonymous"}()\`)}}function cv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Mr,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n!==null&&m(Tn,{root:{children:n,page:e.page}}))}function uv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Mr,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),t?m("small",{className:"text-neutral-300"},\`Array(\${e.length})\`):n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Er,{node:i}))))}function dv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m("div",{className:"flex flex-col items-start gap-1 w-full"},m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Er,{node:i}))))}function fv({node:e}){let t=e.viewerNode.value;return m(Mr,null,m("div",{className:"flex items-center gap-2"},m("label",{className:"text-xs truncate",title:e.path},e.label),m("span",{className:"text-[10px] italic text-primary border border-primary/40 px-1 rounded leading-none py-px"},"signal")),m("div",{className:"pl-2 w-full"},m(Er,{node:t})))}function Mr({children:e}){return m("div",{className:"flex flex-col items-start gap-1 w-full"},e)}var ic=M(()=>{"use strict";V();V();Z();Oo();Ce()});function Ct(){return{collapsed:new Map,page:new Map,children:new Map,signalNodes:new Map}}function xe(e,t,n){n.page.set(t,e.page),Bs(e.children,n)}function Bs(e,t){for(let n of e)if(n.kind==="object"){t.collapsed.set(n.path,n.collapsed),t.page.set(n.path,n.page),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Bs(i,t)}else if(n.kind==="array"||n.kind==="array-chunk"){t.collapsed.set(n.path,n.collapsed),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Bs(i,t)}else n.kind==="signal"&&(t.signalNodes.set(n.path,n),Bs([n.viewerNode.peek()],t))}function le(e){for(let t of e.collapsed.values())L.dispose(t);for(let t of e.page.values())L.dispose(t);for(let t of e.children.values())L.dispose(t);for(let t of e.signalNodes.values())t.unsubscribe(),L.dispose(t.viewerNode)}function hv(e){if(e===null)return"null";if(e===void 0)return"undefined";let t=window.opener?window.opener.Node:window.Node;if(e instanceof t)return"dom-node";let n=window.opener?window.opener.Error:window.Error;if(e instanceof n)return"error";let i=typeof e;return i==="string"?"string":i==="number"?"number":i==="bigint"?"bigint":i==="boolean"?"boolean":i==="symbol"?"symbol":i==="function"?"function":null}function Hs(e,t,n,i,s){let o=hv(e);if(o!==null)return{kind:o,label:t,path:n,raw:e};if(L.isSignal(e)){let d=e,f=\`\${n}.$value\`,p=Hs(d.peek(),"value",f,i,s),b=D(p),x=d.subscribe(y=>{let w=Ct();Bs([b.peek()],w),b.value=Hs(y,"value",f,w,s),le(w)});return{kind:"signal",label:t,path:n,signal:d,viewerNode:b,unsubscribe:x}}if(Array.isArray(e)){let d=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let f=D(null);return{kind:"array",label:t,path:n,collapsed:d,length:e.length,children:f,buildChildren:()=>{if(f.peek()===null)if(e.length>s.arrayChunkSize){let b=Math.ceil(e.length/s.arrayChunkSize);f.value=Array.from({length:b},(x,y)=>{let w=y*s.arrayChunkSize,_=Math.min((y+1)*s.arrayChunkSize,e.length),S=\`\${n}[\${w}..\${_-1}]\`,T=D(!0),E=D(null),P=e.slice(w,_);return{kind:"array-chunk",label:\`[\${w}..\${_-1}]\`,path:S,collapsed:T,range:{start:w,end:_},children:E,buildChildren:()=>{E.peek()===null&&(E.value=P.map((A,N)=>Hs(A,(w+N).toString(),\`\${n}[\${w+N}]\`,Ct(),s)))}}})}else f.value=e.map((b,x)=>Hs(b,x.toString(),\`\${n}[\${x}]\`,Ct(),s))}}}let r=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let a=i.page.get(n)??D(0);i.page.delete(n);let l=D(null),c=e;return{kind:"object",label:t,path:n,collapsed:r,page:a,children:l,buildChildren:()=>{l.peek()===null&&(l.value=Qh(c,n,Ct(),s))}}}function Qh(e,t,n,i){return Object.keys(e).map(s=>Hs(e[s],s,\`\${t}.\${s}\`,n,i))}function sn(e,t,n,i){let s=n.page.get(t)??D(0);n.page.delete(t);let o=Qh(e,t,n,i);return{page:s,children:o}}var sc=M(()=>{"use strict";V()});var Ws=M(()=>{"use strict";Cd();Jh();ic();sc()});function Tr(e){e&&("nodes"in e?e.nodes.forEach(Tr):(Tr(e.child),Tr(e.sibling)))}function tp(e,t,n){let i=new Map;Cr(n,i);let s=e.rootNode,o=rc();if(s){let r=t.trim().toLowerCase(),a=r?r.split(/\\s+/):[];o.nodes.push(...ip(s,a,i))}for(let{collapsed:r}of i.values())L.dispose(r);return o}function Cr(e,t){if(e)if("nodes"in e)for(let n of e.nodes)Cr(n,t);else{let{id:n,collapsed:i}=e;t.set(e.kiruNode,{id:n,collapsed:i}),Cr(e.child,t),Cr(e.sibling,t)}}function ip(e,t,n=new Map){let i=[],s=e;for(;s;){let o=ip(s.child,t,n);if(typeof s.type!="function")i.push(...o);else{let r=Vn(s);if(mv(t,r)){let a=bv(s,r,n);a.child=o[0]??null;for(let l=0;l<o.length;l++)o[l].parent=a,o[l].sibling=o[l+1]??null;i.push(a)}else i.push(...o)}s=s.sibling}return i}function mv(e,t){let n=t.toLowerCase();return e.every(i=>n.includes(i))}function rc(...e){return{value:"ROOT",nodes:e}}function bv(e,t,n=new Map){let{id:i,collapsed:s}=n.get(e)??{id:crypto.randomUUID(),collapsed:D(!0)};return n.delete(e),{id:i,name:t,kiruNode:e,collapsed:s,parent:null,child:null,sibling:null}}function oc(e){let t=Ii.peek();if(!t)return;let n=ac(e,t);if(!n)return;let i=n.parent;for(;i;)i.collapsed.value=!1,i=i.parent}function sp(e){e&&oc(Gt.peek())}function xv(e){let t=Ii.peek();if(!t)return;let n=ac(Gt.peek(),t);n?.child&&(n.collapsed.value=e)}function yv(e,t){let n=Array.from(e.querySelectorAll("[data-graph-node-id]"));if(n.length===0)return;let i=Ii.peek(),s=-1;if(i){let c=ac(Gt.peek(),i);c&&(s=n.findIndex(u=>u.dataset.graphNodeId===c.id))}let r=s===-1?t==="down"?0:n.length-1:(s+(t==="up"?-1:1)+n.length)%n.length,a=n[r];if(!a)return;let l=vv(Gt.peek(),a);l&&(Ii.sneak(l.kiruNode),Ii.notify(c=>c!==sp))}function vv(e,t){let n=t.dataset.graphNodeId;if(!n)return null;let i=s=>s?s.id===n?s:i(s.child)??i(s.sibling):null;for(let s of e.nodes){let o=i(s);if(o)return o}return null}function ac(e,t){let n=i=>i?i.kiruNode===t?i:n(i.child)??n(i.sibling):null;for(let i of e.nodes){let s=n(i);if(s)return s}return null}var pv,Ii,gv,Gt,np,ep,op=M(()=>{"use strict";V();Ce();Fn();({selectedApp:pv,selectedNode:Ii,appSearchTerm:gv}=J),Gt=D(rc()),np=()=>(window.addEventListener("keydown",ep),()=>window.removeEventListener("keydown",ep));Ft(()=>{let e=pv.value,t=gv.value;if(!e){Tr(Gt.peek()),Gt.value=rc();return}Gt.value=tp(e,t,Gt.peek()),oc(Gt.peek());let n=i=>{i===e&&(Gt.value=tp(i,t,Gt.peek()),oc(Gt.peek()))};return dt().on("update",n),()=>dt().off("update",n)});Ii.subscribe(sp);ep=e=>{Ra(t=>{if(e.key==="l"&&e.ctrlKey){e.preventDefault(),J.appSearchInput.value?.focus(),J.appSearchInput.value?.select();return}if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;if(J.appSearchInput.value?.matches(":focus")){if(!e.altKey)return;e.preventDefault()}let n=e.key==="ArrowUp"?"up":e.key==="ArrowDown"?"down":e.key==="ArrowLeft"?"left":"right";if(n==="left"||n==="right"){xv(n==="left");return}yv(t,n)})}});function ap(){return Tt(()=>np()),()=>m("div",{className:"flex-grow p-2 sticky top-0"},m("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},m("input",{autofocus:!0,ref:_v,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text","bind:value":wv})),m("div",{className:"flex flex-col"},m(ge,{from:Gt},e=>m(kv,{root:e}))))}function kv({root:e}){return e.nodes.map(t=>m(lc,{node:t,traverseSiblings:!0}))}function lc({node:e,traverseSiblings:t=!0}){let n=e.collapsed.value,i=rp.value===e.kiruNode,s=o=>{o.preventDefault(),o.stopPropagation(),e.collapsed.value=!e.collapsed.value};return m(vt,null,m("div",{"data-graph-node-id":e.id,className:"pl-4 mb-1 w-full"},m("button",{className:ut("flex gap-2 items-center px-2 py-0.5 w-full",i?"bg-crimson text-white":""),onclick:()=>rp.value=e.kiruNode},e.child&&m(Xe,{className:ut("transition-transform duration-200 w-4 h-4",n?"":"rotate-90"),onclick:s}),m("div",{className:e.child?"":"ml-6"},m("span",{className:i?"":"text-neutral-400"},"<"),m("span",{className:ut("font-medium",i?"":"text-crimson")},e.name),m("span",{className:i?"":"text-neutral-400"},">"))),!n&&e.child&&m(lc,{node:e.child})),t&&m(Sv,{node:e}))}function Sv({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m(vt,null,t.map(i=>m(lc,{node:i,traverseSiblings:!1})))}var rp,wv,_v,lp=M(()=>{"use strict";V();Ce();op();Ws();Z();({selectedNode:rp,appSearchTerm:wv,appSearchInput:_v}=J)});function dp(e,t){let n=js.peek();if(!e){n&&fp(n.props),js.value=null;return}let i=n?.node===e,s=Ct();i&&n?xe(n.props.root,"props",s):n&&fp(n.props);let o={...e.props};delete o.children;let r=i?n?.props.collapsed??D(!0):D(!0),a=sn(o,"props",s,t);le(s),js.value={node:e,name:Vn(e),props:{root:a,collapsed:r}}}function fp(e){L.dispose(e.collapsed),L.dispose(e.root.page);let t=Ct();xe(e.root,"props",t),le(t)}var cp,Ev,up,js,hp=M(()=>{"use strict";V();Z();Ce();Fn();sc();({selectedNode:cp,selectedApp:Ev,viewerSettings:up}=J),js=D(null);Ft(()=>{let e=cp.value,t=Ev.value,n=up.value;if(dp(e,n),!e||!t)return;let i=s=>{if(s===t){if(So(e)){cp.value=null;return}dp(e,up.peek())}};return dt().on("update",i),()=>dt().off("update",i)})});function pp(){let e=js.value;if(!e)return null;let{name:t,props:n}=e,i=n.collapsed.value;return m("div",{className:"flex-grow p-2 sticky top-0"},m("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},m("div",{className:"flex gap-2 items-center"},"<"+t+">")),m("div",{className:"flex flex-col"},m("button",{onclick:()=>n.collapsed.value=!n.collapsed.value,className:n.root.children.length===0?"opacity-50 cursor-default":"cursor-pointer"},m("span",{className:"flex items-center gap-2 font-medium"},m(Xe,{className:\`transition \${i?"":"rotate-90"}\`}),"props")),i?null:m("div",{className:"p-2",...n},m(Tn,{root:n.root}))))}var gp=M(()=>{"use strict";V();ic();Oo();hp()});function cc(){let e=bp.value;return m(vt,null,m("div",{className:"flex items-center justify-between gap-4 p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m("div",{className:"flex items-center gap-4"},m("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:t=>bp.value=mp.peek().find(n=>n.name===t.currentTarget.value)??null},m("option",{value:"",disabled:!0},"Select App"),m(Ge,{each:mp},t=>m("option",{key:t.id,value:t.name},t.name))),m("button",{title:"Toggle Component Inspection",onclick:Mv,className:\`p-1 rounded \${Tv.value?"bg-neutral-900":""}\`},m(as,null)))),m(nc,{minContainerWidth:100,className:"min-w-[480px]"},m(ap,null),m(pp,null)))}var mp,bp,Pr,Mv,Tv,xp=M(()=>{"use strict";V();Ce();Ws();lp();gp();({apps:mp,selectedApp:bp,componentSelection:Pr}=J),Mv=()=>{Pr.value={enabled:!Pr.value.enabled,componentNode:Pr.value.componentNode}},Tv=Mt(()=>Pr.value.enabled)});function Sp(e){if(vp)return;vp=!0;let t=e.profilingContext,n=s=>{if(oe(s)||ze.value.find(a=>a.app.name===s.name))return;let r=_p(e,t,s);ze.value=[...ze.value,r]},i=s=>{oe(s)||(console.log("onAppUnmounted",s),ze.value.find(o=>o.app.name===s.name)?.dispose())};t.appStats.forEach((s,o)=>{if(oe(o))return;let r=_p(e,t,o);ze.value=[...ze.value,r]}),e.on("mount",n),e.on("unmount",i)}function wp(e,t){return{mountDuration:e.mountDuration(t).toFixed(2),totalTicks:e.totalTicks(t).toLocaleString(),avgTickDuration:e.averageTickDuration(t).toFixed(2),lastTickDuration:e.lastTickDuration(t).toFixed(2)}}function _p(e,t,n){let i=[],s=()=>{i.forEach(u=>u()),ze.value=ze.value.filter(u=>u.app.name!==n.name)},o=Cv(),r=D({labels:[(performance.now()/1e3).toFixed(2)],datasets:kp(o)});i.push(()=>L.dispose(r)),Object.entries(o).forEach(([u,{values:d}])=>{let f=b=>{b.name===n.name&&d[d.length-1]++},p=u;t.addEventListener(p,f),i.push(()=>t.removeEventListener(p,f))});let a=setInterval(()=>{Object.values(o).forEach(d=>{d.values.push(0),d.values.length>yp&&d.values.shift()});let u=[...r.value.labels,(performance.now()/1e3).toFixed(2)];u.length>yp&&u.shift(),r.value={labels:u,datasets:kp(o)}},100);i.push(()=>clearInterval(a));let l=D(wp(t,n)),c=u=>{u.name===n.name&&(l.value=wp(t,u))};return e.on("update",c),i.push(()=>e.off("update",c)),{app:n,stats:l,chartData:r,dispose:s}}function kp(e){return Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:[...n],fill:!1,borderColor:i,tension:.1}))}function Cv(){return{update:{values:[0],color:"#ad981f"},updateDirtied:{values:[0],color:"#b21f3a"},createNode:{values:[0],color:"#198019"},removeNode:{values:[0],color:"#5F3691"},updateNode:{values:[0],color:"#2f2f9d"},signalAttrUpdate:{values:[0],color:"#28888f"},signalTextUpdate:{values:[0],color:"#9b3b98"}}}var yp,ze,vp,Ep=M(()=>{"use strict";V();Fn();yp=100,ze=D([]),vp=!1});function Mp(e){return m("svg",{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",...e},m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M12 16v-4"}),m("path",{d:"M12 8h.01"}))}var Tp=M(()=>{"use strict";V()});function $s({pauseWhen:e}){let t=dt();return Tt(()=>Sp(t)),m("div",{className:"flex flex-col gap-2"},m(Ge,{each:ze},n=>m(Pv,{item:n,pauseWhen:e})))}function Pv({item:e,pauseWhen:t}){let n=D(!1),i=D(e.chartData.peek()),s=ec({data:i}),o=e.chartData.subscribe(c=>{n.peek()||t?.peek()||(i.value=c)});Ht(()=>o()),Tt(()=>s.init());let r=D(!1),a=()=>{n.value=!0},l=()=>{t?.peek()||(n.value=!1,i.value=e.chartData.peek(),s.resetZoom())};return()=>m("div",{title:e.app.name,className:"flex overflow-hidden"},m("canvas",{ref:s.canvasRef,className:"w-full max-w-full h-80 overflow-hidden",onmouseover:a,onmouseout:l,onmousedown:c=>{s.getZoomLevel()<=1||(c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation())}}),m("div",{className:"absolute top-1 right-1 flex flex-col gap-1 items-end"},m("button",{className:"p-1",onclick:()=>r.value=!r.value},m(Mp,{className:"w-4 h-4"})),m(ge,{from:{stats:e.stats,showStatsTooltip:r}},({stats:c,showStatsTooltip:u})=>u&&m("div",{className:"text-xs grid grid-cols-2 gap-x-4 bg-neutral-800 bg-opacity-60 hover:bg-opacity-80 rounded-md p-2",style:"grid-template-columns: auto auto;"},m("span",{className:"text-right"},"Mount duration:"),c.mountDuration," ms",m("span",{className:"text-right"},"Total updates:"),m("span",null,c.totalTicks),m("span",{className:"text-right"},"Avg. update duration:"),c.avgTickDuration," ms",m("span",{className:"text-right"},"Latest update:"),m("span",null,c.lastTickDuration," ms")))))}var Cp=M(()=>{"use strict";V();Sr();Ce();Ep();Tp()});var uc=M(()=>{"use strict";xp();Cp()});var Dr,Pp=M(()=>{"use strict";V();Ws();uc();Dr={Apps:{Icon:Na,View:cc},FileRouter:{Icon:Va,View:()=>m("div",null,"FileRouter")},Profiling:{Icon:rs,View:$s},Settings:{Icon:za,View:()=>m("div",null,"Settings")}}});function Av(){return m("button",{ref:J.rootRef,className:"flex gap-2 cursor-default"},m("nav",{className:"flex flex-col gap-2 justify-between"},m("div",{className:"flex flex-col gap-2"},Object.keys(Dr).map(e=>m(Ov,{key:e,id:e})))),m("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto p-2 bg-neutral-400/5 rounded"},m(ge,{from:Dv},e=>m(e.View,null))))}function Ov({id:e}){let{Icon:t}=Dr[e];return m("button",{key:e,onclick:()=>J.devtoolsTab.value=e,className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(J.devtoolsTab.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},m(t,{className:"text-primary"}),m("span",{className:"hidden sm:inline"},e))}var Dv,Dp=M(()=>{"use strict";V();Ce();Pp();Dv=Mt(()=>Dr[J.devtoolsTab.value])});var Ap={};Wr(Ap,{AppsIcon:()=>Na,AppsTabView:()=>cc,ChevronRightIcon:()=>Xe,CloseIcon:()=>La,CogIcon:()=>za,ComponentIcon:()=>Zm,DevtoolsApp:()=>Av,ExpandIcon:()=>Jm,ExternalLinkIcon:()=>os,FlameIcon:()=>Fa,FolderTreeIcon:()=>Va,GaugeIcon:()=>rs,GripIcon:()=>Qm,MouseIcon:()=>as,OpenIcon:()=>tb,ProfilingTabView:()=>$s,RadioIcon:()=>Ha,ResizableSplit:()=>nc,ResizeGripIcon:()=>Hn,ValueViewer:()=>Tn,ZapIcon:()=>eb,assert:()=>Ye,buildViewerRoot:()=>sn,clamp:()=>Ke,collectFromRoot:()=>xe,computeComponentHash:()=>bi,createDraggableController:()=>qe,createElementBoundingTracker:()=>Ba,createLineChart:()=>ec,createMousePositionTracker:()=>ls,createResizableController:()=>Bn,devtoolsAppRootHasFocus:()=>Xm,devtoolsState:()=>J,disposeCache:()=>le,emptyCache:()=>Ct,findComponentByHash:()=>Ia,getFileLink:()=>ss,getNodeName:()=>Vn,ifDevtoolsAppRootHasFocus:()=>Ra,isDevtoolsApp:()=>oe,kiruGlobal:()=>dt,trapFocus:()=>Km,typedMapEntries:()=>Ym});var ei=M(()=>{"use strict";Dp();Ws();Sr();Ce();uc();Fn()});var YM,Us,Gs,ye,St,Op,on,ce,Ni=M(()=>{"use strict";V();YM=D(!1),Us=D(!1),Gs=D(!1),ye=D(!1),St=D([]),Op=Mt(()=>St.value.length>0),on=50,ce=D(null)});var Ys=M(()=>{"use strict"});var Rv,Iv,Np,Nv,Lv,zv,Lp=M(()=>{"use strict";V();Z();ei();Ys();Ni();Rv="kiru.devtools.debuggerPosition",Iv="kiru.devtools.debuggerSize",Np=()=>{let e=qe({key:Rv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Iv,storage:sessionStorage,minSize:[320,180]});Tt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:ce.value==="debugger"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>ce.value="debugger"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"auto",scrollbarWidth:"thin",minHeight:0}},m(Nv,null)),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))},Nv=()=>{let e=D([]);return Tt(()=>{let t=dt().devtools.subscribe(n=>{e.value=Array.from(n).map(i=>({...i,link:ss(i.signal)}))});return()=>t()}),m("div",{className:"flex flex-col gap-2 p-2"},m(Ge,{each:e,fallback:m("div",{className:"flex flex-col items-center justify-center gap-2 py-8 px-4 text-center text-neutral-400 text-sm"},m("p",{className:"font-medium"},"No signals tracked"),m("p",{className:"text-xs text-neutral-500 max-w-[240px]"},"Use"," ",m("code",{className:"px-1 py-0.5 rounded bg-neutral-800 text-neutral-300 font-mono text-[11px]"},"DevTools.track(signal, label)")," ","in your app to inspect signal values here."))},t=>m(Lv,{key:\`\${t.signal.$id}:\${t.label}\${t.link}\`,entry:t})))},Lv=({entry:e})=>{let t=J.viewerSettings.peek(),n=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{value:s},i=D(sn(n(e.signal.peek()),e.label,Ct(),t));return Tt(()=>{let s=e.signal.subscribe(o=>{let r=Ct();xe(i.peek(),e.label,r),i.value=sn(n(o),e.label,r,t),le(r)});return()=>{s();let o=Ct();xe(i.peek(),e.label,o),le(o)}}),()=>m("div",{className:"rounded border border-neutral-700 text-xs"},m("div",{className:"flex items-center justify-between px-2 py-1 border-b border-neutral-700 font-medium text-neutral-300"},e.label,m(zv,{link:e.link})),m(ge,{from:i},s=>m(Tn,{root:s})))},zv=({link:e})=>e?m("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:e,onclick:t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),window.open(e)},title:"Open in editor"},"Open in editor",m(os,{width:"0.65rem",height:"0.65rem"})):null});var Vv,Fv,Fp,Hp=M(()=>{"use strict";V();Z();ei();Ys();Ni();Vv="kiru.devtools.profilerPosition",Fv="kiru.devtools.profilerSize",Fp=()=>{let e=qe({key:Vv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Fv,storage:sessionStorage,minSize:[320,180],aspectRatio:2/1});Tt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:ce.value==="profiler"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>ce.value="profiler"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"hidden",minHeight:0}},m($s,{pauseWhen:e.isDragging})),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))}});function Ar({style:e,top:t,left:n,width:i,height:s,...o}){return m("div",{style:{...e,position:"absolute",zIndex:50,top:t+"px",left:n+"px",width:i+"px",height:s+"px",background:"linear-gradient(135deg, rgb(164 11 32 / 66%) 0%, rgb(82 14 47 / 80%) 80%)"},...o})}var dc=M(()=>{"use strict";V()});function Hv(e){let t=null,n=e;for(;n;){if(typeof n.type=="function"){let i=n,s=ss(i.type);if(s){t={component:i,link:s};break}}n=n.parent}return t?{...t,elements:Wp(t.component.child)}:null}function Wp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Wp(n.child,t),n=n.sibling;return t}var Bp,jp=M(()=>{"use strict";V();ei();Ni();dc();Z();Bp=()=>{let[e,t]=ls();Ht(()=>t());let n=D(null),i=null,s=()=>{let u=ye.value,{x:d,y:f}=e.value;if(!u){n.value=null;return}let p=document.elementsFromPoint(d,f),b=null;for(let E of p){let P=E.__kiruNode;if(P&&(b=Hv(P),b))break}if(!b){n.value=null;return}let x=1/0,y=1/0,w=-1/0,_=-1/0;for(let E of b.elements){let{top:P,left:O,width:A,height:N}=E.getBoundingClientRect();x=Math.min(x,O),y=Math.min(y,P),w=Math.max(w,O+A),_=Math.max(_,P+N)}let S=w-x,T=_-y;n.value={name:Vn(b.component),top:y,left:x,width:S,height:T,link:b.link,component:b.component}},o=()=>{i==null&&(i=requestAnimationFrame(()=>{i=null,s()}))};Ft([ye,e],o);let r=u=>{if(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),!ye.value||!n.value)return;let{name:d,link:f,component:p}=n.value;if(!f)return;let b=bi(p);ye.value=!1;let x=St.value,y=x.findIndex(w=>w.hash===b&&w.link===f);if(y!==-1){let w=x[y],_={...w,pulseGeneration:(w.pulseGeneration??0)+1},S=x.filter(T=>T.id!==w.id);St.value=[...S,_],ce.value="componentInfo";return}St.value=[...x,{id:crypto.randomUUID(),name:d,link:f,component:p,unmounted:!1,hash:b,pulseGeneration:0}],ce.value="componentInfo"},a=u=>{oe(u)||o()};dt().on("update",a),window.addEventListener("resize",o),window.addEventListener("scroll",o);let l=new MutationObserver(o);l.observe(document.body,{childList:!0,subtree:!0});let c=new ResizeObserver(o);return c.observe(document.body),Ht(()=>{dt().off("update",a),window.removeEventListener("resize",o),window.removeEventListener("scroll",o),l.disconnect(),c.disconnect()}),({state:u})=>{let d=ye.value,f=n.value;return!d||!f||u==="exited"?null:m(Ar,{top:f.top+window.scrollY,left:f.left+window.scrollX,width:f.width,height:f.height,className:ut("text-white flex items-center justify-center",u==="entered"?"opacity-100":"opacity-90",u==="entered"?"scale-100":"scale-90"),onclick:r},m("span",{className:"font-medium text-sm truncate max-w-full"},\`<\${f.name}>\`))}}});function Gp(e){let t={...e.props};return delete t.children,t}function fc(e){let t=Ct();xe(e,"props",t),le(t)}function Yp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Yp(n.child,t),n=n.sibling;return t}function $v(e){if(!e.child)return null;let t=Yp(e.child);if(t.size===0)return null;let n=1/0,i=1/0,s=-1/0,o=-1/0;for(let l of t){let{top:c,left:u,width:d,height:f}=l.getBoundingClientRect();n=Math.min(n,u),i=Math.min(i,c),s=Math.max(s,u+d),o=Math.max(o,c+f)}let r=s-n,a=o-i;return{top:i,left:n,width:r,height:a}}var Bv,Wv,jv,Uv,Kp,Xp=M(()=>{"use strict";V();Z();ei();Ys();Ni();dc();Bv="kiru.devtools.componentInfoPosition",Wv="kiru.devtools.componentInfoSize",jv=300;Uv=()=>{let e=D(null),t=D(null),n=D(null),i=D(!1),s=D(!1),o=-1;Ft(()=>{let u=n.value;if(!u){let _=e.peek();_&&(fc(_),e.value=null);return}let d=St.value,f=d.find(_=>_.id===u);if(!f){let _=e.peek();_&&(fc(_),e.value=null);return}if(f.pulseGeneration!==o&&(o=f.pulseGeneration,f.pulseGeneration>0&&(s.value=!0,setTimeout(()=>{o===f.pulseGeneration&&(s.value=!1)},jv))),!f.unmounted){let _=bi(f.component);t.value=_,f.hash!==_&&(St.value=d.map(S=>S.id===u?{...S,hash:_}:S))}if(f.unmounted)return;let p=e.peek(),b=Ct();p&&xe(p,"props",b);let x=J.viewerSettings.peek(),y=Gp(f.component),w=sn(y,"props",b,x);e.value=w,le(b)}),Ht(()=>{let u=e.peek();u&&(fc(u),e.value=null)});let r=qe({key:Bv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),a=Bn({key:Wv,storage:sessionStorage,minSize:[320,200]});Tt(()=>{r.init(),a.init();let u=d=>{let f=n.value;if(!f)return;let p=St.value,b=p.find(S=>S.id===f);if(!b||oe(d))return;let x=Lt(b.component);if(x&&x!==d)return;if(b.unmounted){let S=t.value;if(!S)return;let T=Ia(d.rootNode,S);if(!T)return;St.value=p.map(E=>E.id===f?{...E,component:T,unmounted:!1}:E);return}if(So(b.component)){St.value=p.map(S=>S.id===f?{...S,unmounted:!0}:S);return}let y=e.peek();if(!y)return;let w=J.viewerSettings.peek(),_=Ct();xe(y,"props",_),e.value=sn(Gp(b.component),"props",_,w),le(_)};return dt().on("update",u),()=>{r.dispose(),a.dispose(),dt().off("update",u)}});let l=u=>{r.containerRef.value=u,r.handleRef.value=u,a.containerRef.value=u},c=u=>{a.handleRef.value=u};return({panel:u,state:d})=>{n.value||(n.value=u.id);let p=St.value.find(_=>_.id===u.id);if(!p)return null;let b=()=>{let _=St.value,S=_.find(T=>T.id===u.id);S&&(St.value=[..._.filter(T=>T.id!==u.id),S],ce.value="componentInfo")},x=i.value,y=s.value,w=x&&!p.unmounted?$v(p.component):null;return m(vt,null,w&&m(Ar,{top:w.top+window.scrollY,left:w.left+window.scrollX,width:w.width,height:w.height,className:ut("pointer-events-none",d==="entered"?"opacity-100":"opacity-90")}),m("div",{ref:l,className:"fixed p-0.5 flex flex-col gap-2 select-none z-index-1001",style:{zIndex:ce.value==="componentInfo"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${200}px\`,opacity:d==="entered"?1:0,cursor:a.isResizing.value?"se-resize":r.isDragging.value?"grabbing":"grab"},onclick:b,onmousedown:b,onmouseenter:()=>i.value=!0,onmouseleave:()=>i.value=!1},m("div",{style:{transition:"80ms ease-in-out",opacity:y?1:.75,flex:1,scrollbarWidth:"thin",minHeight:0,overflow:"hidden",boxShadow:y?"0 0 8px crimson":void 0},className:"rounded-lg bg-neutral-900 opacity-75 hover:opacity-100! shadow-lg"},m("div",{className:"flex flex-col text-sm overflow-auto"},m("div",{className:"flex items-center justify-between gap-2 p-2"},m("a",{href:p.link,className:ut("flex items-center justify-center gap-2","text-neutral-400 hover:text-neutral-200"),onclick:_=>{_.preventDefault(),_.stopPropagation(),window.open(p.link)},onmousedown:_=>_.stopPropagation(),title:"Open in editor"},\`<\${p.name}>\`,m(os,{className:"w-4 h-4 shrink-0 pointer-events-none"})),m("div",{className:"flex items-center gap-2"},p.unmounted&&m("span",{className:"rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400"},"Unmounted"),m("button",{type:"button",className:"p-1 text-neutral-400 hover:text-neutral-200",onclick:()=>{St.value=St.value.filter(_=>_.id!==u.id)},title:"Close"},m(La,{className:"w-4 h-4 shrink-0 pointer-events-none"})))),m("div",{className:"pt-2 px-4"},m("div",{className:"mb-1.5 font-medium text-neutral-300 text-xs"},"Props"),m(ge,{from:e},_=>_?_.children.length===0?m("div",{className:"text-neutral-500 text-xs italic py-1"},"No props"):m(Tn,{root:_,className:"text-xs"}):null)))),m("div",{ref:c,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"}))))}},Kp=({state:e})=>m(Ge,{each:St},(t,n)=>m(Uv,{key:t.id,panel:t,index:n,state:e}))});var qp=M(()=>{"use strict";Lp();Hp();jp();Xp()});var eg={};Wr(eg,{default:()=>tg});function tg(){let e=qe({storage:localStorage,key:Gv,defaultPosition:{type:"snapped",side:"bottom",percent:.5},getPadding:()=>[10,10],getDraggableBounds:()=>[window.innerWidth,window.innerHeight],onclick:()=>hc.value=!hc.value}),t=Mt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"column":"row"}),n=Mt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"row":"column"});return Tt(()=>{e.init();let i=e.containerRef.value,s=Jp.current;Ft([hc,e.snapSide,e.containerPos],(o,r,[a,l])=>{let[c,u]=[s.offsetWidth,s.offsetHeight],d=e.handleRef.value,f=d?.offsetWidth??0,p=d?.offsetHeight??0,b=0,x=0;if(r==="top"||r==="bottom"){let P=a+i.offsetWidth/2-c/2;b=Ke(P,10,window.innerWidth-10-c)-P}else{let P=l+i.offsetHeight/2-u/2;x=Ke(P,10,window.innerHeight-10-u)-P}let y=f/2+8+c/2,w=p/2+8+u/2,_=0,S=0;r==="left"?_=o?y:-y:r==="right"?_=o?-y:y:r==="top"?S=o?w:-w:S=o?-w:w;let T=-c/2+b+_,E=-u/2+x+S;s.style.transform=\`scale(\${o?1:0}) translate(\${T}px, \${E}px)\`,setTimeout(()=>{Qp.value=!0},50)})}),()=>m(vt,null,m("div",{ref:e.containerRef,style:{transition:"80ms",opacity:Yv,flexDirection:n},className:"z-999999 top-0 left-0 flex items-center justify-center"},m("button",{ref:e.handleRef,className:"rounded-full p-2 z-10",style:{background:"linear-gradient(135deg, rgb(143 1 1 / 90%) 0%, rgba(119, 14, 103, 0.89) 75%)"}},m(Fa,{className:"w-5 h-5"})),m("div",{ref:Jp,style:{transition:"80ms ease-in-out",transformOrigin:"0 0",flexDirection:t},className:ut("absolute left-1/2 top-1/2 z-0 flex p-1 gap-1","bg-neutral-900 rounded-xl shadow-sm")},m(pc,{active:Us,title:"Toggle Profiler",onclick:()=>Us.value=!Us.value},m(rs,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Profiler")),m(pc,{active:Gs,title:"Toggle Debugger",onclick:()=>Gs.value=!Gs.value},m(Ha,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Tracking")),m(pc,{active:ye,title:"Select Component",onclick:()=>{ye.value=!ye.value}},m(as,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Inspect")))),m(mi,{in:Us,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Fp,{state:i})}),m(mi,{in:Gs,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Np,{state:i})}),m(mi,{in:ye,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Bp,{state:i})}),m(mi,{in:Op,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Kp,{state:i})}))}var Gv,Qp,hc,Jp,Yv,pc,ng=M(()=>{"use strict";V();Z();ei();Ni();Ys();qp();Gv="kiru.devtools.anchorPosition",Qp=D(!1),hc=D(!1),Jp=pn(null),Yv=Mt(()=>Qp.value?1:0);pc=()=>{let{derive:e}=Aa(),t=e(({className:i,active:s})=>{let o=!!s?.value;return ut("flex items-center px-1.5 py-0.5 gap-2","text-sm rounded-lg border border-white/10",o?"text-neutral-100":"bg-white/2.5 hover:bg-white/5 text-neutral-400","transition-colors duration-150",q(i,!0))}),n=e(({active:i})=>!!i?.value?"linear-gradient(135deg, rgb(143 1 1 / 75%) 0%, rgba(119, 14, 103, 0.89) 65%)":"transparent");return({className:i,active:s,...o})=>m("button",{className:t,style:{background:n},...o})}});var Ic=\`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
|
|
5421
5421
|
@layer properties;
|
|
5422
5422
|
@layer theme, base, components, utilities;
|
|
5423
5423
|
@layer theme {
|
|
@@ -6077,6 +6077,11 @@ var dist_default = `var Cg=Object.create;var io=Object.defineProperty;var Pg=Obj
|
|
|
6077
6077
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
6078
6078
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
6079
6079
|
}
|
|
6080
|
+
.transition-colors {
|
|
6081
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
|
|
6082
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
6083
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
6084
|
+
}
|
|
6080
6085
|
.transition-opacity {
|
|
6081
6086
|
transition-property: opacity;
|
|
6082
6087
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
@@ -6087,6 +6092,10 @@ var dist_default = `var Cg=Object.create;var io=Object.defineProperty;var Pg=Obj
|
|
|
6087
6092
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
6088
6093
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
6089
6094
|
}
|
|
6095
|
+
.duration-150 {
|
|
6096
|
+
--tw-duration: 150ms;
|
|
6097
|
+
transition-duration: 150ms;
|
|
6098
|
+
}
|
|
6090
6099
|
.duration-200 {
|
|
6091
6100
|
--tw-duration: 200ms;
|
|
6092
6101
|
transition-duration: 200ms;
|
|
@@ -6357,7 +6366,7 @@ var dist_default = `var Cg=Object.create;var io=Object.defineProperty;var Pg=Obj
|
|
|
6357
6366
|
--tw-outline-style: solid;
|
|
6358
6367
|
}
|
|
6359
6368
|
}
|
|
6360
|
-
}\`;if("window"in globalThis){async function e(){let t=await Promise.resolve().then(()=>(V(),B)),{default:n}=await Promise.resolve().then(()=>(
|
|
6369
|
+
}\`;if("window"in globalThis){async function e(){let t=await Promise.resolve().then(()=>(V(),B)),{default:n}=await Promise.resolve().then(()=>(ng(),eg)),{devtoolsState:i}=await Promise.resolve().then(()=>(ei(),Ap)),s=document.createElement("kiru-devtools");s.setAttribute("style","display: contents"),s.tabIndex=-1,document.body.appendChild(s);let o=s.attachShadow({mode:"open",delegatesFocus:!0}),r=new CSSStyleSheet;r.replaceSync(Ic),o.adoptedStyleSheets=[r],t.mount(t.createElement(n),o,{name:"kiru.devtools"});let a=()=>i.popupWindow.value?.close();window.addEventListener("close",a),window.addEventListener("beforeunload",a)}window.addEventListener("kiru:ready",e,{once:!0})}
|
|
6361
6370
|
/*! Bundled license information:
|
|
6362
6371
|
|
|
6363
6372
|
@kurkle/color/dist/color.esm.js:
|