react-semaphor 0.0.111 → 0.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function($e,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):($e=typeof globalThis<"u"?globalThis:$e||self,m($e["react-semaphor"]={},$e.React,$e.ReactDOM))})(this,function($e,m,Tt){"use strict";var pfe=Object.defineProperty;var gfe=($e,m,Tt)=>m in $e?pfe($e,m,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):$e[m]=Tt;var Me=($e,m,Tt)=>(gfe($e,typeof m!="symbol"?m+"":m,Tt),Tt),nw=($e,m,Tt)=>{if(!m.has($e))throw TypeError("Cannot "+Tt)};var Z=($e,m,Tt)=>(nw($e,m,"read from private field"),Tt?Tt.call($e):m.get($e)),Ve=($e,m,Tt)=>{if(m.has($e))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add($e):m.set($e,Tt)},Ne=($e,m,Tt,js)=>(nw($e,m,"write to private field"),js?js.call($e,Tt):m.set($e,Tt),Tt);var um=($e,m,Tt,js)=>({set _(ue){Ne($e,m,ue,Tt)},get _(){return Z($e,m,js)}}),St=($e,m,Tt)=>(nw($e,m,"access private method"),Tt);var Na,_s,oc,K5,sc,Ss,ac,X5,Ra,Q5,lc,cc,oi,Cs,si,Nn,Cd,La,uc,dm,Mi,Vo,Z5,eo,J5,to,Ed,Wr,dc,no,$s,eA,ai,Od,Fa,tA,Mn,Es,Os,fc,hc,Ps,pc,gc,nA,xr,nn,Pd,ir,$a,mc,ro,kd,vc,bc,ja,za,ks,yc,Ba,rf,Md,rw,Dd,iw,Td,ow,Ad,sw,Id,aw,Nd,lw,Rd,cw,_g,MN,rA,Sg,Ux;function js(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ue=js(m),DN=js(Tt);var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fm(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var hm={exports:{}},Lc={};/**
1
+ (function($e,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):($e=typeof globalThis<"u"?globalThis:$e||self,m($e["react-semaphor"]={},$e.React,$e.ReactDOM))})(this,function($e,m,Tt){"use strict";var pfe=Object.defineProperty;var gfe=($e,m,Tt)=>m in $e?pfe($e,m,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):$e[m]=Tt;var Me=($e,m,Tt)=>(gfe($e,typeof m!="symbol"?m+"":m,Tt),Tt),nw=($e,m,Tt)=>{if(!m.has($e))throw TypeError("Cannot "+Tt)};var Z=($e,m,Tt)=>(nw($e,m,"read from private field"),Tt?Tt.call($e):m.get($e)),Ve=($e,m,Tt)=>{if(m.has($e))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add($e):m.set($e,Tt)},Ne=($e,m,Tt,js)=>(nw($e,m,"write to private field"),js?js.call($e,Tt):m.set($e,Tt),Tt);var um=($e,m,Tt,js)=>({set _(ue){Ne($e,m,ue,Tt)},get _(){return Z($e,m,js)}}),St=($e,m,Tt)=>(nw($e,m,"access private method"),Tt);var Na,_s,oc,K5,sc,Ss,ac,X5,Ra,Q5,lc,cc,oi,Cs,si,Nn,Cd,La,uc,dm,Mi,Vo,Z5,eo,J5,to,Ed,Wr,dc,no,$s,eA,ai,Od,Fa,tA,Mn,Es,Os,fc,hc,Ps,pc,gc,nA,xr,rn,Pd,ir,$a,mc,ro,kd,vc,bc,ja,za,ks,yc,Ba,rf,Md,rw,Dd,iw,Td,ow,Ad,sw,Id,aw,Nd,lw,Rd,cw,_g,MN,rA,Sg,Ux;function js(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ue=js(m),DN=js(Tt);var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fm(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var hm={exports:{}},Lc={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.development.js
4
4
  *
@@ -24,7 +24,7 @@ Check the top-level render call using <`+se+">.")}return Y}}function Ua(M,Y){{if
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var dw;function AN(){if(dw)return Fc;dw=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Fc.Fragment=n,Fc.jsx=s,Fc.jsxs=s,Fc}process.env.NODE_ENV==="production"?hm.exports=AN():hm.exports=TN();var w=hm.exports;function fw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=fw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function of(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const IN=Object.freeze(Object.defineProperty({__proto__:null,clsx:of,default:of},Symbol.toStringTag,{value:"Module"})),pm="-";function NN(e){const t=LN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(pm);return a[0]===""&&a.length!==1&&a.shift(),hw(a,t)||RN(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function hw(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?hw(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(pm);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const pw=/^\[(.+)\]$/;function RN(e){if(pw.test(e)){const t=pw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function LN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return $N(Object.entries(e.classGroups),n).forEach(([o,s])=>{gm(s,r,o,t)}),r}function gm(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:gw(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(FN(i)){gm(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{gm(s,gw(t,o),n,r)})})}function gw(e,t){let n=e;return t.split(pm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function FN(e){return e.isThemeGetter}function $N(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function jN(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const mw="!";function zN(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,u;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+i)===t)){a.push(s.slice(c,y)),c=y+i;continue}if(x==="/"){u=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(mw),p=g?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function BN(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function VN(e){return{cache:jN(e.cacheSize),splitModifiers:zN(e),...NN(e)}}const HN=/\s+/;function WN(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(HN).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),g=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=BN(a).join(":");return{isTailwindClass:!0,modifierId:l?p+mw:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return o.has(u)?!1:(o.add(u),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function UN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vw(t))&&(r&&(r+=" "),r+=n);return r}function vw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vw(e[r]))&&(n&&(n+=" "),n+=t);return n}function qN(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=VN(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=WN(l,n);return i(l,u),u}return function(){return o(UN.apply(null,arguments))}}function Xt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const bw=/^\[(?:([a-z-]+):)?(.+)\]$/i,GN=/^\d+\/\d+$/,YN=new Set(["px","full","screen"]),KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,QN=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function mi(e){return zs(e)||YN.has(e)||GN.test(e)}function Wo(e){return sl(e,"length",s3)}function zs(e){return!!e&&!Number.isNaN(Number(e))}function sf(e){return sl(e,"number",zs)}function $c(e){return!!e&&Number.isInteger(Number(e))}function JN(e){return e.endsWith("%")&&zs(e.slice(0,-1))}function pt(e){return bw.test(e)}function Uo(e){return KN.test(e)}const e3=new Set(["length","size","percentage"]);function t3(e){return sl(e,e3,yw)}function n3(e){return sl(e,"position",yw)}const r3=new Set(["image","url"]);function i3(e){return sl(e,r3,l3)}function o3(e){return sl(e,"",a3)}function jc(){return!0}function sl(e,t,n){const r=bw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function s3(e){return XN.test(e)}function yw(){return!1}function a3(e){return QN.test(e)}function l3(e){return ZN.test(e)}function c3(){const e=Xt("colors"),t=Xt("spacing"),n=Xt("blur"),r=Xt("brightness"),i=Xt("borderColor"),o=Xt("borderRadius"),s=Xt("borderSpacing"),a=Xt("borderWidth"),l=Xt("contrast"),c=Xt("grayscale"),u=Xt("hueRotate"),f=Xt("invert"),g=Xt("gap"),p=Xt("gradientColorStops"),v=Xt("gradientColorStopPositions"),y=Xt("inset"),x=Xt("margin"),_=Xt("opacity"),S=Xt("padding"),C=Xt("saturate"),P=Xt("scale"),O=Xt("sepia"),k=Xt("skew"),A=Xt("space"),L=Xt("translate"),F=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",pt,t],V=()=>[pt,t],oe=()=>["",mi,Wo],ee=()=>["auto",zs,pt],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],K=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",pt],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[zs,sf],ne=()=>[zs,pt];return{cacheSize:500,separator:":",theme:{colors:[jc],spacing:[mi,Wo],blur:["none","",Uo,pt],brightness:H(),borderColor:[e],borderRadius:["none","","full",Uo,pt],borderSpacing:V(),borderWidth:oe(),contrast:H(),grayscale:G(),hueRotate:ne(),invert:G(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[JN,Wo],inset:z(),margin:z(),opacity:H(),padding:V(),saturate:H(),scale:H(),sepia:G(),skew:ne(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",pt]}],container:["container"],columns:[{columns:[Uo]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),pt]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$c,pt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pt]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",$c,pt]}],"grid-cols":[{"grid-cols":[jc]}],"col-start-end":[{col:["auto",{span:["full",$c,pt]},pt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[jc]}],"row-start-end":[{row:["auto",{span:[$c,pt]},pt]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",pt,t]}],"min-w":[{"min-w":["min","max","fit",pt,mi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Uo]},Uo,pt]}],h:[{h:[pt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",mi,pt]}],"max-h":[{"max-h":[pt,t,"min","max","fit"]}],"font-size":[{text:["base",Uo,Wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sf]}],"font-family":[{font:[jc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pt]}],"line-clamp":[{"line-clamp":["none",zs,sf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mi,pt]}],"list-image":[{"list-image":["none",pt]}],"list-style-type":[{list:["none","disc","decimal",pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mi,Wo]}],"underline-offset":[{"underline-offset":["auto",mi,pt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),n3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",t3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},i3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:J()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[mi,pt]}],"outline-w":[{outline:[mi,Wo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[mi,Wo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Uo,o3]}],"shadow-color":[{shadow:[jc]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":q()}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Uo,pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pt]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",pt]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[$c,pt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mi,Wo,sf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const u3=qN(c3);class d3 extends Error{}d3.prototype.name="InvalidTokenError";function ke(...e){return u3(of(e))}async function al(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function zc(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function f3(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function xw(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(i,o)=>h3(o,t))}function h3(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function mm(e){return e.charAt(0).toUpperCase()+e.slice(1)}var p3={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ww=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(p3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},g3=e=>e?ww(e):ww;var vm={exports:{}},bm={},af={exports:{}},ym={};/**
27
+ */var dw;function AN(){if(dw)return Fc;dw=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Fc.Fragment=n,Fc.jsx=s,Fc.jsxs=s,Fc}process.env.NODE_ENV==="production"?hm.exports=AN():hm.exports=TN();var w=hm.exports;function fw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=fw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function of(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const IN=Object.freeze(Object.defineProperty({__proto__:null,clsx:of,default:of},Symbol.toStringTag,{value:"Module"})),pm="-";function NN(e){const t=LN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(pm);return a[0]===""&&a.length!==1&&a.shift(),hw(a,t)||RN(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function hw(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?hw(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(pm);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const pw=/^\[(.+)\]$/;function RN(e){if(pw.test(e)){const t=pw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function LN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return $N(Object.entries(e.classGroups),n).forEach(([o,s])=>{gm(s,r,o,t)}),r}function gm(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:gw(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(FN(i)){gm(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{gm(s,gw(t,o),n,r)})})}function gw(e,t){let n=e;return t.split(pm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function FN(e){return e.isThemeGetter}function $N(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function jN(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const mw="!";function zN(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,u;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+i)===t)){a.push(s.slice(c,y)),c=y+i;continue}if(x==="/"){u=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(mw),p=g?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function BN(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function VN(e){return{cache:jN(e.cacheSize),splitModifiers:zN(e),...NN(e)}}const HN=/\s+/;function WN(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(HN).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),g=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=BN(a).join(":");return{isTailwindClass:!0,modifierId:l?p+mw:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return o.has(u)?!1:(o.add(u),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function UN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vw(t))&&(r&&(r+=" "),r+=n);return r}function vw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vw(e[r]))&&(n&&(n+=" "),n+=t);return n}function qN(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=VN(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=WN(l,n);return i(l,u),u}return function(){return o(UN.apply(null,arguments))}}function Qt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const bw=/^\[(?:([a-z-]+):)?(.+)\]$/i,GN=/^\d+\/\d+$/,YN=new Set(["px","full","screen"]),KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,QN=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function mi(e){return zs(e)||YN.has(e)||GN.test(e)}function Wo(e){return sl(e,"length",s3)}function zs(e){return!!e&&!Number.isNaN(Number(e))}function sf(e){return sl(e,"number",zs)}function $c(e){return!!e&&Number.isInteger(Number(e))}function JN(e){return e.endsWith("%")&&zs(e.slice(0,-1))}function pt(e){return bw.test(e)}function Uo(e){return KN.test(e)}const e3=new Set(["length","size","percentage"]);function t3(e){return sl(e,e3,yw)}function n3(e){return sl(e,"position",yw)}const r3=new Set(["image","url"]);function i3(e){return sl(e,r3,l3)}function o3(e){return sl(e,"",a3)}function jc(){return!0}function sl(e,t,n){const r=bw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function s3(e){return XN.test(e)}function yw(){return!1}function a3(e){return QN.test(e)}function l3(e){return ZN.test(e)}function c3(){const e=Qt("colors"),t=Qt("spacing"),n=Qt("blur"),r=Qt("brightness"),i=Qt("borderColor"),o=Qt("borderRadius"),s=Qt("borderSpacing"),a=Qt("borderWidth"),l=Qt("contrast"),c=Qt("grayscale"),u=Qt("hueRotate"),f=Qt("invert"),g=Qt("gap"),p=Qt("gradientColorStops"),v=Qt("gradientColorStopPositions"),y=Qt("inset"),x=Qt("margin"),_=Qt("opacity"),S=Qt("padding"),C=Qt("saturate"),P=Qt("scale"),O=Qt("sepia"),k=Qt("skew"),A=Qt("space"),L=Qt("translate"),F=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",pt,t],V=()=>[pt,t],oe=()=>["",mi,Wo],ee=()=>["auto",zs,pt],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],K=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",pt],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[zs,sf],ne=()=>[zs,pt];return{cacheSize:500,separator:":",theme:{colors:[jc],spacing:[mi,Wo],blur:["none","",Uo,pt],brightness:H(),borderColor:[e],borderRadius:["none","","full",Uo,pt],borderSpacing:V(),borderWidth:oe(),contrast:H(),grayscale:G(),hueRotate:ne(),invert:G(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[JN,Wo],inset:z(),margin:z(),opacity:H(),padding:V(),saturate:H(),scale:H(),sepia:G(),skew:ne(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",pt]}],container:["container"],columns:[{columns:[Uo]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),pt]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$c,pt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pt]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",$c,pt]}],"grid-cols":[{"grid-cols":[jc]}],"col-start-end":[{col:["auto",{span:["full",$c,pt]},pt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[jc]}],"row-start-end":[{row:["auto",{span:[$c,pt]},pt]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",pt,t]}],"min-w":[{"min-w":["min","max","fit",pt,mi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Uo]},Uo,pt]}],h:[{h:[pt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",mi,pt]}],"max-h":[{"max-h":[pt,t,"min","max","fit"]}],"font-size":[{text:["base",Uo,Wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sf]}],"font-family":[{font:[jc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pt]}],"line-clamp":[{"line-clamp":["none",zs,sf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mi,pt]}],"list-image":[{"list-image":["none",pt]}],"list-style-type":[{list:["none","disc","decimal",pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mi,Wo]}],"underline-offset":[{"underline-offset":["auto",mi,pt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),n3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",t3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},i3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:J()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[mi,pt]}],"outline-w":[{outline:[mi,Wo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[mi,Wo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Uo,o3]}],"shadow-color":[{shadow:[jc]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":q()}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Uo,pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pt]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",pt]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[$c,pt]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mi,Wo,sf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const u3=qN(c3);class d3 extends Error{}d3.prototype.name="InvalidTokenError";function ke(...e){return u3(of(e))}async function al(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function zc(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function f3(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function xw(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(i,o)=>h3(o,t))}function h3(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function mm(e){return e.charAt(0).toUpperCase()+e.slice(1)}var p3={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ww=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(p3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},g3=e=>e?ww(e):ww;var vm={exports:{}},bm={},af={exports:{}},ym={};/**
28
28
  * @license React
29
29
  * use-sync-external-store-shim.development.js
30
30
  *
@@ -56,14 +56,14 @@ Check the top-level render call using <`+se+">.")}return Y}}function Ua(M,Y){{if
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var Pw;function y3(){if(Pw)return wm;Pw=1;var e=m,t=Ew();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return wm.useSyncExternalStoreWithSelector=function(c,u,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function _(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return P=A}return P=k}if(A=P,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,P=L)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return _(u())},O===null?void 0:function(){return _(O())}]},[u,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},wm}process.env.NODE_ENV==="production"?vm.exports=y3():vm.exports=b3();var x3=vm.exports;const w3=Rc(x3);var kw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:_3}=m,{useSyncExternalStoreWithSelector:S3}=w3;let Mw=!1;function C3(e,t=e.getState,n){(kw?"production":void 0)!=="production"&&n&&!Mw&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Mw=!0);const r=S3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _3(r),r}const Dw=e=>{(kw?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?g3(e):e,n=(r,i)=>C3(t,r,i);return Object.assign(n,t),n},Tw=e=>e?Dw(e):Dw;var Aw=Symbol.for("immer-nothing"),Iw=Symbol.for("immer-draftable"),Or=Symbol.for("immer-state"),E3=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function cr(e,...t){if(process.env.NODE_ENV!=="production"){const n=E3[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ll=Object.getPrototypeOf;function cl(e){return!!e&&!!e[Or]}function Bs(e){var t;return e?Nw(e)||Array.isArray(e)||!!e[Iw]||!!((t=e.constructor)!=null&&t[Iw])||cf(e)||uf(e):!1}var O3=Object.prototype.constructor.toString();function Nw(e){if(!e||typeof e!="object")return!1;const t=ll(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===O3}function Bc(e,t){lf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function lf(e){const t=e[Or];return t?t.type_:Array.isArray(e)?1:cf(e)?2:uf(e)?3:0}function _m(e,t){return lf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Rw(e,t,n){const r=lf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function P3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cf(e){return e instanceof Map}function uf(e){return e instanceof Set}function Vs(e){return e.copy_||e.base_}function Sm(e,t){if(cf(e))return new Map(e);if(uf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Nw(e))return ll(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Or];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(ll(e),n)}function Cm(e,t=!1){return df(e)||cl(e)||!Bs(e)||(lf(e)>1&&(e.set=e.add=e.clear=e.delete=k3),Object.freeze(e),t&&Bc(e,(n,r)=>Cm(r,!0))),e}function k3(){cr(2)}function df(e){return Object.isFrozen(e)}var M3={};function Hs(e){const t=M3[e];return t||cr(0,e),t}var Vc;function Lw(){return Vc}function D3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Fw(e,t){t&&(Hs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Em(e){Om(e),e.drafts_.forEach(T3),e.drafts_=null}function Om(e){e===Vc&&(Vc=e.parent_)}function $w(e){return Vc=D3(Vc,e)}function T3(e){const t=e[Or];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Or].modified_&&(Em(t),cr(4)),Bs(e)&&(e=ff(t,e),t.parent_||hf(t,e)),t.patches_&&Hs("Patches").generateReplacementPatches_(n[Or].base_,e,t.patches_,t.inversePatches_)):e=ff(t,n,[]),Em(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Aw?e:void 0}function ff(e,t,n){if(df(t))return t;const r=t[Or];if(!r)return Bc(t,(i,o)=>zw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Bc(o,(a,l)=>zw(e,r,i,a,l,n,s)),hf(e,i,!1),n&&e.patches_&&Hs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function zw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&cr(5),cl(i)){const a=o&&t&&t.type_!==3&&!_m(t.assigned_,r)?o.concat(r):void 0,l=ff(e,i,a);if(Rw(n,r,l),cl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Bs(i)&&!df(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ff(e,i),(!t||!t.scope_.parent_)&&hf(e,i)}}function hf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Cm(t,n)}function A3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Lw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Pm;n&&(i=[r],o=Hc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Pm={get(e,t){if(t===Or)return e;const n=Vs(e);if(!_m(n,t))return I3(e,n,t);const r=n[t];return e.finalized_||!Bs(r)?r:r===km(e.base_,t)?(Dm(e),e.copy_[t]=Tm(r,e)):r},has(e,t){return t in Vs(e)},ownKeys(e){return Reflect.ownKeys(Vs(e))},set(e,t,n){const r=Bw(Vs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=km(Vs(e),t),o=i==null?void 0:i[Or];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(P3(n,i)&&(n!==void 0||_m(e.base_,t)))return!0;Dm(e),Mm(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return km(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Dm(e),Mm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){cr(11)},getPrototypeOf(e){return ll(e.base_)},setPrototypeOf(){cr(12)}},Hc={};Bc(Pm,(e,t)=>{Hc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Hc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&cr(13),Hc.set.call(this,e,t,void 0)},Hc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&cr(14),Pm.set.call(this,e[0],t,n,e[0])};function km(e,t){const n=e[Or];return(n?Vs(n):e)[t]}function I3(e,t,n){var i;const r=Bw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Bw(e,t){if(!(t in e))return;let n=ll(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ll(n)}}function Mm(e){e.modified_||(e.modified_=!0,e.parent_&&Mm(e.parent_))}function Dm(e){e.copy_||(e.copy_=Sm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var N3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&cr(6),r!==void 0&&typeof r!="function"&&cr(7);let i;if(Bs(t)){const o=$w(this),s=Tm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Em(o):Om(o)}return Fw(o,r),jw(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Aw&&(i=void 0),this.autoFreeze_&&Cm(i,!0),r){const o=[],s=[];Hs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else cr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Bs(e)||cr(8),cl(e)&&(e=R3(e));const t=$w(this),n=Tm(e,void 0);return n[Or].isManual_=!0,Om(t),n}finishDraft(e,t){const n=e&&e[Or];(!n||!n.isManual_)&&cr(9);const{scope_:r}=n;return Fw(r,t),jw(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Hs("Patches").applyPatches_;return cl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Tm(e,t){const n=cf(e)?Hs("MapSet").proxyMap_(e,t):uf(e)?Hs("MapSet").proxySet_(e,t):A3(e,t);return(t?t.scope_:Lw()).drafts_.push(n),n}function R3(e){return cl(e)||cr(10,e),Vw(e)}function Vw(e){if(!Bs(e)||df(e))return e;const t=e[Or];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sm(e,!0);return Bc(n,(r,i)=>{Rw(n,r,Vw(i))}),t&&(t.finalized_=!1),n}var Pr=new N3,L3=Pr.produce;Pr.produceWithPatches.bind(Pr),Pr.setAutoFreeze.bind(Pr),Pr.setUseStrictShallowCopy.bind(Pr),Pr.applyPatches.bind(Pr),Pr.createDraft.bind(Pr),Pr.finishDraft.bind(Pr);const Hw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?L3(i):i;return t(a,o,...s)},e(r.setState,n,r));var pf,gf=Tt;if(process.env.NODE_ENV==="production")pf=gf.createRoot,gf.hydrateRoot;else{var Ww=gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;pf=function(e,t){Ww.usingClientEntryPoint=!0;try{return gf.createRoot(e,t)}finally{Ww.usingClientEntryPoint=!1}}}function Uw(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=pf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var qw={},Gw={},Am={exports:{}},Qt=String,Yw=function(){return{isColorSupported:!1,reset:Qt,bold:Qt,dim:Qt,italic:Qt,underline:Qt,inverse:Qt,hidden:Qt,strikethrough:Qt,black:Qt,red:Qt,green:Qt,yellow:Qt,blue:Qt,magenta:Qt,cyan:Qt,white:Qt,gray:Qt,bgBlack:Qt,bgRed:Qt,bgGreen:Qt,bgYellow:Qt,bgBlue:Qt,bgMagenta:Qt,bgCyan:Qt,bgWhite:Qt}};Am.exports=Yw(),Am.exports.createColors=Yw;var F3=Am.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(F3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Gw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Gw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(qw);let Im=qw;var $3=(Im.__esModule?Im:{default:Im}).default;const on=Rc($3),Nm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[on.blue[500],on.teal[500],on.amber[500],on.red[500],on.indigo[500],on.green[500]],borderColor:[on.blue[500],on.teal[500],on.amber[500],on.red[500],on.indigo[500],on.green[500]]},options:{plugins:{datalabels:{display:!1,color:j3},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[on.teal[100],on.purple[100],on.amber[100],on.orange[100],on.rose[100]],borderColor:[on.teal[400],on.purple[400],on.amber[400],on.orange[300],on.rose[400]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:on.slate[800]}},y:{grid:{display:!0,color:on.slate[800]}}}}}}};function j3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Kw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Kw()),z3(n)}function Kw(){return pe.getState().theme==="dark"?"#000000":"#FFFFFF"}function z3(e){let t=0,n=0,r=0,i=0;const o=u=>{const f=u.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Wc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ul=typeof window>"u"||"Deno"in window;function Qr(){}function B3(e,t){return typeof e=="function"?e(t):e}function Rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Lm(s,t.options))return!1}else if(!qc(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Zw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Uc(t.options.mutationKey)!==Uc(o))return!1}else if(!qc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Lm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Uc)(e)}function Uc(e){return JSON.stringify(e,(t,n)=>$m(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qc(e[n],t[n])):!1}function Jw(e,t){if(e===t)return e;const n=e_(e)&&e_(t);if(n||$m(e)&&$m(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=Jw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Fm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function e_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $m(e){if(!t_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!t_(n)||!n.hasOwnProperty("isPrototypeOf"))}function t_(e){return Object.prototype.toString.call(e)==="[object Object]"}function V3(e){return new Promise(t=>{setTimeout(t,e)})}function jm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Jw(e,t):t}function H3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function W3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var U3=(K5=class extends Wc{constructor(){super();Ve(this,Na,void 0);Ve(this,_s,void 0);Ve(this,oc,void 0);Ne(this,oc,t=>{if(!ul&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,_s)||this.setEventListener(Z(this,oc))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,_s))==null||t.call(this),Ne(this,_s,void 0))}setEventListener(t){var n;Ne(this,oc,t),(n=Z(this,_s))==null||n.call(this),Ne(this,_s,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Na)!==t&&(Ne(this,Na,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,Na)=="boolean"?Z(this,Na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Na=new WeakMap,_s=new WeakMap,oc=new WeakMap,K5),mf=new U3,q3=(X5=class extends Wc{constructor(){super();Ve(this,sc,!0);Ve(this,Ss,void 0);Ve(this,ac,void 0);Ne(this,ac,t=>{if(!ul&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Ss)||this.setEventListener(Z(this,ac))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Ss))==null||t.call(this),Ne(this,Ss,void 0))}setEventListener(t){var n;Ne(this,ac,t),(n=Z(this,Ss))==null||n.call(this),Ne(this,Ss,t(this.setOnline.bind(this)))}setOnline(t){Z(this,sc)!==t&&(Ne(this,sc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,sc)}},sc=new WeakMap,Ss=new WeakMap,ac=new WeakMap,X5),vf=new q3;function G3(e){return Math.min(1e3*2**e,3e4)}function bf(e){return(e??"online")==="online"?vf.isOnline():!0}var n_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zm(e){return e instanceof n_}function r_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,_)=>{o=x,s=_}),l=x=>{var _;r||(p(new n_(x)),(_=e.abort)==null||_.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!mf.isFocused()||e.networkMode!=="always"&&!vf.isOnline(),g=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),i==null||i(),o(x))},p=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var _;i=S=>{const C=r||!f();return C&&x(S),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(g).catch(_=>{var k;if(r)return;const S=e.retry??(ul?0:3),C=e.retryDelay??G3,P=typeof C=="function"?C(n,_):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,_);if(t||!O){p(_);return}n++,(k=e.onFail)==null||k.call(e,n,_),V3(P).then(()=>{if(f())return v()}).then(()=>{t?p(_):y()})})};return bf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function Y3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var Fn=Y3(),i_=(Q5=class{constructor(){Ve(this,Ra,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rm(this.gcTime)&&Ne(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ul?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Ra)&&(clearTimeout(Z(this,Ra)),Ne(this,Ra,void 0))}},Ra=new WeakMap,Q5),K3=(Z5=class extends i_{constructor(t){super();Ve(this,uc);Ve(this,Mi);Ve(this,lc,void 0);Ve(this,cc,void 0);Ve(this,oi,void 0);Ve(this,Cs,void 0);Ve(this,si,void 0);Ve(this,Nn,void 0);Ve(this,Cd,void 0);Ve(this,La,void 0);Ne(this,La,!1),Ne(this,Cd,t.defaultOptions),St(this,uc,dm).call(this,t.options),Ne(this,Nn,[]),Ne(this,oi,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,lc,t.state||X3(this.options)),this.state=Z(this,lc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Nn).length&&this.state.fetchStatus==="idle"&&Z(this,oi).remove(this)}setData(t,n){const r=jm(this.state.data,t,this.options);return St(this,Mi,Vo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){St(this,Mi,Vo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,Cs);return(r=Z(this,si))==null||r.cancel(t),n?n.then(Qr).catch(Qr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,lc))}isActive(){return Z(this,Nn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Nn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Xw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Nn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,si))==null||n.continue()}onOnline(){var n;const t=Z(this,Nn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,si))==null||n.continue()}addObserver(t){Z(this,Nn).includes(t)||(Z(this,Nn).push(t),this.clearGcTimeout(),Z(this,oi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Nn).includes(t)&&(Ne(this,Nn,Z(this,Nn).filter(n=>n!==t)),Z(this,Nn).length||(Z(this,si)&&(Z(this,La)?Z(this,si).cancel({revert:!0}):Z(this,si).cancelRetry()),this.scheduleGc()),Z(this,oi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Nn).length}invalidate(){this.state.isInvalidated||St(this,Mi,Vo).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Cs))return(c=Z(this,si))==null||c.continueRetry(),Z(this,Cs)}if(t&&St(this,uc,dm).call(this,t),!this.options.queryFn){const p=Z(this,Nn).find(v=>v.options.queryFn);p&&St(this,uc,dm).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ne(this,La,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ne(this,La,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ne(this,cc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&St(this,Mi,Vo).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,_;zm(p)&&p.silent||St(this,Mi,Vo).call(this,{type:"error",error:p}),zm(p)||((y=(v=Z(this,oi).config).onError)==null||y.call(v,p,this),(_=(x=Z(this,oi).config).onSettled)==null||_.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ne(this,si,r_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,_;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=Z(this,oi).config).onSuccess)==null||y.call(v,p,this),(_=(x=Z(this,oi).config).onSettled)==null||_.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{St(this,Mi,Vo).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{St(this,Mi,Vo).call(this,{type:"pause"})},onContinue:()=>{St(this,Mi,Vo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ne(this,Cs,Z(this,si).promise),Z(this,Cs)}},lc=new WeakMap,cc=new WeakMap,oi=new WeakMap,Cs=new WeakMap,si=new WeakMap,Nn=new WeakMap,Cd=new WeakMap,La=new WeakMap,uc=new WeakSet,dm=function(t){this.options={...Z(this,Cd),...t},this.updateGcTime(this.options.gcTime)},Mi=new WeakSet,Vo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:bf(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return zm(i)&&i.revert&&Z(this,cc)?{...Z(this,cc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Fn.batch(()=>{Z(this,Nn).forEach(r=>{r.onQueryUpdate()}),Z(this,oi).notify({query:this,type:"updated",action:t})})},Z5);function X3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q3=(J5=class extends Wc{constructor(t={}){super();Ve(this,eo,void 0);this.config=t,Ne(this,eo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Lm(i,n);let s=this.get(o);return s||(s=new K3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,eo).has(t.queryHash)||(Z(this,eo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,eo).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,eo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Fn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,eo).get(t)}getAll(){return[...Z(this,eo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Qw(t,r)):n}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},eo=new WeakMap,J5),Z3=(eA=class extends i_{constructor(t){super();Ve(this,no);Ve(this,to,void 0);Ve(this,Ed,void 0);Ve(this,Wr,void 0);Ve(this,dc,void 0);this.mutationId=t.mutationId,Ne(this,Ed,t.defaultOptions),Ne(this,Wr,t.mutationCache),Ne(this,to,[]),this.state=t.state||J3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,Ed),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,to).includes(t)||(Z(this,to).push(t),this.clearGcTimeout(),Z(this,Wr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,to,Z(this,to).filter(n=>n!==t)),this.scheduleGc(),Z(this,Wr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,to).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Wr).remove(this))}continue(){var t;return((t=Z(this,dc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,f,g,p,v,y,x,_,S,C,P,O,k,A;const n=()=>(Ne(this,dc,r_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{St(this,no,$s).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{St(this,no,$s).call(this,{type:"pause"})},onContinue:()=>{St(this,no,$s).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,dc).promise),r=this.state.status==="pending";try{if(!r){St(this,no,$s).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,Wr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&St(this,no,$s).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,Wr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,L,t,this.state.context)),await((p=(g=Z(this,Wr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),St(this,no,$s).call(this,{type:"success",data:L}),L}catch(L){try{throw await((_=(x=Z(this,Wr).config).onError)==null?void 0:_.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((O=(P=Z(this,Wr).config).onSettled)==null?void 0:O.call(P,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{St(this,no,$s).call(this,{type:"error",error:L})}}}},to=new WeakMap,Ed=new WeakMap,Wr=new WeakMap,dc=new WeakMap,no=new WeakSet,$s=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!bf(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Fn.batch(()=>{Z(this,to).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Wr).notify({mutation:this,type:"updated",action:t})})},eA);function J3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var e4=(tA=class extends Wc{constructor(t={}){super();Ve(this,ai,void 0);Ve(this,Od,void 0);Ve(this,Fa,void 0);this.config=t,Ne(this,ai,[]),Ne(this,Od,0)}build(t,n,r){const i=new Z3({mutationCache:this,mutationId:++um(this,Od)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,ai).push(t),this.notify({type:"added",mutation:t})}remove(t){Ne(this,ai,Z(this,ai).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Fn.batch(()=>{Z(this,ai).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,ai)}find(t){const n={exact:!0,...t};return Z(this,ai).find(r=>Zw(n,r))}findAll(t={}){return Z(this,ai).filter(n=>Zw(t,n))}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ne(this,Fa,(Z(this,Fa)??Promise.resolve()).then(()=>{const t=Z(this,ai).filter(n=>n.state.isPaused);return Fn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Qr)),Promise.resolve()))}).then(()=>{Ne(this,Fa,void 0)})),Z(this,Fa)}},ai=new WeakMap,Od=new WeakMap,Fa=new WeakMap,tA);function t4(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,_,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};u(k);const A=await f(k),{maxPages:L}=t.options,F=O?W3:H3;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,P,L)}};let p;if(o&&s.length){const C=o==="backward",P=C?n4:o_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=o_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function o_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function n4(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var s_=(nA=class{constructor(e={}){Ve(this,Mn,void 0);Ve(this,Es,void 0);Ve(this,Os,void 0);Ve(this,fc,void 0);Ve(this,hc,void 0);Ve(this,Ps,void 0);Ve(this,pc,void 0);Ve(this,gc,void 0);Ne(this,Mn,e.queryCache||new Q3),Ne(this,Es,e.mutationCache||new e4),Ne(this,Os,e.defaultOptions||{}),Ne(this,fc,new Map),Ne(this,hc,new Map),Ne(this,Ps,0)}mount(){um(this,Ps)._++,Z(this,Ps)===1&&(Ne(this,pc,mf.subscribe(()=>{mf.isFocused()&&(this.resumePausedMutations(),Z(this,Mn).onFocus())})),Ne(this,gc,vf.subscribe(()=>{vf.isOnline()&&(this.resumePausedMutations(),Z(this,Mn).onOnline())})))}unmount(){var e,t;um(this,Ps)._--,Z(this,Ps)===0&&((e=Z(this,pc))==null||e.call(this),Ne(this,pc,void 0),(t=Z(this,gc))==null||t.call(this),Ne(this,gc,void 0))}isFetching(e){return Z(this,Mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,Mn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=Z(this,Mn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=B3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,Mn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Fn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=Z(this,Mn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,Mn);Fn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Mn),r={type:"active",...e};return Fn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Fn.batch(()=>Z(this,Mn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Qr).catch(Qr)}invalidateQueries(e={},t={}){return Fn.batch(()=>{if(Z(this,Mn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Fn.batch(()=>Z(this,Mn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Qr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Qr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,Mn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qr).catch(Qr)}fetchInfiniteQuery(e){return e.behavior=t4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qr).catch(Qr)}resumePausedMutations(){return Z(this,Es).resumePausedMutations()}getQueryCache(){return Z(this,Mn)}getMutationCache(){return Z(this,Es)}getDefaultOptions(){return Z(this,Os)}setDefaultOptions(e){Ne(this,Os,e)}setQueryDefaults(e,t){Z(this,fc).set(Uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,fc).values()];let n={};return t.forEach(r=>{qc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,hc).set(Uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,hc).values()];let n={};return t.forEach(r=>{qc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,Os).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Os).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Mn).clear(),Z(this,Es).clear()}},Mn=new WeakMap,Es=new WeakMap,Os=new WeakMap,fc=new WeakMap,hc=new WeakMap,Ps=new WeakMap,pc=new WeakMap,gc=new WeakMap,nA),r4=(rA=class extends Wc{constructor(t,n){super();Ve(this,Ba);Ve(this,Md);Ve(this,Dd);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,_g);Ve(this,xr,void 0);Ve(this,nn,void 0);Ve(this,Pd,void 0);Ve(this,ir,void 0);Ve(this,$a,void 0);Ve(this,mc,void 0);Ve(this,ro,void 0);Ve(this,kd,void 0);Ve(this,vc,void 0);Ve(this,bc,void 0);Ve(this,ja,void 0);Ve(this,za,void 0);Ve(this,ks,void 0);Ve(this,yc,new Set);this.options=n,Ne(this,xr,t),Ne(this,ro,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,nn).addObserver(this),a_(Z(this,nn),this.options)?St(this,Ba,rf).call(this):this.updateResult(),St(this,Ad,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bm(Z(this,nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bm(Z(this,nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,St(this,Id,aw).call(this),St(this,Nd,lw).call(this),Z(this,nn).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,nn);if(this.options=Z(this,xr).defaultQueryOptions(t),Fm(r,this.options)||Z(this,xr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,nn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),St(this,Rd,cw).call(this);const o=this.hasListeners();o&&l_(Z(this,nn),i,this.options,r)&&St(this,Ba,rf).call(this),this.updateResult(n),o&&(Z(this,nn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&St(this,Md,rw).call(this);const s=St(this,Dd,iw).call(this);o&&(Z(this,nn)!==i||this.options.enabled!==r.enabled||s!==Z(this,ks))&&St(this,Td,ow).call(this,s)}getOptimisticResult(t){const n=Z(this,xr).getQueryCache().build(Z(this,xr),t),r=this.createResult(n,t);return o4(this,r)&&(Ne(this,ir,r),Ne(this,mc,this.options),Ne(this,$a,Z(this,nn).state)),r}getCurrentResult(){return Z(this,ir)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,yc).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,xr).defaultQueryOptions(t),r=Z(this,xr).getQueryCache().build(Z(this,xr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return St(this,Ba,rf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,ir)))}createResult(t,n){var k;const r=Z(this,nn),i=this.options,o=Z(this,ir),s=Z(this,$a),a=Z(this,mc),c=t!==r?t.state:Z(this,Pd),{state:u}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=u,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&a_(t,n),F=A&&l_(t,r,n,i);(L||F)&&(p=bf(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(o&&u.data===(s==null?void 0:s.data)&&n.select===Z(this,kd))x=Z(this,vc);else try{Ne(this,kd,n.select),x=n.select(u.data),x=jm(o==null?void 0:o.data,x,n),Ne(this,vc,x),Ne(this,ro,null)}catch(A){Ne(this,ro,A)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=Z(this,bc))==null?void 0:k.state.data,Z(this,bc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ne(this,ro,null)}catch(L){Ne(this,ro,L)}typeof A<"u"&&(v="success",x=jm(o==null?void 0:o.data,A,n),y=!0)}Z(this,ro)&&(f=Z(this,ro),x=Z(this,vc),g=Date.now(),v="error");const _=p==="fetching",S=v==="pending",C=v==="error",P=S&&_;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!S,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:Vm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,ir),r=this.createResult(Z(this,nn),this.options);if(Ne(this,$a,Z(this,nn).state),Ne(this,mc,this.options),Z(this,$a).data!==void 0&&Ne(this,bc,Z(this,nn)),Fm(r,n))return;Ne(this,ir,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,yc).size)return!0;const l=new Set(a??Z(this,yc));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,ir)).some(c=>{const u=c;return Z(this,ir)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),St(this,_g,MN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&St(this,Ad,sw).call(this)}},xr=new WeakMap,nn=new WeakMap,Pd=new WeakMap,ir=new WeakMap,$a=new WeakMap,mc=new WeakMap,ro=new WeakMap,kd=new WeakMap,vc=new WeakMap,bc=new WeakMap,ja=new WeakMap,za=new WeakMap,ks=new WeakMap,yc=new WeakMap,Ba=new WeakSet,rf=function(t){St(this,Rd,cw).call(this);let n=Z(this,nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Qr)),n},Md=new WeakSet,rw=function(){if(St(this,Id,aw).call(this),ul||Z(this,ir).isStale||!Rm(this.options.staleTime))return;const n=Xw(Z(this,ir).dataUpdatedAt,this.options.staleTime)+1;Ne(this,ja,setTimeout(()=>{Z(this,ir).isStale||this.updateResult()},n))},Dd=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,nn)):this.options.refetchInterval)??!1},Td=new WeakSet,ow=function(t){St(this,Nd,lw).call(this),Ne(this,ks,t),!(ul||this.options.enabled===!1||!Rm(Z(this,ks))||Z(this,ks)===0)&&Ne(this,za,setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&St(this,Ba,rf).call(this)},Z(this,ks)))},Ad=new WeakSet,sw=function(){St(this,Md,rw).call(this),St(this,Td,ow).call(this,St(this,Dd,iw).call(this))},Id=new WeakSet,aw=function(){Z(this,ja)&&(clearTimeout(Z(this,ja)),Ne(this,ja,void 0))},Nd=new WeakSet,lw=function(){Z(this,za)&&(clearInterval(Z(this,za)),Ne(this,za,void 0))},Rd=new WeakSet,cw=function(){const t=Z(this,xr).getQueryCache().build(Z(this,xr),this.options);if(t===Z(this,nn))return;const n=Z(this,nn);Ne(this,nn,t),Ne(this,Pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_g=new WeakSet,MN=function(t){Fn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,ir))}),Z(this,xr).getQueryCache().notify({query:Z(this,nn),type:"observerResultsUpdated"})})},rA);function i4(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function a_(e,t){return i4(e,t)||e.state.dataUpdatedAt>0&&Bm(e,t,t.refetchOnMount)}function Bm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vm(e,t)}return!1}function l_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Vm(e,n)}function Vm(e,t){return e.isStaleByTime(t.staleTime)}function o4(e,t){return!Fm(e.getCurrentResult(),t)}var c_=ue.createContext(void 0),s4=e=>{const t=ue.useContext(c_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},a4=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(c_.Provider,{value:e},t)),u_=ue.createContext(!1),l4=()=>ue.useContext(u_);u_.Provider;function c4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var u4=ue.createContext(c4()),d4=()=>ue.useContext(u4);function f4(e,t){return typeof e=="function"?e(...t):!!e}var h4=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},p4=e=>{ue.useEffect(()=>{e.clearReset()},[e])},g4=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&f4(n,[e.error,r]),m4=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},v4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,b4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function y4(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=s4(n),i=l4(),o=d4(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",m4(s),h4(s,o),p4(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const u=i?()=>{}:a.subscribe(Fn.batchCalls(c));return a.updateResult(),u},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),v4(s,l))throw b4(s,a,o);if(g4({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function vi(e,t){return y4(e,r4,t)}let yf;const x4=new Uint8Array(16);function w4(){if(!yf&&(yf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yf(x4)}const $n=[];for(let e=0;e<256;++e)$n.push((e+256).toString(16).slice(1));function _4(e,t=0){return $n[e[t+0]]+$n[e[t+1]]+$n[e[t+2]]+$n[e[t+3]]+"-"+$n[e[t+4]]+$n[e[t+5]]+"-"+$n[e[t+6]]+$n[e[t+7]]+"-"+$n[e[t+8]]+$n[e[t+9]]+"-"+$n[e[t+10]]+$n[e[t+11]]+$n[e[t+12]]+$n[e[t+13]]+$n[e[t+14]]+$n[e[t+15]]}const d_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qo(e,t,n){if(d_.randomUUID&&!t&&!e)return d_.randomUUID();e=e||{};const r=e.random||(e.rng||w4)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return _4(r)}const ve=Tw()(Hw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:qo(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:qo(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),S4=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Uw("EditorStore",ve);const C4={id:"",authToken:void 0},f_=m.createContext(C4),h_=({children:e,dashboardProps:t})=>w.jsx(f_.Provider,{value:t,children:e});function lo(){const e=m.useContext(f_);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function p_(e,t){var we;let n=m.useMemo(()=>[],[]);const r=lo().authToken||e,i=ve(U=>U.selectedConnectionId),o=ve(U=>U.selectedDatabaseName),s=ve(U=>U.selectedSchemaName),a=ve(U=>U.selectedTableName),l=ve(U=>U.actions.setCurrentColumns),c=ve(U=>U.actions.setSelectedConnectionId),u=ve(U=>U.actions.setSelectedDatabaseName),f=ve(U=>U.actions.setSelectedSchemaName),g=ve(U=>U.actions.setSelectedTableName),p=ve(U=>U.actions.setCardSql),{data:v,isLoading:y,isError:x}=vi({queryKey:[t||"connections"],queryFn:()=>al("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),_=v==null?void 0:v.connections.find(U=>U.id===i),S=(_==null?void 0:_.type)==="API"||(_==null?void 0:_.type)==="S3",{data:C,isLoading:P,isFetching:O,isError:k,refetch:A}=vi({queryKey:[i],queryFn:()=>al("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&!S}),{data:L,isLoading:F,isFetching:j,isError:z,refetch:V}=vi({queryKey:[i,o],queryFn:()=>al("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&!S}),{data:oe,isLoading:ee,isFetching:$,isError:J,refetch:q}=vi({queryKey:[i,o,s],queryFn:()=>al("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&!S}),{data:K,isLoading:G,isFetching:D,isError:H}=vi({queryKey:[i,o,s,a],queryFn:()=>al("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a||S});m.useEffect(()=>{l(n)},[K,l,n]),m.useEffect(()=>{var U;S&&(u("NA"),f("NA"),g((U=_==null?void 0:_.type)==null?void 0:U.toLowerCase()))},[S,p,g,f,u,_]);const ne=S?(we=_==null?void 0:_.type)==null?void 0:we.toLowerCase():a||"",N=S?"":s||"";function le(U){f(U),g("")}function me(U){u(U),f(""),g("")}function he(U){c(U)}C&&C.databases.length>0,L&&L.schemas.length>0,K&&K.columns.length>0&&(n=K.columns.map(U=>({...U,data_type:U.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const de=v==null?void 0:v.connections.map(U=>({id:U.id,name:U.name,type:U.type})),re=C==null?void 0:C.databases.map(U=>({id:U.database_name,name:U.database_name})),Q=L==null?void 0:L.schemas.map(U=>({id:U.schema_name,name:U.schema_name})),ie=oe==null?void 0:oe.tables.map(U=>({id:U.table_name,name:U.table_name}));return{connectionItems:de,isConnectionsLoading:y,isConnectionsError:x,databaseItems:re,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Q,isSchemaLoadingOrFetching:F||j,isSchemaError:z,tableItems:ie,isTableLoadingOrFetching:ee||$,isTableError:J,columns:n,isColumnsLoadingOrFetching:G||D,isColumnsError:H,isAPIConnection:S,tableName:ne,schemaName:N,handleConnectionChange:he,handleDatabaseChange:me,handleSchemaChange:le}}const E4=e=>{const t=new Date(e);return!isNaN(t.getTime())},O4=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xf=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?E4(e)?t="date":O4(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function P4({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:xf(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
59
+ */var Pw;function y3(){if(Pw)return wm;Pw=1;var e=m,t=Ew();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return wm.useSyncExternalStoreWithSelector=function(c,u,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function _(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return P=A}return P=k}if(A=P,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,P=L)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return _(u())},O===null?void 0:function(){return _(O())}]},[u,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},wm}process.env.NODE_ENV==="production"?vm.exports=y3():vm.exports=b3();var x3=vm.exports;const w3=Rc(x3);var kw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:_3}=m,{useSyncExternalStoreWithSelector:S3}=w3;let Mw=!1;function C3(e,t=e.getState,n){(kw?"production":void 0)!=="production"&&n&&!Mw&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Mw=!0);const r=S3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _3(r),r}const Dw=e=>{(kw?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?g3(e):e,n=(r,i)=>C3(t,r,i);return Object.assign(n,t),n},Tw=e=>e?Dw(e):Dw;var Aw=Symbol.for("immer-nothing"),Iw=Symbol.for("immer-draftable"),Or=Symbol.for("immer-state"),E3=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function cr(e,...t){if(process.env.NODE_ENV!=="production"){const n=E3[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ll=Object.getPrototypeOf;function cl(e){return!!e&&!!e[Or]}function Bs(e){var t;return e?Nw(e)||Array.isArray(e)||!!e[Iw]||!!((t=e.constructor)!=null&&t[Iw])||cf(e)||uf(e):!1}var O3=Object.prototype.constructor.toString();function Nw(e){if(!e||typeof e!="object")return!1;const t=ll(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===O3}function Bc(e,t){lf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function lf(e){const t=e[Or];return t?t.type_:Array.isArray(e)?1:cf(e)?2:uf(e)?3:0}function _m(e,t){return lf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Rw(e,t,n){const r=lf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function P3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cf(e){return e instanceof Map}function uf(e){return e instanceof Set}function Vs(e){return e.copy_||e.base_}function Sm(e,t){if(cf(e))return new Map(e);if(uf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Nw(e))return ll(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Or];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(ll(e),n)}function Cm(e,t=!1){return df(e)||cl(e)||!Bs(e)||(lf(e)>1&&(e.set=e.add=e.clear=e.delete=k3),Object.freeze(e),t&&Bc(e,(n,r)=>Cm(r,!0))),e}function k3(){cr(2)}function df(e){return Object.isFrozen(e)}var M3={};function Hs(e){const t=M3[e];return t||cr(0,e),t}var Vc;function Lw(){return Vc}function D3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Fw(e,t){t&&(Hs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Em(e){Om(e),e.drafts_.forEach(T3),e.drafts_=null}function Om(e){e===Vc&&(Vc=e.parent_)}function $w(e){return Vc=D3(Vc,e)}function T3(e){const t=e[Or];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Or].modified_&&(Em(t),cr(4)),Bs(e)&&(e=ff(t,e),t.parent_||hf(t,e)),t.patches_&&Hs("Patches").generateReplacementPatches_(n[Or].base_,e,t.patches_,t.inversePatches_)):e=ff(t,n,[]),Em(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Aw?e:void 0}function ff(e,t,n){if(df(t))return t;const r=t[Or];if(!r)return Bc(t,(i,o)=>zw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Bc(o,(a,l)=>zw(e,r,i,a,l,n,s)),hf(e,i,!1),n&&e.patches_&&Hs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function zw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&cr(5),cl(i)){const a=o&&t&&t.type_!==3&&!_m(t.assigned_,r)?o.concat(r):void 0,l=ff(e,i,a);if(Rw(n,r,l),cl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Bs(i)&&!df(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ff(e,i),(!t||!t.scope_.parent_)&&hf(e,i)}}function hf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Cm(t,n)}function A3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Lw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Pm;n&&(i=[r],o=Hc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Pm={get(e,t){if(t===Or)return e;const n=Vs(e);if(!_m(n,t))return I3(e,n,t);const r=n[t];return e.finalized_||!Bs(r)?r:r===km(e.base_,t)?(Dm(e),e.copy_[t]=Tm(r,e)):r},has(e,t){return t in Vs(e)},ownKeys(e){return Reflect.ownKeys(Vs(e))},set(e,t,n){const r=Bw(Vs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=km(Vs(e),t),o=i==null?void 0:i[Or];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(P3(n,i)&&(n!==void 0||_m(e.base_,t)))return!0;Dm(e),Mm(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return km(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Dm(e),Mm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){cr(11)},getPrototypeOf(e){return ll(e.base_)},setPrototypeOf(){cr(12)}},Hc={};Bc(Pm,(e,t)=>{Hc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Hc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&cr(13),Hc.set.call(this,e,t,void 0)},Hc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&cr(14),Pm.set.call(this,e[0],t,n,e[0])};function km(e,t){const n=e[Or];return(n?Vs(n):e)[t]}function I3(e,t,n){var i;const r=Bw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Bw(e,t){if(!(t in e))return;let n=ll(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ll(n)}}function Mm(e){e.modified_||(e.modified_=!0,e.parent_&&Mm(e.parent_))}function Dm(e){e.copy_||(e.copy_=Sm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var N3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&cr(6),r!==void 0&&typeof r!="function"&&cr(7);let i;if(Bs(t)){const o=$w(this),s=Tm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Em(o):Om(o)}return Fw(o,r),jw(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Aw&&(i=void 0),this.autoFreeze_&&Cm(i,!0),r){const o=[],s=[];Hs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else cr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Bs(e)||cr(8),cl(e)&&(e=R3(e));const t=$w(this),n=Tm(e,void 0);return n[Or].isManual_=!0,Om(t),n}finishDraft(e,t){const n=e&&e[Or];(!n||!n.isManual_)&&cr(9);const{scope_:r}=n;return Fw(r,t),jw(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Hs("Patches").applyPatches_;return cl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Tm(e,t){const n=cf(e)?Hs("MapSet").proxyMap_(e,t):uf(e)?Hs("MapSet").proxySet_(e,t):A3(e,t);return(t?t.scope_:Lw()).drafts_.push(n),n}function R3(e){return cl(e)||cr(10,e),Vw(e)}function Vw(e){if(!Bs(e)||df(e))return e;const t=e[Or];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sm(e,!0);return Bc(n,(r,i)=>{Rw(n,r,Vw(i))}),t&&(t.finalized_=!1),n}var Pr=new N3,L3=Pr.produce;Pr.produceWithPatches.bind(Pr),Pr.setAutoFreeze.bind(Pr),Pr.setUseStrictShallowCopy.bind(Pr),Pr.applyPatches.bind(Pr),Pr.createDraft.bind(Pr),Pr.finishDraft.bind(Pr);const Hw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?L3(i):i;return t(a,o,...s)},e(r.setState,n,r));var pf,gf=Tt;if(process.env.NODE_ENV==="production")pf=gf.createRoot,gf.hydrateRoot;else{var Ww=gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;pf=function(e,t){Ww.usingClientEntryPoint=!0;try{return gf.createRoot(e,t)}finally{Ww.usingClientEntryPoint=!1}}}function Uw(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=pf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var qw={},Gw={},Am={exports:{}},Zt=String,Yw=function(){return{isColorSupported:!1,reset:Zt,bold:Zt,dim:Zt,italic:Zt,underline:Zt,inverse:Zt,hidden:Zt,strikethrough:Zt,black:Zt,red:Zt,green:Zt,yellow:Zt,blue:Zt,magenta:Zt,cyan:Zt,white:Zt,gray:Zt,bgBlack:Zt,bgRed:Zt,bgGreen:Zt,bgYellow:Zt,bgBlue:Zt,bgMagenta:Zt,bgCyan:Zt,bgWhite:Zt}};Am.exports=Yw(),Am.exports.createColors=Yw;var F3=Am.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(F3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Gw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Gw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(qw);let Im=qw;var $3=(Im.__esModule?Im:{default:Im}).default;const qt=Rc($3),Nm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[qt.blue[500],qt.teal[500],qt.amber[500],qt.red[500],qt.indigo[500],qt.green[500]],borderColor:[qt.blue[500],qt.teal[500],qt.amber[500],qt.red[500],qt.indigo[500],qt.green[500]]},options:{plugins:{datalabels:{display:!1,color:j3},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[qt.blue[500],qt.teal[500],qt.amber[500],qt.red[500],qt.indigo[500],qt.green[500]],borderColor:[qt.blue[500],qt.teal[500],qt.amber[500],qt.red[500],qt.indigo[500],qt.green[500]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:qt.slate[800]}},y:{grid:{display:!0,color:qt.slate[800]}}}}}}};function j3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Kw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Kw()),z3(n)}function Kw(){return pe.getState().theme==="dark"?"#000000":"#FFFFFF"}function z3(e){let t=0,n=0,r=0,i=0;const o=u=>{const f=u.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Wc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ul=typeof window>"u"||"Deno"in window;function Qr(){}function B3(e,t){return typeof e=="function"?e(t):e}function Rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Lm(s,t.options))return!1}else if(!qc(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Zw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Uc(t.options.mutationKey)!==Uc(o))return!1}else if(!qc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Lm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Uc)(e)}function Uc(e){return JSON.stringify(e,(t,n)=>$m(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qc(e[n],t[n])):!1}function Jw(e,t){if(e===t)return e;const n=e_(e)&&e_(t);if(n||$m(e)&&$m(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=Jw(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Fm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function e_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $m(e){if(!t_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!t_(n)||!n.hasOwnProperty("isPrototypeOf"))}function t_(e){return Object.prototype.toString.call(e)==="[object Object]"}function V3(e){return new Promise(t=>{setTimeout(t,e)})}function jm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Jw(e,t):t}function H3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function W3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var U3=(K5=class extends Wc{constructor(){super();Ve(this,Na,void 0);Ve(this,_s,void 0);Ve(this,oc,void 0);Ne(this,oc,t=>{if(!ul&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,_s)||this.setEventListener(Z(this,oc))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,_s))==null||t.call(this),Ne(this,_s,void 0))}setEventListener(t){var n;Ne(this,oc,t),(n=Z(this,_s))==null||n.call(this),Ne(this,_s,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Na)!==t&&(Ne(this,Na,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,Na)=="boolean"?Z(this,Na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Na=new WeakMap,_s=new WeakMap,oc=new WeakMap,K5),mf=new U3,q3=(X5=class extends Wc{constructor(){super();Ve(this,sc,!0);Ve(this,Ss,void 0);Ve(this,ac,void 0);Ne(this,ac,t=>{if(!ul&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Ss)||this.setEventListener(Z(this,ac))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Ss))==null||t.call(this),Ne(this,Ss,void 0))}setEventListener(t){var n;Ne(this,ac,t),(n=Z(this,Ss))==null||n.call(this),Ne(this,Ss,t(this.setOnline.bind(this)))}setOnline(t){Z(this,sc)!==t&&(Ne(this,sc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,sc)}},sc=new WeakMap,Ss=new WeakMap,ac=new WeakMap,X5),vf=new q3;function G3(e){return Math.min(1e3*2**e,3e4)}function bf(e){return(e??"online")==="online"?vf.isOnline():!0}var n_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zm(e){return e instanceof n_}function r_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,_)=>{o=x,s=_}),l=x=>{var _;r||(p(new n_(x)),(_=e.abort)==null||_.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!mf.isFocused()||e.networkMode!=="always"&&!vf.isOnline(),g=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),i==null||i(),o(x))},p=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var _;i=S=>{const C=r||!f();return C&&x(S),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(g).catch(_=>{var k;if(r)return;const S=e.retry??(ul?0:3),C=e.retryDelay??G3,P=typeof C=="function"?C(n,_):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,_);if(t||!O){p(_);return}n++,(k=e.onFail)==null||k.call(e,n,_),V3(P).then(()=>{if(f())return v()}).then(()=>{t?p(_):y()})})};return bf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function Y3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var Fn=Y3(),i_=(Q5=class{constructor(){Ve(this,Ra,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rm(this.gcTime)&&Ne(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ul?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Ra)&&(clearTimeout(Z(this,Ra)),Ne(this,Ra,void 0))}},Ra=new WeakMap,Q5),K3=(Z5=class extends i_{constructor(t){super();Ve(this,uc);Ve(this,Mi);Ve(this,lc,void 0);Ve(this,cc,void 0);Ve(this,oi,void 0);Ve(this,Cs,void 0);Ve(this,si,void 0);Ve(this,Nn,void 0);Ve(this,Cd,void 0);Ve(this,La,void 0);Ne(this,La,!1),Ne(this,Cd,t.defaultOptions),St(this,uc,dm).call(this,t.options),Ne(this,Nn,[]),Ne(this,oi,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,lc,t.state||X3(this.options)),this.state=Z(this,lc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Nn).length&&this.state.fetchStatus==="idle"&&Z(this,oi).remove(this)}setData(t,n){const r=jm(this.state.data,t,this.options);return St(this,Mi,Vo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){St(this,Mi,Vo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,Cs);return(r=Z(this,si))==null||r.cancel(t),n?n.then(Qr).catch(Qr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,lc))}isActive(){return Z(this,Nn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Nn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Xw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Nn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,si))==null||n.continue()}onOnline(){var n;const t=Z(this,Nn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,si))==null||n.continue()}addObserver(t){Z(this,Nn).includes(t)||(Z(this,Nn).push(t),this.clearGcTimeout(),Z(this,oi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Nn).includes(t)&&(Ne(this,Nn,Z(this,Nn).filter(n=>n!==t)),Z(this,Nn).length||(Z(this,si)&&(Z(this,La)?Z(this,si).cancel({revert:!0}):Z(this,si).cancelRetry()),this.scheduleGc()),Z(this,oi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Nn).length}invalidate(){this.state.isInvalidated||St(this,Mi,Vo).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Cs))return(c=Z(this,si))==null||c.continueRetry(),Z(this,Cs)}if(t&&St(this,uc,dm).call(this,t),!this.options.queryFn){const p=Z(this,Nn).find(v=>v.options.queryFn);p&&St(this,uc,dm).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ne(this,La,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ne(this,La,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ne(this,cc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&St(this,Mi,Vo).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,_;zm(p)&&p.silent||St(this,Mi,Vo).call(this,{type:"error",error:p}),zm(p)||((y=(v=Z(this,oi).config).onError)==null||y.call(v,p,this),(_=(x=Z(this,oi).config).onSettled)==null||_.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ne(this,si,r_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,_;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=Z(this,oi).config).onSuccess)==null||y.call(v,p,this),(_=(x=Z(this,oi).config).onSettled)==null||_.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{St(this,Mi,Vo).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{St(this,Mi,Vo).call(this,{type:"pause"})},onContinue:()=>{St(this,Mi,Vo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ne(this,Cs,Z(this,si).promise),Z(this,Cs)}},lc=new WeakMap,cc=new WeakMap,oi=new WeakMap,Cs=new WeakMap,si=new WeakMap,Nn=new WeakMap,Cd=new WeakMap,La=new WeakMap,uc=new WeakSet,dm=function(t){this.options={...Z(this,Cd),...t},this.updateGcTime(this.options.gcTime)},Mi=new WeakSet,Vo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:bf(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return zm(i)&&i.revert&&Z(this,cc)?{...Z(this,cc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Fn.batch(()=>{Z(this,Nn).forEach(r=>{r.onQueryUpdate()}),Z(this,oi).notify({query:this,type:"updated",action:t})})},Z5);function X3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q3=(J5=class extends Wc{constructor(t={}){super();Ve(this,eo,void 0);this.config=t,Ne(this,eo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Lm(i,n);let s=this.get(o);return s||(s=new K3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,eo).has(t.queryHash)||(Z(this,eo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,eo).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,eo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Fn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,eo).get(t)}getAll(){return[...Z(this,eo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Qw(t,r)):n}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Fn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},eo=new WeakMap,J5),Z3=(eA=class extends i_{constructor(t){super();Ve(this,no);Ve(this,to,void 0);Ve(this,Ed,void 0);Ve(this,Wr,void 0);Ve(this,dc,void 0);this.mutationId=t.mutationId,Ne(this,Ed,t.defaultOptions),Ne(this,Wr,t.mutationCache),Ne(this,to,[]),this.state=t.state||J3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,Ed),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,to).includes(t)||(Z(this,to).push(t),this.clearGcTimeout(),Z(this,Wr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,to,Z(this,to).filter(n=>n!==t)),this.scheduleGc(),Z(this,Wr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,to).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Wr).remove(this))}continue(){var t;return((t=Z(this,dc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,f,g,p,v,y,x,_,S,C,P,O,k,A;const n=()=>(Ne(this,dc,r_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{St(this,no,$s).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{St(this,no,$s).call(this,{type:"pause"})},onContinue:()=>{St(this,no,$s).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,dc).promise),r=this.state.status==="pending";try{if(!r){St(this,no,$s).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,Wr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&St(this,no,$s).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,Wr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,L,t,this.state.context)),await((p=(g=Z(this,Wr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),St(this,no,$s).call(this,{type:"success",data:L}),L}catch(L){try{throw await((_=(x=Z(this,Wr).config).onError)==null?void 0:_.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((O=(P=Z(this,Wr).config).onSettled)==null?void 0:O.call(P,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{St(this,no,$s).call(this,{type:"error",error:L})}}}},to=new WeakMap,Ed=new WeakMap,Wr=new WeakMap,dc=new WeakMap,no=new WeakSet,$s=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!bf(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Fn.batch(()=>{Z(this,to).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Wr).notify({mutation:this,type:"updated",action:t})})},eA);function J3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var e4=(tA=class extends Wc{constructor(t={}){super();Ve(this,ai,void 0);Ve(this,Od,void 0);Ve(this,Fa,void 0);this.config=t,Ne(this,ai,[]),Ne(this,Od,0)}build(t,n,r){const i=new Z3({mutationCache:this,mutationId:++um(this,Od)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,ai).push(t),this.notify({type:"added",mutation:t})}remove(t){Ne(this,ai,Z(this,ai).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Fn.batch(()=>{Z(this,ai).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,ai)}find(t){const n={exact:!0,...t};return Z(this,ai).find(r=>Zw(n,r))}findAll(t={}){return Z(this,ai).filter(n=>Zw(t,n))}notify(t){Fn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ne(this,Fa,(Z(this,Fa)??Promise.resolve()).then(()=>{const t=Z(this,ai).filter(n=>n.state.isPaused);return Fn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Qr)),Promise.resolve()))}).then(()=>{Ne(this,Fa,void 0)})),Z(this,Fa)}},ai=new WeakMap,Od=new WeakMap,Fa=new WeakMap,tA);function t4(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,_,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};u(k);const A=await f(k),{maxPages:L}=t.options,F=O?W3:H3;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,P,L)}};let p;if(o&&s.length){const C=o==="backward",P=C?n4:o_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=o_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function o_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function n4(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var s_=(nA=class{constructor(e={}){Ve(this,Mn,void 0);Ve(this,Es,void 0);Ve(this,Os,void 0);Ve(this,fc,void 0);Ve(this,hc,void 0);Ve(this,Ps,void 0);Ve(this,pc,void 0);Ve(this,gc,void 0);Ne(this,Mn,e.queryCache||new Q3),Ne(this,Es,e.mutationCache||new e4),Ne(this,Os,e.defaultOptions||{}),Ne(this,fc,new Map),Ne(this,hc,new Map),Ne(this,Ps,0)}mount(){um(this,Ps)._++,Z(this,Ps)===1&&(Ne(this,pc,mf.subscribe(()=>{mf.isFocused()&&(this.resumePausedMutations(),Z(this,Mn).onFocus())})),Ne(this,gc,vf.subscribe(()=>{vf.isOnline()&&(this.resumePausedMutations(),Z(this,Mn).onOnline())})))}unmount(){var e,t;um(this,Ps)._--,Z(this,Ps)===0&&((e=Z(this,pc))==null||e.call(this),Ne(this,pc,void 0),(t=Z(this,gc))==null||t.call(this),Ne(this,gc,void 0))}isFetching(e){return Z(this,Mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,Mn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=Z(this,Mn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=B3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,Mn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Fn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=Z(this,Mn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,Mn);Fn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Mn),r={type:"active",...e};return Fn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Fn.batch(()=>Z(this,Mn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Qr).catch(Qr)}invalidateQueries(e={},t={}){return Fn.batch(()=>{if(Z(this,Mn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Fn.batch(()=>Z(this,Mn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Qr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Qr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,Mn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qr).catch(Qr)}fetchInfiniteQuery(e){return e.behavior=t4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qr).catch(Qr)}resumePausedMutations(){return Z(this,Es).resumePausedMutations()}getQueryCache(){return Z(this,Mn)}getMutationCache(){return Z(this,Es)}getDefaultOptions(){return Z(this,Os)}setDefaultOptions(e){Ne(this,Os,e)}setQueryDefaults(e,t){Z(this,fc).set(Uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,fc).values()];let n={};return t.forEach(r=>{qc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,hc).set(Uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,hc).values()];let n={};return t.forEach(r=>{qc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,Os).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Os).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Mn).clear(),Z(this,Es).clear()}},Mn=new WeakMap,Es=new WeakMap,Os=new WeakMap,fc=new WeakMap,hc=new WeakMap,Ps=new WeakMap,pc=new WeakMap,gc=new WeakMap,nA),r4=(rA=class extends Wc{constructor(t,n){super();Ve(this,Ba);Ve(this,Md);Ve(this,Dd);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,_g);Ve(this,xr,void 0);Ve(this,rn,void 0);Ve(this,Pd,void 0);Ve(this,ir,void 0);Ve(this,$a,void 0);Ve(this,mc,void 0);Ve(this,ro,void 0);Ve(this,kd,void 0);Ve(this,vc,void 0);Ve(this,bc,void 0);Ve(this,ja,void 0);Ve(this,za,void 0);Ve(this,ks,void 0);Ve(this,yc,new Set);this.options=n,Ne(this,xr,t),Ne(this,ro,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,rn).addObserver(this),a_(Z(this,rn),this.options)?St(this,Ba,rf).call(this):this.updateResult(),St(this,Ad,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bm(Z(this,rn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bm(Z(this,rn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,St(this,Id,aw).call(this),St(this,Nd,lw).call(this),Z(this,rn).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,rn);if(this.options=Z(this,xr).defaultQueryOptions(t),Fm(r,this.options)||Z(this,xr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,rn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),St(this,Rd,cw).call(this);const o=this.hasListeners();o&&l_(Z(this,rn),i,this.options,r)&&St(this,Ba,rf).call(this),this.updateResult(n),o&&(Z(this,rn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&St(this,Md,rw).call(this);const s=St(this,Dd,iw).call(this);o&&(Z(this,rn)!==i||this.options.enabled!==r.enabled||s!==Z(this,ks))&&St(this,Td,ow).call(this,s)}getOptimisticResult(t){const n=Z(this,xr).getQueryCache().build(Z(this,xr),t),r=this.createResult(n,t);return o4(this,r)&&(Ne(this,ir,r),Ne(this,mc,this.options),Ne(this,$a,Z(this,rn).state)),r}getCurrentResult(){return Z(this,ir)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,yc).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,rn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,xr).defaultQueryOptions(t),r=Z(this,xr).getQueryCache().build(Z(this,xr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return St(this,Ba,rf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,ir)))}createResult(t,n){var k;const r=Z(this,rn),i=this.options,o=Z(this,ir),s=Z(this,$a),a=Z(this,mc),c=t!==r?t.state:Z(this,Pd),{state:u}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=u,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&a_(t,n),F=A&&l_(t,r,n,i);(L||F)&&(p=bf(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(o&&u.data===(s==null?void 0:s.data)&&n.select===Z(this,kd))x=Z(this,vc);else try{Ne(this,kd,n.select),x=n.select(u.data),x=jm(o==null?void 0:o.data,x,n),Ne(this,vc,x),Ne(this,ro,null)}catch(A){Ne(this,ro,A)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=Z(this,bc))==null?void 0:k.state.data,Z(this,bc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ne(this,ro,null)}catch(L){Ne(this,ro,L)}typeof A<"u"&&(v="success",x=jm(o==null?void 0:o.data,A,n),y=!0)}Z(this,ro)&&(f=Z(this,ro),x=Z(this,vc),g=Date.now(),v="error");const _=p==="fetching",S=v==="pending",C=v==="error",P=S&&_;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!S,isLoadingError:C&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&u.dataUpdatedAt!==0,isStale:Vm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,ir),r=this.createResult(Z(this,rn),this.options);if(Ne(this,$a,Z(this,rn).state),Ne(this,mc,this.options),Z(this,$a).data!==void 0&&Ne(this,bc,Z(this,rn)),Fm(r,n))return;Ne(this,ir,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,yc).size)return!0;const l=new Set(a??Z(this,yc));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,ir)).some(c=>{const u=c;return Z(this,ir)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),St(this,_g,MN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&St(this,Ad,sw).call(this)}},xr=new WeakMap,rn=new WeakMap,Pd=new WeakMap,ir=new WeakMap,$a=new WeakMap,mc=new WeakMap,ro=new WeakMap,kd=new WeakMap,vc=new WeakMap,bc=new WeakMap,ja=new WeakMap,za=new WeakMap,ks=new WeakMap,yc=new WeakMap,Ba=new WeakSet,rf=function(t){St(this,Rd,cw).call(this);let n=Z(this,rn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Qr)),n},Md=new WeakSet,rw=function(){if(St(this,Id,aw).call(this),ul||Z(this,ir).isStale||!Rm(this.options.staleTime))return;const n=Xw(Z(this,ir).dataUpdatedAt,this.options.staleTime)+1;Ne(this,ja,setTimeout(()=>{Z(this,ir).isStale||this.updateResult()},n))},Dd=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,rn)):this.options.refetchInterval)??!1},Td=new WeakSet,ow=function(t){St(this,Nd,lw).call(this),Ne(this,ks,t),!(ul||this.options.enabled===!1||!Rm(Z(this,ks))||Z(this,ks)===0)&&Ne(this,za,setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&St(this,Ba,rf).call(this)},Z(this,ks)))},Ad=new WeakSet,sw=function(){St(this,Md,rw).call(this),St(this,Td,ow).call(this,St(this,Dd,iw).call(this))},Id=new WeakSet,aw=function(){Z(this,ja)&&(clearTimeout(Z(this,ja)),Ne(this,ja,void 0))},Nd=new WeakSet,lw=function(){Z(this,za)&&(clearInterval(Z(this,za)),Ne(this,za,void 0))},Rd=new WeakSet,cw=function(){const t=Z(this,xr).getQueryCache().build(Z(this,xr),this.options);if(t===Z(this,rn))return;const n=Z(this,rn);Ne(this,rn,t),Ne(this,Pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_g=new WeakSet,MN=function(t){Fn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,ir))}),Z(this,xr).getQueryCache().notify({query:Z(this,rn),type:"observerResultsUpdated"})})},rA);function i4(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function a_(e,t){return i4(e,t)||e.state.dataUpdatedAt>0&&Bm(e,t,t.refetchOnMount)}function Bm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vm(e,t)}return!1}function l_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Vm(e,n)}function Vm(e,t){return e.isStaleByTime(t.staleTime)}function o4(e,t){return!Fm(e.getCurrentResult(),t)}var c_=ue.createContext(void 0),s4=e=>{const t=ue.useContext(c_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},a4=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(c_.Provider,{value:e},t)),u_=ue.createContext(!1),l4=()=>ue.useContext(u_);u_.Provider;function c4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var u4=ue.createContext(c4()),d4=()=>ue.useContext(u4);function f4(e,t){return typeof e=="function"?e(...t):!!e}var h4=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},p4=e=>{ue.useEffect(()=>{e.clearReset()},[e])},g4=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&f4(n,[e.error,r]),m4=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},v4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,b4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function y4(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=s4(n),i=l4(),o=d4(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",m4(s),h4(s,o),p4(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const u=i?()=>{}:a.subscribe(Fn.batchCalls(c));return a.updateResult(),u},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),v4(s,l))throw b4(s,a,o);if(g4({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function vi(e,t){return y4(e,r4,t)}let yf;const x4=new Uint8Array(16);function w4(){if(!yf&&(yf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yf(x4)}const $n=[];for(let e=0;e<256;++e)$n.push((e+256).toString(16).slice(1));function _4(e,t=0){return $n[e[t+0]]+$n[e[t+1]]+$n[e[t+2]]+$n[e[t+3]]+"-"+$n[e[t+4]]+$n[e[t+5]]+"-"+$n[e[t+6]]+$n[e[t+7]]+"-"+$n[e[t+8]]+$n[e[t+9]]+"-"+$n[e[t+10]]+$n[e[t+11]]+$n[e[t+12]]+$n[e[t+13]]+$n[e[t+14]]+$n[e[t+15]]}const d_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qo(e,t,n){if(d_.randomUUID&&!t&&!e)return d_.randomUUID();e=e||{};const r=e.random||(e.rng||w4)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return _4(r)}const ve=Tw()(Hw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:qo(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:qo(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),S4=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Uw("EditorStore",ve);const C4={id:"",authToken:void 0},f_=m.createContext(C4),h_=({children:e,dashboardProps:t})=>w.jsx(f_.Provider,{value:t,children:e});function lo(){const e=m.useContext(f_);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function p_(e,t){var we;let n=m.useMemo(()=>[],[]);const r=lo().authToken||e,i=ve(U=>U.selectedConnectionId),o=ve(U=>U.selectedDatabaseName),s=ve(U=>U.selectedSchemaName),a=ve(U=>U.selectedTableName),l=ve(U=>U.actions.setCurrentColumns),c=ve(U=>U.actions.setSelectedConnectionId),u=ve(U=>U.actions.setSelectedDatabaseName),f=ve(U=>U.actions.setSelectedSchemaName),g=ve(U=>U.actions.setSelectedTableName),p=ve(U=>U.actions.setCardSql),{data:v,isLoading:y,isError:x}=vi({queryKey:[t||"connections"],queryFn:()=>al("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),_=v==null?void 0:v.connections.find(U=>U.id===i),S=(_==null?void 0:_.type)==="API"||(_==null?void 0:_.type)==="S3",{data:C,isLoading:P,isFetching:O,isError:k,refetch:A}=vi({queryKey:[i],queryFn:()=>al("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&!S}),{data:L,isLoading:F,isFetching:j,isError:z,refetch:V}=vi({queryKey:[i,o],queryFn:()=>al("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&!S}),{data:oe,isLoading:ee,isFetching:$,isError:J,refetch:q}=vi({queryKey:[i,o,s],queryFn:()=>al("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&!S}),{data:K,isLoading:G,isFetching:D,isError:H}=vi({queryKey:[i,o,s,a],queryFn:()=>al("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a||S});m.useEffect(()=>{l(n)},[K,l,n]),m.useEffect(()=>{var U;S&&(u("NA"),f("NA"),g((U=_==null?void 0:_.type)==null?void 0:U.toLowerCase()))},[S,p,g,f,u,_]);const ne=S?(we=_==null?void 0:_.type)==null?void 0:we.toLowerCase():a||"",N=S?"":s||"";function le(U){f(U),g("")}function me(U){u(U),f(""),g("")}function he(U){c(U)}C&&C.databases.length>0,L&&L.schemas.length>0,K&&K.columns.length>0&&(n=K.columns.map(U=>({...U,data_type:U.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const de=v==null?void 0:v.connections.map(U=>({id:U.id,name:U.name,type:U.type})),re=C==null?void 0:C.databases.map(U=>({id:U.database_name,name:U.database_name})),Q=L==null?void 0:L.schemas.map(U=>({id:U.schema_name,name:U.schema_name})),ie=oe==null?void 0:oe.tables.map(U=>({id:U.table_name,name:U.table_name}));return{connectionItems:de,isConnectionsLoading:y,isConnectionsError:x,databaseItems:re,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Q,isSchemaLoadingOrFetching:F||j,isSchemaError:z,tableItems:ie,isTableLoadingOrFetching:ee||$,isTableError:J,columns:n,isColumnsLoadingOrFetching:G||D,isColumnsError:H,isAPIConnection:S,tableName:ne,schemaName:N,handleConnectionChange:he,handleDatabaseChange:me,handleSchemaChange:le}}const E4=e=>{const t=new Date(e);return!isNaN(t.getTime())},O4=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xf=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?E4(e)?t="date":O4(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function P4({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:xf(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
63
63
  * Released under MIT license <https://lodash.com/license>
64
64
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
65
65
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
66
- */wf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,_=2,S=4,C=8,P=16,O=32,k=64,A=128,L=256,F=512,j=30,z="...",V=800,oe=16,ee=1,$=2,J=3,q=1/0,K=9007199254740991,G=17976931348623157e292,D=NaN,H=4294967295,ne=H-1,N=H>>>1,le=[["ary",A],["bind",x],["bindKey",_],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",L]],me="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",re="[object Boolean]",Q="[object Date]",ie="[object DOMException]",we="[object Error]",U="[object Function]",Ie="[object GeneratorFunction]",je="[object Map]",We="[object Number]",Xe="[object Null]",be="[object Object]",Qe="[object Promise]",it="[object Proxy]",Dt="[object RegExp]",bt="[object Set]",En="[object String]",cn="[object Symbol]",Do="[object Undefined]",fe="[object WeakMap]",Ee="[object WeakSet]",Re="[object ArrayBuffer]",qe="[object DataView]",Ze="[object Float32Array]",Nt="[object Float64Array]",Bt="[object Int8Array]",gn="[object Int16Array]",or="[object Int32Array]",Vn="[object Uint8Array]",mn="[object Uint8ClampedArray]",wr="[object Uint16Array]",Hn="[object Uint32Array]",Ld=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,Va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Zn=/&(?:amp|lt|gt|quot|#39);/g,io=/[&<>"']/g,Ao=RegExp(Zn.source),Ha=RegExp(io.source),Fd=/<%-([\s\S]+?)%>/g,Wa=/<%([\s\S]+?)%>/g,xc=/<%=([\s\S]+?)%>/g,Ua=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qa=/^\w*$/,$d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ga=/[\\^$.*+?()[\]{}|]/g,Ya=RegExp(Ga.source),Ka=/^\s+/,jd=/\s/,zd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bd=/\{\n\/\* \[wrapped with (.+)\] \*/,M=/,? & /,Y=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,Ce=/\\(\\)?/g,Fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,Mt=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,lt=/^(?:0|[1-9]\d*)$/,Wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Rn=/($^)/,Xa=/['\n\r\u2028\u2029\\]/g,sn="\\ud800-\\udfff",aoe="\\u0300-\\u036f",loe="\\ufe20-\\ufe2f",coe="\\u20d0-\\u20ff",iA=aoe+loe+coe,oA="\\u2700-\\u27bf",sA="a-z\\xdf-\\xf6\\xf8-\\xff",uoe="\\xac\\xb1\\xd7\\xf7",doe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",foe="\\u2000-\\u206f",hoe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aA="A-Z\\xc0-\\xd6\\xd8-\\xde",lA="\\ufe0e\\ufe0f",cA=uoe+doe+foe+hoe,qx="['’]",poe="["+sn+"]",uA="["+cA+"]",Cg="["+iA+"]",dA="\\d+",goe="["+oA+"]",fA="["+sA+"]",hA="[^"+sn+cA+dA+oA+sA+aA+"]",Gx="\\ud83c[\\udffb-\\udfff]",moe="(?:"+Cg+"|"+Gx+")",pA="[^"+sn+"]",Yx="(?:\\ud83c[\\udde6-\\uddff]){2}",Kx="[\\ud800-\\udbff][\\udc00-\\udfff]",wc="["+aA+"]",gA="\\u200d",mA="(?:"+fA+"|"+hA+")",voe="(?:"+wc+"|"+hA+")",vA="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",bA="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",yA=moe+"?",xA="["+lA+"]?",boe="(?:"+gA+"(?:"+[pA,Yx,Kx].join("|")+")"+xA+yA+")*",yoe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xoe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wA=xA+yA+boe,woe="(?:"+[goe,Yx,Kx].join("|")+")"+wA,_oe="(?:"+[pA+Cg+"?",Cg,Yx,Kx,poe].join("|")+")",Soe=RegExp(qx,"g"),Coe=RegExp(Cg,"g"),Xx=RegExp(Gx+"(?="+Gx+")|"+_oe+wA,"g"),Eoe=RegExp([wc+"?"+fA+"+"+vA+"(?="+[uA,wc,"$"].join("|")+")",voe+"+"+bA+"(?="+[uA,wc+mA,"$"].join("|")+")",wc+"?"+mA+"+"+vA,wc+"+"+bA,xoe,yoe,dA,woe].join("|"),"g"),Ooe=RegExp("["+gA+sn+iA+lA+"]"),Poe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,koe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Moe=-1,rn={};rn[Ze]=rn[Nt]=rn[Bt]=rn[gn]=rn[or]=rn[Vn]=rn[mn]=rn[wr]=rn[Hn]=!0,rn[me]=rn[he]=rn[Re]=rn[re]=rn[qe]=rn[Q]=rn[we]=rn[U]=rn[je]=rn[We]=rn[be]=rn[Dt]=rn[bt]=rn[En]=rn[fe]=!1;var Kt={};Kt[me]=Kt[he]=Kt[Re]=Kt[qe]=Kt[re]=Kt[Q]=Kt[Ze]=Kt[Nt]=Kt[Bt]=Kt[gn]=Kt[or]=Kt[je]=Kt[We]=Kt[be]=Kt[Dt]=Kt[bt]=Kt[En]=Kt[cn]=Kt[Vn]=Kt[mn]=Kt[wr]=Kt[Hn]=!0,Kt[we]=Kt[U]=Kt[fe]=!1;var Doe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Toe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Aoe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ioe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Noe=parseFloat,Roe=parseInt,_A=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,Loe=typeof self=="object"&&self&&self.Object===Object&&self,Wn=_A||Loe||Function("return this")(),Qx=t&&!t.nodeType&&t,Qa=Qx&&!0&&e&&!e.nodeType&&e,SA=Qa&&Qa.exports===Qx,Zx=SA&&_A.process,li=function(){try{var X=Qa&&Qa.require&&Qa.require("util").types;return X||Zx&&Zx.binding&&Zx.binding("util")}catch{}}(),CA=li&&li.isArrayBuffer,EA=li&&li.isDate,OA=li&&li.isMap,PA=li&&li.isRegExp,kA=li&&li.isSet,MA=li&&li.isTypedArray;function Ur(X,ge,ce){switch(ce.length){case 0:return X.call(ge);case 1:return X.call(ge,ce[0]);case 2:return X.call(ge,ce[0],ce[1]);case 3:return X.call(ge,ce[0],ce[1],ce[2])}return X.apply(ge,ce)}function Foe(X,ge,ce,Le){for(var ot=-1,Rt=X==null?0:X.length;++ot<Rt;){var Dn=X[ot];ge(Le,Dn,ce(Dn),X)}return Le}function ci(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le&&ge(X[ce],ce,X)!==!1;);return X}function $oe(X,ge){for(var ce=X==null?0:X.length;ce--&&ge(X[ce],ce,X)!==!1;);return X}function DA(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le;)if(!ge(X[ce],ce,X))return!1;return!0}function Ms(X,ge){for(var ce=-1,Le=X==null?0:X.length,ot=0,Rt=[];++ce<Le;){var Dn=X[ce];ge(Dn,ce,X)&&(Rt[ot++]=Dn)}return Rt}function Eg(X,ge){var ce=X==null?0:X.length;return!!ce&&_c(X,ge,0)>-1}function Jx(X,ge,ce){for(var Le=-1,ot=X==null?0:X.length;++Le<ot;)if(ce(ge,X[Le]))return!0;return!1}function an(X,ge){for(var ce=-1,Le=X==null?0:X.length,ot=Array(Le);++ce<Le;)ot[ce]=ge(X[ce],ce,X);return ot}function Ds(X,ge){for(var ce=-1,Le=ge.length,ot=X.length;++ce<Le;)X[ot+ce]=ge[ce];return X}function e1(X,ge,ce,Le){var ot=-1,Rt=X==null?0:X.length;for(Le&&Rt&&(ce=X[++ot]);++ot<Rt;)ce=ge(ce,X[ot],ot,X);return ce}function joe(X,ge,ce,Le){var ot=X==null?0:X.length;for(Le&&ot&&(ce=X[--ot]);ot--;)ce=ge(ce,X[ot],ot,X);return ce}function t1(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le;)if(ge(X[ce],ce,X))return!0;return!1}var zoe=n1("length");function Boe(X){return X.split("")}function Voe(X){return X.match(Y)||[]}function TA(X,ge,ce){var Le;return ce(X,function(ot,Rt,Dn){if(ge(ot,Rt,Dn))return Le=Rt,!1}),Le}function Og(X,ge,ce,Le){for(var ot=X.length,Rt=ce+(Le?1:-1);Le?Rt--:++Rt<ot;)if(ge(X[Rt],Rt,X))return Rt;return-1}function _c(X,ge,ce){return ge===ge?ese(X,ge,ce):Og(X,AA,ce)}function Hoe(X,ge,ce,Le){for(var ot=ce-1,Rt=X.length;++ot<Rt;)if(Le(X[ot],ge))return ot;return-1}function AA(X){return X!==X}function IA(X,ge){var ce=X==null?0:X.length;return ce?i1(X,ge)/ce:D}function n1(X){return function(ge){return ge==null?n:ge[X]}}function r1(X){return function(ge){return X==null?n:X[ge]}}function NA(X,ge,ce,Le,ot){return ot(X,function(Rt,Dn,Ut){ce=Le?(Le=!1,Rt):ge(ce,Rt,Dn,Ut)}),ce}function Woe(X,ge){var ce=X.length;for(X.sort(ge);ce--;)X[ce]=X[ce].value;return X}function i1(X,ge){for(var ce,Le=-1,ot=X.length;++Le<ot;){var Rt=ge(X[Le]);Rt!==n&&(ce=ce===n?Rt:ce+Rt)}return ce}function o1(X,ge){for(var ce=-1,Le=Array(X);++ce<X;)Le[ce]=ge(ce);return Le}function Uoe(X,ge){return an(ge,function(ce){return[ce,X[ce]]})}function RA(X){return X&&X.slice(0,jA(X)+1).replace(Ka,"")}function qr(X){return function(ge){return X(ge)}}function s1(X,ge){return an(ge,function(ce){return X[ce]})}function Vd(X,ge){return X.has(ge)}function LA(X,ge){for(var ce=-1,Le=X.length;++ce<Le&&_c(ge,X[ce],0)>-1;);return ce}function FA(X,ge){for(var ce=X.length;ce--&&_c(ge,X[ce],0)>-1;);return ce}function qoe(X,ge){for(var ce=X.length,Le=0;ce--;)X[ce]===ge&&++Le;return Le}var Goe=r1(Doe),Yoe=r1(Toe);function Koe(X){return"\\"+Ioe[X]}function Xoe(X,ge){return X==null?n:X[ge]}function Sc(X){return Ooe.test(X)}function Qoe(X){return Poe.test(X)}function Zoe(X){for(var ge,ce=[];!(ge=X.next()).done;)ce.push(ge.value);return ce}function a1(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le,ot){ce[++ge]=[ot,Le]}),ce}function $A(X,ge){return function(ce){return X(ge(ce))}}function Ts(X,ge){for(var ce=-1,Le=X.length,ot=0,Rt=[];++ce<Le;){var Dn=X[ce];(Dn===ge||Dn===u)&&(X[ce]=u,Rt[ot++]=ce)}return Rt}function Pg(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le){ce[++ge]=Le}),ce}function Joe(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le){ce[++ge]=[Le,Le]}),ce}function ese(X,ge,ce){for(var Le=ce-1,ot=X.length;++Le<ot;)if(X[Le]===ge)return Le;return-1}function tse(X,ge,ce){for(var Le=ce+1;Le--;)if(X[Le]===ge)return Le;return Le}function Cc(X){return Sc(X)?rse(X):zoe(X)}function Di(X){return Sc(X)?ise(X):Boe(X)}function jA(X){for(var ge=X.length;ge--&&jd.test(X.charAt(ge)););return ge}var nse=r1(Aoe);function rse(X){for(var ge=Xx.lastIndex=0;Xx.test(X);)++ge;return ge}function ise(X){return X.match(Xx)||[]}function ose(X){return X.match(Eoe)||[]}var sse=function X(ge){ge=ge==null?Wn:Ec.defaults(Wn.Object(),ge,Ec.pick(Wn,koe));var ce=ge.Array,Le=ge.Date,ot=ge.Error,Rt=ge.Function,Dn=ge.Math,Ut=ge.Object,l1=ge.RegExp,ase=ge.String,ui=ge.TypeError,kg=ce.prototype,lse=Rt.prototype,Oc=Ut.prototype,Mg=ge["__core-js_shared__"],Dg=lse.toString,Vt=Oc.hasOwnProperty,cse=0,zA=function(){var d=/[^.]+$/.exec(Mg&&Mg.keys&&Mg.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),Tg=Oc.toString,use=Dg.call(Ut),dse=Wn._,fse=l1("^"+Dg.call(Vt).replace(Ga,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ag=SA?ge.Buffer:n,As=ge.Symbol,Ig=ge.Uint8Array,BA=Ag?Ag.allocUnsafe:n,Ng=$A(Ut.getPrototypeOf,Ut),VA=Ut.create,HA=Oc.propertyIsEnumerable,Rg=kg.splice,WA=As?As.isConcatSpreadable:n,Hd=As?As.iterator:n,Za=As?As.toStringTag:n,Lg=function(){try{var d=rl(Ut,"defineProperty");return d({},"",{}),d}catch{}}(),hse=ge.clearTimeout!==Wn.clearTimeout&&ge.clearTimeout,pse=Le&&Le.now!==Wn.Date.now&&Le.now,gse=ge.setTimeout!==Wn.setTimeout&&ge.setTimeout,Fg=Dn.ceil,$g=Dn.floor,c1=Ut.getOwnPropertySymbols,mse=Ag?Ag.isBuffer:n,UA=ge.isFinite,vse=kg.join,bse=$A(Ut.keys,Ut),Tn=Dn.max,Jn=Dn.min,yse=Le.now,xse=ge.parseInt,qA=Dn.random,wse=kg.reverse,u1=rl(ge,"DataView"),Wd=rl(ge,"Map"),d1=rl(ge,"Promise"),Pc=rl(ge,"Set"),Ud=rl(ge,"WeakMap"),qd=rl(Ut,"create"),jg=Ud&&new Ud,kc={},_se=il(u1),Sse=il(Wd),Cse=il(d1),Ese=il(Pc),Ose=il(Ud),zg=As?As.prototype:n,Gd=zg?zg.valueOf:n,GA=zg?zg.toString:n;function I(d){if(hn(d)&&!ct(d)&&!(d instanceof Ot)){if(d instanceof di)return d;if(Vt.call(d,"__wrapped__"))return YI(d)}return new di(d)}var Mc=function(){function d(){}return function(h){if(!un(h))return{};if(VA)return VA(h);d.prototype=h;var b=new d;return d.prototype=n,b}}();function Bg(){}function di(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:Fd,evaluate:Wa,interpolate:xc,variable:"",imports:{_:I}},I.prototype=Bg.prototype,I.prototype.constructor=I,di.prototype=Mc(Bg.prototype),di.prototype.constructor=di;function Ot(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Pse(){var d=new Ot(this.__wrapped__);return d.__actions__=_r(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=_r(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=_r(this.__views__),d}function kse(){if(this.__filtered__){var d=new Ot(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function Mse(){var d=this.__wrapped__.value(),h=this.__dir__,b=ct(d),E=h<0,T=b?d.length:0,R=Bae(0,T,this.__views__),B=R.start,W=R.end,te=W-B,ye=E?W:B-1,xe=this.__iteratees__,Se=xe.length,Te=0,ze=Jn(te,this.__takeCount__);if(!b||!E&&T==te&&ze==te)return vI(d,this.__actions__);var Ge=[];e:for(;te--&&Te<ze;){ye+=h;for(var vt=-1,Ye=d[ye];++vt<Se;){var Et=xe[vt],Pt=Et.iteratee,Kr=Et.type,lr=Pt(Ye);if(Kr==$)Ye=lr;else if(!lr){if(Kr==ee)continue e;break e}}Ge[Te++]=Ye}return Ge}Ot.prototype=Mc(Bg.prototype),Ot.prototype.constructor=Ot;function Ja(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function Dse(){this.__data__=qd?qd(null):{},this.size=0}function Tse(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function Ase(d){var h=this.__data__;if(qd){var b=h[d];return b===l?n:b}return Vt.call(h,d)?h[d]:n}function Ise(d){var h=this.__data__;return qd?h[d]!==n:Vt.call(h,d)}function Nse(d,h){var b=this.__data__;return this.size+=this.has(d)?0:1,b[d]=qd&&h===n?l:h,this}Ja.prototype.clear=Dse,Ja.prototype.delete=Tse,Ja.prototype.get=Ase,Ja.prototype.has=Ise,Ja.prototype.set=Nse;function Io(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function Rse(){this.__data__=[],this.size=0}function Lse(d){var h=this.__data__,b=Vg(h,d);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():Rg.call(h,b,1),--this.size,!0}function Fse(d){var h=this.__data__,b=Vg(h,d);return b<0?n:h[b][1]}function $se(d){return Vg(this.__data__,d)>-1}function jse(d,h){var b=this.__data__,E=Vg(b,d);return E<0?(++this.size,b.push([d,h])):b[E][1]=h,this}Io.prototype.clear=Rse,Io.prototype.delete=Lse,Io.prototype.get=Fse,Io.prototype.has=$se,Io.prototype.set=jse;function No(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function zse(){this.size=0,this.__data__={hash:new Ja,map:new(Wd||Io),string:new Ja}}function Bse(d){var h=em(this,d).delete(d);return this.size-=h?1:0,h}function Vse(d){return em(this,d).get(d)}function Hse(d){return em(this,d).has(d)}function Wse(d,h){var b=em(this,d),E=b.size;return b.set(d,h),this.size+=b.size==E?0:1,this}No.prototype.clear=zse,No.prototype.delete=Bse,No.prototype.get=Vse,No.prototype.has=Hse,No.prototype.set=Wse;function el(d){var h=-1,b=d==null?0:d.length;for(this.__data__=new No;++h<b;)this.add(d[h])}function Use(d){return this.__data__.set(d,l),this}function qse(d){return this.__data__.has(d)}el.prototype.add=el.prototype.push=Use,el.prototype.has=qse;function Ti(d){var h=this.__data__=new Io(d);this.size=h.size}function Gse(){this.__data__=new Io,this.size=0}function Yse(d){var h=this.__data__,b=h.delete(d);return this.size=h.size,b}function Kse(d){return this.__data__.get(d)}function Xse(d){return this.__data__.has(d)}function Qse(d,h){var b=this.__data__;if(b instanceof Io){var E=b.__data__;if(!Wd||E.length<i-1)return E.push([d,h]),this.size=++b.size,this;b=this.__data__=new No(E)}return b.set(d,h),this.size=b.size,this}Ti.prototype.clear=Gse,Ti.prototype.delete=Yse,Ti.prototype.get=Kse,Ti.prototype.has=Xse,Ti.prototype.set=Qse;function YA(d,h){var b=ct(d),E=!b&&ol(d),T=!b&&!E&&Fs(d),R=!b&&!E&&!T&&Ic(d),B=b||E||T||R,W=B?o1(d.length,ase):[],te=W.length;for(var ye in d)(h||Vt.call(d,ye))&&!(B&&(ye=="length"||T&&(ye=="offset"||ye=="parent")||R&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||$o(ye,te)))&&W.push(ye);return W}function KA(d){var h=d.length;return h?d[_1(0,h-1)]:n}function Zse(d,h){return tm(_r(d),tl(h,0,d.length))}function Jse(d){return tm(_r(d))}function f1(d,h,b){(b!==n&&!Ai(d[h],b)||b===n&&!(h in d))&&Ro(d,h,b)}function Yd(d,h,b){var E=d[h];(!(Vt.call(d,h)&&Ai(E,b))||b===n&&!(h in d))&&Ro(d,h,b)}function Vg(d,h){for(var b=d.length;b--;)if(Ai(d[b][0],h))return b;return-1}function eae(d,h,b,E){return Is(d,function(T,R,B){h(E,T,b(T),B)}),E}function XA(d,h){return d&&so(h,Ln(h),d)}function tae(d,h){return d&&so(h,Cr(h),d)}function Ro(d,h,b){h=="__proto__"&&Lg?Lg(d,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):d[h]=b}function h1(d,h){for(var b=-1,E=h.length,T=ce(E),R=d==null;++b<E;)T[b]=R?n:G1(d,h[b]);return T}function tl(d,h,b){return d===d&&(b!==n&&(d=d<=b?d:b),h!==n&&(d=d>=h?d:h)),d}function fi(d,h,b,E,T,R){var B,W=h&f,te=h&g,ye=h&p;if(b&&(B=T?b(d,E,T,R):b(d)),B!==n)return B;if(!un(d))return d;var xe=ct(d);if(xe){if(B=Hae(d),!W)return _r(d,B)}else{var Se=er(d),Te=Se==U||Se==Ie;if(Fs(d))return xI(d,W);if(Se==be||Se==me||Te&&!T){if(B=te||Te?{}:jI(d),!W)return te?Aae(d,tae(B,d)):Tae(d,XA(B,d))}else{if(!Kt[Se])return T?d:{};B=Wae(d,Se,W)}}R||(R=new Ti);var ze=R.get(d);if(ze)return ze;R.set(d,B),pN(d)?d.forEach(function(Ye){B.add(fi(Ye,h,b,Ye,d,R))}):fN(d)&&d.forEach(function(Ye,Et){B.set(Et,fi(Ye,h,b,Et,d,R))});var Ge=ye?te?I1:A1:te?Cr:Ln,vt=xe?n:Ge(d);return ci(vt||d,function(Ye,Et){vt&&(Et=Ye,Ye=d[Et]),Yd(B,Et,fi(Ye,h,b,Et,d,R))}),B}function nae(d){var h=Ln(d);return function(b){return QA(b,d,h)}}function QA(d,h,b){var E=b.length;if(d==null)return!E;for(d=Ut(d);E--;){var T=b[E],R=h[T],B=d[T];if(B===n&&!(T in d)||!R(B))return!1}return!0}function ZA(d,h,b){if(typeof d!="function")throw new ui(s);return tf(function(){d.apply(n,b)},h)}function Kd(d,h,b,E){var T=-1,R=Eg,B=!0,W=d.length,te=[],ye=h.length;if(!W)return te;b&&(h=an(h,qr(b))),E?(R=Jx,B=!1):h.length>=i&&(R=Vd,B=!1,h=new el(h));e:for(;++T<W;){var xe=d[T],Se=b==null?xe:b(xe);if(xe=E||xe!==0?xe:0,B&&Se===Se){for(var Te=ye;Te--;)if(h[Te]===Se)continue e;te.push(xe)}else R(h,Se,E)||te.push(xe)}return te}var Is=EI(oo),JA=EI(g1,!0);function rae(d,h){var b=!0;return Is(d,function(E,T,R){return b=!!h(E,T,R),b}),b}function Hg(d,h,b){for(var E=-1,T=d.length;++E<T;){var R=d[E],B=h(R);if(B!=null&&(W===n?B===B&&!Yr(B):b(B,W)))var W=B,te=R}return te}function iae(d,h,b,E){var T=d.length;for(b=ht(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:ht(E),E<0&&(E+=T),E=b>E?0:mN(E);b<E;)d[b++]=h;return d}function eI(d,h){var b=[];return Is(d,function(E,T,R){h(E,T,R)&&b.push(E)}),b}function Un(d,h,b,E,T){var R=-1,B=d.length;for(b||(b=qae),T||(T=[]);++R<B;){var W=d[R];h>0&&b(W)?h>1?Un(W,h-1,b,E,T):Ds(T,W):E||(T[T.length]=W)}return T}var p1=OI(),tI=OI(!0);function oo(d,h){return d&&p1(d,h,Ln)}function g1(d,h){return d&&tI(d,h,Ln)}function Wg(d,h){return Ms(h,function(b){return jo(d[b])})}function nl(d,h){h=Rs(h,d);for(var b=0,E=h.length;d!=null&&b<E;)d=d[ao(h[b++])];return b&&b==E?d:n}function nI(d,h,b){var E=h(d);return ct(d)?E:Ds(E,b(d))}function sr(d){return d==null?d===n?Do:Xe:Za&&Za in Ut(d)?zae(d):Jae(d)}function m1(d,h){return d>h}function oae(d,h){return d!=null&&Vt.call(d,h)}function sae(d,h){return d!=null&&h in Ut(d)}function aae(d,h,b){return d>=Jn(h,b)&&d<Tn(h,b)}function v1(d,h,b){for(var E=b?Jx:Eg,T=d[0].length,R=d.length,B=R,W=ce(R),te=1/0,ye=[];B--;){var xe=d[B];B&&h&&(xe=an(xe,qr(h))),te=Jn(xe.length,te),W[B]=!b&&(h||T>=120&&xe.length>=120)?new el(B&&xe):n}xe=d[0];var Se=-1,Te=W[0];e:for(;++Se<T&&ye.length<te;){var ze=xe[Se],Ge=h?h(ze):ze;if(ze=b||ze!==0?ze:0,!(Te?Vd(Te,Ge):E(ye,Ge,b))){for(B=R;--B;){var vt=W[B];if(!(vt?Vd(vt,Ge):E(d[B],Ge,b)))continue e}Te&&Te.push(Ge),ye.push(ze)}}return ye}function lae(d,h,b,E){return oo(d,function(T,R,B){h(E,b(T),R,B)}),E}function Xd(d,h,b){h=Rs(h,d),d=HI(d,h);var E=d==null?d:d[ao(pi(h))];return E==null?n:Ur(E,d,b)}function rI(d){return hn(d)&&sr(d)==me}function cae(d){return hn(d)&&sr(d)==Re}function uae(d){return hn(d)&&sr(d)==Q}function Qd(d,h,b,E,T){return d===h?!0:d==null||h==null||!hn(d)&&!hn(h)?d!==d&&h!==h:dae(d,h,b,E,Qd,T)}function dae(d,h,b,E,T,R){var B=ct(d),W=ct(h),te=B?he:er(d),ye=W?he:er(h);te=te==me?be:te,ye=ye==me?be:ye;var xe=te==be,Se=ye==be,Te=te==ye;if(Te&&Fs(d)){if(!Fs(h))return!1;B=!0,xe=!1}if(Te&&!xe)return R||(R=new Ti),B||Ic(d)?LI(d,h,b,E,T,R):$ae(d,h,te,b,E,T,R);if(!(b&v)){var ze=xe&&Vt.call(d,"__wrapped__"),Ge=Se&&Vt.call(h,"__wrapped__");if(ze||Ge){var vt=ze?d.value():d,Ye=Ge?h.value():h;return R||(R=new Ti),T(vt,Ye,b,E,R)}}return Te?(R||(R=new Ti),jae(d,h,b,E,T,R)):!1}function fae(d){return hn(d)&&er(d)==je}function b1(d,h,b,E){var T=b.length,R=T,B=!E;if(d==null)return!R;for(d=Ut(d);T--;){var W=b[T];if(B&&W[2]?W[1]!==d[W[0]]:!(W[0]in d))return!1}for(;++T<R;){W=b[T];var te=W[0],ye=d[te],xe=W[1];if(B&&W[2]){if(ye===n&&!(te in d))return!1}else{var Se=new Ti;if(E)var Te=E(ye,xe,te,d,h,Se);if(!(Te===n?Qd(xe,ye,v|y,E,Se):Te))return!1}}return!0}function iI(d){if(!un(d)||Yae(d))return!1;var h=jo(d)?fse:Mt;return h.test(il(d))}function hae(d){return hn(d)&&sr(d)==Dt}function pae(d){return hn(d)&&er(d)==bt}function gae(d){return hn(d)&&am(d.length)&&!!rn[sr(d)]}function oI(d){return typeof d=="function"?d:d==null?Er:typeof d=="object"?ct(d)?lI(d[0],d[1]):aI(d):PN(d)}function y1(d){if(!ef(d))return bse(d);var h=[];for(var b in Ut(d))Vt.call(d,b)&&b!="constructor"&&h.push(b);return h}function mae(d){if(!un(d))return Zae(d);var h=ef(d),b=[];for(var E in d)E=="constructor"&&(h||!Vt.call(d,E))||b.push(E);return b}function x1(d,h){return d<h}function sI(d,h){var b=-1,E=Sr(d)?ce(d.length):[];return Is(d,function(T,R,B){E[++b]=h(T,R,B)}),E}function aI(d){var h=R1(d);return h.length==1&&h[0][2]?BI(h[0][0],h[0][1]):function(b){return b===d||b1(b,d,h)}}function lI(d,h){return F1(d)&&zI(h)?BI(ao(d),h):function(b){var E=G1(b,d);return E===n&&E===h?Y1(b,d):Qd(h,E,v|y)}}function Ug(d,h,b,E,T){d!==h&&p1(h,function(R,B){if(T||(T=new Ti),un(R))vae(d,h,B,b,Ug,E,T);else{var W=E?E(j1(d,B),R,B+"",d,h,T):n;W===n&&(W=R),f1(d,B,W)}},Cr)}function vae(d,h,b,E,T,R,B){var W=j1(d,b),te=j1(h,b),ye=B.get(te);if(ye){f1(d,b,ye);return}var xe=R?R(W,te,b+"",d,h,B):n,Se=xe===n;if(Se){var Te=ct(te),ze=!Te&&Fs(te),Ge=!Te&&!ze&&Ic(te);xe=te,Te||ze||Ge?ct(W)?xe=W:vn(W)?xe=_r(W):ze?(Se=!1,xe=xI(te,!0)):Ge?(Se=!1,xe=wI(te,!0)):xe=[]:nf(te)||ol(te)?(xe=W,ol(W)?xe=vN(W):(!un(W)||jo(W))&&(xe=jI(te))):Se=!1}Se&&(B.set(te,xe),T(xe,te,E,R,B),B.delete(te)),f1(d,b,xe)}function cI(d,h){var b=d.length;if(b)return h+=h<0?b:0,$o(h,b)?d[h]:n}function uI(d,h,b){h.length?h=an(h,function(R){return ct(R)?function(B){return nl(B,R.length===1?R[0]:R)}:R}):h=[Er];var E=-1;h=an(h,qr(Ue()));var T=sI(d,function(R,B,W){var te=an(h,function(ye){return ye(R)});return{criteria:te,index:++E,value:R}});return Woe(T,function(R,B){return Dae(R,B,b)})}function bae(d,h){return dI(d,h,function(b,E){return Y1(d,E)})}function dI(d,h,b){for(var E=-1,T=h.length,R={};++E<T;){var B=h[E],W=nl(d,B);b(W,B)&&Zd(R,Rs(B,d),W)}return R}function yae(d){return function(h){return nl(h,d)}}function w1(d,h,b,E){var T=E?Hoe:_c,R=-1,B=h.length,W=d;for(d===h&&(h=_r(h)),b&&(W=an(d,qr(b)));++R<B;)for(var te=0,ye=h[R],xe=b?b(ye):ye;(te=T(W,xe,te,E))>-1;)W!==d&&Rg.call(W,te,1),Rg.call(d,te,1);return d}function fI(d,h){for(var b=d?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==R){var R=T;$o(T)?Rg.call(d,T,1):E1(d,T)}}return d}function _1(d,h){return d+$g(qA()*(h-d+1))}function xae(d,h,b,E){for(var T=-1,R=Tn(Fg((h-d)/(b||1)),0),B=ce(R);R--;)B[E?R:++T]=d,d+=b;return B}function S1(d,h){var b="";if(!d||h<1||h>K)return b;do h%2&&(b+=d),h=$g(h/2),h&&(d+=d);while(h);return b}function yt(d,h){return z1(VI(d,h,Er),d+"")}function wae(d){return KA(Nc(d))}function _ae(d,h){var b=Nc(d);return tm(b,tl(h,0,b.length))}function Zd(d,h,b,E){if(!un(d))return d;h=Rs(h,d);for(var T=-1,R=h.length,B=R-1,W=d;W!=null&&++T<R;){var te=ao(h[T]),ye=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return d;if(T!=B){var xe=W[te];ye=E?E(xe,te,W):n,ye===n&&(ye=un(xe)?xe:$o(h[T+1])?[]:{})}Yd(W,te,ye),W=W[te]}return d}var hI=jg?function(d,h){return jg.set(d,h),d}:Er,Sae=Lg?function(d,h){return Lg(d,"toString",{configurable:!0,enumerable:!1,value:X1(h),writable:!0})}:Er;function Cae(d){return tm(Nc(d))}function hi(d,h,b){var E=-1,T=d.length;h<0&&(h=-h>T?0:T+h),b=b>T?T:b,b<0&&(b+=T),T=h>b?0:b-h>>>0,h>>>=0;for(var R=ce(T);++E<T;)R[E]=d[E+h];return R}function Eae(d,h){var b;return Is(d,function(E,T,R){return b=h(E,T,R),!b}),!!b}function qg(d,h,b){var E=0,T=d==null?E:d.length;if(typeof h=="number"&&h===h&&T<=N){for(;E<T;){var R=E+T>>>1,B=d[R];B!==null&&!Yr(B)&&(b?B<=h:B<h)?E=R+1:T=R}return T}return C1(d,h,Er,b)}function C1(d,h,b,E){var T=0,R=d==null?0:d.length;if(R===0)return 0;h=b(h);for(var B=h!==h,W=h===null,te=Yr(h),ye=h===n;T<R;){var xe=$g((T+R)/2),Se=b(d[xe]),Te=Se!==n,ze=Se===null,Ge=Se===Se,vt=Yr(Se);if(B)var Ye=E||Ge;else ye?Ye=Ge&&(E||Te):W?Ye=Ge&&Te&&(E||!ze):te?Ye=Ge&&Te&&!ze&&(E||!vt):ze||vt?Ye=!1:Ye=E?Se<=h:Se<h;Ye?T=xe+1:R=xe}return Jn(R,ne)}function pI(d,h){for(var b=-1,E=d.length,T=0,R=[];++b<E;){var B=d[b],W=h?h(B):B;if(!b||!Ai(W,te)){var te=W;R[T++]=B===0?0:B}}return R}function gI(d){return typeof d=="number"?d:Yr(d)?D:+d}function Gr(d){if(typeof d=="string")return d;if(ct(d))return an(d,Gr)+"";if(Yr(d))return GA?GA.call(d):"";var h=d+"";return h=="0"&&1/d==-q?"-0":h}function Ns(d,h,b){var E=-1,T=Eg,R=d.length,B=!0,W=[],te=W;if(b)B=!1,T=Jx;else if(R>=i){var ye=h?null:Lae(d);if(ye)return Pg(ye);B=!1,T=Vd,te=new el}else te=h?[]:W;e:for(;++E<R;){var xe=d[E],Se=h?h(xe):xe;if(xe=b||xe!==0?xe:0,B&&Se===Se){for(var Te=te.length;Te--;)if(te[Te]===Se)continue e;h&&te.push(Se),W.push(xe)}else T(te,Se,b)||(te!==W&&te.push(Se),W.push(xe))}return W}function E1(d,h){return h=Rs(h,d),d=HI(d,h),d==null||delete d[ao(pi(h))]}function mI(d,h,b,E){return Zd(d,h,b(nl(d,h)),E)}function Gg(d,h,b,E){for(var T=d.length,R=E?T:-1;(E?R--:++R<T)&&h(d[R],R,d););return b?hi(d,E?0:R,E?R+1:T):hi(d,E?R+1:0,E?T:R)}function vI(d,h){var b=d;return b instanceof Ot&&(b=b.value()),e1(h,function(E,T){return T.func.apply(T.thisArg,Ds([E],T.args))},b)}function O1(d,h,b){var E=d.length;if(E<2)return E?Ns(d[0]):[];for(var T=-1,R=ce(E);++T<E;)for(var B=d[T],W=-1;++W<E;)W!=T&&(R[T]=Kd(R[T]||B,d[W],h,b));return Ns(Un(R,1),h,b)}function bI(d,h,b){for(var E=-1,T=d.length,R=h.length,B={};++E<T;){var W=E<R?h[E]:n;b(B,d[E],W)}return B}function P1(d){return vn(d)?d:[]}function k1(d){return typeof d=="function"?d:Er}function Rs(d,h){return ct(d)?d:F1(d,h)?[d]:GI(jt(d))}var Oae=yt;function Ls(d,h,b){var E=d.length;return b=b===n?E:b,!h&&b>=E?d:hi(d,h,b)}var yI=hse||function(d){return Wn.clearTimeout(d)};function xI(d,h){if(h)return d.slice();var b=d.length,E=BA?BA(b):new d.constructor(b);return d.copy(E),E}function M1(d){var h=new d.constructor(d.byteLength);return new Ig(h).set(new Ig(d)),h}function Pae(d,h){var b=h?M1(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.byteLength)}function kae(d){var h=new d.constructor(d.source,Be.exec(d));return h.lastIndex=d.lastIndex,h}function Mae(d){return Gd?Ut(Gd.call(d)):{}}function wI(d,h){var b=h?M1(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.length)}function _I(d,h){if(d!==h){var b=d!==n,E=d===null,T=d===d,R=Yr(d),B=h!==n,W=h===null,te=h===h,ye=Yr(h);if(!W&&!ye&&!R&&d>h||R&&B&&te&&!W&&!ye||E&&B&&te||!b&&te||!T)return 1;if(!E&&!R&&!ye&&d<h||ye&&b&&T&&!E&&!R||W&&b&&T||!B&&T||!te)return-1}return 0}function Dae(d,h,b){for(var E=-1,T=d.criteria,R=h.criteria,B=T.length,W=b.length;++E<B;){var te=_I(T[E],R[E]);if(te){if(E>=W)return te;var ye=b[E];return te*(ye=="desc"?-1:1)}}return d.index-h.index}function SI(d,h,b,E){for(var T=-1,R=d.length,B=b.length,W=-1,te=h.length,ye=Tn(R-B,0),xe=ce(te+ye),Se=!E;++W<te;)xe[W]=h[W];for(;++T<B;)(Se||T<R)&&(xe[b[T]]=d[T]);for(;ye--;)xe[W++]=d[T++];return xe}function CI(d,h,b,E){for(var T=-1,R=d.length,B=-1,W=b.length,te=-1,ye=h.length,xe=Tn(R-W,0),Se=ce(xe+ye),Te=!E;++T<xe;)Se[T]=d[T];for(var ze=T;++te<ye;)Se[ze+te]=h[te];for(;++B<W;)(Te||T<R)&&(Se[ze+b[B]]=d[T++]);return Se}function _r(d,h){var b=-1,E=d.length;for(h||(h=ce(E));++b<E;)h[b]=d[b];return h}function so(d,h,b,E){var T=!b;b||(b={});for(var R=-1,B=h.length;++R<B;){var W=h[R],te=E?E(b[W],d[W],W,b,d):n;te===n&&(te=d[W]),T?Ro(b,W,te):Yd(b,W,te)}return b}function Tae(d,h){return so(d,L1(d),h)}function Aae(d,h){return so(d,FI(d),h)}function Yg(d,h){return function(b,E){var T=ct(b)?Foe:eae,R=h?h():{};return T(b,d,Ue(E,2),R)}}function Dc(d){return yt(function(h,b){var E=-1,T=b.length,R=T>1?b[T-1]:n,B=T>2?b[2]:n;for(R=d.length>3&&typeof R=="function"?(T--,R):n,B&&ar(b[0],b[1],B)&&(R=T<3?n:R,T=1),h=Ut(h);++E<T;){var W=b[E];W&&d(h,W,E,R)}return h})}function EI(d,h){return function(b,E){if(b==null)return b;if(!Sr(b))return d(b,E);for(var T=b.length,R=h?T:-1,B=Ut(b);(h?R--:++R<T)&&E(B[R],R,B)!==!1;);return b}}function OI(d){return function(h,b,E){for(var T=-1,R=Ut(h),B=E(h),W=B.length;W--;){var te=B[d?W:++T];if(b(R[te],te,R)===!1)break}return h}}function Iae(d,h,b){var E=h&x,T=Jd(d);function R(){var B=this&&this!==Wn&&this instanceof R?T:d;return B.apply(E?b:this,arguments)}return R}function PI(d){return function(h){h=jt(h);var b=Sc(h)?Di(h):n,E=b?b[0]:h.charAt(0),T=b?Ls(b,1).join(""):h.slice(1);return E[d]()+T}}function Tc(d){return function(h){return e1(EN(CN(h).replace(Soe,"")),d,"")}}function Jd(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=Mc(d.prototype),E=d.apply(b,h);return un(E)?E:b}}function Nae(d,h,b){var E=Jd(d);function T(){for(var R=arguments.length,B=ce(R),W=R,te=Ac(T);W--;)B[W]=arguments[W];var ye=R<3&&B[0]!==te&&B[R-1]!==te?[]:Ts(B,te);if(R-=ye.length,R<b)return AI(d,h,Kg,T.placeholder,n,B,ye,n,n,b-R);var xe=this&&this!==Wn&&this instanceof T?E:d;return Ur(xe,this,B)}return T}function kI(d){return function(h,b,E){var T=Ut(h);if(!Sr(h)){var R=Ue(b,3);h=Ln(h),b=function(W){return R(T[W],W,T)}}var B=d(h,b,E);return B>-1?T[R?h[B]:B]:n}}function MI(d){return Fo(function(h){var b=h.length,E=b,T=di.prototype.thru;for(d&&h.reverse();E--;){var R=h[E];if(typeof R!="function")throw new ui(s);if(T&&!B&&Jg(R)=="wrapper")var B=new di([],!0)}for(E=B?E:b;++E<b;){R=h[E];var W=Jg(R),te=W=="wrapper"?N1(R):n;te&&$1(te[0])&&te[1]==(A|C|O|L)&&!te[4].length&&te[9]==1?B=B[Jg(te[0])].apply(B,te[3]):B=R.length==1&&$1(R)?B[W]():B.thru(R)}return function(){var ye=arguments,xe=ye[0];if(B&&ye.length==1&&ct(xe))return B.plant(xe).value();for(var Se=0,Te=b?h[Se].apply(this,ye):xe;++Se<b;)Te=h[Se].call(this,Te);return Te}})}function Kg(d,h,b,E,T,R,B,W,te,ye){var xe=h&A,Se=h&x,Te=h&_,ze=h&(C|P),Ge=h&F,vt=Te?n:Jd(d);function Ye(){for(var Et=arguments.length,Pt=ce(Et),Kr=Et;Kr--;)Pt[Kr]=arguments[Kr];if(ze)var lr=Ac(Ye),Xr=qoe(Pt,lr);if(E&&(Pt=SI(Pt,E,T,ze)),R&&(Pt=CI(Pt,R,B,ze)),Et-=Xr,ze&&Et<ye){var bn=Ts(Pt,lr);return AI(d,h,Kg,Ye.placeholder,b,Pt,bn,W,te,ye-Et)}var Ii=Se?b:this,Bo=Te?Ii[d]:d;return Et=Pt.length,W?Pt=ele(Pt,W):Ge&&Et>1&&Pt.reverse(),xe&&te<Et&&(Pt.length=te),this&&this!==Wn&&this instanceof Ye&&(Bo=vt||Jd(Bo)),Bo.apply(Ii,Pt)}return Ye}function DI(d,h){return function(b,E){return lae(b,d,h(E),{})}}function Xg(d,h){return function(b,E){var T;if(b===n&&E===n)return h;if(b!==n&&(T=b),E!==n){if(T===n)return E;typeof b=="string"||typeof E=="string"?(b=Gr(b),E=Gr(E)):(b=gI(b),E=gI(E)),T=d(b,E)}return T}}function D1(d){return Fo(function(h){return h=an(h,qr(Ue())),yt(function(b){var E=this;return d(h,function(T){return Ur(T,E,b)})})})}function Qg(d,h){h=h===n?" ":Gr(h);var b=h.length;if(b<2)return b?S1(h,d):h;var E=S1(h,Fg(d/Cc(h)));return Sc(h)?Ls(Di(E),0,d).join(""):E.slice(0,d)}function Rae(d,h,b,E){var T=h&x,R=Jd(d);function B(){for(var W=-1,te=arguments.length,ye=-1,xe=E.length,Se=ce(xe+te),Te=this&&this!==Wn&&this instanceof B?R:d;++ye<xe;)Se[ye]=E[ye];for(;te--;)Se[ye++]=arguments[++W];return Ur(Te,T?b:this,Se)}return B}function TI(d){return function(h,b,E){return E&&typeof E!="number"&&ar(h,b,E)&&(b=E=n),h=zo(h),b===n?(b=h,h=0):b=zo(b),E=E===n?h<b?1:-1:zo(E),xae(h,b,E,d)}}function Zg(d){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=gi(h),b=gi(b)),d(h,b)}}function AI(d,h,b,E,T,R,B,W,te,ye){var xe=h&C,Se=xe?B:n,Te=xe?n:B,ze=xe?R:n,Ge=xe?n:R;h|=xe?O:k,h&=~(xe?k:O),h&S||(h&=~(x|_));var vt=[d,h,T,ze,Se,Ge,Te,W,te,ye],Ye=b.apply(n,vt);return $1(d)&&WI(Ye,vt),Ye.placeholder=E,UI(Ye,d,h)}function T1(d){var h=Dn[d];return function(b,E){if(b=gi(b),E=E==null?0:Jn(ht(E),292),E&&UA(b)){var T=(jt(b)+"e").split("e"),R=h(T[0]+"e"+(+T[1]+E));return T=(jt(R)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var Lae=Pc&&1/Pg(new Pc([,-0]))[1]==q?function(d){return new Pc(d)}:J1;function II(d){return function(h){var b=er(h);return b==je?a1(h):b==bt?Joe(h):Uoe(h,d(h))}}function Lo(d,h,b,E,T,R,B,W){var te=h&_;if(!te&&typeof d!="function")throw new ui(s);var ye=E?E.length:0;if(ye||(h&=~(O|k),E=T=n),B=B===n?B:Tn(ht(B),0),W=W===n?W:ht(W),ye-=T?T.length:0,h&k){var xe=E,Se=T;E=T=n}var Te=te?n:N1(d),ze=[d,h,b,E,T,xe,Se,R,B,W];if(Te&&Qae(ze,Te),d=ze[0],h=ze[1],b=ze[2],E=ze[3],T=ze[4],W=ze[9]=ze[9]===n?te?0:d.length:Tn(ze[9]-ye,0),!W&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var Ge=Iae(d,h,b);else h==C||h==P?Ge=Nae(d,h,W):(h==O||h==(x|O))&&!T.length?Ge=Rae(d,h,b,E):Ge=Kg.apply(n,ze);var vt=Te?hI:WI;return UI(vt(Ge,ze),d,h)}function NI(d,h,b,E){return d===n||Ai(d,Oc[b])&&!Vt.call(E,b)?h:d}function RI(d,h,b,E,T,R){return un(d)&&un(h)&&(R.set(h,d),Ug(d,h,n,RI,R),R.delete(h)),d}function Fae(d){return nf(d)?n:d}function LI(d,h,b,E,T,R){var B=b&v,W=d.length,te=h.length;if(W!=te&&!(B&&te>W))return!1;var ye=R.get(d),xe=R.get(h);if(ye&&xe)return ye==h&&xe==d;var Se=-1,Te=!0,ze=b&y?new el:n;for(R.set(d,h),R.set(h,d);++Se<W;){var Ge=d[Se],vt=h[Se];if(E)var Ye=B?E(vt,Ge,Se,h,d,R):E(Ge,vt,Se,d,h,R);if(Ye!==n){if(Ye)continue;Te=!1;break}if(ze){if(!t1(h,function(Et,Pt){if(!Vd(ze,Pt)&&(Ge===Et||T(Ge,Et,b,E,R)))return ze.push(Pt)})){Te=!1;break}}else if(!(Ge===vt||T(Ge,vt,b,E,R))){Te=!1;break}}return R.delete(d),R.delete(h),Te}function $ae(d,h,b,E,T,R,B){switch(b){case qe:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case Re:return!(d.byteLength!=h.byteLength||!R(new Ig(d),new Ig(h)));case re:case Q:case We:return Ai(+d,+h);case we:return d.name==h.name&&d.message==h.message;case Dt:case En:return d==h+"";case je:var W=a1;case bt:var te=E&v;if(W||(W=Pg),d.size!=h.size&&!te)return!1;var ye=B.get(d);if(ye)return ye==h;E|=y,B.set(d,h);var xe=LI(W(d),W(h),E,T,R,B);return B.delete(d),xe;case cn:if(Gd)return Gd.call(d)==Gd.call(h)}return!1}function jae(d,h,b,E,T,R){var B=b&v,W=A1(d),te=W.length,ye=A1(h),xe=ye.length;if(te!=xe&&!B)return!1;for(var Se=te;Se--;){var Te=W[Se];if(!(B?Te in h:Vt.call(h,Te)))return!1}var ze=R.get(d),Ge=R.get(h);if(ze&&Ge)return ze==h&&Ge==d;var vt=!0;R.set(d,h),R.set(h,d);for(var Ye=B;++Se<te;){Te=W[Se];var Et=d[Te],Pt=h[Te];if(E)var Kr=B?E(Pt,Et,Te,h,d,R):E(Et,Pt,Te,d,h,R);if(!(Kr===n?Et===Pt||T(Et,Pt,b,E,R):Kr)){vt=!1;break}Ye||(Ye=Te=="constructor")}if(vt&&!Ye){var lr=d.constructor,Xr=h.constructor;lr!=Xr&&"constructor"in d&&"constructor"in h&&!(typeof lr=="function"&&lr instanceof lr&&typeof Xr=="function"&&Xr instanceof Xr)&&(vt=!1)}return R.delete(d),R.delete(h),vt}function Fo(d){return z1(VI(d,n,QI),d+"")}function A1(d){return nI(d,Ln,L1)}function I1(d){return nI(d,Cr,FI)}var N1=jg?function(d){return jg.get(d)}:J1;function Jg(d){for(var h=d.name+"",b=kc[h],E=Vt.call(kc,h)?b.length:0;E--;){var T=b[E],R=T.func;if(R==null||R==d)return T.name}return h}function Ac(d){var h=Vt.call(I,"placeholder")?I:d;return h.placeholder}function Ue(){var d=I.iteratee||Q1;return d=d===Q1?oI:d,arguments.length?d(arguments[0],arguments[1]):d}function em(d,h){var b=d.__data__;return Gae(h)?b[typeof h=="string"?"string":"hash"]:b.map}function R1(d){for(var h=Ln(d),b=h.length;b--;){var E=h[b],T=d[E];h[b]=[E,T,zI(T)]}return h}function rl(d,h){var b=Xoe(d,h);return iI(b)?b:n}function zae(d){var h=Vt.call(d,Za),b=d[Za];try{d[Za]=n;var E=!0}catch{}var T=Tg.call(d);return E&&(h?d[Za]=b:delete d[Za]),T}var L1=c1?function(d){return d==null?[]:(d=Ut(d),Ms(c1(d),function(h){return HA.call(d,h)}))}:ew,FI=c1?function(d){for(var h=[];d;)Ds(h,L1(d)),d=Ng(d);return h}:ew,er=sr;(u1&&er(new u1(new ArrayBuffer(1)))!=qe||Wd&&er(new Wd)!=je||d1&&er(d1.resolve())!=Qe||Pc&&er(new Pc)!=bt||Ud&&er(new Ud)!=fe)&&(er=function(d){var h=sr(d),b=h==be?d.constructor:n,E=b?il(b):"";if(E)switch(E){case _se:return qe;case Sse:return je;case Cse:return Qe;case Ese:return bt;case Ose:return fe}return h});function Bae(d,h,b){for(var E=-1,T=b.length;++E<T;){var R=b[E],B=R.size;switch(R.type){case"drop":d+=B;break;case"dropRight":h-=B;break;case"take":h=Jn(h,d+B);break;case"takeRight":d=Tn(d,h-B);break}}return{start:d,end:h}}function Vae(d){var h=d.match(Bd);return h?h[1].split(M):[]}function $I(d,h,b){h=Rs(h,d);for(var E=-1,T=h.length,R=!1;++E<T;){var B=ao(h[E]);if(!(R=d!=null&&b(d,B)))break;d=d[B]}return R||++E!=T?R:(T=d==null?0:d.length,!!T&&am(T)&&$o(B,T)&&(ct(d)||ol(d)))}function Hae(d){var h=d.length,b=new d.constructor(h);return h&&typeof d[0]=="string"&&Vt.call(d,"index")&&(b.index=d.index,b.input=d.input),b}function jI(d){return typeof d.constructor=="function"&&!ef(d)?Mc(Ng(d)):{}}function Wae(d,h,b){var E=d.constructor;switch(h){case Re:return M1(d);case re:case Q:return new E(+d);case qe:return Pae(d,b);case Ze:case Nt:case Bt:case gn:case or:case Vn:case mn:case wr:case Hn:return wI(d,b);case je:return new E;case We:case En:return new E(d);case Dt:return kae(d);case bt:return new E;case cn:return Mae(d)}}function Uae(d,h){var b=h.length;if(!b)return d;var E=b-1;return h[E]=(b>1?"& ":"")+h[E],h=h.join(b>2?", ":" "),d.replace(zd,`{
66
+ */wf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,_=2,S=4,C=8,P=16,O=32,k=64,A=128,L=256,F=512,j=30,z="...",V=800,oe=16,ee=1,$=2,J=3,q=1/0,K=9007199254740991,G=17976931348623157e292,D=NaN,H=4294967295,ne=H-1,N=H>>>1,le=[["ary",A],["bind",x],["bindKey",_],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",L]],me="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",re="[object Boolean]",Q="[object Date]",ie="[object DOMException]",we="[object Error]",U="[object Function]",Ie="[object GeneratorFunction]",je="[object Map]",We="[object Number]",Xe="[object Null]",be="[object Object]",Qe="[object Promise]",it="[object Proxy]",Dt="[object RegExp]",bt="[object Set]",En="[object String]",cn="[object Symbol]",Do="[object Undefined]",fe="[object WeakMap]",Ee="[object WeakSet]",Re="[object ArrayBuffer]",qe="[object DataView]",Ze="[object Float32Array]",Nt="[object Float64Array]",Bt="[object Int8Array]",gn="[object Int16Array]",or="[object Int32Array]",Vn="[object Uint8Array]",mn="[object Uint8ClampedArray]",wr="[object Uint16Array]",Hn="[object Uint32Array]",Ld=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,Va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Zn=/&(?:amp|lt|gt|quot|#39);/g,io=/[&<>"']/g,Ao=RegExp(Zn.source),Ha=RegExp(io.source),Fd=/<%-([\s\S]+?)%>/g,Wa=/<%([\s\S]+?)%>/g,xc=/<%=([\s\S]+?)%>/g,Ua=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qa=/^\w*$/,$d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ga=/[\\^$.*+?()[\]{}|]/g,Ya=RegExp(Ga.source),Ka=/^\s+/,jd=/\s/,zd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bd=/\{\n\/\* \[wrapped with (.+)\] \*/,M=/,? & /,Y=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,Ce=/\\(\\)?/g,Fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,Mt=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,lt=/^(?:0|[1-9]\d*)$/,Wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Rn=/($^)/,Xa=/['\n\r\u2028\u2029\\]/g,sn="\\ud800-\\udfff",aoe="\\u0300-\\u036f",loe="\\ufe20-\\ufe2f",coe="\\u20d0-\\u20ff",iA=aoe+loe+coe,oA="\\u2700-\\u27bf",sA="a-z\\xdf-\\xf6\\xf8-\\xff",uoe="\\xac\\xb1\\xd7\\xf7",doe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",foe="\\u2000-\\u206f",hoe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aA="A-Z\\xc0-\\xd6\\xd8-\\xde",lA="\\ufe0e\\ufe0f",cA=uoe+doe+foe+hoe,qx="['’]",poe="["+sn+"]",uA="["+cA+"]",Cg="["+iA+"]",dA="\\d+",goe="["+oA+"]",fA="["+sA+"]",hA="[^"+sn+cA+dA+oA+sA+aA+"]",Gx="\\ud83c[\\udffb-\\udfff]",moe="(?:"+Cg+"|"+Gx+")",pA="[^"+sn+"]",Yx="(?:\\ud83c[\\udde6-\\uddff]){2}",Kx="[\\ud800-\\udbff][\\udc00-\\udfff]",wc="["+aA+"]",gA="\\u200d",mA="(?:"+fA+"|"+hA+")",voe="(?:"+wc+"|"+hA+")",vA="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",bA="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",yA=moe+"?",xA="["+lA+"]?",boe="(?:"+gA+"(?:"+[pA,Yx,Kx].join("|")+")"+xA+yA+")*",yoe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xoe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wA=xA+yA+boe,woe="(?:"+[goe,Yx,Kx].join("|")+")"+wA,_oe="(?:"+[pA+Cg+"?",Cg,Yx,Kx,poe].join("|")+")",Soe=RegExp(qx,"g"),Coe=RegExp(Cg,"g"),Xx=RegExp(Gx+"(?="+Gx+")|"+_oe+wA,"g"),Eoe=RegExp([wc+"?"+fA+"+"+vA+"(?="+[uA,wc,"$"].join("|")+")",voe+"+"+bA+"(?="+[uA,wc+mA,"$"].join("|")+")",wc+"?"+mA+"+"+vA,wc+"+"+bA,xoe,yoe,dA,woe].join("|"),"g"),Ooe=RegExp("["+gA+sn+iA+lA+"]"),Poe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,koe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Moe=-1,on={};on[Ze]=on[Nt]=on[Bt]=on[gn]=on[or]=on[Vn]=on[mn]=on[wr]=on[Hn]=!0,on[me]=on[he]=on[Re]=on[re]=on[qe]=on[Q]=on[we]=on[U]=on[je]=on[We]=on[be]=on[Dt]=on[bt]=on[En]=on[fe]=!1;var Xt={};Xt[me]=Xt[he]=Xt[Re]=Xt[qe]=Xt[re]=Xt[Q]=Xt[Ze]=Xt[Nt]=Xt[Bt]=Xt[gn]=Xt[or]=Xt[je]=Xt[We]=Xt[be]=Xt[Dt]=Xt[bt]=Xt[En]=Xt[cn]=Xt[Vn]=Xt[mn]=Xt[wr]=Xt[Hn]=!0,Xt[we]=Xt[U]=Xt[fe]=!1;var Doe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Toe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Aoe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ioe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Noe=parseFloat,Roe=parseInt,_A=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,Loe=typeof self=="object"&&self&&self.Object===Object&&self,Wn=_A||Loe||Function("return this")(),Qx=t&&!t.nodeType&&t,Qa=Qx&&!0&&e&&!e.nodeType&&e,SA=Qa&&Qa.exports===Qx,Zx=SA&&_A.process,li=function(){try{var X=Qa&&Qa.require&&Qa.require("util").types;return X||Zx&&Zx.binding&&Zx.binding("util")}catch{}}(),CA=li&&li.isArrayBuffer,EA=li&&li.isDate,OA=li&&li.isMap,PA=li&&li.isRegExp,kA=li&&li.isSet,MA=li&&li.isTypedArray;function Ur(X,ge,ce){switch(ce.length){case 0:return X.call(ge);case 1:return X.call(ge,ce[0]);case 2:return X.call(ge,ce[0],ce[1]);case 3:return X.call(ge,ce[0],ce[1],ce[2])}return X.apply(ge,ce)}function Foe(X,ge,ce,Le){for(var ot=-1,Rt=X==null?0:X.length;++ot<Rt;){var Dn=X[ot];ge(Le,Dn,ce(Dn),X)}return Le}function ci(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le&&ge(X[ce],ce,X)!==!1;);return X}function $oe(X,ge){for(var ce=X==null?0:X.length;ce--&&ge(X[ce],ce,X)!==!1;);return X}function DA(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le;)if(!ge(X[ce],ce,X))return!1;return!0}function Ms(X,ge){for(var ce=-1,Le=X==null?0:X.length,ot=0,Rt=[];++ce<Le;){var Dn=X[ce];ge(Dn,ce,X)&&(Rt[ot++]=Dn)}return Rt}function Eg(X,ge){var ce=X==null?0:X.length;return!!ce&&_c(X,ge,0)>-1}function Jx(X,ge,ce){for(var Le=-1,ot=X==null?0:X.length;++Le<ot;)if(ce(ge,X[Le]))return!0;return!1}function an(X,ge){for(var ce=-1,Le=X==null?0:X.length,ot=Array(Le);++ce<Le;)ot[ce]=ge(X[ce],ce,X);return ot}function Ds(X,ge){for(var ce=-1,Le=ge.length,ot=X.length;++ce<Le;)X[ot+ce]=ge[ce];return X}function e1(X,ge,ce,Le){var ot=-1,Rt=X==null?0:X.length;for(Le&&Rt&&(ce=X[++ot]);++ot<Rt;)ce=ge(ce,X[ot],ot,X);return ce}function joe(X,ge,ce,Le){var ot=X==null?0:X.length;for(Le&&ot&&(ce=X[--ot]);ot--;)ce=ge(ce,X[ot],ot,X);return ce}function t1(X,ge){for(var ce=-1,Le=X==null?0:X.length;++ce<Le;)if(ge(X[ce],ce,X))return!0;return!1}var zoe=n1("length");function Boe(X){return X.split("")}function Voe(X){return X.match(Y)||[]}function TA(X,ge,ce){var Le;return ce(X,function(ot,Rt,Dn){if(ge(ot,Rt,Dn))return Le=Rt,!1}),Le}function Og(X,ge,ce,Le){for(var ot=X.length,Rt=ce+(Le?1:-1);Le?Rt--:++Rt<ot;)if(ge(X[Rt],Rt,X))return Rt;return-1}function _c(X,ge,ce){return ge===ge?ese(X,ge,ce):Og(X,AA,ce)}function Hoe(X,ge,ce,Le){for(var ot=ce-1,Rt=X.length;++ot<Rt;)if(Le(X[ot],ge))return ot;return-1}function AA(X){return X!==X}function IA(X,ge){var ce=X==null?0:X.length;return ce?i1(X,ge)/ce:D}function n1(X){return function(ge){return ge==null?n:ge[X]}}function r1(X){return function(ge){return X==null?n:X[ge]}}function NA(X,ge,ce,Le,ot){return ot(X,function(Rt,Dn,Ut){ce=Le?(Le=!1,Rt):ge(ce,Rt,Dn,Ut)}),ce}function Woe(X,ge){var ce=X.length;for(X.sort(ge);ce--;)X[ce]=X[ce].value;return X}function i1(X,ge){for(var ce,Le=-1,ot=X.length;++Le<ot;){var Rt=ge(X[Le]);Rt!==n&&(ce=ce===n?Rt:ce+Rt)}return ce}function o1(X,ge){for(var ce=-1,Le=Array(X);++ce<X;)Le[ce]=ge(ce);return Le}function Uoe(X,ge){return an(ge,function(ce){return[ce,X[ce]]})}function RA(X){return X&&X.slice(0,jA(X)+1).replace(Ka,"")}function qr(X){return function(ge){return X(ge)}}function s1(X,ge){return an(ge,function(ce){return X[ce]})}function Vd(X,ge){return X.has(ge)}function LA(X,ge){for(var ce=-1,Le=X.length;++ce<Le&&_c(ge,X[ce],0)>-1;);return ce}function FA(X,ge){for(var ce=X.length;ce--&&_c(ge,X[ce],0)>-1;);return ce}function qoe(X,ge){for(var ce=X.length,Le=0;ce--;)X[ce]===ge&&++Le;return Le}var Goe=r1(Doe),Yoe=r1(Toe);function Koe(X){return"\\"+Ioe[X]}function Xoe(X,ge){return X==null?n:X[ge]}function Sc(X){return Ooe.test(X)}function Qoe(X){return Poe.test(X)}function Zoe(X){for(var ge,ce=[];!(ge=X.next()).done;)ce.push(ge.value);return ce}function a1(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le,ot){ce[++ge]=[ot,Le]}),ce}function $A(X,ge){return function(ce){return X(ge(ce))}}function Ts(X,ge){for(var ce=-1,Le=X.length,ot=0,Rt=[];++ce<Le;){var Dn=X[ce];(Dn===ge||Dn===u)&&(X[ce]=u,Rt[ot++]=ce)}return Rt}function Pg(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le){ce[++ge]=Le}),ce}function Joe(X){var ge=-1,ce=Array(X.size);return X.forEach(function(Le){ce[++ge]=[Le,Le]}),ce}function ese(X,ge,ce){for(var Le=ce-1,ot=X.length;++Le<ot;)if(X[Le]===ge)return Le;return-1}function tse(X,ge,ce){for(var Le=ce+1;Le--;)if(X[Le]===ge)return Le;return Le}function Cc(X){return Sc(X)?rse(X):zoe(X)}function Di(X){return Sc(X)?ise(X):Boe(X)}function jA(X){for(var ge=X.length;ge--&&jd.test(X.charAt(ge)););return ge}var nse=r1(Aoe);function rse(X){for(var ge=Xx.lastIndex=0;Xx.test(X);)++ge;return ge}function ise(X){return X.match(Xx)||[]}function ose(X){return X.match(Eoe)||[]}var sse=function X(ge){ge=ge==null?Wn:Ec.defaults(Wn.Object(),ge,Ec.pick(Wn,koe));var ce=ge.Array,Le=ge.Date,ot=ge.Error,Rt=ge.Function,Dn=ge.Math,Ut=ge.Object,l1=ge.RegExp,ase=ge.String,ui=ge.TypeError,kg=ce.prototype,lse=Rt.prototype,Oc=Ut.prototype,Mg=ge["__core-js_shared__"],Dg=lse.toString,Vt=Oc.hasOwnProperty,cse=0,zA=function(){var d=/[^.]+$/.exec(Mg&&Mg.keys&&Mg.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),Tg=Oc.toString,use=Dg.call(Ut),dse=Wn._,fse=l1("^"+Dg.call(Vt).replace(Ga,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ag=SA?ge.Buffer:n,As=ge.Symbol,Ig=ge.Uint8Array,BA=Ag?Ag.allocUnsafe:n,Ng=$A(Ut.getPrototypeOf,Ut),VA=Ut.create,HA=Oc.propertyIsEnumerable,Rg=kg.splice,WA=As?As.isConcatSpreadable:n,Hd=As?As.iterator:n,Za=As?As.toStringTag:n,Lg=function(){try{var d=rl(Ut,"defineProperty");return d({},"",{}),d}catch{}}(),hse=ge.clearTimeout!==Wn.clearTimeout&&ge.clearTimeout,pse=Le&&Le.now!==Wn.Date.now&&Le.now,gse=ge.setTimeout!==Wn.setTimeout&&ge.setTimeout,Fg=Dn.ceil,$g=Dn.floor,c1=Ut.getOwnPropertySymbols,mse=Ag?Ag.isBuffer:n,UA=ge.isFinite,vse=kg.join,bse=$A(Ut.keys,Ut),Tn=Dn.max,Jn=Dn.min,yse=Le.now,xse=ge.parseInt,qA=Dn.random,wse=kg.reverse,u1=rl(ge,"DataView"),Wd=rl(ge,"Map"),d1=rl(ge,"Promise"),Pc=rl(ge,"Set"),Ud=rl(ge,"WeakMap"),qd=rl(Ut,"create"),jg=Ud&&new Ud,kc={},_se=il(u1),Sse=il(Wd),Cse=il(d1),Ese=il(Pc),Ose=il(Ud),zg=As?As.prototype:n,Gd=zg?zg.valueOf:n,GA=zg?zg.toString:n;function I(d){if(hn(d)&&!ct(d)&&!(d instanceof Ot)){if(d instanceof di)return d;if(Vt.call(d,"__wrapped__"))return YI(d)}return new di(d)}var Mc=function(){function d(){}return function(h){if(!un(h))return{};if(VA)return VA(h);d.prototype=h;var b=new d;return d.prototype=n,b}}();function Bg(){}function di(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:Fd,evaluate:Wa,interpolate:xc,variable:"",imports:{_:I}},I.prototype=Bg.prototype,I.prototype.constructor=I,di.prototype=Mc(Bg.prototype),di.prototype.constructor=di;function Ot(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Pse(){var d=new Ot(this.__wrapped__);return d.__actions__=_r(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=_r(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=_r(this.__views__),d}function kse(){if(this.__filtered__){var d=new Ot(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function Mse(){var d=this.__wrapped__.value(),h=this.__dir__,b=ct(d),E=h<0,T=b?d.length:0,R=Bae(0,T,this.__views__),B=R.start,W=R.end,te=W-B,ye=E?W:B-1,xe=this.__iteratees__,Se=xe.length,Te=0,ze=Jn(te,this.__takeCount__);if(!b||!E&&T==te&&ze==te)return vI(d,this.__actions__);var Ge=[];e:for(;te--&&Te<ze;){ye+=h;for(var vt=-1,Ye=d[ye];++vt<Se;){var Et=xe[vt],Pt=Et.iteratee,Kr=Et.type,lr=Pt(Ye);if(Kr==$)Ye=lr;else if(!lr){if(Kr==ee)continue e;break e}}Ge[Te++]=Ye}return Ge}Ot.prototype=Mc(Bg.prototype),Ot.prototype.constructor=Ot;function Ja(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function Dse(){this.__data__=qd?qd(null):{},this.size=0}function Tse(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function Ase(d){var h=this.__data__;if(qd){var b=h[d];return b===l?n:b}return Vt.call(h,d)?h[d]:n}function Ise(d){var h=this.__data__;return qd?h[d]!==n:Vt.call(h,d)}function Nse(d,h){var b=this.__data__;return this.size+=this.has(d)?0:1,b[d]=qd&&h===n?l:h,this}Ja.prototype.clear=Dse,Ja.prototype.delete=Tse,Ja.prototype.get=Ase,Ja.prototype.has=Ise,Ja.prototype.set=Nse;function Io(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function Rse(){this.__data__=[],this.size=0}function Lse(d){var h=this.__data__,b=Vg(h,d);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():Rg.call(h,b,1),--this.size,!0}function Fse(d){var h=this.__data__,b=Vg(h,d);return b<0?n:h[b][1]}function $se(d){return Vg(this.__data__,d)>-1}function jse(d,h){var b=this.__data__,E=Vg(b,d);return E<0?(++this.size,b.push([d,h])):b[E][1]=h,this}Io.prototype.clear=Rse,Io.prototype.delete=Lse,Io.prototype.get=Fse,Io.prototype.has=$se,Io.prototype.set=jse;function No(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var E=d[h];this.set(E[0],E[1])}}function zse(){this.size=0,this.__data__={hash:new Ja,map:new(Wd||Io),string:new Ja}}function Bse(d){var h=em(this,d).delete(d);return this.size-=h?1:0,h}function Vse(d){return em(this,d).get(d)}function Hse(d){return em(this,d).has(d)}function Wse(d,h){var b=em(this,d),E=b.size;return b.set(d,h),this.size+=b.size==E?0:1,this}No.prototype.clear=zse,No.prototype.delete=Bse,No.prototype.get=Vse,No.prototype.has=Hse,No.prototype.set=Wse;function el(d){var h=-1,b=d==null?0:d.length;for(this.__data__=new No;++h<b;)this.add(d[h])}function Use(d){return this.__data__.set(d,l),this}function qse(d){return this.__data__.has(d)}el.prototype.add=el.prototype.push=Use,el.prototype.has=qse;function Ti(d){var h=this.__data__=new Io(d);this.size=h.size}function Gse(){this.__data__=new Io,this.size=0}function Yse(d){var h=this.__data__,b=h.delete(d);return this.size=h.size,b}function Kse(d){return this.__data__.get(d)}function Xse(d){return this.__data__.has(d)}function Qse(d,h){var b=this.__data__;if(b instanceof Io){var E=b.__data__;if(!Wd||E.length<i-1)return E.push([d,h]),this.size=++b.size,this;b=this.__data__=new No(E)}return b.set(d,h),this.size=b.size,this}Ti.prototype.clear=Gse,Ti.prototype.delete=Yse,Ti.prototype.get=Kse,Ti.prototype.has=Xse,Ti.prototype.set=Qse;function YA(d,h){var b=ct(d),E=!b&&ol(d),T=!b&&!E&&Fs(d),R=!b&&!E&&!T&&Ic(d),B=b||E||T||R,W=B?o1(d.length,ase):[],te=W.length;for(var ye in d)(h||Vt.call(d,ye))&&!(B&&(ye=="length"||T&&(ye=="offset"||ye=="parent")||R&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||$o(ye,te)))&&W.push(ye);return W}function KA(d){var h=d.length;return h?d[_1(0,h-1)]:n}function Zse(d,h){return tm(_r(d),tl(h,0,d.length))}function Jse(d){return tm(_r(d))}function f1(d,h,b){(b!==n&&!Ai(d[h],b)||b===n&&!(h in d))&&Ro(d,h,b)}function Yd(d,h,b){var E=d[h];(!(Vt.call(d,h)&&Ai(E,b))||b===n&&!(h in d))&&Ro(d,h,b)}function Vg(d,h){for(var b=d.length;b--;)if(Ai(d[b][0],h))return b;return-1}function eae(d,h,b,E){return Is(d,function(T,R,B){h(E,T,b(T),B)}),E}function XA(d,h){return d&&so(h,Ln(h),d)}function tae(d,h){return d&&so(h,Cr(h),d)}function Ro(d,h,b){h=="__proto__"&&Lg?Lg(d,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):d[h]=b}function h1(d,h){for(var b=-1,E=h.length,T=ce(E),R=d==null;++b<E;)T[b]=R?n:G1(d,h[b]);return T}function tl(d,h,b){return d===d&&(b!==n&&(d=d<=b?d:b),h!==n&&(d=d>=h?d:h)),d}function fi(d,h,b,E,T,R){var B,W=h&f,te=h&g,ye=h&p;if(b&&(B=T?b(d,E,T,R):b(d)),B!==n)return B;if(!un(d))return d;var xe=ct(d);if(xe){if(B=Hae(d),!W)return _r(d,B)}else{var Se=er(d),Te=Se==U||Se==Ie;if(Fs(d))return xI(d,W);if(Se==be||Se==me||Te&&!T){if(B=te||Te?{}:jI(d),!W)return te?Aae(d,tae(B,d)):Tae(d,XA(B,d))}else{if(!Xt[Se])return T?d:{};B=Wae(d,Se,W)}}R||(R=new Ti);var ze=R.get(d);if(ze)return ze;R.set(d,B),pN(d)?d.forEach(function(Ye){B.add(fi(Ye,h,b,Ye,d,R))}):fN(d)&&d.forEach(function(Ye,Et){B.set(Et,fi(Ye,h,b,Et,d,R))});var Ge=ye?te?I1:A1:te?Cr:Ln,vt=xe?n:Ge(d);return ci(vt||d,function(Ye,Et){vt&&(Et=Ye,Ye=d[Et]),Yd(B,Et,fi(Ye,h,b,Et,d,R))}),B}function nae(d){var h=Ln(d);return function(b){return QA(b,d,h)}}function QA(d,h,b){var E=b.length;if(d==null)return!E;for(d=Ut(d);E--;){var T=b[E],R=h[T],B=d[T];if(B===n&&!(T in d)||!R(B))return!1}return!0}function ZA(d,h,b){if(typeof d!="function")throw new ui(s);return tf(function(){d.apply(n,b)},h)}function Kd(d,h,b,E){var T=-1,R=Eg,B=!0,W=d.length,te=[],ye=h.length;if(!W)return te;b&&(h=an(h,qr(b))),E?(R=Jx,B=!1):h.length>=i&&(R=Vd,B=!1,h=new el(h));e:for(;++T<W;){var xe=d[T],Se=b==null?xe:b(xe);if(xe=E||xe!==0?xe:0,B&&Se===Se){for(var Te=ye;Te--;)if(h[Te]===Se)continue e;te.push(xe)}else R(h,Se,E)||te.push(xe)}return te}var Is=EI(oo),JA=EI(g1,!0);function rae(d,h){var b=!0;return Is(d,function(E,T,R){return b=!!h(E,T,R),b}),b}function Hg(d,h,b){for(var E=-1,T=d.length;++E<T;){var R=d[E],B=h(R);if(B!=null&&(W===n?B===B&&!Yr(B):b(B,W)))var W=B,te=R}return te}function iae(d,h,b,E){var T=d.length;for(b=ht(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:ht(E),E<0&&(E+=T),E=b>E?0:mN(E);b<E;)d[b++]=h;return d}function eI(d,h){var b=[];return Is(d,function(E,T,R){h(E,T,R)&&b.push(E)}),b}function Un(d,h,b,E,T){var R=-1,B=d.length;for(b||(b=qae),T||(T=[]);++R<B;){var W=d[R];h>0&&b(W)?h>1?Un(W,h-1,b,E,T):Ds(T,W):E||(T[T.length]=W)}return T}var p1=OI(),tI=OI(!0);function oo(d,h){return d&&p1(d,h,Ln)}function g1(d,h){return d&&tI(d,h,Ln)}function Wg(d,h){return Ms(h,function(b){return jo(d[b])})}function nl(d,h){h=Rs(h,d);for(var b=0,E=h.length;d!=null&&b<E;)d=d[ao(h[b++])];return b&&b==E?d:n}function nI(d,h,b){var E=h(d);return ct(d)?E:Ds(E,b(d))}function sr(d){return d==null?d===n?Do:Xe:Za&&Za in Ut(d)?zae(d):Jae(d)}function m1(d,h){return d>h}function oae(d,h){return d!=null&&Vt.call(d,h)}function sae(d,h){return d!=null&&h in Ut(d)}function aae(d,h,b){return d>=Jn(h,b)&&d<Tn(h,b)}function v1(d,h,b){for(var E=b?Jx:Eg,T=d[0].length,R=d.length,B=R,W=ce(R),te=1/0,ye=[];B--;){var xe=d[B];B&&h&&(xe=an(xe,qr(h))),te=Jn(xe.length,te),W[B]=!b&&(h||T>=120&&xe.length>=120)?new el(B&&xe):n}xe=d[0];var Se=-1,Te=W[0];e:for(;++Se<T&&ye.length<te;){var ze=xe[Se],Ge=h?h(ze):ze;if(ze=b||ze!==0?ze:0,!(Te?Vd(Te,Ge):E(ye,Ge,b))){for(B=R;--B;){var vt=W[B];if(!(vt?Vd(vt,Ge):E(d[B],Ge,b)))continue e}Te&&Te.push(Ge),ye.push(ze)}}return ye}function lae(d,h,b,E){return oo(d,function(T,R,B){h(E,b(T),R,B)}),E}function Xd(d,h,b){h=Rs(h,d),d=HI(d,h);var E=d==null?d:d[ao(pi(h))];return E==null?n:Ur(E,d,b)}function rI(d){return hn(d)&&sr(d)==me}function cae(d){return hn(d)&&sr(d)==Re}function uae(d){return hn(d)&&sr(d)==Q}function Qd(d,h,b,E,T){return d===h?!0:d==null||h==null||!hn(d)&&!hn(h)?d!==d&&h!==h:dae(d,h,b,E,Qd,T)}function dae(d,h,b,E,T,R){var B=ct(d),W=ct(h),te=B?he:er(d),ye=W?he:er(h);te=te==me?be:te,ye=ye==me?be:ye;var xe=te==be,Se=ye==be,Te=te==ye;if(Te&&Fs(d)){if(!Fs(h))return!1;B=!0,xe=!1}if(Te&&!xe)return R||(R=new Ti),B||Ic(d)?LI(d,h,b,E,T,R):$ae(d,h,te,b,E,T,R);if(!(b&v)){var ze=xe&&Vt.call(d,"__wrapped__"),Ge=Se&&Vt.call(h,"__wrapped__");if(ze||Ge){var vt=ze?d.value():d,Ye=Ge?h.value():h;return R||(R=new Ti),T(vt,Ye,b,E,R)}}return Te?(R||(R=new Ti),jae(d,h,b,E,T,R)):!1}function fae(d){return hn(d)&&er(d)==je}function b1(d,h,b,E){var T=b.length,R=T,B=!E;if(d==null)return!R;for(d=Ut(d);T--;){var W=b[T];if(B&&W[2]?W[1]!==d[W[0]]:!(W[0]in d))return!1}for(;++T<R;){W=b[T];var te=W[0],ye=d[te],xe=W[1];if(B&&W[2]){if(ye===n&&!(te in d))return!1}else{var Se=new Ti;if(E)var Te=E(ye,xe,te,d,h,Se);if(!(Te===n?Qd(xe,ye,v|y,E,Se):Te))return!1}}return!0}function iI(d){if(!un(d)||Yae(d))return!1;var h=jo(d)?fse:Mt;return h.test(il(d))}function hae(d){return hn(d)&&sr(d)==Dt}function pae(d){return hn(d)&&er(d)==bt}function gae(d){return hn(d)&&am(d.length)&&!!on[sr(d)]}function oI(d){return typeof d=="function"?d:d==null?Er:typeof d=="object"?ct(d)?lI(d[0],d[1]):aI(d):PN(d)}function y1(d){if(!ef(d))return bse(d);var h=[];for(var b in Ut(d))Vt.call(d,b)&&b!="constructor"&&h.push(b);return h}function mae(d){if(!un(d))return Zae(d);var h=ef(d),b=[];for(var E in d)E=="constructor"&&(h||!Vt.call(d,E))||b.push(E);return b}function x1(d,h){return d<h}function sI(d,h){var b=-1,E=Sr(d)?ce(d.length):[];return Is(d,function(T,R,B){E[++b]=h(T,R,B)}),E}function aI(d){var h=R1(d);return h.length==1&&h[0][2]?BI(h[0][0],h[0][1]):function(b){return b===d||b1(b,d,h)}}function lI(d,h){return F1(d)&&zI(h)?BI(ao(d),h):function(b){var E=G1(b,d);return E===n&&E===h?Y1(b,d):Qd(h,E,v|y)}}function Ug(d,h,b,E,T){d!==h&&p1(h,function(R,B){if(T||(T=new Ti),un(R))vae(d,h,B,b,Ug,E,T);else{var W=E?E(j1(d,B),R,B+"",d,h,T):n;W===n&&(W=R),f1(d,B,W)}},Cr)}function vae(d,h,b,E,T,R,B){var W=j1(d,b),te=j1(h,b),ye=B.get(te);if(ye){f1(d,b,ye);return}var xe=R?R(W,te,b+"",d,h,B):n,Se=xe===n;if(Se){var Te=ct(te),ze=!Te&&Fs(te),Ge=!Te&&!ze&&Ic(te);xe=te,Te||ze||Ge?ct(W)?xe=W:vn(W)?xe=_r(W):ze?(Se=!1,xe=xI(te,!0)):Ge?(Se=!1,xe=wI(te,!0)):xe=[]:nf(te)||ol(te)?(xe=W,ol(W)?xe=vN(W):(!un(W)||jo(W))&&(xe=jI(te))):Se=!1}Se&&(B.set(te,xe),T(xe,te,E,R,B),B.delete(te)),f1(d,b,xe)}function cI(d,h){var b=d.length;if(b)return h+=h<0?b:0,$o(h,b)?d[h]:n}function uI(d,h,b){h.length?h=an(h,function(R){return ct(R)?function(B){return nl(B,R.length===1?R[0]:R)}:R}):h=[Er];var E=-1;h=an(h,qr(Ue()));var T=sI(d,function(R,B,W){var te=an(h,function(ye){return ye(R)});return{criteria:te,index:++E,value:R}});return Woe(T,function(R,B){return Dae(R,B,b)})}function bae(d,h){return dI(d,h,function(b,E){return Y1(d,E)})}function dI(d,h,b){for(var E=-1,T=h.length,R={};++E<T;){var B=h[E],W=nl(d,B);b(W,B)&&Zd(R,Rs(B,d),W)}return R}function yae(d){return function(h){return nl(h,d)}}function w1(d,h,b,E){var T=E?Hoe:_c,R=-1,B=h.length,W=d;for(d===h&&(h=_r(h)),b&&(W=an(d,qr(b)));++R<B;)for(var te=0,ye=h[R],xe=b?b(ye):ye;(te=T(W,xe,te,E))>-1;)W!==d&&Rg.call(W,te,1),Rg.call(d,te,1);return d}function fI(d,h){for(var b=d?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==R){var R=T;$o(T)?Rg.call(d,T,1):E1(d,T)}}return d}function _1(d,h){return d+$g(qA()*(h-d+1))}function xae(d,h,b,E){for(var T=-1,R=Tn(Fg((h-d)/(b||1)),0),B=ce(R);R--;)B[E?R:++T]=d,d+=b;return B}function S1(d,h){var b="";if(!d||h<1||h>K)return b;do h%2&&(b+=d),h=$g(h/2),h&&(d+=d);while(h);return b}function yt(d,h){return z1(VI(d,h,Er),d+"")}function wae(d){return KA(Nc(d))}function _ae(d,h){var b=Nc(d);return tm(b,tl(h,0,b.length))}function Zd(d,h,b,E){if(!un(d))return d;h=Rs(h,d);for(var T=-1,R=h.length,B=R-1,W=d;W!=null&&++T<R;){var te=ao(h[T]),ye=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return d;if(T!=B){var xe=W[te];ye=E?E(xe,te,W):n,ye===n&&(ye=un(xe)?xe:$o(h[T+1])?[]:{})}Yd(W,te,ye),W=W[te]}return d}var hI=jg?function(d,h){return jg.set(d,h),d}:Er,Sae=Lg?function(d,h){return Lg(d,"toString",{configurable:!0,enumerable:!1,value:X1(h),writable:!0})}:Er;function Cae(d){return tm(Nc(d))}function hi(d,h,b){var E=-1,T=d.length;h<0&&(h=-h>T?0:T+h),b=b>T?T:b,b<0&&(b+=T),T=h>b?0:b-h>>>0,h>>>=0;for(var R=ce(T);++E<T;)R[E]=d[E+h];return R}function Eae(d,h){var b;return Is(d,function(E,T,R){return b=h(E,T,R),!b}),!!b}function qg(d,h,b){var E=0,T=d==null?E:d.length;if(typeof h=="number"&&h===h&&T<=N){for(;E<T;){var R=E+T>>>1,B=d[R];B!==null&&!Yr(B)&&(b?B<=h:B<h)?E=R+1:T=R}return T}return C1(d,h,Er,b)}function C1(d,h,b,E){var T=0,R=d==null?0:d.length;if(R===0)return 0;h=b(h);for(var B=h!==h,W=h===null,te=Yr(h),ye=h===n;T<R;){var xe=$g((T+R)/2),Se=b(d[xe]),Te=Se!==n,ze=Se===null,Ge=Se===Se,vt=Yr(Se);if(B)var Ye=E||Ge;else ye?Ye=Ge&&(E||Te):W?Ye=Ge&&Te&&(E||!ze):te?Ye=Ge&&Te&&!ze&&(E||!vt):ze||vt?Ye=!1:Ye=E?Se<=h:Se<h;Ye?T=xe+1:R=xe}return Jn(R,ne)}function pI(d,h){for(var b=-1,E=d.length,T=0,R=[];++b<E;){var B=d[b],W=h?h(B):B;if(!b||!Ai(W,te)){var te=W;R[T++]=B===0?0:B}}return R}function gI(d){return typeof d=="number"?d:Yr(d)?D:+d}function Gr(d){if(typeof d=="string")return d;if(ct(d))return an(d,Gr)+"";if(Yr(d))return GA?GA.call(d):"";var h=d+"";return h=="0"&&1/d==-q?"-0":h}function Ns(d,h,b){var E=-1,T=Eg,R=d.length,B=!0,W=[],te=W;if(b)B=!1,T=Jx;else if(R>=i){var ye=h?null:Lae(d);if(ye)return Pg(ye);B=!1,T=Vd,te=new el}else te=h?[]:W;e:for(;++E<R;){var xe=d[E],Se=h?h(xe):xe;if(xe=b||xe!==0?xe:0,B&&Se===Se){for(var Te=te.length;Te--;)if(te[Te]===Se)continue e;h&&te.push(Se),W.push(xe)}else T(te,Se,b)||(te!==W&&te.push(Se),W.push(xe))}return W}function E1(d,h){return h=Rs(h,d),d=HI(d,h),d==null||delete d[ao(pi(h))]}function mI(d,h,b,E){return Zd(d,h,b(nl(d,h)),E)}function Gg(d,h,b,E){for(var T=d.length,R=E?T:-1;(E?R--:++R<T)&&h(d[R],R,d););return b?hi(d,E?0:R,E?R+1:T):hi(d,E?R+1:0,E?T:R)}function vI(d,h){var b=d;return b instanceof Ot&&(b=b.value()),e1(h,function(E,T){return T.func.apply(T.thisArg,Ds([E],T.args))},b)}function O1(d,h,b){var E=d.length;if(E<2)return E?Ns(d[0]):[];for(var T=-1,R=ce(E);++T<E;)for(var B=d[T],W=-1;++W<E;)W!=T&&(R[T]=Kd(R[T]||B,d[W],h,b));return Ns(Un(R,1),h,b)}function bI(d,h,b){for(var E=-1,T=d.length,R=h.length,B={};++E<T;){var W=E<R?h[E]:n;b(B,d[E],W)}return B}function P1(d){return vn(d)?d:[]}function k1(d){return typeof d=="function"?d:Er}function Rs(d,h){return ct(d)?d:F1(d,h)?[d]:GI(jt(d))}var Oae=yt;function Ls(d,h,b){var E=d.length;return b=b===n?E:b,!h&&b>=E?d:hi(d,h,b)}var yI=hse||function(d){return Wn.clearTimeout(d)};function xI(d,h){if(h)return d.slice();var b=d.length,E=BA?BA(b):new d.constructor(b);return d.copy(E),E}function M1(d){var h=new d.constructor(d.byteLength);return new Ig(h).set(new Ig(d)),h}function Pae(d,h){var b=h?M1(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.byteLength)}function kae(d){var h=new d.constructor(d.source,Be.exec(d));return h.lastIndex=d.lastIndex,h}function Mae(d){return Gd?Ut(Gd.call(d)):{}}function wI(d,h){var b=h?M1(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.length)}function _I(d,h){if(d!==h){var b=d!==n,E=d===null,T=d===d,R=Yr(d),B=h!==n,W=h===null,te=h===h,ye=Yr(h);if(!W&&!ye&&!R&&d>h||R&&B&&te&&!W&&!ye||E&&B&&te||!b&&te||!T)return 1;if(!E&&!R&&!ye&&d<h||ye&&b&&T&&!E&&!R||W&&b&&T||!B&&T||!te)return-1}return 0}function Dae(d,h,b){for(var E=-1,T=d.criteria,R=h.criteria,B=T.length,W=b.length;++E<B;){var te=_I(T[E],R[E]);if(te){if(E>=W)return te;var ye=b[E];return te*(ye=="desc"?-1:1)}}return d.index-h.index}function SI(d,h,b,E){for(var T=-1,R=d.length,B=b.length,W=-1,te=h.length,ye=Tn(R-B,0),xe=ce(te+ye),Se=!E;++W<te;)xe[W]=h[W];for(;++T<B;)(Se||T<R)&&(xe[b[T]]=d[T]);for(;ye--;)xe[W++]=d[T++];return xe}function CI(d,h,b,E){for(var T=-1,R=d.length,B=-1,W=b.length,te=-1,ye=h.length,xe=Tn(R-W,0),Se=ce(xe+ye),Te=!E;++T<xe;)Se[T]=d[T];for(var ze=T;++te<ye;)Se[ze+te]=h[te];for(;++B<W;)(Te||T<R)&&(Se[ze+b[B]]=d[T++]);return Se}function _r(d,h){var b=-1,E=d.length;for(h||(h=ce(E));++b<E;)h[b]=d[b];return h}function so(d,h,b,E){var T=!b;b||(b={});for(var R=-1,B=h.length;++R<B;){var W=h[R],te=E?E(b[W],d[W],W,b,d):n;te===n&&(te=d[W]),T?Ro(b,W,te):Yd(b,W,te)}return b}function Tae(d,h){return so(d,L1(d),h)}function Aae(d,h){return so(d,FI(d),h)}function Yg(d,h){return function(b,E){var T=ct(b)?Foe:eae,R=h?h():{};return T(b,d,Ue(E,2),R)}}function Dc(d){return yt(function(h,b){var E=-1,T=b.length,R=T>1?b[T-1]:n,B=T>2?b[2]:n;for(R=d.length>3&&typeof R=="function"?(T--,R):n,B&&ar(b[0],b[1],B)&&(R=T<3?n:R,T=1),h=Ut(h);++E<T;){var W=b[E];W&&d(h,W,E,R)}return h})}function EI(d,h){return function(b,E){if(b==null)return b;if(!Sr(b))return d(b,E);for(var T=b.length,R=h?T:-1,B=Ut(b);(h?R--:++R<T)&&E(B[R],R,B)!==!1;);return b}}function OI(d){return function(h,b,E){for(var T=-1,R=Ut(h),B=E(h),W=B.length;W--;){var te=B[d?W:++T];if(b(R[te],te,R)===!1)break}return h}}function Iae(d,h,b){var E=h&x,T=Jd(d);function R(){var B=this&&this!==Wn&&this instanceof R?T:d;return B.apply(E?b:this,arguments)}return R}function PI(d){return function(h){h=jt(h);var b=Sc(h)?Di(h):n,E=b?b[0]:h.charAt(0),T=b?Ls(b,1).join(""):h.slice(1);return E[d]()+T}}function Tc(d){return function(h){return e1(EN(CN(h).replace(Soe,"")),d,"")}}function Jd(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=Mc(d.prototype),E=d.apply(b,h);return un(E)?E:b}}function Nae(d,h,b){var E=Jd(d);function T(){for(var R=arguments.length,B=ce(R),W=R,te=Ac(T);W--;)B[W]=arguments[W];var ye=R<3&&B[0]!==te&&B[R-1]!==te?[]:Ts(B,te);if(R-=ye.length,R<b)return AI(d,h,Kg,T.placeholder,n,B,ye,n,n,b-R);var xe=this&&this!==Wn&&this instanceof T?E:d;return Ur(xe,this,B)}return T}function kI(d){return function(h,b,E){var T=Ut(h);if(!Sr(h)){var R=Ue(b,3);h=Ln(h),b=function(W){return R(T[W],W,T)}}var B=d(h,b,E);return B>-1?T[R?h[B]:B]:n}}function MI(d){return Fo(function(h){var b=h.length,E=b,T=di.prototype.thru;for(d&&h.reverse();E--;){var R=h[E];if(typeof R!="function")throw new ui(s);if(T&&!B&&Jg(R)=="wrapper")var B=new di([],!0)}for(E=B?E:b;++E<b;){R=h[E];var W=Jg(R),te=W=="wrapper"?N1(R):n;te&&$1(te[0])&&te[1]==(A|C|O|L)&&!te[4].length&&te[9]==1?B=B[Jg(te[0])].apply(B,te[3]):B=R.length==1&&$1(R)?B[W]():B.thru(R)}return function(){var ye=arguments,xe=ye[0];if(B&&ye.length==1&&ct(xe))return B.plant(xe).value();for(var Se=0,Te=b?h[Se].apply(this,ye):xe;++Se<b;)Te=h[Se].call(this,Te);return Te}})}function Kg(d,h,b,E,T,R,B,W,te,ye){var xe=h&A,Se=h&x,Te=h&_,ze=h&(C|P),Ge=h&F,vt=Te?n:Jd(d);function Ye(){for(var Et=arguments.length,Pt=ce(Et),Kr=Et;Kr--;)Pt[Kr]=arguments[Kr];if(ze)var lr=Ac(Ye),Xr=qoe(Pt,lr);if(E&&(Pt=SI(Pt,E,T,ze)),R&&(Pt=CI(Pt,R,B,ze)),Et-=Xr,ze&&Et<ye){var bn=Ts(Pt,lr);return AI(d,h,Kg,Ye.placeholder,b,Pt,bn,W,te,ye-Et)}var Ii=Se?b:this,Bo=Te?Ii[d]:d;return Et=Pt.length,W?Pt=ele(Pt,W):Ge&&Et>1&&Pt.reverse(),xe&&te<Et&&(Pt.length=te),this&&this!==Wn&&this instanceof Ye&&(Bo=vt||Jd(Bo)),Bo.apply(Ii,Pt)}return Ye}function DI(d,h){return function(b,E){return lae(b,d,h(E),{})}}function Xg(d,h){return function(b,E){var T;if(b===n&&E===n)return h;if(b!==n&&(T=b),E!==n){if(T===n)return E;typeof b=="string"||typeof E=="string"?(b=Gr(b),E=Gr(E)):(b=gI(b),E=gI(E)),T=d(b,E)}return T}}function D1(d){return Fo(function(h){return h=an(h,qr(Ue())),yt(function(b){var E=this;return d(h,function(T){return Ur(T,E,b)})})})}function Qg(d,h){h=h===n?" ":Gr(h);var b=h.length;if(b<2)return b?S1(h,d):h;var E=S1(h,Fg(d/Cc(h)));return Sc(h)?Ls(Di(E),0,d).join(""):E.slice(0,d)}function Rae(d,h,b,E){var T=h&x,R=Jd(d);function B(){for(var W=-1,te=arguments.length,ye=-1,xe=E.length,Se=ce(xe+te),Te=this&&this!==Wn&&this instanceof B?R:d;++ye<xe;)Se[ye]=E[ye];for(;te--;)Se[ye++]=arguments[++W];return Ur(Te,T?b:this,Se)}return B}function TI(d){return function(h,b,E){return E&&typeof E!="number"&&ar(h,b,E)&&(b=E=n),h=zo(h),b===n?(b=h,h=0):b=zo(b),E=E===n?h<b?1:-1:zo(E),xae(h,b,E,d)}}function Zg(d){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=gi(h),b=gi(b)),d(h,b)}}function AI(d,h,b,E,T,R,B,W,te,ye){var xe=h&C,Se=xe?B:n,Te=xe?n:B,ze=xe?R:n,Ge=xe?n:R;h|=xe?O:k,h&=~(xe?k:O),h&S||(h&=~(x|_));var vt=[d,h,T,ze,Se,Ge,Te,W,te,ye],Ye=b.apply(n,vt);return $1(d)&&WI(Ye,vt),Ye.placeholder=E,UI(Ye,d,h)}function T1(d){var h=Dn[d];return function(b,E){if(b=gi(b),E=E==null?0:Jn(ht(E),292),E&&UA(b)){var T=(jt(b)+"e").split("e"),R=h(T[0]+"e"+(+T[1]+E));return T=(jt(R)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var Lae=Pc&&1/Pg(new Pc([,-0]))[1]==q?function(d){return new Pc(d)}:J1;function II(d){return function(h){var b=er(h);return b==je?a1(h):b==bt?Joe(h):Uoe(h,d(h))}}function Lo(d,h,b,E,T,R,B,W){var te=h&_;if(!te&&typeof d!="function")throw new ui(s);var ye=E?E.length:0;if(ye||(h&=~(O|k),E=T=n),B=B===n?B:Tn(ht(B),0),W=W===n?W:ht(W),ye-=T?T.length:0,h&k){var xe=E,Se=T;E=T=n}var Te=te?n:N1(d),ze=[d,h,b,E,T,xe,Se,R,B,W];if(Te&&Qae(ze,Te),d=ze[0],h=ze[1],b=ze[2],E=ze[3],T=ze[4],W=ze[9]=ze[9]===n?te?0:d.length:Tn(ze[9]-ye,0),!W&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var Ge=Iae(d,h,b);else h==C||h==P?Ge=Nae(d,h,W):(h==O||h==(x|O))&&!T.length?Ge=Rae(d,h,b,E):Ge=Kg.apply(n,ze);var vt=Te?hI:WI;return UI(vt(Ge,ze),d,h)}function NI(d,h,b,E){return d===n||Ai(d,Oc[b])&&!Vt.call(E,b)?h:d}function RI(d,h,b,E,T,R){return un(d)&&un(h)&&(R.set(h,d),Ug(d,h,n,RI,R),R.delete(h)),d}function Fae(d){return nf(d)?n:d}function LI(d,h,b,E,T,R){var B=b&v,W=d.length,te=h.length;if(W!=te&&!(B&&te>W))return!1;var ye=R.get(d),xe=R.get(h);if(ye&&xe)return ye==h&&xe==d;var Se=-1,Te=!0,ze=b&y?new el:n;for(R.set(d,h),R.set(h,d);++Se<W;){var Ge=d[Se],vt=h[Se];if(E)var Ye=B?E(vt,Ge,Se,h,d,R):E(Ge,vt,Se,d,h,R);if(Ye!==n){if(Ye)continue;Te=!1;break}if(ze){if(!t1(h,function(Et,Pt){if(!Vd(ze,Pt)&&(Ge===Et||T(Ge,Et,b,E,R)))return ze.push(Pt)})){Te=!1;break}}else if(!(Ge===vt||T(Ge,vt,b,E,R))){Te=!1;break}}return R.delete(d),R.delete(h),Te}function $ae(d,h,b,E,T,R,B){switch(b){case qe:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case Re:return!(d.byteLength!=h.byteLength||!R(new Ig(d),new Ig(h)));case re:case Q:case We:return Ai(+d,+h);case we:return d.name==h.name&&d.message==h.message;case Dt:case En:return d==h+"";case je:var W=a1;case bt:var te=E&v;if(W||(W=Pg),d.size!=h.size&&!te)return!1;var ye=B.get(d);if(ye)return ye==h;E|=y,B.set(d,h);var xe=LI(W(d),W(h),E,T,R,B);return B.delete(d),xe;case cn:if(Gd)return Gd.call(d)==Gd.call(h)}return!1}function jae(d,h,b,E,T,R){var B=b&v,W=A1(d),te=W.length,ye=A1(h),xe=ye.length;if(te!=xe&&!B)return!1;for(var Se=te;Se--;){var Te=W[Se];if(!(B?Te in h:Vt.call(h,Te)))return!1}var ze=R.get(d),Ge=R.get(h);if(ze&&Ge)return ze==h&&Ge==d;var vt=!0;R.set(d,h),R.set(h,d);for(var Ye=B;++Se<te;){Te=W[Se];var Et=d[Te],Pt=h[Te];if(E)var Kr=B?E(Pt,Et,Te,h,d,R):E(Et,Pt,Te,d,h,R);if(!(Kr===n?Et===Pt||T(Et,Pt,b,E,R):Kr)){vt=!1;break}Ye||(Ye=Te=="constructor")}if(vt&&!Ye){var lr=d.constructor,Xr=h.constructor;lr!=Xr&&"constructor"in d&&"constructor"in h&&!(typeof lr=="function"&&lr instanceof lr&&typeof Xr=="function"&&Xr instanceof Xr)&&(vt=!1)}return R.delete(d),R.delete(h),vt}function Fo(d){return z1(VI(d,n,QI),d+"")}function A1(d){return nI(d,Ln,L1)}function I1(d){return nI(d,Cr,FI)}var N1=jg?function(d){return jg.get(d)}:J1;function Jg(d){for(var h=d.name+"",b=kc[h],E=Vt.call(kc,h)?b.length:0;E--;){var T=b[E],R=T.func;if(R==null||R==d)return T.name}return h}function Ac(d){var h=Vt.call(I,"placeholder")?I:d;return h.placeholder}function Ue(){var d=I.iteratee||Q1;return d=d===Q1?oI:d,arguments.length?d(arguments[0],arguments[1]):d}function em(d,h){var b=d.__data__;return Gae(h)?b[typeof h=="string"?"string":"hash"]:b.map}function R1(d){for(var h=Ln(d),b=h.length;b--;){var E=h[b],T=d[E];h[b]=[E,T,zI(T)]}return h}function rl(d,h){var b=Xoe(d,h);return iI(b)?b:n}function zae(d){var h=Vt.call(d,Za),b=d[Za];try{d[Za]=n;var E=!0}catch{}var T=Tg.call(d);return E&&(h?d[Za]=b:delete d[Za]),T}var L1=c1?function(d){return d==null?[]:(d=Ut(d),Ms(c1(d),function(h){return HA.call(d,h)}))}:ew,FI=c1?function(d){for(var h=[];d;)Ds(h,L1(d)),d=Ng(d);return h}:ew,er=sr;(u1&&er(new u1(new ArrayBuffer(1)))!=qe||Wd&&er(new Wd)!=je||d1&&er(d1.resolve())!=Qe||Pc&&er(new Pc)!=bt||Ud&&er(new Ud)!=fe)&&(er=function(d){var h=sr(d),b=h==be?d.constructor:n,E=b?il(b):"";if(E)switch(E){case _se:return qe;case Sse:return je;case Cse:return Qe;case Ese:return bt;case Ose:return fe}return h});function Bae(d,h,b){for(var E=-1,T=b.length;++E<T;){var R=b[E],B=R.size;switch(R.type){case"drop":d+=B;break;case"dropRight":h-=B;break;case"take":h=Jn(h,d+B);break;case"takeRight":d=Tn(d,h-B);break}}return{start:d,end:h}}function Vae(d){var h=d.match(Bd);return h?h[1].split(M):[]}function $I(d,h,b){h=Rs(h,d);for(var E=-1,T=h.length,R=!1;++E<T;){var B=ao(h[E]);if(!(R=d!=null&&b(d,B)))break;d=d[B]}return R||++E!=T?R:(T=d==null?0:d.length,!!T&&am(T)&&$o(B,T)&&(ct(d)||ol(d)))}function Hae(d){var h=d.length,b=new d.constructor(h);return h&&typeof d[0]=="string"&&Vt.call(d,"index")&&(b.index=d.index,b.input=d.input),b}function jI(d){return typeof d.constructor=="function"&&!ef(d)?Mc(Ng(d)):{}}function Wae(d,h,b){var E=d.constructor;switch(h){case Re:return M1(d);case re:case Q:return new E(+d);case qe:return Pae(d,b);case Ze:case Nt:case Bt:case gn:case or:case Vn:case mn:case wr:case Hn:return wI(d,b);case je:return new E;case We:case En:return new E(d);case Dt:return kae(d);case bt:return new E;case cn:return Mae(d)}}function Uae(d,h){var b=h.length;if(!b)return d;var E=b-1;return h[E]=(b>1?"& ":"")+h[E],h=h.join(b>2?", ":" "),d.replace(zd,`{
67
67
  /* [wrapped with `+h+`] */
68
68
  `)}function qae(d){return ct(d)||ol(d)||!!(WA&&d&&d[WA])}function $o(d,h){var b=typeof d;return h=h??K,!!h&&(b=="number"||b!="symbol"&&lt.test(d))&&d>-1&&d%1==0&&d<h}function ar(d,h,b){if(!un(b))return!1;var E=typeof h;return(E=="number"?Sr(b)&&$o(h,b.length):E=="string"&&h in b)?Ai(b[h],d):!1}function F1(d,h){if(ct(d))return!1;var b=typeof d;return b=="number"||b=="symbol"||b=="boolean"||d==null||Yr(d)?!0:qa.test(d)||!Ua.test(d)||h!=null&&d in Ut(h)}function Gae(d){var h=typeof d;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?d!=="__proto__":d===null}function $1(d){var h=Jg(d),b=I[h];if(typeof b!="function"||!(h in Ot.prototype))return!1;if(d===b)return!0;var E=N1(b);return!!E&&d===E[0]}function Yae(d){return!!zA&&zA in d}var Kae=Mg?jo:tw;function ef(d){var h=d&&d.constructor,b=typeof h=="function"&&h.prototype||Oc;return d===b}function zI(d){return d===d&&!un(d)}function BI(d,h){return function(b){return b==null?!1:b[d]===h&&(h!==n||d in Ut(b))}}function Xae(d){var h=om(d,function(E){return b.size===c&&b.clear(),E}),b=h.cache;return h}function Qae(d,h){var b=d[1],E=h[1],T=b|E,R=T<(x|_|A),B=E==A&&b==C||E==A&&b==L&&d[7].length<=h[8]||E==(A|L)&&h[7].length<=h[8]&&b==C;if(!(R||B))return d;E&x&&(d[2]=h[2],T|=b&x?0:S);var W=h[3];if(W){var te=d[3];d[3]=te?SI(te,W,h[4]):W,d[4]=te?Ts(d[3],u):h[4]}return W=h[5],W&&(te=d[5],d[5]=te?CI(te,W,h[6]):W,d[6]=te?Ts(d[5],u):h[6]),W=h[7],W&&(d[7]=W),E&A&&(d[8]=d[8]==null?h[8]:Jn(d[8],h[8])),d[9]==null&&(d[9]=h[9]),d[0]=h[0],d[1]=T,d}function Zae(d){var h=[];if(d!=null)for(var b in Ut(d))h.push(b);return h}function Jae(d){return Tg.call(d)}function VI(d,h,b){return h=Tn(h===n?d.length-1:h,0),function(){for(var E=arguments,T=-1,R=Tn(E.length-h,0),B=ce(R);++T<R;)B[T]=E[h+T];T=-1;for(var W=ce(h+1);++T<h;)W[T]=E[T];return W[h]=b(B),Ur(d,this,W)}}function HI(d,h){return h.length<2?d:nl(d,hi(h,0,-1))}function ele(d,h){for(var b=d.length,E=Jn(h.length,b),T=_r(d);E--;){var R=h[E];d[E]=$o(R,b)?T[R]:n}return d}function j1(d,h){if(!(h==="constructor"&&typeof d[h]=="function")&&h!="__proto__")return d[h]}var WI=qI(hI),tf=gse||function(d,h){return Wn.setTimeout(d,h)},z1=qI(Sae);function UI(d,h,b){var E=h+"";return z1(d,Uae(E,tle(Vae(E),b)))}function qI(d){var h=0,b=0;return function(){var E=yse(),T=oe-(E-b);if(b=E,T>0){if(++h>=V)return arguments[0]}else h=0;return d.apply(n,arguments)}}function tm(d,h){var b=-1,E=d.length,T=E-1;for(h=h===n?E:h;++b<h;){var R=_1(b,T),B=d[R];d[R]=d[b],d[b]=B}return d.length=h,d}var GI=Xae(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace($d,function(b,E,T,R){h.push(T?R.replace(Ce,"$1"):E||b)}),h});function ao(d){if(typeof d=="string"||Yr(d))return d;var h=d+"";return h=="0"&&1/d==-q?"-0":h}function il(d){if(d!=null){try{return Dg.call(d)}catch{}try{return d+""}catch{}}return""}function tle(d,h){return ci(le,function(b){var E="_."+b[0];h&b[1]&&!Eg(d,E)&&d.push(E)}),d.sort()}function YI(d){if(d instanceof Ot)return d.clone();var h=new di(d.__wrapped__,d.__chain__);return h.__actions__=_r(d.__actions__),h.__index__=d.__index__,h.__values__=d.__values__,h}function nle(d,h,b){(b?ar(d,h,b):h===n)?h=1:h=Tn(ht(h),0);var E=d==null?0:d.length;if(!E||h<1)return[];for(var T=0,R=0,B=ce(Fg(E/h));T<E;)B[R++]=hi(d,T,T+=h);return B}function rle(d){for(var h=-1,b=d==null?0:d.length,E=0,T=[];++h<b;){var R=d[h];R&&(T[E++]=R)}return T}function ile(){var d=arguments.length;if(!d)return[];for(var h=ce(d-1),b=arguments[0],E=d;E--;)h[E-1]=arguments[E];return Ds(ct(b)?_r(b):[b],Un(h,1))}var ole=yt(function(d,h){return vn(d)?Kd(d,Un(h,1,vn,!0)):[]}),sle=yt(function(d,h){var b=pi(h);return vn(b)&&(b=n),vn(d)?Kd(d,Un(h,1,vn,!0),Ue(b,2)):[]}),ale=yt(function(d,h){var b=pi(h);return vn(b)&&(b=n),vn(d)?Kd(d,Un(h,1,vn,!0),n,b):[]});function lle(d,h,b){var E=d==null?0:d.length;return E?(h=b||h===n?1:ht(h),hi(d,h<0?0:h,E)):[]}function cle(d,h,b){var E=d==null?0:d.length;return E?(h=b||h===n?1:ht(h),h=E-h,hi(d,0,h<0?0:h)):[]}function ule(d,h){return d&&d.length?Gg(d,Ue(h,3),!0,!0):[]}function dle(d,h){return d&&d.length?Gg(d,Ue(h,3),!0):[]}function fle(d,h,b,E){var T=d==null?0:d.length;return T?(b&&typeof b!="number"&&ar(d,h,b)&&(b=0,E=T),iae(d,h,b,E)):[]}function KI(d,h,b){var E=d==null?0:d.length;if(!E)return-1;var T=b==null?0:ht(b);return T<0&&(T=Tn(E+T,0)),Og(d,Ue(h,3),T)}function XI(d,h,b){var E=d==null?0:d.length;if(!E)return-1;var T=E-1;return b!==n&&(T=ht(b),T=b<0?Tn(E+T,0):Jn(T,E-1)),Og(d,Ue(h,3),T,!0)}function QI(d){var h=d==null?0:d.length;return h?Un(d,1):[]}function hle(d){var h=d==null?0:d.length;return h?Un(d,q):[]}function ple(d,h){var b=d==null?0:d.length;return b?(h=h===n?1:ht(h),Un(d,h)):[]}function gle(d){for(var h=-1,b=d==null?0:d.length,E={};++h<b;){var T=d[h];E[T[0]]=T[1]}return E}function ZI(d){return d&&d.length?d[0]:n}function mle(d,h,b){var E=d==null?0:d.length;if(!E)return-1;var T=b==null?0:ht(b);return T<0&&(T=Tn(E+T,0)),_c(d,h,T)}function vle(d){var h=d==null?0:d.length;return h?hi(d,0,-1):[]}var ble=yt(function(d){var h=an(d,P1);return h.length&&h[0]===d[0]?v1(h):[]}),yle=yt(function(d){var h=pi(d),b=an(d,P1);return h===pi(b)?h=n:b.pop(),b.length&&b[0]===d[0]?v1(b,Ue(h,2)):[]}),xle=yt(function(d){var h=pi(d),b=an(d,P1);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===d[0]?v1(b,n,h):[]});function wle(d,h){return d==null?"":vse.call(d,h)}function pi(d){var h=d==null?0:d.length;return h?d[h-1]:n}function _le(d,h,b){var E=d==null?0:d.length;if(!E)return-1;var T=E;return b!==n&&(T=ht(b),T=T<0?Tn(E+T,0):Jn(T,E-1)),h===h?tse(d,h,T):Og(d,AA,T,!0)}function Sle(d,h){return d&&d.length?cI(d,ht(h)):n}var Cle=yt(JI);function JI(d,h){return d&&d.length&&h&&h.length?w1(d,h):d}function Ele(d,h,b){return d&&d.length&&h&&h.length?w1(d,h,Ue(b,2)):d}function Ole(d,h,b){return d&&d.length&&h&&h.length?w1(d,h,n,b):d}var Ple=Fo(function(d,h){var b=d==null?0:d.length,E=h1(d,h);return fI(d,an(h,function(T){return $o(T,b)?+T:T}).sort(_I)),E});function kle(d,h){var b=[];if(!(d&&d.length))return b;var E=-1,T=[],R=d.length;for(h=Ue(h,3);++E<R;){var B=d[E];h(B,E,d)&&(b.push(B),T.push(E))}return fI(d,T),b}function B1(d){return d==null?d:wse.call(d)}function Mle(d,h,b){var E=d==null?0:d.length;return E?(b&&typeof b!="number"&&ar(d,h,b)?(h=0,b=E):(h=h==null?0:ht(h),b=b===n?E:ht(b)),hi(d,h,b)):[]}function Dle(d,h){return qg(d,h)}function Tle(d,h,b){return C1(d,h,Ue(b,2))}function Ale(d,h){var b=d==null?0:d.length;if(b){var E=qg(d,h);if(E<b&&Ai(d[E],h))return E}return-1}function Ile(d,h){return qg(d,h,!0)}function Nle(d,h,b){return C1(d,h,Ue(b,2),!0)}function Rle(d,h){var b=d==null?0:d.length;if(b){var E=qg(d,h,!0)-1;if(Ai(d[E],h))return E}return-1}function Lle(d){return d&&d.length?pI(d):[]}function Fle(d,h){return d&&d.length?pI(d,Ue(h,2)):[]}function $le(d){var h=d==null?0:d.length;return h?hi(d,1,h):[]}function jle(d,h,b){return d&&d.length?(h=b||h===n?1:ht(h),hi(d,0,h<0?0:h)):[]}function zle(d,h,b){var E=d==null?0:d.length;return E?(h=b||h===n?1:ht(h),h=E-h,hi(d,h<0?0:h,E)):[]}function Ble(d,h){return d&&d.length?Gg(d,Ue(h,3),!1,!0):[]}function Vle(d,h){return d&&d.length?Gg(d,Ue(h,3)):[]}var Hle=yt(function(d){return Ns(Un(d,1,vn,!0))}),Wle=yt(function(d){var h=pi(d);return vn(h)&&(h=n),Ns(Un(d,1,vn,!0),Ue(h,2))}),Ule=yt(function(d){var h=pi(d);return h=typeof h=="function"?h:n,Ns(Un(d,1,vn,!0),n,h)});function qle(d){return d&&d.length?Ns(d):[]}function Gle(d,h){return d&&d.length?Ns(d,Ue(h,2)):[]}function Yle(d,h){return h=typeof h=="function"?h:n,d&&d.length?Ns(d,n,h):[]}function V1(d){if(!(d&&d.length))return[];var h=0;return d=Ms(d,function(b){if(vn(b))return h=Tn(b.length,h),!0}),o1(h,function(b){return an(d,n1(b))})}function eN(d,h){if(!(d&&d.length))return[];var b=V1(d);return h==null?b:an(b,function(E){return Ur(h,n,E)})}var Kle=yt(function(d,h){return vn(d)?Kd(d,h):[]}),Xle=yt(function(d){return O1(Ms(d,vn))}),Qle=yt(function(d){var h=pi(d);return vn(h)&&(h=n),O1(Ms(d,vn),Ue(h,2))}),Zle=yt(function(d){var h=pi(d);return h=typeof h=="function"?h:n,O1(Ms(d,vn),n,h)}),Jle=yt(V1);function ece(d,h){return bI(d||[],h||[],Yd)}function tce(d,h){return bI(d||[],h||[],Zd)}var nce=yt(function(d){var h=d.length,b=h>1?d[h-1]:n;return b=typeof b=="function"?(d.pop(),b):n,eN(d,b)});function tN(d){var h=I(d);return h.__chain__=!0,h}function rce(d,h){return h(d),d}function nm(d,h){return h(d)}var ice=Fo(function(d){var h=d.length,b=h?d[0]:0,E=this.__wrapped__,T=function(R){return h1(R,d)};return h>1||this.__actions__.length||!(E instanceof Ot)||!$o(b)?this.thru(T):(E=E.slice(b,+b+(h?1:0)),E.__actions__.push({func:nm,args:[T],thisArg:n}),new di(E,this.__chain__).thru(function(R){return h&&!R.length&&R.push(n),R}))});function oce(){return tN(this)}function sce(){return new di(this.value(),this.__chain__)}function ace(){this.__values__===n&&(this.__values__=gN(this.value()));var d=this.__index__>=this.__values__.length,h=d?n:this.__values__[this.__index__++];return{done:d,value:h}}function lce(){return this}function cce(d){for(var h,b=this;b instanceof Bg;){var E=YI(b);E.__index__=0,E.__values__=n,h?T.__wrapped__=E:h=E;var T=E;b=b.__wrapped__}return T.__wrapped__=d,h}function uce(){var d=this.__wrapped__;if(d instanceof Ot){var h=d;return this.__actions__.length&&(h=new Ot(this)),h=h.reverse(),h.__actions__.push({func:nm,args:[B1],thisArg:n}),new di(h,this.__chain__)}return this.thru(B1)}function dce(){return vI(this.__wrapped__,this.__actions__)}var fce=Yg(function(d,h,b){Vt.call(d,b)?++d[b]:Ro(d,b,1)});function hce(d,h,b){var E=ct(d)?DA:rae;return b&&ar(d,h,b)&&(h=n),E(d,Ue(h,3))}function pce(d,h){var b=ct(d)?Ms:eI;return b(d,Ue(h,3))}var gce=kI(KI),mce=kI(XI);function vce(d,h){return Un(rm(d,h),1)}function bce(d,h){return Un(rm(d,h),q)}function yce(d,h,b){return b=b===n?1:ht(b),Un(rm(d,h),b)}function nN(d,h){var b=ct(d)?ci:Is;return b(d,Ue(h,3))}function rN(d,h){var b=ct(d)?$oe:JA;return b(d,Ue(h,3))}var xce=Yg(function(d,h,b){Vt.call(d,b)?d[b].push(h):Ro(d,b,[h])});function wce(d,h,b,E){d=Sr(d)?d:Nc(d),b=b&&!E?ht(b):0;var T=d.length;return b<0&&(b=Tn(T+b,0)),lm(d)?b<=T&&d.indexOf(h,b)>-1:!!T&&_c(d,h,b)>-1}var _ce=yt(function(d,h,b){var E=-1,T=typeof h=="function",R=Sr(d)?ce(d.length):[];return Is(d,function(B){R[++E]=T?Ur(h,B,b):Xd(B,h,b)}),R}),Sce=Yg(function(d,h,b){Ro(d,b,h)});function rm(d,h){var b=ct(d)?an:sI;return b(d,Ue(h,3))}function Cce(d,h,b,E){return d==null?[]:(ct(h)||(h=h==null?[]:[h]),b=E?n:b,ct(b)||(b=b==null?[]:[b]),uI(d,h,b))}var Ece=Yg(function(d,h,b){d[b?0:1].push(h)},function(){return[[],[]]});function Oce(d,h,b){var E=ct(d)?e1:NA,T=arguments.length<3;return E(d,Ue(h,4),b,T,Is)}function Pce(d,h,b){var E=ct(d)?joe:NA,T=arguments.length<3;return E(d,Ue(h,4),b,T,JA)}function kce(d,h){var b=ct(d)?Ms:eI;return b(d,sm(Ue(h,3)))}function Mce(d){var h=ct(d)?KA:wae;return h(d)}function Dce(d,h,b){(b?ar(d,h,b):h===n)?h=1:h=ht(h);var E=ct(d)?Zse:_ae;return E(d,h)}function Tce(d){var h=ct(d)?Jse:Cae;return h(d)}function Ace(d){if(d==null)return 0;if(Sr(d))return lm(d)?Cc(d):d.length;var h=er(d);return h==je||h==bt?d.size:y1(d).length}function Ice(d,h,b){var E=ct(d)?t1:Eae;return b&&ar(d,h,b)&&(h=n),E(d,Ue(h,3))}var Nce=yt(function(d,h){if(d==null)return[];var b=h.length;return b>1&&ar(d,h[0],h[1])?h=[]:b>2&&ar(h[0],h[1],h[2])&&(h=[h[0]]),uI(d,Un(h,1),[])}),im=pse||function(){return Wn.Date.now()};function Rce(d,h){if(typeof h!="function")throw new ui(s);return d=ht(d),function(){if(--d<1)return h.apply(this,arguments)}}function iN(d,h,b){return h=b?n:h,h=d&&h==null?d.length:h,Lo(d,A,n,n,n,n,h)}function oN(d,h){var b;if(typeof h!="function")throw new ui(s);return d=ht(d),function(){return--d>0&&(b=h.apply(this,arguments)),d<=1&&(h=n),b}}var H1=yt(function(d,h,b){var E=x;if(b.length){var T=Ts(b,Ac(H1));E|=O}return Lo(d,E,h,b,T)}),sN=yt(function(d,h,b){var E=x|_;if(b.length){var T=Ts(b,Ac(sN));E|=O}return Lo(h,E,d,b,T)});function aN(d,h,b){h=b?n:h;var E=Lo(d,C,n,n,n,n,n,h);return E.placeholder=aN.placeholder,E}function lN(d,h,b){h=b?n:h;var E=Lo(d,P,n,n,n,n,n,h);return E.placeholder=lN.placeholder,E}function cN(d,h,b){var E,T,R,B,W,te,ye=0,xe=!1,Se=!1,Te=!0;if(typeof d!="function")throw new ui(s);h=gi(h)||0,un(b)&&(xe=!!b.leading,Se="maxWait"in b,R=Se?Tn(gi(b.maxWait)||0,h):R,Te="trailing"in b?!!b.trailing:Te);function ze(bn){var Ii=E,Bo=T;return E=T=n,ye=bn,B=d.apply(Bo,Ii),B}function Ge(bn){return ye=bn,W=tf(Et,h),xe?ze(bn):B}function vt(bn){var Ii=bn-te,Bo=bn-ye,kN=h-Ii;return Se?Jn(kN,R-Bo):kN}function Ye(bn){var Ii=bn-te,Bo=bn-ye;return te===n||Ii>=h||Ii<0||Se&&Bo>=R}function Et(){var bn=im();if(Ye(bn))return Pt(bn);W=tf(Et,vt(bn))}function Pt(bn){return W=n,Te&&E?ze(bn):(E=T=n,B)}function Kr(){W!==n&&yI(W),ye=0,E=te=T=W=n}function lr(){return W===n?B:Pt(im())}function Xr(){var bn=im(),Ii=Ye(bn);if(E=arguments,T=this,te=bn,Ii){if(W===n)return Ge(te);if(Se)return yI(W),W=tf(Et,h),ze(te)}return W===n&&(W=tf(Et,h)),B}return Xr.cancel=Kr,Xr.flush=lr,Xr}var Lce=yt(function(d,h){return ZA(d,1,h)}),Fce=yt(function(d,h,b){return ZA(d,gi(h)||0,b)});function $ce(d){return Lo(d,F)}function om(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new ui(s);var b=function(){var E=arguments,T=h?h.apply(this,E):E[0],R=b.cache;if(R.has(T))return R.get(T);var B=d.apply(this,E);return b.cache=R.set(T,B)||R,B};return b.cache=new(om.Cache||No),b}om.Cache=No;function sm(d){if(typeof d!="function")throw new ui(s);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function jce(d){return oN(2,d)}var zce=Oae(function(d,h){h=h.length==1&&ct(h[0])?an(h[0],qr(Ue())):an(Un(h,1),qr(Ue()));var b=h.length;return yt(function(E){for(var T=-1,R=Jn(E.length,b);++T<R;)E[T]=h[T].call(this,E[T]);return Ur(d,this,E)})}),W1=yt(function(d,h){var b=Ts(h,Ac(W1));return Lo(d,O,n,h,b)}),uN=yt(function(d,h){var b=Ts(h,Ac(uN));return Lo(d,k,n,h,b)}),Bce=Fo(function(d,h){return Lo(d,L,n,n,n,h)});function Vce(d,h){if(typeof d!="function")throw new ui(s);return h=h===n?h:ht(h),yt(d,h)}function Hce(d,h){if(typeof d!="function")throw new ui(s);return h=h==null?0:Tn(ht(h),0),yt(function(b){var E=b[h],T=Ls(b,0,h);return E&&Ds(T,E),Ur(d,this,T)})}function Wce(d,h,b){var E=!0,T=!0;if(typeof d!="function")throw new ui(s);return un(b)&&(E="leading"in b?!!b.leading:E,T="trailing"in b?!!b.trailing:T),cN(d,h,{leading:E,maxWait:h,trailing:T})}function Uce(d){return iN(d,1)}function qce(d,h){return W1(k1(h),d)}function Gce(){if(!arguments.length)return[];var d=arguments[0];return ct(d)?d:[d]}function Yce(d){return fi(d,p)}function Kce(d,h){return h=typeof h=="function"?h:n,fi(d,p,h)}function Xce(d){return fi(d,f|p)}function Qce(d,h){return h=typeof h=="function"?h:n,fi(d,f|p,h)}function Zce(d,h){return h==null||QA(d,h,Ln(h))}function Ai(d,h){return d===h||d!==d&&h!==h}var Jce=Zg(m1),eue=Zg(function(d,h){return d>=h}),ol=rI(function(){return arguments}())?rI:function(d){return hn(d)&&Vt.call(d,"callee")&&!HA.call(d,"callee")},ct=ce.isArray,tue=CA?qr(CA):cae;function Sr(d){return d!=null&&am(d.length)&&!jo(d)}function vn(d){return hn(d)&&Sr(d)}function nue(d){return d===!0||d===!1||hn(d)&&sr(d)==re}var Fs=mse||tw,rue=EA?qr(EA):uae;function iue(d){return hn(d)&&d.nodeType===1&&!nf(d)}function oue(d){if(d==null)return!0;if(Sr(d)&&(ct(d)||typeof d=="string"||typeof d.splice=="function"||Fs(d)||Ic(d)||ol(d)))return!d.length;var h=er(d);if(h==je||h==bt)return!d.size;if(ef(d))return!y1(d).length;for(var b in d)if(Vt.call(d,b))return!1;return!0}function sue(d,h){return Qd(d,h)}function aue(d,h,b){b=typeof b=="function"?b:n;var E=b?b(d,h):n;return E===n?Qd(d,h,n,b):!!E}function U1(d){if(!hn(d))return!1;var h=sr(d);return h==we||h==ie||typeof d.message=="string"&&typeof d.name=="string"&&!nf(d)}function lue(d){return typeof d=="number"&&UA(d)}function jo(d){if(!un(d))return!1;var h=sr(d);return h==U||h==Ie||h==de||h==it}function dN(d){return typeof d=="number"&&d==ht(d)}function am(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=K}function un(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function hn(d){return d!=null&&typeof d=="object"}var fN=OA?qr(OA):fae;function cue(d,h){return d===h||b1(d,h,R1(h))}function uue(d,h,b){return b=typeof b=="function"?b:n,b1(d,h,R1(h),b)}function due(d){return hN(d)&&d!=+d}function fue(d){if(Kae(d))throw new ot(o);return iI(d)}function hue(d){return d===null}function pue(d){return d==null}function hN(d){return typeof d=="number"||hn(d)&&sr(d)==We}function nf(d){if(!hn(d)||sr(d)!=be)return!1;var h=Ng(d);if(h===null)return!0;var b=Vt.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&Dg.call(b)==use}var q1=PA?qr(PA):hae;function gue(d){return dN(d)&&d>=-K&&d<=K}var pN=kA?qr(kA):pae;function lm(d){return typeof d=="string"||!ct(d)&&hn(d)&&sr(d)==En}function Yr(d){return typeof d=="symbol"||hn(d)&&sr(d)==cn}var Ic=MA?qr(MA):gae;function mue(d){return d===n}function vue(d){return hn(d)&&er(d)==fe}function bue(d){return hn(d)&&sr(d)==Ee}var yue=Zg(x1),xue=Zg(function(d,h){return d<=h});function gN(d){if(!d)return[];if(Sr(d))return lm(d)?Di(d):_r(d);if(Hd&&d[Hd])return Zoe(d[Hd]());var h=er(d),b=h==je?a1:h==bt?Pg:Nc;return b(d)}function zo(d){if(!d)return d===0?d:0;if(d=gi(d),d===q||d===-q){var h=d<0?-1:1;return h*G}return d===d?d:0}function ht(d){var h=zo(d),b=h%1;return h===h?b?h-b:h:0}function mN(d){return d?tl(ht(d),0,H):0}function gi(d){if(typeof d=="number")return d;if(Yr(d))return D;if(un(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=un(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=RA(d);var b=De.test(d);return b||rt.test(d)?Roe(d.slice(2),b?2:8):Ae.test(d)?D:+d}function vN(d){return so(d,Cr(d))}function wue(d){return d?tl(ht(d),-K,K):d===0?d:0}function jt(d){return d==null?"":Gr(d)}var _ue=Dc(function(d,h){if(ef(h)||Sr(h)){so(h,Ln(h),d);return}for(var b in h)Vt.call(h,b)&&Yd(d,b,h[b])}),bN=Dc(function(d,h){so(h,Cr(h),d)}),cm=Dc(function(d,h,b,E){so(h,Cr(h),d,E)}),Sue=Dc(function(d,h,b,E){so(h,Ln(h),d,E)}),Cue=Fo(h1);function Eue(d,h){var b=Mc(d);return h==null?b:XA(b,h)}var Oue=yt(function(d,h){d=Ut(d);var b=-1,E=h.length,T=E>2?h[2]:n;for(T&&ar(h[0],h[1],T)&&(E=1);++b<E;)for(var R=h[b],B=Cr(R),W=-1,te=B.length;++W<te;){var ye=B[W],xe=d[ye];(xe===n||Ai(xe,Oc[ye])&&!Vt.call(d,ye))&&(d[ye]=R[ye])}return d}),Pue=yt(function(d){return d.push(n,RI),Ur(yN,n,d)});function kue(d,h){return TA(d,Ue(h,3),oo)}function Mue(d,h){return TA(d,Ue(h,3),g1)}function Due(d,h){return d==null?d:p1(d,Ue(h,3),Cr)}function Tue(d,h){return d==null?d:tI(d,Ue(h,3),Cr)}function Aue(d,h){return d&&oo(d,Ue(h,3))}function Iue(d,h){return d&&g1(d,Ue(h,3))}function Nue(d){return d==null?[]:Wg(d,Ln(d))}function Rue(d){return d==null?[]:Wg(d,Cr(d))}function G1(d,h,b){var E=d==null?n:nl(d,h);return E===n?b:E}function Lue(d,h){return d!=null&&$I(d,h,oae)}function Y1(d,h){return d!=null&&$I(d,h,sae)}var Fue=DI(function(d,h,b){h!=null&&typeof h.toString!="function"&&(h=Tg.call(h)),d[h]=b},X1(Er)),$ue=DI(function(d,h,b){h!=null&&typeof h.toString!="function"&&(h=Tg.call(h)),Vt.call(d,h)?d[h].push(b):d[h]=[b]},Ue),jue=yt(Xd);function Ln(d){return Sr(d)?YA(d):y1(d)}function Cr(d){return Sr(d)?YA(d,!0):mae(d)}function zue(d,h){var b={};return h=Ue(h,3),oo(d,function(E,T,R){Ro(b,h(E,T,R),E)}),b}function Bue(d,h){var b={};return h=Ue(h,3),oo(d,function(E,T,R){Ro(b,T,h(E,T,R))}),b}var Vue=Dc(function(d,h,b){Ug(d,h,b)}),yN=Dc(function(d,h,b,E){Ug(d,h,b,E)}),Hue=Fo(function(d,h){var b={};if(d==null)return b;var E=!1;h=an(h,function(R){return R=Rs(R,d),E||(E=R.length>1),R}),so(d,I1(d),b),E&&(b=fi(b,f|g|p,Fae));for(var T=h.length;T--;)E1(b,h[T]);return b});function Wue(d,h){return xN(d,sm(Ue(h)))}var Uue=Fo(function(d,h){return d==null?{}:bae(d,h)});function xN(d,h){if(d==null)return{};var b=an(I1(d),function(E){return[E]});return h=Ue(h),dI(d,b,function(E,T){return h(E,T[0])})}function que(d,h,b){h=Rs(h,d);var E=-1,T=h.length;for(T||(T=1,d=n);++E<T;){var R=d==null?n:d[ao(h[E])];R===n&&(E=T,R=b),d=jo(R)?R.call(d):R}return d}function Gue(d,h,b){return d==null?d:Zd(d,h,b)}function Yue(d,h,b,E){return E=typeof E=="function"?E:n,d==null?d:Zd(d,h,b,E)}var wN=II(Ln),_N=II(Cr);function Kue(d,h,b){var E=ct(d),T=E||Fs(d)||Ic(d);if(h=Ue(h,4),b==null){var R=d&&d.constructor;T?b=E?new R:[]:un(d)?b=jo(R)?Mc(Ng(d)):{}:b={}}return(T?ci:oo)(d,function(B,W,te){return h(b,B,W,te)}),b}function Xue(d,h){return d==null?!0:E1(d,h)}function Que(d,h,b){return d==null?d:mI(d,h,k1(b))}function Zue(d,h,b,E){return E=typeof E=="function"?E:n,d==null?d:mI(d,h,k1(b),E)}function Nc(d){return d==null?[]:s1(d,Ln(d))}function Jue(d){return d==null?[]:s1(d,Cr(d))}function ede(d,h,b){return b===n&&(b=h,h=n),b!==n&&(b=gi(b),b=b===b?b:0),h!==n&&(h=gi(h),h=h===h?h:0),tl(gi(d),h,b)}function tde(d,h,b){return h=zo(h),b===n?(b=h,h=0):b=zo(b),d=gi(d),aae(d,h,b)}function nde(d,h,b){if(b&&typeof b!="boolean"&&ar(d,h,b)&&(h=b=n),b===n&&(typeof h=="boolean"?(b=h,h=n):typeof d=="boolean"&&(b=d,d=n)),d===n&&h===n?(d=0,h=1):(d=zo(d),h===n?(h=d,d=0):h=zo(h)),d>h){var E=d;d=h,h=E}if(b||d%1||h%1){var T=qA();return Jn(d+T*(h-d+Noe("1e-"+((T+"").length-1))),h)}return _1(d,h)}var rde=Tc(function(d,h,b){return h=h.toLowerCase(),d+(b?SN(h):h)});function SN(d){return K1(jt(d).toLowerCase())}function CN(d){return d=jt(d),d&&d.replace(Wt,Goe).replace(Coe,"")}function ide(d,h,b){d=jt(d),h=Gr(h);var E=d.length;b=b===n?E:tl(ht(b),0,E);var T=b;return b-=h.length,b>=0&&d.slice(b,T)==h}function ode(d){return d=jt(d),d&&Ha.test(d)?d.replace(io,Yoe):d}function sde(d){return d=jt(d),d&&Ya.test(d)?d.replace(Ga,"\\$&"):d}var ade=Tc(function(d,h,b){return d+(b?"-":"")+h.toLowerCase()}),lde=Tc(function(d,h,b){return d+(b?" ":"")+h.toLowerCase()}),cde=PI("toLowerCase");function ude(d,h,b){d=jt(d),h=ht(h);var E=h?Cc(d):0;if(!h||E>=h)return d;var T=(h-E)/2;return Qg($g(T),b)+d+Qg(Fg(T),b)}function dde(d,h,b){d=jt(d),h=ht(h);var E=h?Cc(d):0;return h&&E<h?d+Qg(h-E,b):d}function fde(d,h,b){d=jt(d),h=ht(h);var E=h?Cc(d):0;return h&&E<h?Qg(h-E,b)+d:d}function hde(d,h,b){return b||h==null?h=0:h&&(h=+h),xse(jt(d).replace(Ka,""),h||0)}function pde(d,h,b){return(b?ar(d,h,b):h===n)?h=1:h=ht(h),S1(jt(d),h)}function gde(){var d=arguments,h=jt(d[0]);return d.length<3?h:h.replace(d[1],d[2])}var mde=Tc(function(d,h,b){return d+(b?"_":"")+h.toLowerCase()});function vde(d,h,b){return b&&typeof b!="number"&&ar(d,h,b)&&(h=b=n),b=b===n?H:b>>>0,b?(d=jt(d),d&&(typeof h=="string"||h!=null&&!q1(h))&&(h=Gr(h),!h&&Sc(d))?Ls(Di(d),0,b):d.split(h,b)):[]}var bde=Tc(function(d,h,b){return d+(b?" ":"")+K1(h)});function yde(d,h,b){return d=jt(d),b=b==null?0:tl(ht(b),0,d.length),h=Gr(h),d.slice(b,b+h.length)==h}function xde(d,h,b){var E=I.templateSettings;b&&ar(d,h,b)&&(h=n),d=jt(d),h=cm({},h,E,NI);var T=cm({},h.imports,E.imports,NI),R=Ln(T),B=s1(T,R),W,te,ye=0,xe=h.interpolate||Rn,Se="__p += '",Te=l1((h.escape||Rn).source+"|"+xe.source+"|"+(xe===xc?Fe:Rn).source+"|"+(h.evaluate||Rn).source+"|$","g"),ze="//# sourceURL="+(Vt.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Moe+"]")+`
69
69
  `;d.replace(Te,function(Ye,Et,Pt,Kr,lr,Xr){return Pt||(Pt=Kr),Se+=d.slice(ye,Xr).replace(Xa,Koe),Et&&(W=!0,Se+=`' +
@@ -113,20 +113,20 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var U=we(de,ie,le,me,he+
113
113
  * https://www.chartjs.org
114
114
  * (c) 2023 Chart.js Contributors
115
115
  * Released under the MIT License
116
- */function ho(){}const uF=(()=>{let e=0;return()=>e++})();function wt(e){return e===null||typeof e>"u"}function Zt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Ct(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function fn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Dr(e,t){return fn(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const dF=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,eC=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ht(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $t(e,t,n,r){let i,o,s;if(Zt(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(Ct(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Jf(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function eh(e){if(Zt(e))return e.map(eh);if(Ct(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=eh(e[n[i]]);return t}return e}function tC(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function fF(e,t,n,r){if(!tC(e))return;const i=t[e],o=n[e];Ct(i)&&Ct(o)?$i(i,o,r):t[e]=eh(o)}function $i(e,t,n){const r=Zt(t)?t:[t],i=r.length;if(!Ct(e))return e;n=n||{};const o=n.merger||fF;let s;for(let a=0;a<i;++a){if(s=r[a],!Ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)o(l[c],e,s,n)}return e}function ou(e,t){return $i(e,t,{merger:hF})}function hF(e,t,n){if(!tC(e))return;const r=t[e],i=n[e];Ct(r)&&Ct(i)?ou(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eh(i))}const nC={"":e=>e,x:e=>e.x,y:e=>e.y};function pF(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function gF(e){const t=pF(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Jo(e,t){return(nC[t]||(nC[t]=gF(t)))(e)}function tb(e){return e.charAt(0).toUpperCase()+e.slice(1)}const su=e=>typeof e<"u",es=e=>typeof e=="function",rC=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function mF(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Jt=Math.PI,en=2*Jt,vF=en+Jt,th=Number.POSITIVE_INFINITY,bF=Jt/180,pn=Jt/2,Js=Jt/4,iC=Jt*2/3,ts=Math.log10,ji=Math.sign;function au(e,t,n){return Math.abs(e-t)<n}function oC(e){const t=Math.round(e);e=au(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ts(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function yF(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function yl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function xF(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function sC(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function yi(e){return e*(Jt/180)}function nb(e){return e*(180/Jt)}function aC(e){if(!fn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function lC(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Jt&&(o+=en),{angle:o,distance:i}}function rb(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function wF(e,t){return(e-t+vF)%en-Jt}function Tr(e){return(e%en+en)%en}function lu(e,t,n,r){const i=Tr(e),o=Tr(t),s=Tr(n),a=Tr(o-i),l=Tr(s-i),c=Tr(i-o),u=Tr(i-s);return i===o||i===s||r&&o===s||a>l&&c<u}function In(e,t,n){return Math.max(t,Math.min(n,e))}function _F(e){return In(e,-32768,32767)}function po(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ib(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const go=(e,t,n,r)=>ib(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),SF=(e,t,n)=>ib(e,n,r=>e[r][t]>=n);function CF(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const cC=["push","pop","shift","splice","unshift"];function EF(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),cC.forEach(n=>{const r="_onData"+tb(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function uC(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(cC.forEach(o=>{delete e[o]}),delete e._chartjs)}function dC(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const fC=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function hC(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,fC.call(window,()=>{r=!1,e.apply(t,n)}))}}function OF(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const ob=e=>e==="start"?"left":e==="end"?"right":"center",Kn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,PF=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function pC(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(i=In(Math.min(go(a,l,c).lo,n?r:go(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?o=In(Math.max(go(a,s.axis,u,!0).hi+1,n?0:go(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function gC(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const nh=e=>e===0||e===1,mC=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*en/n)),vC=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*en/n)+1,cu={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*pn)+1,easeOutSine:e=>Math.sin(e*pn),easeInOutSine:e=>-.5*(Math.cos(Jt*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=>nh(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=>nh(e)?e:mC(e,.075,.3),easeOutElastic:e=>nh(e)?e:vC(e,.075,.3),easeInOutElastic(e){return nh(e)?e:e<.5?.5*mC(e*2,.1125,.45):.5+.5*vC(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-cu.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?cu.easeInBounce(e*2)*.5:cu.easeOutBounce(e*2-1)*.5+.5};function sb(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function bC(e){return sb(e)?e:new iu(e)}function ab(e){return sb(e)?e:new iu(e).saturate(.5).darken(.1).hexString()}const kF=["x","y","borderWidth","radius","tension"],MF=["color","borderColor","backgroundColor"];function DF(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:MF},numbers:{type:"number",properties:kF}}),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 TF(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yC=new Map;function AF(e,t){t=t||{};const n=e+JSON.stringify(t);let r=yC.get(n);return r||(r=new Intl.NumberFormat(e,t),yC.set(n,r)),r}function uu(e,t,n){return AF(t,n).format(e)}const xC={values(e){return Zt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=IF(e,n)}const s=ts(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),uu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ts(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?xC.numeric.call(this,e,t,n):""}};function IF(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var rh={formatters:xC};function NF(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:rh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ea=Object.create(null),lb=Object.create(null);function du(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function cb(e,t,n){return typeof t=="string"?$i(du(e,t),n):$i(du(e,""),t)}class RF{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=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>ab(i.backgroundColor),this.hoverBorderColor=(r,i)=>ab(i.borderColor),this.hoverColor=(r,i)=>ab(i.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 cb(this,t,n)}get(t){return du(this,t)}describe(t,n){return cb(lb,t,n)}override(t,n){return cb(ea,t,n)}route(t,n,r,i){const o=du(this,t),s=du(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Ct(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ln=new RF({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[DF,TF,NF]);function LF(e){return!e||wt(e.size)||wt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ih(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function FF(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Zt(f))s=ih(e,i,o,s,f);else if(Zt(f))for(c=0,u=f.length;c<u;c++)g=f[c],g!=null&&!Zt(g)&&(s=ih(e,i,o,s,g));e.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[o[l]];o.splice(0,p)}return s}function ta(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function wC(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ub(e,t,n,r){_C(e,t,n,r,null)}function _C(e,t,n,r,i){let o,s,a,l,c,u,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*bF;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,y,0,0,en):e.arc(n,r,y,0,en),e.closePath();break;case"triangle":u=i?i/2:y,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=iC,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=iC,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+Js)*l,f=Math.cos(x+Js)*(i?i/2-c:l),a=Math.sin(x+Js)*l,g=Math.sin(x+Js)*(i?i/2-c:l),e.arc(n-f,r-a,c,x-Jt,x-pn),e.arc(n+g,r-s,c,x-pn,x),e.arc(n+f,r+a,c,x,x+pn),e.arc(n-g,r+s,c,x+pn,x+Jt),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}x+=Js;case"rectRot":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=Js;case"cross":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=Js,f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=i?i/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(i?i/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function mo(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 oh(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function sh(e){e.restore()}function $F(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function jF(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function zF(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),wt(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 BF(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function VF(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function na(e,t,n,r,i,o={}){const s=Zt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,zF(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&VF(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),wt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),BF(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function fu(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Jt,Jt,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Jt,pn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,pn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-pn,!0),e.lineTo(n+s.topLeft,r)}const HF=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,WF=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UF(e,t){const n=(""+e).match(HF);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}const qF=e=>+e||0;function db(e,t){const n={},r=Ct(t),i=r?Object.keys(t):t,o=Ct(e)?r?s=>at(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=qF(o(s));return n}function SC(e){return db(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ra(e){return db(e,["topLeft","topRight","bottomLeft","bottomRight"])}function zn(e){const t=SC(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function xn(e,t){e=e||{},t=t||ln.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=at(e.style,t.style);r&&!(""+r).match(WF)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:at(e.family,t.family),lineHeight:UF(at(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:at(e.weight,t.weight),string:""};return i.string=LF(i),i}function tn(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;o<s;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),n!==void 0&&Zt(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function GF(e,t,n){const{min:r,max:i}=e,o=eC(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function ns(e,t){return Object.assign(Object.create(e),t)}function fb(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=kC("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>fb([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return EC(a,l,()=>t9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return MC(a).includes(l)},ownKeys(a){return MC(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function xl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:CC(e,r),setContext:o=>xl(e,o,n,r),override:o=>xl(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return EC(o,s,()=>KF(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function CC(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:es(n)?n:()=>n,isIndexable:es(r)?r:()=>r}}const YF=(e,t)=>e?e+tb(t):t,hb=(e,t)=>Ct(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function EC(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function KF(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return es(a)&&s.isScriptable(t)&&(a=XF(t,a,e,n)),Zt(a)&&a.length&&(a=QF(t,a,e,s.isIndexable)),hb(t,a)&&(a=xl(a,i,o&&o[t],s)),a}function XF(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),hb(e,l)&&(l=pb(i._scopes,i,e,l)),l}function QF(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Ct(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=pb(c,i,e,u);t.push(xl(f,o,s&&s[e],a))}}return t}function OC(e,t,n){return es(e)?e(t,n):e}const ZF=(e,t)=>e===!0?t:typeof e=="string"?Jo(t,e):void 0;function JF(e,t,n,r,i){for(const o of t){const s=ZF(n,o);if(s){e.add(s);const a=OC(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function pb(e,t,n,r){const i=t._rootScopes,o=OC(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=PC(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=PC(a,s,o,l,r),l===null)?!1:fb(Array.from(a),[""],i,o,()=>e9(t,n,r))}function PC(e,t,n,r,i){for(;n;)n=JF(e,t,n,r,i);return n}function e9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Zt(i)&&Ct(n)?n:i||{}}function t9(e,t,n,r){let i;for(const o of t)if(i=kC(YF(o,e),n),typeof i<"u")return hb(e,i)?pb(n,r,e,i):i}function kC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function MC(e){let t=e._keys;return t||(t=e._keys=n9(e._scopes)),t}function n9(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function DC(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:i.parse(Jo(u,o),c)};return s}const r9=Number.EPSILON||1e-14,wl=(e,t)=>t<e.length&&!e[t].skip&&e[t],TC=e=>e==="x"?"y":"x";function i9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=rb(o,i),l=rb(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,g=r*u;return{previous:{x:o.x-f*(s.x-i.x),y:o.y-f*(s.y-i.y)},next:{x:o.x+g*(s.x-i.x),y:o.y+g*(s.y-i.y)}}}function o9(e,t,n){const r=e.length;let i,o,s,a,l,c=wl(e,0);for(let u=0;u<r-1;++u)if(l=c,c=wl(e,u+1),!(!l||!c)){if(au(t[u],0,r9)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=i*s*t[u],n[u+1]=o*s*t[u])}}function s9(e,t,n="x"){const r=TC(n),i=e.length;let o,s,a,l=wl(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=wl(e,c+1),!a)continue;const u=a[n],f=a[r];s&&(o=(u-s[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=f-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=f+o*t[c])}}function a9(e,t="x"){const n=TC(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=wl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=wl(e,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[n]-l[n])/u:0}o[s]=a?c?ji(i[s-1])!==ji(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}o9(e,i,o),s9(e,o,t)}function ah(e,t,n){return Math.max(Math.min(e,n),t)}function l9(e,t){let n,r,i,o,s,a=mo(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&mo(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=ah(i.cp1x,t.left,t.right),i.cp1y=ah(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ah(i.cp2x,t.left,t.right),i.cp2y=ah(i.cp2y,t.top,t.bottom)))}function c9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")a9(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=i9(c,a,e[Math.min(o+1,s-(r?0:1))%s],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&&l9(e,n)}function gb(){return typeof window<"u"&&typeof document<"u"}function mb(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function lh(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const ch=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function u9(e,t){return ch(e).getPropertyValue(t)}const d9=["top","right","bottom","left"];function ia(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=d9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const f9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function h9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(f9(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function oa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=ch(n),o=i.boxSizing==="border-box",s=ia(i,"padding"),a=ia(i,"border","width"),{x:l,y:c,box:u}=h9(e,n),f=s.left+(u&&a.left),g=s.top+(u&&a.top);let{width:p,height:v}=t;return o&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function p9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=mb(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=ch(o),l=ia(a,"border","width"),c=ia(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=lh(a.maxWidth,o,"clientWidth"),i=lh(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||th,maxHeight:i||th}}const uh=e=>Math.round(e*10)/10;function g9(e,t,n,r){const i=ch(e),o=ia(i,"margin"),s=lh(i.maxWidth,e,"clientWidth")||th,a=lh(i.maxHeight,e,"clientHeight")||th,l=p9(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const g=ia(i,"border","width"),p=ia(i,"padding");c-=p.width+g.width,u-=p.height+g.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=uh(Math.min(c,s,l.maxWidth)),u=uh(Math.min(u,a,l.maxHeight)),c&&!u&&(u=uh(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=uh(Math.floor(u*r))),{width:c,height:u}}function AC(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const m9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gb()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function IC(e,t){const n=u9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function sa(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function v9(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function b9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=sa(e,i,n),a=sa(i,o,n),l=sa(o,t,n),c=sa(s,a,n),u=sa(a,l,n);return sa(c,u,n)}const y9=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,r){return n-r},leftForLtr(n,r){return n-r}}},x9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _l(e,t,n){return e?y9(t,n):x9()}function NC(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function RC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function LC(e){return e==="angle"?{between:lu,compare:wF,normalize:Tr}:{between:po,compare:(t,n)=>t-n,normalize:t=>t}}function FC({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function w9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=LC(r),l=t.length;let{start:c,end:u,loop:f}=e,g,p;if(f){for(c+=l,u+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),i,o);++g)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function $C(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=LC(r),{start:u,end:f,loop:g,style:p}=w9(e,t,n),v=[];let y=!1,x=null,_,S,C;const P=()=>l(i,C,_)&&a(i,C)!==0,O=()=>a(o,_)===0||l(o,C,_),k=()=>y||P(),A=()=>!y||O();for(let L=u,F=u;L<=f;++L)S=t[L%s],!S.skip&&(_=c(S[r]),_!==C&&(y=l(_,i,o),x===null&&k()&&(x=a(_,i)===0?L:F),x!==null&&A()&&(v.push(FC({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=_));return x!==null&&v.push(FC({start:x,end:f,loop:g,count:s,style:p})),v}function jC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=$C(r[i],e.points,t);o.length&&n.push(...o)}return n}function _9(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function S9(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function C9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=_9(n,i,o,r);if(r===!0)return zC(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return zC(e,S9(n,s,l,c),n,t)}function zC(e,t,n,r){return!r||!r.setContext||!n?t:E9(e,t,n,r)}function E9(e,t,n,r){const i=e._chart.getContext(),o=BC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,g=f;function p(v,y,x,_){const S=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=S;for(;n[y%l].skip;)y+=S;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:_}),u=_,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const _=n[g%l];x=BC(r.setContext(ns(i,{type:"segment",p0:y,p1:_,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),O9(x,u)&&p(f,g-1,v.loop,u),y=_,u=x}f<g-1&&p(f,g-1,v.loop,u)}return c}function BC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function O9(e,t){if(!t)return!1;const n=[],r=function(i,o){return sb(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
116
+ */function ho(){}const uF=(()=>{let e=0;return()=>e++})();function wt(e){return e===null||typeof e>"u"}function Jt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Ct(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function fn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Dr(e,t){return fn(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const dF=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,eC=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ht(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $t(e,t,n,r){let i,o,s;if(Jt(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(Ct(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Jf(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function eh(e){if(Jt(e))return e.map(eh);if(Ct(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=eh(e[n[i]]);return t}return e}function tC(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function fF(e,t,n,r){if(!tC(e))return;const i=t[e],o=n[e];Ct(i)&&Ct(o)?$i(i,o,r):t[e]=eh(o)}function $i(e,t,n){const r=Jt(t)?t:[t],i=r.length;if(!Ct(e))return e;n=n||{};const o=n.merger||fF;let s;for(let a=0;a<i;++a){if(s=r[a],!Ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)o(l[c],e,s,n)}return e}function ou(e,t){return $i(e,t,{merger:hF})}function hF(e,t,n){if(!tC(e))return;const r=t[e],i=n[e];Ct(r)&&Ct(i)?ou(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eh(i))}const nC={"":e=>e,x:e=>e.x,y:e=>e.y};function pF(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function gF(e){const t=pF(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Jo(e,t){return(nC[t]||(nC[t]=gF(t)))(e)}function tb(e){return e.charAt(0).toUpperCase()+e.slice(1)}const su=e=>typeof e<"u",es=e=>typeof e=="function",rC=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function mF(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const en=Math.PI,tn=2*en,vF=tn+en,th=Number.POSITIVE_INFINITY,bF=en/180,pn=en/2,Js=en/4,iC=en*2/3,ts=Math.log10,ji=Math.sign;function au(e,t,n){return Math.abs(e-t)<n}function oC(e){const t=Math.round(e);e=au(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ts(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function yF(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function yl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function xF(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function sC(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function yi(e){return e*(en/180)}function nb(e){return e*(180/en)}function aC(e){if(!fn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function lC(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*en&&(o+=tn),{angle:o,distance:i}}function rb(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function wF(e,t){return(e-t+vF)%tn-en}function Tr(e){return(e%tn+tn)%tn}function lu(e,t,n,r){const i=Tr(e),o=Tr(t),s=Tr(n),a=Tr(o-i),l=Tr(s-i),c=Tr(i-o),u=Tr(i-s);return i===o||i===s||r&&o===s||a>l&&c<u}function In(e,t,n){return Math.max(t,Math.min(n,e))}function _F(e){return In(e,-32768,32767)}function po(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ib(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const go=(e,t,n,r)=>ib(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),SF=(e,t,n)=>ib(e,n,r=>e[r][t]>=n);function CF(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const cC=["push","pop","shift","splice","unshift"];function EF(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),cC.forEach(n=>{const r="_onData"+tb(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function uC(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(cC.forEach(o=>{delete e[o]}),delete e._chartjs)}function dC(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const fC=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function hC(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,fC.call(window,()=>{r=!1,e.apply(t,n)}))}}function OF(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const ob=e=>e==="start"?"left":e==="end"?"right":"center",Kn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,PF=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function pC(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(i=In(Math.min(go(a,l,c).lo,n?r:go(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?o=In(Math.max(go(a,s.axis,u,!0).hi+1,n?0:go(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function gC(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const nh=e=>e===0||e===1,mC=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*tn/n)),vC=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*tn/n)+1,cu={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*pn)+1,easeOutSine:e=>Math.sin(e*pn),easeInOutSine:e=>-.5*(Math.cos(en*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=>nh(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=>nh(e)?e:mC(e,.075,.3),easeOutElastic:e=>nh(e)?e:vC(e,.075,.3),easeInOutElastic(e){return nh(e)?e:e<.5?.5*mC(e*2,.1125,.45):.5+.5*vC(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-cu.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?cu.easeInBounce(e*2)*.5:cu.easeOutBounce(e*2-1)*.5+.5};function sb(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function bC(e){return sb(e)?e:new iu(e)}function ab(e){return sb(e)?e:new iu(e).saturate(.5).darken(.1).hexString()}const kF=["x","y","borderWidth","radius","tension"],MF=["color","borderColor","backgroundColor"];function DF(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:MF},numbers:{type:"number",properties:kF}}),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 TF(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yC=new Map;function AF(e,t){t=t||{};const n=e+JSON.stringify(t);let r=yC.get(n);return r||(r=new Intl.NumberFormat(e,t),yC.set(n,r)),r}function uu(e,t,n){return AF(t,n).format(e)}const xC={values(e){return Jt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=IF(e,n)}const s=ts(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),uu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ts(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?xC.numeric.call(this,e,t,n):""}};function IF(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var rh={formatters:xC};function NF(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:rh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ea=Object.create(null),lb=Object.create(null);function du(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function cb(e,t,n){return typeof t=="string"?$i(du(e,t),n):$i(du(e,""),t)}class RF{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=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>ab(i.backgroundColor),this.hoverBorderColor=(r,i)=>ab(i.borderColor),this.hoverColor=(r,i)=>ab(i.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 cb(this,t,n)}get(t){return du(this,t)}describe(t,n){return cb(lb,t,n)}override(t,n){return cb(ea,t,n)}route(t,n,r,i){const o=du(this,t),s=du(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Ct(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ln=new RF({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[DF,TF,NF]);function LF(e){return!e||wt(e.size)||wt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ih(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function FF(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Jt(f))s=ih(e,i,o,s,f);else if(Jt(f))for(c=0,u=f.length;c<u;c++)g=f[c],g!=null&&!Jt(g)&&(s=ih(e,i,o,s,g));e.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[o[l]];o.splice(0,p)}return s}function ta(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function wC(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ub(e,t,n,r){_C(e,t,n,r,null)}function _C(e,t,n,r,i){let o,s,a,l,c,u,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*bF;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,y,0,0,tn):e.arc(n,r,y,0,tn),e.closePath();break;case"triangle":u=i?i/2:y,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=iC,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=iC,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+Js)*l,f=Math.cos(x+Js)*(i?i/2-c:l),a=Math.sin(x+Js)*l,g=Math.sin(x+Js)*(i?i/2-c:l),e.arc(n-f,r-a,c,x-en,x-pn),e.arc(n+g,r-s,c,x-pn,x),e.arc(n+f,r+a,c,x,x+pn),e.arc(n-g,r+s,c,x+pn,x+en),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}x+=Js;case"rectRot":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=Js;case"cross":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=Js,f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=i?i/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(i?i/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function mo(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 oh(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function sh(e){e.restore()}function $F(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function jF(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function zF(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),wt(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 BF(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function VF(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function na(e,t,n,r,i,o={}){const s=Jt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,zF(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&VF(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),wt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),BF(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function fu(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*en,en,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,en,pn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,pn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-pn,!0),e.lineTo(n+s.topLeft,r)}const HF=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,WF=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UF(e,t){const n=(""+e).match(HF);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}const qF=e=>+e||0;function db(e,t){const n={},r=Ct(t),i=r?Object.keys(t):t,o=Ct(e)?r?s=>at(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=qF(o(s));return n}function SC(e){return db(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ra(e){return db(e,["topLeft","topRight","bottomLeft","bottomRight"])}function zn(e){const t=SC(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function xn(e,t){e=e||{},t=t||ln.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=at(e.style,t.style);r&&!(""+r).match(WF)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:at(e.family,t.family),lineHeight:UF(at(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:at(e.weight,t.weight),string:""};return i.string=LF(i),i}function nn(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;o<s;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),n!==void 0&&Jt(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function GF(e,t,n){const{min:r,max:i}=e,o=eC(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function ns(e,t){return Object.assign(Object.create(e),t)}function fb(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=kC("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>fb([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return EC(a,l,()=>t9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return MC(a).includes(l)},ownKeys(a){return MC(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function xl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:CC(e,r),setContext:o=>xl(e,o,n,r),override:o=>xl(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return EC(o,s,()=>KF(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function CC(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:es(n)?n:()=>n,isIndexable:es(r)?r:()=>r}}const YF=(e,t)=>e?e+tb(t):t,hb=(e,t)=>Ct(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function EC(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function KF(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return es(a)&&s.isScriptable(t)&&(a=XF(t,a,e,n)),Jt(a)&&a.length&&(a=QF(t,a,e,s.isIndexable)),hb(t,a)&&(a=xl(a,i,o&&o[t],s)),a}function XF(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),hb(e,l)&&(l=pb(i._scopes,i,e,l)),l}function QF(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Ct(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=pb(c,i,e,u);t.push(xl(f,o,s&&s[e],a))}}return t}function OC(e,t,n){return es(e)?e(t,n):e}const ZF=(e,t)=>e===!0?t:typeof e=="string"?Jo(t,e):void 0;function JF(e,t,n,r,i){for(const o of t){const s=ZF(n,o);if(s){e.add(s);const a=OC(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function pb(e,t,n,r){const i=t._rootScopes,o=OC(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=PC(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=PC(a,s,o,l,r),l===null)?!1:fb(Array.from(a),[""],i,o,()=>e9(t,n,r))}function PC(e,t,n,r,i){for(;n;)n=JF(e,t,n,r,i);return n}function e9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Jt(i)&&Ct(n)?n:i||{}}function t9(e,t,n,r){let i;for(const o of t)if(i=kC(YF(o,e),n),typeof i<"u")return hb(e,i)?pb(n,r,e,i):i}function kC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function MC(e){let t=e._keys;return t||(t=e._keys=n9(e._scopes)),t}function n9(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function DC(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:i.parse(Jo(u,o),c)};return s}const r9=Number.EPSILON||1e-14,wl=(e,t)=>t<e.length&&!e[t].skip&&e[t],TC=e=>e==="x"?"y":"x";function i9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=rb(o,i),l=rb(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,g=r*u;return{previous:{x:o.x-f*(s.x-i.x),y:o.y-f*(s.y-i.y)},next:{x:o.x+g*(s.x-i.x),y:o.y+g*(s.y-i.y)}}}function o9(e,t,n){const r=e.length;let i,o,s,a,l,c=wl(e,0);for(let u=0;u<r-1;++u)if(l=c,c=wl(e,u+1),!(!l||!c)){if(au(t[u],0,r9)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=i*s*t[u],n[u+1]=o*s*t[u])}}function s9(e,t,n="x"){const r=TC(n),i=e.length;let o,s,a,l=wl(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=wl(e,c+1),!a)continue;const u=a[n],f=a[r];s&&(o=(u-s[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=f-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=f+o*t[c])}}function a9(e,t="x"){const n=TC(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=wl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=wl(e,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[n]-l[n])/u:0}o[s]=a?c?ji(i[s-1])!==ji(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}o9(e,i,o),s9(e,o,t)}function ah(e,t,n){return Math.max(Math.min(e,n),t)}function l9(e,t){let n,r,i,o,s,a=mo(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&mo(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=ah(i.cp1x,t.left,t.right),i.cp1y=ah(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ah(i.cp2x,t.left,t.right),i.cp2y=ah(i.cp2y,t.top,t.bottom)))}function c9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")a9(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=i9(c,a,e[Math.min(o+1,s-(r?0:1))%s],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&&l9(e,n)}function gb(){return typeof window<"u"&&typeof document<"u"}function mb(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function lh(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const ch=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function u9(e,t){return ch(e).getPropertyValue(t)}const d9=["top","right","bottom","left"];function ia(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=d9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const f9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function h9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(f9(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function oa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=ch(n),o=i.boxSizing==="border-box",s=ia(i,"padding"),a=ia(i,"border","width"),{x:l,y:c,box:u}=h9(e,n),f=s.left+(u&&a.left),g=s.top+(u&&a.top);let{width:p,height:v}=t;return o&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function p9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=mb(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=ch(o),l=ia(a,"border","width"),c=ia(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=lh(a.maxWidth,o,"clientWidth"),i=lh(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||th,maxHeight:i||th}}const uh=e=>Math.round(e*10)/10;function g9(e,t,n,r){const i=ch(e),o=ia(i,"margin"),s=lh(i.maxWidth,e,"clientWidth")||th,a=lh(i.maxHeight,e,"clientHeight")||th,l=p9(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const g=ia(i,"border","width"),p=ia(i,"padding");c-=p.width+g.width,u-=p.height+g.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=uh(Math.min(c,s,l.maxWidth)),u=uh(Math.min(u,a,l.maxHeight)),c&&!u&&(u=uh(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=uh(Math.floor(u*r))),{width:c,height:u}}function AC(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const m9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};gb()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function IC(e,t){const n=u9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function sa(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function v9(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function b9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=sa(e,i,n),a=sa(i,o,n),l=sa(o,t,n),c=sa(s,a,n),u=sa(a,l,n);return sa(c,u,n)}const y9=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,r){return n-r},leftForLtr(n,r){return n-r}}},x9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _l(e,t,n){return e?y9(t,n):x9()}function NC(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function RC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function LC(e){return e==="angle"?{between:lu,compare:wF,normalize:Tr}:{between:po,compare:(t,n)=>t-n,normalize:t=>t}}function FC({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function w9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=LC(r),l=t.length;let{start:c,end:u,loop:f}=e,g,p;if(f){for(c+=l,u+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),i,o);++g)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function $C(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=LC(r),{start:u,end:f,loop:g,style:p}=w9(e,t,n),v=[];let y=!1,x=null,_,S,C;const P=()=>l(i,C,_)&&a(i,C)!==0,O=()=>a(o,_)===0||l(o,C,_),k=()=>y||P(),A=()=>!y||O();for(let L=u,F=u;L<=f;++L)S=t[L%s],!S.skip&&(_=c(S[r]),_!==C&&(y=l(_,i,o),x===null&&k()&&(x=a(_,i)===0?L:F),x!==null&&A()&&(v.push(FC({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=_));return x!==null&&v.push(FC({start:x,end:f,loop:g,count:s,style:p})),v}function jC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=$C(r[i],e.points,t);o.length&&n.push(...o)}return n}function _9(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function S9(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function C9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=_9(n,i,o,r);if(r===!0)return zC(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return zC(e,S9(n,s,l,c),n,t)}function zC(e,t,n,r){return!r||!r.setContext||!n?t:E9(e,t,n,r)}function E9(e,t,n,r){const i=e._chart.getContext(),o=BC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,f=t[0].start,g=f;function p(v,y,x,_){const S=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=S;for(;n[y%l].skip;)y+=S;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:_}),u=_,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const _=n[g%l];x=BC(r.setContext(ns(i,{type:"segment",p0:y,p1:_,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),O9(x,u)&&p(f,g-1,v.loop,u),y=_,u=x}f<g-1&&p(f,g-1,v.loop,u)}return c}function BC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function O9(e,t){if(!t)return!1;const n=[],r=function(i,o){return sb(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
117
117
  * Chart.js v4.4.1
118
118
  * https://www.chartjs.org
119
119
  * (c) 2023 Chart.js Contributors
120
120
  * Released under the MIT License
121
- */class P9{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=fC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var vo=new P9;const VC="transparent",k9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=bC(e||VC),i=r.valid&&bC(t||VC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class M9{constructor(t,n,r,i){const o=n[r];i=tn([t.to,i,o,t.from]);const s=tn([t.from,o,i]);this._active=!0,this._fn=t.fn||k9[t.type||typeof s],this._easing=cu[t.easing]||cu.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=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=tn([t.to,n,i,t.from]),this._from=tn([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class HC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ct(t))return;const n=Object.keys(ln.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ct(o))return;const s={};for(const a of n)s[a]=o[a];(Zt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=T9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&D9(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,u,a);continue}else f.cancel();if(!g||!g.duration){t[c]=u;continue}o[c]=f=new M9(g,t,c,u),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return vo.add(this._chart,r),!0}}function D9(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function T9(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 WC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function A9(e,t,n){if(n===!1)return!1;const r=WC(e,n),i=WC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function I9(e){let t,n,r,i;return Ct(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function UC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function qC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],fn(c)&&(o||t===0||ji(t)===ji(c))&&(t+=c)}return t}}function N9(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function GC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function R9(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function L9(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function F9(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function YC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function KC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=R9(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,_=v._stacks||(v._stacks={});g=_[c]=F9(i,u,y),g[a]=x,g._top=YC(g,s,!0,r.type),g._bottom=YC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function vb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function $9(e,t){return ns(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function j9(e,t,n){return ns(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hu(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const bb=e=>e==="reset"||e==="none",XC=(e,t)=>t?e:Object.assign({},e),z9=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:UC(n,!0),values:null};class xi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=GC(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&&hu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=at(r.xAxisID,vb(t,"x")),s=n.yAxisID=at(r.yAxisID,vb(t,"y")),a=n.rAxisID=at(r.rAxisID,vb(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&uC(this._data,this),t._stacked&&hu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ct(n))this._data=N9(n);else if(r!==n){if(r){uC(r,this);const i=this._cachedMeta;hu(i),i._parsed=[]}n&&Object.isExtensible(n)&&EF(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=GC(n.vScale,n),n.stack!==r.stack&&(i=!0,hu(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&KC(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Zt(i[t])?g=this.parseArrayData(r,i,t,n):Ct(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=g[u],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&KC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),u=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:u||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,u,f;for(l=0,c=i;l<c;++l)u=l+r,f=n[u],a[l]={x:o.parse(f[0],u),y:s.parse(f[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,f,g,p;for(u=0,f=i;u<f;++u)g=u+r,p=n[g],c[u]={x:o.parse(Jo(p,a),g),y:s.parse(Jo(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:UC(i,!0),values:n._stacks[t.axis]._visualValues};return qC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=qC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=z9(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=L9(a);let g,p;function v(){p=i[g];const y=p[a.axis];return!fn(p[t.axis])||u>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],fn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=I9(at(this.options.clip,A9(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const f=i[u];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(u=0;u<s.length;++u)s[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=j9(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=$9(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,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",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&su(r);if(a)return XC(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),u),p=Object.keys(ln.elements[t]),v=()=>this.getContext(r,i,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(XC(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),g=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(g,this.getContext(t,r,n))}const c=new HC(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||bb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){bb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!bb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&hu(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Me(xi,"defaults",{}),Me(xi,"datasetElementType",null),Me(xi,"dataElementType",null);function B9(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=dC(r.sort((i,o)=>i-o))}return e._cache.$bar}function V9(e){const t=e.iScale,n=B9(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(su(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function H9(e,t,n,r){const i=n.barThickness;let o,s;return wt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function W9(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function U9(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function QC(e,t,n,r){return Zt(e)?U9(e,t,n,r):t[n.axis]=n.parse(e,r),t}function ZC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,u,f,g;for(c=n,u=n+r;c<u;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(QC(g,f,o,c));return l}function yb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function q9(e,t,n){return e!==0?ji(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function G9(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function Y9(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=G9(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[JC(u,s,a,l)]=!0,i=c)),o[JC(i,s,a,l)]=!0,e.borderSkipped=o}function JC(e,t,n,r){return r?(e=K9(e,t,n),e=eE(e,n,t)):e=eE(e,t,n),e}function K9(e,t,n){return e===t?n:e===n?t:e}function eE(e,t,n){return e==="start"?t:e==="end"?n:e}function X9(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class dh extends xi{parsePrimitiveData(t,n,r,i){return ZC(t,n,r,i)}parseArrayData(t,n,r,i){return ZC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+i;g<p;++g)y=n[g],v={},v[o.axis]=o.parse(Jo(y,c),g),f.push(QC(Jo(y,u),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=yb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=o||wt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),_=(v._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!_||yb(v._custom)||s===_._top||s===_._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;Y9(S,C,_,s),X9(S,C,u.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(wt(u)||isNaN(u))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||V9(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=yb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),u&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&ji(f)!==ji(c.barEnd)&&(g=0),g+=f);const x=!wt(o)&&!u?o:g;let _=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=_,y=v-_,Math.abs(y)<s){y=q9(y,n,a)*s,f===a&&(_-=y/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);_=Math.max(Math.min(_,O),P),v=_+y,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(_))}if(_===n.getPixelForValue(a)){const S=ji(y)*n.getLineWidthForValue(a)/2;_+=S,y-=S}return{size:y,base:_,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=at(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,u=i.barThickness==="flex"?W9(t,n,i,c):H9(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}Me(dh,"id","bar"),Me(dh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(dh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class fh extends xi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=at(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=at(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),y={},x=y[u]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),_=y[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(_),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(y.options.radius=0)),this.updateElement(p,g,y,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=at(r&&r._custom,o),i}}Me(fh,"id","bubble"),Me(fh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(fh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Q9(e,t,n){let r=1,i=1,o=0,s=0;if(t<en){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>lu(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>lu(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),y=p(0,c,f),x=p(pn,u,g),_=v(Jt,c,f),S=v(Jt+pn,u,g);r=(y-_)/2,i=(x-S)/2,o=-(y+_)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class aa extends xi{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Ct(r[t])){const{key:l="value"}=this._parsing;o=c=>+Jo(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return yi(this.options.rotation-90)}_getCircumference(){return yi(this.options.circumference)}_getRotationExtents(){let t=en,n=-en;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(dF(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=Q9(f,u,l),x=(r.width-s)/g,_=(r.height-s)/p,S=Math.max(Math.min(x,_)/2,0),C=eC(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/en)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,i);let _=this._getRotation(),S;for(S=0;S<n;++S)_+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:u+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=y||this.resolveDataElementOptions(S,P.active?"active":i)),_+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?en*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=uu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me(aa,"id","doughnut"),Me(aa,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Me(aa,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(aa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class hh extends xi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=pC(n,i,s);this._drawStart=a,this._drawCount=l,gC(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=yl(v)?v:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],A=_?k:{};if(O<n||O>=S){A.skip=!0;continue}const L=this.getParsed(O),F=wt(L[p]),j=A[g]=s.getPixelForValue(L[g],O),z=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],O);A.skip=isNaN(j)||isNaN(z)||F,A.stop=O>0&&Math.abs(L[g]-P[g])>x,y&&(A.parsed=L,A.raw=c.data[O]),f&&(A.options=u||this.resolveDataElementOptions(O,k.active?"active":i)),_||this.updateElement(k,O,A,i),P=L}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(hh,"id","line"),Me(hh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(hh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pu extends xi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=uu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return DC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Jt;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,y);for(v=n;v<n+r;v++){const x=t[v];let _=p,S=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(_=S=g));const P={x:u,y:f,innerRadius:0,outerRadius:C,startAngle:_,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?yi(this.resolveDataElementOptions(t,n).angle||r):0}}Me(pu,"id","polarArea"),Me(pu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(pu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class xb extends aa{}Me(xb,"id","pie"),Me(xb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ph extends xi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return DC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:u.x,g=s?o.yCenter:u.y,p={x:f,y:g,angle:u.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}Me(ph,"id","radar"),Me(ph,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(ph,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class gh extends xi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=pC(n,r,i);if(this._drawStart=o,this._drawCount=s,gC(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,_=yl(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),A=S?O:{},L=wt(k[v]),F=A[p]=s.getPixelForValue(k[p],P),j=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);A.skip=isNaN(F)||isNaN(j)||L,A.stop=P>0&&Math.abs(k[p]-C[p])>_,x&&(A.parsed=k,A.raw=c.data[P]),g&&(A.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,A,i),C=k}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Me(gh,"id","scatter"),Me(gh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(gh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Z9=Object.freeze({__proto__:null,BarController:dh,BubbleController:fh,DoughnutController:aa,LineController:hh,PieController:xb,PolarAreaController:pu,RadarController:ph,ScatterController:gh});function la(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wb{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(wb.prototype,t)}init(){}formats(){return la()}parse(){return la()}format(){return la()}add(){return la()}diff(){return la()}startOf(){return la()}endOf(){return la()}}var J9={_date:wb};function e$(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?SF:go;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(o,t,n-u),g=l(o,t,n+u);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function gu(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:f,hi:g}=e$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=u[p];v.skip||r(v,c,p)}}}function t$(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function _b(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||gu(e,n,t,function(a,l,c){!i&&!mo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function n$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=lC(s,{x:t.x,y:t.y});lu(f,c,u)&&i.push({element:s,datasetIndex:a,index:l})}return gu(e,n,t,o),i}function r$(e,t,n,r,i,o){let s=[];const a=t$(n);let l=Number.POSITIVE_INFINITY;function c(u,f,g){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const v=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:u,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:u,datasetIndex:f,index:g})}return gu(e,n,t,c),s}function Sb(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?n$(e,t,n,i):r$(e,t,n,r,i,o)}function tE(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return gu(e,n,t,(l,c,u)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var i$={evaluateInteractionItems:gu,modes:{index(e,t,n,r){const i=oa(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?_b(e,i,o,r,s):Sb(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?_b(e,i,o,r,s):Sb(e,i,o,!1,r,s);if(a.length>0){const 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,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return _b(e,i,o,r,s)},nearest(e,t,n,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Sb(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=oa(t,e);return tE(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=oa(t,e);return tE(e,i,"y",n.intersect,r)}}};const nE=["left","top","right","bottom"];function mu(e,t){return e.filter(n=>n.pos===t)}function rE(e,t){return e.filter(n=>nE.indexOf(n.pos)===-1&&n.box.axis===t)}function vu(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function o$(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function s$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!nE.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function a$(e,t){const n=s$(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function l$(e){const t=o$(e),n=vu(t.filter(c=>c.box.fullSize),!0),r=vu(mu(t,"left"),!0),i=vu(mu(t,"right")),o=vu(mu(t,"top"),!0),s=vu(mu(t,"bottom")),a=rE(t,"x"),l=rE(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:mu(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function iE(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function oE(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 c$(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Ct(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&oE(s,o.getPadding());const a=Math.max(0,t.outerWidth-iE(s,e,"left","right")),l=Math.max(0,t.outerHeight-iE(s,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 u$(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function d$(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function bu(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,d$(a.horizontal,t));const{same:f,other:g}=c$(t,n,a,r);c|=f&&i.length,u=u||g,l.fullSize||i.push(a)}return c&&bu(i,t,n,r)||u}function mh(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function sE(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,g=c.size||l.height;su(c.start)&&(s=c.start),l.fullSize?mh(l,i.left,s,n.outerWidth-i.right-i.left,g):mh(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,g=c.size||l.width;su(c.start)&&(o=c.start),l.fullSize?mh(l,o,i.top,g,n.outerHeight-i.bottom-i.top):mh(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var Xn={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){const 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,r){if(!e)return;const i=zn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=l$(e.boxes),l=a.vertical,c=a.horizontal;$t(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),g=Object.assign({},i);oE(g,zn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=a$(l.concat(c),f);bu(a.fullSize,p,f,v),bu(l,p,f,v),bu(c,p,f,v)&&bu(l,p,f,v),u$(p),sE(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,sE(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$t(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class aE{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class f$ extends aE{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vh="$chartjs",h$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lE=e=>e===null||e==="";function p$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[vh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",lE(i)){const o=IC(e,"width");o!==void 0&&(e.width=o)}if(lE(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=IC(e,"height");o!==void 0&&(e.height=o)}return e}const cE=m9?{passive:!0}:!1;function g$(e,t,n){e.addEventListener(t,n,cE)}function m$(e,t,n){e.canvas.removeEventListener(t,n,cE)}function v$(e,t){const n=h$[e.type]||e.type,{x:r,y:i}=oa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function bh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function b$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||bh(a.addedNodes,r),s=s&&!bh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function y$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||bh(a.removedNodes,r),s=s&&!bh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const yu=new Map;let uE=0;function dE(){const e=window.devicePixelRatio;e!==uE&&(uE=e,yu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function x$(e,t){yu.size||window.addEventListener("resize",dE),yu.set(e,t)}function w$(e){yu.delete(e),yu.size||window.removeEventListener("resize",dE)}function _$(e,t,n){const r=e.canvas,i=r&&mb(r);if(!i)return;const o=hC((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),x$(e,o),s}function Cb(e,t,n){n&&n.disconnect(),t==="resize"&&w$(e)}function S$(e,t,n){const r=e.canvas,i=hC(o=>{e.ctx!==null&&n(v$(o,e))},e);return g$(r,t,i),i}class C$ extends aE{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(p$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[vh])return!1;const r=n[vh].initial;["height","width"].forEach(o=>{const s=r[o];wt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[vh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:b$,detach:y$,resize:_$}[n]||S$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Cb,detach:Cb,resize:Cb}[n]||m$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return g9(t,n,r,i)}isAttached(t){const n=mb(t);return!!(n&&n.isConnected)}}function E$(e){return!gb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?f$:C$}let bo=(Sg=class{constructor(){Me(this,"x");Me(this,"y");Me(this,"active",!1);Me(this,"options");Me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return yl(this.x)&&yl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Me(Sg,"defaults",{}),Me(Sg,"defaultRoutes"),Sg);function O$(e,t){const n=e.options.ticks,r=P$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?M$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return D$(t,c,o,s/i),c;const u=k$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(yh(t,c,u,wt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)yh(t,c,u,o[f],o[f+1]);return yh(t,c,u,l,wt(p)?t.length:l+p),c}return yh(t,c,u),c}function P$(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function k$(e,t,n){const r=T$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=yF(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function M$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function D$(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function yh(e,t,n,r,i){const o=at(r,0),s=Math.min(at(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function T$(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const A$=e=>e==="left"?"right":e==="right"?"left":e,fE=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,hE=(e,t)=>Math.min(t||e,e);function pE(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function I$(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function N$(e,t){$t(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function xu(e){return e.drawTicks?e.tickLength:0}function gE(e,t){if(!e.display)return 0;const n=xn(e.font,t),r=zn(e.padding);return(Zt(e.text)?e.text.length:1)*n.lineHeight+r.height}function R$(e,t){return ns(e,{scale:t,type:"scale"})}function L$(e,t,n){return ns(e,{tick:n,index:t,type:"tick"})}function F$(e,t,n){let r=ob(e);return(n&&t!=="right"||!n&&t==="right")&&(r=A$(r)),r}function $$(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,g,p,v;const y=s-i,x=a-o;if(e.isHorizontal()){if(p=Kn(r,o,a),Ct(n)){const _=Object.keys(n)[0],S=n[_];v=u[_].getPixelForValue(S)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=fE(e,n,t);g=a-o}else{if(Ct(n)){const _=Object.keys(n)[0],S=n[_];p=u[_].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=fE(e,n,t);v=Kn(r,s,i),f=n==="left"?-pn:pn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class ca extends bo{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:r,_suggestedMax:i}=this;return t=Dr(t,Number.POSITIVE_INFINITY),n=Dr(n,Number.NEGATIVE_INFINITY),r=Dr(r,Number.POSITIVE_INFINITY),i=Dr(i,Number.NEGATIVE_INFINITY),{min:Dr(t,r),max:Dr(n,i),minDefined:fn(t),maxDefined:fn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Dr(n,Dr(r,n)),max:Dr(r,Dr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){Ht(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=GF(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?pE(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=O$(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,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ht(this.options.afterUpdate,[this])}beforeSetDimensions(){Ht(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(){Ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=Ht(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=hE(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,g=u.highest.height,p=In(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-xu(t.grid)-n.padding-gE(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=nb(Math.min(Math.asin(In((u.highest.height+6)/a,-1,1)),Math.asin(In(l/c,-1,1))-Math.asin(In(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ht(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=gE(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=xu(o)+l):(t.height=this.maxHeight,t.width=xu(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=yi(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const _=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(c,u,x,y)}}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,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+s,this.paddingBottom=f+s}}_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(){Ht(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)wt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=pE(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/hE(n,r));let c=0,u=0,f,g,p,v,y,x,_,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),i.font=x=y.string,_=o[x]=o[x]||{data:{},gc:[]},S=y.lineHeight,C=P=0,!wt(v)&&!Zt(v))C=ih(i,_.data,_.gc,C,v),P=S;else if(Zt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!wt(O)&&!Zt(O)&&(C=ih(i,_.data,_.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),u=Math.max(P,u)}N$(o,n);const k=s.indexOf(c),A=a.indexOf(u),L=F=>({width:s[F]||0,height:a[F]||0});return{first:L(0),last:L(n-1),widest:L(k),highest:L(A),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return _F(this._alignToPixels?ta(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=L$(this.getContext(),t,r))}return this.$context||(this.$context=R$(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=yi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=xu(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,_=function(J){return ta(r,J,y)};let S,C,P,O,k,A,L,F,j,z,V,oe;if(s==="top")S=_(this.bottom),A=this.bottom-g,F=S-x,z=_(t.top)+x,oe=t.bottom;else if(s==="bottom")S=_(this.top),z=t.top,oe=_(t.bottom)-x,A=S+x,F=this.top+g;else if(s==="left")S=_(this.right),k=this.right-g,L=S-x,j=_(t.left)+x,V=t.right;else if(s==="right")S=_(this.left),j=t.left,V=_(t.right)-x,k=S+x,L=this.left+g;else if(n==="x"){if(s==="center")S=_((t.top+t.bottom)/2+.5);else if(Ct(s)){const J=Object.keys(s)[0],q=s[J];S=_(this.chart.scales[J].getPixelForValue(q))}z=t.top,oe=t.bottom,A=S+x,F=A+g}else if(n==="y"){if(s==="center")S=_((t.left+t.right)/2);else if(Ct(s)){const J=Object.keys(s)[0],q=s[J];S=_(this.chart.scales[J].getPixelForValue(q))}k=S-x,L=k-g,j=t.left,V=t.right}const ee=at(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/ee));for(C=0;C<f;C+=$){const J=this.getContext(C),q=o.setContext(J),K=a.setContext(J),G=q.lineWidth,D=q.color,H=K.dash||[],ne=K.dashOffset,N=q.tickWidth,le=q.tickColor,me=q.tickBorderDash||[],he=q.tickBorderDashOffset;P=I$(this,C,l),P!==void 0&&(O=ta(r,P,G),c?k=L=j=V=O:A=F=z=oe=O,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:j,y1:z,x2:V,y2:oe,width:G,color:D,borderDash:H,borderDashOffset:ne,tickWidth:N,tickColor:le,tickBorderDash:me,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=o,g=xu(r.grid),p=g+u,v=f?-u:p,y=-yi(this.labelRotation),x=[];let _,S,C,P,O,k,A,L,F,j,z,V,oe="middle";if(i==="top")k=this.bottom-v,A=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,A=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(Ct(i)){const $=Object.keys(i)[0],J=i[$];k=this.chart.scales[$].getPixelForValue(J)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(Ct(i)){const $=Object.keys(i)[0],J=i[$];O=this.chart.scales[$].getPixelForValue(J)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?oe="top":l==="end"&&(oe="bottom"));const ee=this._getLabelSizes();for(_=0,S=a.length;_<S;++_){C=a[_],P=C.label;const $=o.setContext(this.getContext(_));L=this.getPixelForTick(_)+o.labelOffset,F=this._resolveTickFontOptions(_),j=F.lineHeight,z=Zt(P)?P.length:1;const J=z/2,q=$.color,K=$.textStrokeColor,G=$.textStrokeWidth;let D=A;s?(O=L,A==="inner"&&(_===S-1?D=this.options.reverse?"left":"right":_===0?D=this.options.reverse?"right":"left":D="center"),i==="top"?c==="near"||y!==0?V=-z*j+j/2:c==="center"?V=-ee.highest.height/2-J*j+j:V=-ee.highest.height+j/2:c==="near"||y!==0?V=j/2:c==="center"?V=ee.highest.height/2-J*j:V=ee.highest.height-z*j,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(y))):(k=L,V=(1-z)*j/2);let H;if($.showLabelBackdrop){const ne=zn($.backdropPadding),N=ee.heights[_],le=ee.widths[_];let me=V-ne.top,he=0-ne.left;switch(oe){case"middle":me-=N/2;break;case"bottom":me-=N;break}switch(A){case"center":he-=le/2;break;case"right":he-=le;break;case"inner":_===S-1?he-=le:_>0&&(he-=le/2);break}H={left:he,top:me,width:le+ne.width,height:N+ne.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:y,color:q,strokeColor:K,strokeWidth:G,textAlign:D,textBaseline:oe,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-yi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const 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(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[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(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,g;this.isHorizontal()?(c=ta(t,this.left,s)-s/2,u=ta(t,this.right,a)+a/2,f=g=l):(f=ta(t,this.top,s)-s/2,g=ta(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&oh(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,u=s.textOffset;na(r,c,0,u,l,a)}i&&sh(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=xn(r.font),s=zn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ct(n)?(l+=s.bottom,Zt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:f,rotation:g}=$$(this,l,n,a);na(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:F$(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=at(t.grid&&t.grid.z,-1),i=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ca.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class xh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;B$(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,j$(t,s,r),this.override&&ln.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in ln[i]&&(delete ln[i][r],this.override&&delete ea[r])}}function j$(e,t,n){const r=$i(Object.create(null),[n?ln.get(n):{},ln.get(t),e.defaults]);ln.set(t,r),e.defaultRoutes&&z$(t,e.defaultRoutes),e.descriptors&&ln.describe(t,e.descriptors)}function z$(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");ln.route(o,i,l,a)})}function B$(e){return"id"in e&&"defaults"in e}class V${constructor(){this.controllers=new xh(xi,"datasets",!0),this.elements=new xh(bo,"elements"),this.plugins=new xh(Object,"plugins"),this.scales=new xh(ca,"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,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):$t(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=tb(t);Ht(r["before"+i],[],r),n[t](r),Ht(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var zi=new V$;class H${constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(Ht(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){wt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=at(r.options&&r.options.plugins,{}),o=W$(r);return i===!1&&!n?[]:q$(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function W$(e){const t={},n=[],r=Object.keys(zi.plugins.items);for(let o=0;o<r.length;o++)n.push(zi.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function U$(e,t){return!t&&e===!1?null:e===!0?{}:e}function q$(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=U$(r[l],i);c!==null&&o.push({plugin:a,options:G$(e.config,{plugin:a,local:n[l]},c,s)})}return o}function G$(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Eb(e,t){const n=ln.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Y$(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function K$(e,t){return e===t?"_index_":"_value_"}function mE(e){if(e==="x"||e==="y"||e==="r")return e}function X$(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ob(e,...t){if(mE(e))return e;for(const n of t){const r=n.axis||X$(n.position)||e.length>1&&mE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function vE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Q$(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return vE(e,"x",n[0])||vE(e,"y",n[0])}return{}}function Z$(e,t){const n=ea[e.type]||{scales:{}},r=t.scales||{},i=Eb(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Ct(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Ob(s,a,Q$(s,e),ln.scales[a.type]),c=K$(l,i),u=n.scales||{};o[s]=ou(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Eb(a,t),u=(ea[a]||{}).scales||{};Object.keys(u).forEach(f=>{const g=Y$(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),ou(o[p],[{axis:g},r[p],u[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];ou(a,[ln.scales[a.type],ln.scale])}),o}function bE(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Z$(e,t)}function yE(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function J$(e){return e=e||{},e.data=yE(e.data),bE(e),e}const xE=new Map,wE=new Set;function wh(e,t){let n=xE.get(e);return n||(n=t(),xE.set(e,n),wE.add(n)),n}const wu=(e,t,n)=>{const r=Jo(t,n);r!==void 0&&e.add(r)};class e8{constructor(t){this._config=J$(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=yE(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),bE(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return wh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return wh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return wh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>wu(l,t,f))),u.forEach(f=>wu(l,i,f)),u.forEach(f=>wu(l,ea[o]||{},f)),u.forEach(f=>wu(l,ln,f)),u.forEach(f=>wu(l,lb,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),wE.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ea[n]||{},ln.datasets[n]||{},{type:n},ln,lb]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=_E(this._resolverCache,t,i);let l=s;if(n8(s,n)){o.$shared=!1,r=es(r)?r():r;const c=this.createResolver(t,r,a);l=xl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=_E(this._resolverCache,t,r);return Ct(n)?xl(o,n,void 0,i):o}}function _E(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:fb(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const t8=e=>Ct(e)&&Object.getOwnPropertyNames(e).some(t=>es(e[t]));function n8(e,t){const{isScriptable:n,isIndexable:r}=CC(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(es(a)||t8(a))||s&&Zt(a))return!0}return!1}var r8="4.4.1";const i8=["top","bottom","left","right","chartArea"];function SE(e,t){return e==="top"||e==="bottom"||i8.indexOf(e)===-1&&t==="x"}function CE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function EE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ht(n&&n.onComplete,[e],t)}function o8(e){const t=e.chart,n=t.options.animation;Ht(n&&n.onProgress,[e],t)}function OE(e){return gb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const _h={},PE=e=>{const t=OE(e);return Object.values(_h).filter(n=>n.canvas===t).pop()};function s8(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function a8(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Sh(e,t,n){return e.options.clip?e[n]:t[n]}function l8(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Sh(n,t,"left"),right:Sh(n,t,"right"),top:Sh(r,t,"top"),bottom:Sh(r,t,"bottom")}:t}class Jr{static register(...t){zi.add(...t),kE()}static unregister(...t){zi.remove(...t),kE()}constructor(t,n){const r=this.config=new e8(n),i=OE(t),o=PE(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||E$(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=uF(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 H$,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OF(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],_h[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}vo.listen(this,"complete",EE),vo.listen(this,"progress",o8),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return wt(t)?n&&o?o:i?r/i: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 zi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():AC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wC(this.canvas,this.ctx),this}stop(){return vo.stop(this),this}resize(t,n){vo.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,AC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ht(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};$t(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=Ob(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$t(o,s=>{const a=s.options,l=a.id,c=Ob(l,a),u=at(a.type,s.dtype);(a.position===void 0||SE(a.position,c)!==SE(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const g=zi.getScale(u);f=new g({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),$t(i,(s,a)=>{s||delete r[a]}),$t(r,s=>{Xn.configure(this,s,s.options),Xn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(CE("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||Eb(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=zi.getController(a),{datasetElementType:c,dataElementType:u}=ln.datasets[a];Object.assign(l,{dataElementType:zi.getElement(u),datasetElementType:c&&zi.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){$t(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||$t(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(CE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$t(this.scales,t=>{Xn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!rC(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;s8(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!rC(i,r(o)))return;return Array.from(i).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;Xn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],$t(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,es(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(vo.has(this)?this.attached&&!vo.running(this)&&vo.start(this):(this.draw(),EE({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const 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){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=l8(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&oh(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&sh(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return mo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=i$.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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},r.push(i)),i}getContext(){return this.$context||(this.$context=ns(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);su(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),vo.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete _h[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};$t(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){$t(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$t(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Jf(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=mF(t),c=a8(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ht(o.onHover,[t,a,this],this),l&&Ht(o.onClick,[t,a,this],this));const u=!Jf(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Me(Jr,"defaults",ln),Me(Jr,"instances",_h),Me(Jr,"overrides",ea),Me(Jr,"registry",zi),Me(Jr,"version",r8),Me(Jr,"getChart",PE);function kE(){return $t(Jr.instances,e=>e._plugins.invalidate())}function c8(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+pn,r-pn),e.closePath(),e.clip()}function u8(e){return db(e,["outerStart","outerEnd","innerStart","innerEnd"])}function d8(e,t,n,r){const i=u8(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return In(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:In(i.innerStart,0,s),innerEnd:In(i.innerEnd,0,s)}}function Sl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ch(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),g=u>0?u+r+n+c:0;let p=0;const v=i-l;if(r){const $=u>0?u-r:0,J=f>0?f-r:0,q=($+J)/2,K=q!==0?v*q/(q+r):v;p=(v-K)/2}const y=Math.max(.001,v*f-n/Jt)/f,x=(v-y)/2,_=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=d8(t,g,f,S-_),A=f-C,L=f-P,F=_+C/A,j=S-P/L,z=g+O,V=g+k,oe=_+O/z,ee=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const G=Sl(L,j,s,a);e.arc(G.x,G.y,P,j,S+pn)}const J=Sl(V,S,s,a);if(e.lineTo(J.x,J.y),k>0){const G=Sl(V,ee,s,a);e.arc(G.x,G.y,k,S+pn,ee+Math.PI)}const q=(S-k/g+(_+O/g))/2;if(e.arc(s,a,g,S-k/g,q,!0),e.arc(s,a,g,q,_+O/g,!0),O>0){const G=Sl(z,oe,s,a);e.arc(G.x,G.y,O,oe+Math.PI,_-pn)}const K=Sl(A,_,s,a);if(e.lineTo(K.x,K.y),C>0){const G=Sl(A,F,s,a);e.arc(G.x,G.y,C,_-pn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,J=Math.sin(F)*f+a;e.lineTo($,J);const q=Math.cos(j)*f+s,K=Math.sin(j)*f+a;e.lineTo(q,K)}e.closePath()}function f8(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Ch(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%en||en))}return Ch(e,t,n,r,l,i),e.fill(),l}function h8(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(o){Ch(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%en||en))}p&&c8(e,t,v),o||(Ch(e,t,n,r,v,i),e.stroke())}class Cl extends bo{constructor(n){super();Me(this,"circumference");Me(this,"endAngle");Me(this,"fullCircles");Me(this,"innerRadius");Me(this,"outerRadius");Me(this,"pixelMargin");Me(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=lC(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,y=at(g,c-l)>=en||lu(s,l,c),x=po(a,u+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(o+s)/2,g=(a+l+u+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>en?Math.floor(i/en):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Jt,i||0)),u=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,f8(n,this,u,s,a),h8(n,this,u,s,a),n.restore()}}Me(Cl,"id","arc"),Me(Cl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Me(Cl,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(Cl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function ME(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function p8(e,t,n){e.lineTo(n.x,n.y)}function g8(e){return e.stepped?$F:e.tension||e.cubicInterpolationMode==="monotone"?jF:p8}function DE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function m8(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=DE(i,n,r),u=g8(o);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):u(e,y,v,g,o.stepped),y=v);return l&&(v=i[(a+(g?c:0))%s],u(e,y,v,g,o.stepped)),!!l}function v8(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=DE(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,g,p,v,y,x,_;const S=P=>(s+(c?a-P:P))%o,C=()=>{y!==x&&(e.lineTo(u,x),e.lineTo(u,y),e.lineTo(u,_))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<y?y=O:O>x&&(x=O),u=(f*u+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,y=x=O),_=O}C()}function Pb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?v8:m8}function b8(e){return e.stepped?v9:e.tension||e.cubicInterpolationMode==="monotone"?b9:sa}function y8(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),ME(e,t.options),e.stroke(i)}function x8(e,t,n,r){const{segments:i,options:o}=t,s=Pb(t);for(const a of i)ME(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const w8=typeof Path2D=="function";function _8(e,t,n,r){w8&&!t.options.segment?y8(e,t,n,r):x8(e,t,n,r)}class rs extends bo{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){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;c9(this._points,r,t,i,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=C9(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=jC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=b8(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const y=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Pb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Pb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),_8(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(rs,"id","line"),Me(rs,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(rs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(rs,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function TE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class _u extends bo{constructor(n){super();Me(this,"parsed");Me(this,"skip");Me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return TE(this,n,"x",r)}inYRange(n,r){return TE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!mo(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,ub(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(_u,"id","point"),Me(_u,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(_u,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function AE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,u=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function is(e,t,n,r){return e?0:In(t,n,r)}function S8(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=SC(r);return{t:is(i.top,o.top,0,n),r:is(i.right,o.right,0,t),b:is(i.bottom,o.bottom,0,n),l:is(i.left,o.left,0,t)}}function C8(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=ra(i),s=Math.min(t,n),a=e.borderSkipped,l=r||Ct(i);return{topLeft:is(!l||a.top||a.left,o.topLeft,0,s),topRight:is(!l||a.top||a.right,o.topRight,0,s),bottomLeft:is(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:is(!l||a.bottom||a.right,o.bottomRight,0,s)}}function E8(e){const t=AE(e),n=t.right-t.left,r=t.bottom-t.top,i=S8(e,n/2,r/2),o=C8(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function kb(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&AE(e,r);return a&&(i||po(t,a.left,a.right))&&(o||po(n,a.top,a.bottom))}function O8(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function P8(e,t){e.rect(t.x,t.y,t.w,t.h)}function Mb(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class Su extends bo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=E8(this),a=O8(s.radius)?fu:P8;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Mb(s,n,o)),t.clip(),a(t,Mb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Mb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return kb(this,t,n,r)}inXRange(t,n){return kb(this,t,null,n)}inYRange(t,n){return kb(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(Su,"id","bar"),Me(Su,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(Su,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var k8=Object.freeze({__proto__:null,ArcElement:Cl,BarElement:Su,LineElement:rs,PointElement:_u});const Db=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],IE=Db.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function NE(e){return Db[e%Db.length]}function RE(e){return IE[e%IE.length]}function M8(e,t){return e.borderColor=NE(t),e.backgroundColor=RE(t),++t}function D8(e,t){return e.backgroundColor=e.data.map(()=>NE(t++)),t}function T8(e,t){return e.backgroundColor=e.data.map(()=>RE(t++)),t}function A8(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof aa?t=D8(n,t):i instanceof pu?t=T8(n,t):i&&(t=M8(n,t))}}function LE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function I8(e){return e&&(e.borderColor||e.backgroundColor)}var N8={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(LE(r)||I8(i)||o&&LE(o)))return;const s=A8(e);r.forEach(s)}};function R8(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,f,g,p,v,y;for(s[l++]=e[u],f=0;f<o-2;f++){let x=0,_=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,_+=e[S].y;x/=O,_/=O;const k=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:L,y:F}=e[u];for(p=v=-1,S=k;S<A;S++)v=.5*Math.abs((L-x)*(e[S].y-F)-(L-e[S].x)*(_-F)),v>p&&(p=v,g=e[S],y=S);s[l++]=g,u=y}return s[l++]=e[c],s}function L8(e,t,n,r){let i=0,o=0,s,a,l,c,u,f,g,p,v,y;const x=[],_=t+n-1,S=e[t].x,P=e[_].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===u)c<v?(v=c,f=s):c>y&&(y=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!wt(f)&&!wt(g)){const A=Math.min(f,g),L=Math.max(f,g);A!==p&&A!==k&&x.push({...e[A],x:i}),L!==p&&L!==k&&x.push({...e[L],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),u=O,o=0,v=y=c,f=g=p=s}}return x}function FE(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function $E(e){e.data.datasets.forEach(t=>{FE(t)})}function F8(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=In(go(t,o.axis,s).lo,0,n-1)),c?i=In(go(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var $8={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){$E(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(tn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:g}=F8(l,c);const p=n.threshold||4*r;if(g<=p){FE(i);return}wt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=R8(c,f,g,r,n);break;case"min-max":v=L8(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){$E(e)}};function j8(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=Ab(l,c,i);const u=Tb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:i[l],end:i[c]});continue}const f=jC(t,u);for(const g of f){const p=Tb(n,o[g.start],o[g.end],g.loop),v=$C(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:jE(u,p,"start",Math.max)},end:{[n]:jE(u,p,"end",Math.min)}})}}return s}function Tb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Tr(i),o=Tr(o)),{property:e,start:i,end:o}}function z8(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=Ab(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function Ab(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function jE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function zE(e,t){let n=[],r=!1;return Zt(e)?(r=!0,n=e):n=z8(e,t),n.length?new rs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function BE(e){return e&&e.fill!==!1}function B8(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!fn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function V8(e,t,n){const r=q8(e);if(Ct(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return fn(i)&&Math.floor(i)===i?H8(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function H8(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function W8(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ct(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function U8(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ct(e)?r=e.value:r=t.getBaseValue(),r}function q8(e){const t=e.options,n=t.fill;let r=at(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function G8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=Y8(t,n);a.push(zE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)K8(i,s[u],a)}return new rs({points:i,options:{}})}function Y8(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function K8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=X8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function X8(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],f=s[u.start][n],g=s[u.end][n];if(po(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class VE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:en},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function Q8(e){const{chart:t,fill:n,line:r}=e;if(fn(n))return Z8(t,n);if(n==="stack")return G8(e);if(n==="shape")return!0;const i=J8(e);return i instanceof VE?i:zE(i,r)}function Z8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function J8(e){return(e.scale||{}).getPointPositionForValue?tj(e):ej(e)}function ej(e){const{scale:t={},fill:n}=e,r=W8(n,t);if(fn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function tj(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=U8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new VE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Ib(e,t,n){const r=Q8(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};r&&i.points.length&&(oh(e,n),nj(e,{line:i,target:r,above:u,below:f,area:n,scale:o,axis:s}),sh(e))}function nj(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(HE(e,r,s.top),WE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),HE(e,r,s.bottom)),WE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function HE(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ab(l,c,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function WE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=j8(n,r,i);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,rj(e,s,p&&Tb(i,u,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():UE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||UE(e,r,u,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function rj(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function UE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var ij={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof rs&&(l={visible:e.isDatasetVisible(s),index:s,fill:V8(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=B8(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Ib(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;BE(o)&&Ib(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!BE(r)||n.drawTime!=="beforeDatasetDraw"||Ib(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const qE=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},oj=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class GE extends bo{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,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ht(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=xn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qE(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-u;return this.legendItems.forEach((v,y)=>{const x=r+n/2+o.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=u,c[c.length-(y>0?0:1)]=0,p+=u,g++),l[y]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:S,itemHeight:C}=sj(r,n,o,x,i);_>0&&p+C+2*a>u&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[_]={left:v,top:p,col:y,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=_l(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Kn(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Kn(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Kn(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Kn(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;oh(t,this),this._draw(),sh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=ln.color,l=_l(t.rtl,this.left,this.width),c=xn(s.font),{padding:u}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=qE(s,f),_=function(k,A,L){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const F=at(L.lineWidth,1);if(i.fillStyle=at(L.fillStyle,a),i.lineCap=at(L.lineCap,"butt"),i.lineDashOffset=at(L.lineDashOffset,0),i.lineJoin=at(L.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=at(L.strokeStyle,a),i.setLineDash(at(L.lineDash,[])),s.usePointStyle){const j={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},z=l.xPlus(k,v/2),V=A+g;_C(i,j,z,V,s.pointStyleWidth&&v)}else{const j=A+Math.max((f-y)/2,0),z=l.leftForLtr(k,v),V=ra(L.borderRadius);i.beginPath(),Object.values(V).some(oe=>oe!==0)?fu(i,{x:z,y:j,w:v,h:y,radius:V}):i.rect(z,j,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,A,L){na(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:Kn(o,this.left+u,this.right-r[0]),y:this.top+u+P,line:0}:p={x:this.left+u,y:Kn(o,this.top+P+u,this.bottom-n[0].height),line:0},NC(this.ctx,t.textDirection);const O=x+u;this.legendItems.forEach((k,A)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const L=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+L;let z=p.x,V=p.y;l.setWidth(this.width),C?A>0&&z+j+u>this.right&&(V=p.y+=O,p.line++,z=p.x=Kn(o,this.left+u,this.right-r[p.line])):A>0&&V+O>this.bottom&&(z=p.x=z+n[p.line].width+u,p.line++,V=p.y=Kn(o,this.top+P+u,this.bottom-n[p.line].height));const oe=l.x(z);if(_(oe,V,k),z=PF(F,z+v+g,C?z+j:this.right,t.rtl),S(l.x(z),V,k),C)p.x+=j+u;else if(typeof k.text!="string"){const ee=c.lineHeight;p.y+=YE(k,ee)+u}else p.y+=O}),RC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=xn(n.font),i=zn(n.padding);if(!n.display)return;const o=_l(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),u=this.top+c,f=Kn(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+Kn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=Kn(a,f,f+g);s.textAlign=o.textAlign(ob(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,na(s,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=xn(t.font),r=zn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(po(t,this.left,this.right)&&po(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],po(t,i.left,i.left+i.width)&&po(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!cj(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=oj(i,r);i&&!o&&Ht(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&Ht(n.onHover,[t,r,this],this)}else r&&Ht(n.onClick,[t,r,this],this)}}function sj(e,t,n,r,i){const o=aj(r,e,t,n),s=lj(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function aj(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function lj(e,t,n){let r=e;return typeof t.text!="string"&&(r=YE(t,n)),r}function YE(e,t){const n=e.text?e.text.length:0;return t*n}function cj(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var uj={id:"legend",_element:GE,start(e,t,n){const r=e.legend=new GE({ctx:e.ctx,options:n,chart:e});Xn.configure(e,r,n),Xn.addBox(e,r)},stop(e){Xn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Xn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=zn(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:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(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)}}};class Nb extends bo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Zt(r.text)?r.text.length:1;this._padding=zn(r.padding);const o=i*xn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,u,f;return this.isHorizontal()?(u=Kn(a,r,o),f=n+t,c=o-r):(s.position==="left"?(u=r+t,f=Kn(a,i,n),l=Jt*-.5):(u=o-t,f=Kn(a,n,i),l=Jt*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=xn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);na(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:ob(n.align),textBaseline:"middle",translation:[s,a]})}}function dj(e,t){const n=new Nb({ctx:e.ctx,options:t,chart:e});Xn.configure(e,n,t),Xn.addBox(e,n),e.titleBlock=n}var fj={id:"title",_element:Nb,start(e,t,n){dj(e,n)},stop(e){const t=e.titleBlock;Xn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Xn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eh=new WeakMap;var hj={id:"subtitle",start(e,t,n){const r=new Nb({ctx:e.ctx,options:n,chart:e});Xn.configure(e,r,n),Xn.addBox(e,r),Eh.set(e,r)},stop(e){Xn.removeBox(e,Eh.get(e)),Eh.delete(e)},beforeUpdate(e,t,n){const r=Eh.get(e);Xn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cu={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=rb(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Bi(e,t){return t&&(Zt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function yo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
121
+ */class P9{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=fC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var vo=new P9;const VC="transparent",k9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=bC(e||VC),i=r.valid&&bC(t||VC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class M9{constructor(t,n,r,i){const o=n[r];i=nn([t.to,i,o,t.from]);const s=nn([t.from,o,i]);this._active=!0,this._fn=t.fn||k9[t.type||typeof s],this._easing=cu[t.easing]||cu.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=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=nn([t.to,n,i,t.from]),this._from=nn([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class HC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ct(t))return;const n=Object.keys(ln.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ct(o))return;const s={};for(const a of n)s[a]=o[a];(Jt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=T9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&D9(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,u,a);continue}else f.cancel();if(!g||!g.duration){t[c]=u;continue}o[c]=f=new M9(g,t,c,u),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return vo.add(this._chart,r),!0}}function D9(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function T9(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 WC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function A9(e,t,n){if(n===!1)return!1;const r=WC(e,n),i=WC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function I9(e){let t,n,r,i;return Ct(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function UC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function qC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],fn(c)&&(o||t===0||ji(t)===ji(c))&&(t+=c)}return t}}function N9(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function GC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function R9(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function L9(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function F9(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function YC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function KC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=R9(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,_=v._stacks||(v._stacks={});g=_[c]=F9(i,u,y),g[a]=x,g._top=YC(g,s,!0,r.type),g._bottom=YC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function vb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function $9(e,t){return ns(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function j9(e,t,n){return ns(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hu(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const bb=e=>e==="reset"||e==="none",XC=(e,t)=>t?e:Object.assign({},e),z9=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:UC(n,!0),values:null};class xi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=GC(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&&hu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=at(r.xAxisID,vb(t,"x")),s=n.yAxisID=at(r.yAxisID,vb(t,"y")),a=n.rAxisID=at(r.rAxisID,vb(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&uC(this._data,this),t._stacked&&hu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ct(n))this._data=N9(n);else if(r!==n){if(r){uC(r,this);const i=this._cachedMeta;hu(i),i._parsed=[]}n&&Object.isExtensible(n)&&EF(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=GC(n.vScale,n),n.stack!==r.stack&&(i=!0,hu(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&KC(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Jt(i[t])?g=this.parseArrayData(r,i,t,n):Ct(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=g[u],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&KC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),u=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:u||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,u,f;for(l=0,c=i;l<c;++l)u=l+r,f=n[u],a[l]={x:o.parse(f[0],u),y:s.parse(f[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,f,g,p;for(u=0,f=i;u<f;++u)g=u+r,p=n[g],c[u]={x:o.parse(Jo(p,a),g),y:s.parse(Jo(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:UC(i,!0),values:n._stacks[t.axis]._visualValues};return qC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=qC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=z9(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=L9(a);let g,p;function v(){p=i[g];const y=p[a.axis];return!fn(p[t.axis])||u>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],fn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=I9(at(this.options.clip,A9(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const f=i[u];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(u=0;u<s.length;++u)s[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=j9(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=$9(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,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",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&su(r);if(a)return XC(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),u),p=Object.keys(ln.elements[t]),v=()=>this.getContext(r,i,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(XC(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),g=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(g,this.getContext(t,r,n))}const c=new HC(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||bb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){bb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!bb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&hu(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Me(xi,"defaults",{}),Me(xi,"datasetElementType",null),Me(xi,"dataElementType",null);function B9(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=dC(r.sort((i,o)=>i-o))}return e._cache.$bar}function V9(e){const t=e.iScale,n=B9(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(su(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function H9(e,t,n,r){const i=n.barThickness;let o,s;return wt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function W9(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function U9(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function QC(e,t,n,r){return Jt(e)?U9(e,t,n,r):t[n.axis]=n.parse(e,r),t}function ZC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,u,f,g;for(c=n,u=n+r;c<u;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(QC(g,f,o,c));return l}function yb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function q9(e,t,n){return e!==0?ji(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function G9(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function Y9(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=G9(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[JC(u,s,a,l)]=!0,i=c)),o[JC(i,s,a,l)]=!0,e.borderSkipped=o}function JC(e,t,n,r){return r?(e=K9(e,t,n),e=eE(e,n,t)):e=eE(e,t,n),e}function K9(e,t,n){return e===t?n:e===n?t:e}function eE(e,t,n){return e==="start"?t:e==="end"?n:e}function X9(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class dh extends xi{parsePrimitiveData(t,n,r,i){return ZC(t,n,r,i)}parseArrayData(t,n,r,i){return ZC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+i;g<p;++g)y=n[g],v={},v[o.axis]=o.parse(Jo(y,c),g),f.push(QC(Jo(y,u),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=yb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=o||wt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),_=(v._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!_||yb(v._custom)||s===_._top||s===_._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;Y9(S,C,_,s),X9(S,C,u.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(wt(u)||isNaN(u))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||V9(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=yb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),u&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&ji(f)!==ji(c.barEnd)&&(g=0),g+=f);const x=!wt(o)&&!u?o:g;let _=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=_,y=v-_,Math.abs(y)<s){y=q9(y,n,a)*s,f===a&&(_-=y/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);_=Math.max(Math.min(_,O),P),v=_+y,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(_))}if(_===n.getPixelForValue(a)){const S=ji(y)*n.getLineWidthForValue(a)/2;_+=S,y-=S}return{size:y,base:_,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=at(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,u=i.barThickness==="flex"?W9(t,n,i,c):H9(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}Me(dh,"id","bar"),Me(dh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(dh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class fh extends xi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=at(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=at(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),y={},x=y[u]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),_=y[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(_),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(y.options.radius=0)),this.updateElement(p,g,y,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=at(r&&r._custom,o),i}}Me(fh,"id","bubble"),Me(fh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(fh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Q9(e,t,n){let r=1,i=1,o=0,s=0;if(t<tn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>lu(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>lu(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),y=p(0,c,f),x=p(pn,u,g),_=v(en,c,f),S=v(en+pn,u,g);r=(y-_)/2,i=(x-S)/2,o=-(y+_)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class aa extends xi{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Ct(r[t])){const{key:l="value"}=this._parsing;o=c=>+Jo(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return yi(this.options.rotation-90)}_getCircumference(){return yi(this.options.circumference)}_getRotationExtents(){let t=tn,n=-tn;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(dF(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=Q9(f,u,l),x=(r.width-s)/g,_=(r.height-s)/p,S=Math.max(Math.min(x,_)/2,0),C=eC(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/tn)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,i);let _=this._getRotation(),S;for(S=0;S<n;++S)_+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:u+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=y||this.resolveDataElementOptions(S,P.active?"active":i)),_+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?tn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=uu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me(aa,"id","doughnut"),Me(aa,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Me(aa,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(aa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class hh extends xi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=pC(n,i,s);this._drawStart=a,this._drawCount=l,gC(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=yl(v)?v:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],A=_?k:{};if(O<n||O>=S){A.skip=!0;continue}const L=this.getParsed(O),F=wt(L[p]),j=A[g]=s.getPixelForValue(L[g],O),z=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],O);A.skip=isNaN(j)||isNaN(z)||F,A.stop=O>0&&Math.abs(L[g]-P[g])>x,y&&(A.parsed=L,A.raw=c.data[O]),f&&(A.options=u||this.resolveDataElementOptions(O,k.active?"active":i)),_||this.updateElement(k,O,A,i),P=L}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(hh,"id","line"),Me(hh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(hh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pu extends xi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=uu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return DC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*en;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,y);for(v=n;v<n+r;v++){const x=t[v];let _=p,S=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(_=S=g));const P={x:u,y:f,innerRadius:0,outerRadius:C,startAngle:_,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?yi(this.resolveDataElementOptions(t,n).angle||r):0}}Me(pu,"id","polarArea"),Me(pu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(pu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class xb extends aa{}Me(xb,"id","pie"),Me(xb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ph extends xi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return DC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:u.x,g=s?o.yCenter:u.y,p={x:f,y:g,angle:u.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}Me(ph,"id","radar"),Me(ph,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(ph,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class gh extends xi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=pC(n,r,i);if(this._drawStart=o,this._drawCount=s,gC(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,_=yl(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),A=S?O:{},L=wt(k[v]),F=A[p]=s.getPixelForValue(k[p],P),j=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);A.skip=isNaN(F)||isNaN(j)||L,A.stop=P>0&&Math.abs(k[p]-C[p])>_,x&&(A.parsed=k,A.raw=c.data[P]),g&&(A.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,A,i),C=k}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Me(gh,"id","scatter"),Me(gh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(gh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Z9=Object.freeze({__proto__:null,BarController:dh,BubbleController:fh,DoughnutController:aa,LineController:hh,PieController:xb,PolarAreaController:pu,RadarController:ph,ScatterController:gh});function la(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wb{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(wb.prototype,t)}init(){}formats(){return la()}parse(){return la()}format(){return la()}add(){return la()}diff(){return la()}startOf(){return la()}endOf(){return la()}}var J9={_date:wb};function e$(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?SF:go;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(o,t,n-u),g=l(o,t,n+u);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function gu(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:f,hi:g}=e$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=u[p];v.skip||r(v,c,p)}}}function t$(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function _b(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||gu(e,n,t,function(a,l,c){!i&&!mo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function n$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=lC(s,{x:t.x,y:t.y});lu(f,c,u)&&i.push({element:s,datasetIndex:a,index:l})}return gu(e,n,t,o),i}function r$(e,t,n,r,i,o){let s=[];const a=t$(n);let l=Number.POSITIVE_INFINITY;function c(u,f,g){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const v=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:u,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:u,datasetIndex:f,index:g})}return gu(e,n,t,c),s}function Sb(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?n$(e,t,n,i):r$(e,t,n,r,i,o)}function tE(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return gu(e,n,t,(l,c,u)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var i$={evaluateInteractionItems:gu,modes:{index(e,t,n,r){const i=oa(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?_b(e,i,o,r,s):Sb(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?_b(e,i,o,r,s):Sb(e,i,o,!1,r,s);if(a.length>0){const 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,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return _b(e,i,o,r,s)},nearest(e,t,n,r){const i=oa(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Sb(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=oa(t,e);return tE(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=oa(t,e);return tE(e,i,"y",n.intersect,r)}}};const nE=["left","top","right","bottom"];function mu(e,t){return e.filter(n=>n.pos===t)}function rE(e,t){return e.filter(n=>nE.indexOf(n.pos)===-1&&n.box.axis===t)}function vu(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function o$(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function s$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!nE.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function a$(e,t){const n=s$(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function l$(e){const t=o$(e),n=vu(t.filter(c=>c.box.fullSize),!0),r=vu(mu(t,"left"),!0),i=vu(mu(t,"right")),o=vu(mu(t,"top"),!0),s=vu(mu(t,"bottom")),a=rE(t,"x"),l=rE(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:mu(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function iE(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function oE(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 c$(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Ct(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&oE(s,o.getPadding());const a=Math.max(0,t.outerWidth-iE(s,e,"left","right")),l=Math.max(0,t.outerHeight-iE(s,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 u$(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function d$(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function bu(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,d$(a.horizontal,t));const{same:f,other:g}=c$(t,n,a,r);c|=f&&i.length,u=u||g,l.fullSize||i.push(a)}return c&&bu(i,t,n,r)||u}function mh(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function sE(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,g=c.size||l.height;su(c.start)&&(s=c.start),l.fullSize?mh(l,i.left,s,n.outerWidth-i.right-i.left,g):mh(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,g=c.size||l.width;su(c.start)&&(o=c.start),l.fullSize?mh(l,o,i.top,g,n.outerHeight-i.bottom-i.top):mh(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var Xn={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){const 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,r){if(!e)return;const i=zn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=l$(e.boxes),l=a.vertical,c=a.horizontal;$t(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),g=Object.assign({},i);oE(g,zn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=a$(l.concat(c),f);bu(a.fullSize,p,f,v),bu(l,p,f,v),bu(c,p,f,v)&&bu(l,p,f,v),u$(p),sE(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,sE(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$t(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class aE{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class f$ extends aE{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vh="$chartjs",h$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lE=e=>e===null||e==="";function p$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[vh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",lE(i)){const o=IC(e,"width");o!==void 0&&(e.width=o)}if(lE(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=IC(e,"height");o!==void 0&&(e.height=o)}return e}const cE=m9?{passive:!0}:!1;function g$(e,t,n){e.addEventListener(t,n,cE)}function m$(e,t,n){e.canvas.removeEventListener(t,n,cE)}function v$(e,t){const n=h$[e.type]||e.type,{x:r,y:i}=oa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function bh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function b$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||bh(a.addedNodes,r),s=s&&!bh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function y$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||bh(a.removedNodes,r),s=s&&!bh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const yu=new Map;let uE=0;function dE(){const e=window.devicePixelRatio;e!==uE&&(uE=e,yu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function x$(e,t){yu.size||window.addEventListener("resize",dE),yu.set(e,t)}function w$(e){yu.delete(e),yu.size||window.removeEventListener("resize",dE)}function _$(e,t,n){const r=e.canvas,i=r&&mb(r);if(!i)return;const o=hC((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),x$(e,o),s}function Cb(e,t,n){n&&n.disconnect(),t==="resize"&&w$(e)}function S$(e,t,n){const r=e.canvas,i=hC(o=>{e.ctx!==null&&n(v$(o,e))},e);return g$(r,t,i),i}class C$ extends aE{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(p$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[vh])return!1;const r=n[vh].initial;["height","width"].forEach(o=>{const s=r[o];wt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[vh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:b$,detach:y$,resize:_$}[n]||S$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Cb,detach:Cb,resize:Cb}[n]||m$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return g9(t,n,r,i)}isAttached(t){const n=mb(t);return!!(n&&n.isConnected)}}function E$(e){return!gb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?f$:C$}let bo=(Sg=class{constructor(){Me(this,"x");Me(this,"y");Me(this,"active",!1);Me(this,"options");Me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return yl(this.x)&&yl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Me(Sg,"defaults",{}),Me(Sg,"defaultRoutes"),Sg);function O$(e,t){const n=e.options.ticks,r=P$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?M$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return D$(t,c,o,s/i),c;const u=k$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(yh(t,c,u,wt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)yh(t,c,u,o[f],o[f+1]);return yh(t,c,u,l,wt(p)?t.length:l+p),c}return yh(t,c,u),c}function P$(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function k$(e,t,n){const r=T$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=yF(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function M$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function D$(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function yh(e,t,n,r,i){const o=at(r,0),s=Math.min(at(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function T$(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const A$=e=>e==="left"?"right":e==="right"?"left":e,fE=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,hE=(e,t)=>Math.min(t||e,e);function pE(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function I$(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function N$(e,t){$t(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function xu(e){return e.drawTicks?e.tickLength:0}function gE(e,t){if(!e.display)return 0;const n=xn(e.font,t),r=zn(e.padding);return(Jt(e.text)?e.text.length:1)*n.lineHeight+r.height}function R$(e,t){return ns(e,{scale:t,type:"scale"})}function L$(e,t,n){return ns(e,{tick:n,index:t,type:"tick"})}function F$(e,t,n){let r=ob(e);return(n&&t!=="right"||!n&&t==="right")&&(r=A$(r)),r}function $$(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,g,p,v;const y=s-i,x=a-o;if(e.isHorizontal()){if(p=Kn(r,o,a),Ct(n)){const _=Object.keys(n)[0],S=n[_];v=u[_].getPixelForValue(S)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=fE(e,n,t);g=a-o}else{if(Ct(n)){const _=Object.keys(n)[0],S=n[_];p=u[_].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=fE(e,n,t);v=Kn(r,s,i),f=n==="left"?-pn:pn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class ca extends bo{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:r,_suggestedMax:i}=this;return t=Dr(t,Number.POSITIVE_INFINITY),n=Dr(n,Number.NEGATIVE_INFINITY),r=Dr(r,Number.POSITIVE_INFINITY),i=Dr(i,Number.NEGATIVE_INFINITY),{min:Dr(t,r),max:Dr(n,i),minDefined:fn(t),maxDefined:fn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Dr(n,Dr(r,n)),max:Dr(r,Dr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){Ht(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=GF(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?pE(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=O$(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,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ht(this.options.afterUpdate,[this])}beforeSetDimensions(){Ht(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(){Ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=Ht(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){Ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=hE(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,g=u.highest.height,p=In(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-xu(t.grid)-n.padding-gE(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=nb(Math.min(Math.asin(In((u.highest.height+6)/a,-1,1)),Math.asin(In(l/c,-1,1))-Math.asin(In(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ht(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=gE(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=xu(o)+l):(t.height=this.maxHeight,t.width=xu(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=yi(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const _=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(c,u,x,y)}}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,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;o==="start"?(u=0,f=t.height):o==="end"&&(u=n.height,f=0),this.paddingTop=u+s,this.paddingBottom=f+s}}_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(){Ht(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)wt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=pE(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/hE(n,r));let c=0,u=0,f,g,p,v,y,x,_,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),i.font=x=y.string,_=o[x]=o[x]||{data:{},gc:[]},S=y.lineHeight,C=P=0,!wt(v)&&!Jt(v))C=ih(i,_.data,_.gc,C,v),P=S;else if(Jt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!wt(O)&&!Jt(O)&&(C=ih(i,_.data,_.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),u=Math.max(P,u)}N$(o,n);const k=s.indexOf(c),A=a.indexOf(u),L=F=>({width:s[F]||0,height:a[F]||0});return{first:L(0),last:L(n-1),widest:L(k),highest:L(A),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return _F(this._alignToPixels?ta(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=L$(this.getContext(),t,r))}return this.$context||(this.$context=R$(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=yi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=xu(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,_=function(J){return ta(r,J,y)};let S,C,P,O,k,A,L,F,j,z,V,oe;if(s==="top")S=_(this.bottom),A=this.bottom-g,F=S-x,z=_(t.top)+x,oe=t.bottom;else if(s==="bottom")S=_(this.top),z=t.top,oe=_(t.bottom)-x,A=S+x,F=this.top+g;else if(s==="left")S=_(this.right),k=this.right-g,L=S-x,j=_(t.left)+x,V=t.right;else if(s==="right")S=_(this.left),j=t.left,V=_(t.right)-x,k=S+x,L=this.left+g;else if(n==="x"){if(s==="center")S=_((t.top+t.bottom)/2+.5);else if(Ct(s)){const J=Object.keys(s)[0],q=s[J];S=_(this.chart.scales[J].getPixelForValue(q))}z=t.top,oe=t.bottom,A=S+x,F=A+g}else if(n==="y"){if(s==="center")S=_((t.left+t.right)/2);else if(Ct(s)){const J=Object.keys(s)[0],q=s[J];S=_(this.chart.scales[J].getPixelForValue(q))}k=S-x,L=k-g,j=t.left,V=t.right}const ee=at(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/ee));for(C=0;C<f;C+=$){const J=this.getContext(C),q=o.setContext(J),K=a.setContext(J),G=q.lineWidth,D=q.color,H=K.dash||[],ne=K.dashOffset,N=q.tickWidth,le=q.tickColor,me=q.tickBorderDash||[],he=q.tickBorderDashOffset;P=I$(this,C,l),P!==void 0&&(O=ta(r,P,G),c?k=L=j=V=O:A=F=z=oe=O,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:j,y1:z,x2:V,y2:oe,width:G,color:D,borderDash:H,borderDashOffset:ne,tickWidth:N,tickColor:le,tickBorderDash:me,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=o,g=xu(r.grid),p=g+u,v=f?-u:p,y=-yi(this.labelRotation),x=[];let _,S,C,P,O,k,A,L,F,j,z,V,oe="middle";if(i==="top")k=this.bottom-v,A=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,A=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(Ct(i)){const $=Object.keys(i)[0],J=i[$];k=this.chart.scales[$].getPixelForValue(J)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(Ct(i)){const $=Object.keys(i)[0],J=i[$];O=this.chart.scales[$].getPixelForValue(J)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?oe="top":l==="end"&&(oe="bottom"));const ee=this._getLabelSizes();for(_=0,S=a.length;_<S;++_){C=a[_],P=C.label;const $=o.setContext(this.getContext(_));L=this.getPixelForTick(_)+o.labelOffset,F=this._resolveTickFontOptions(_),j=F.lineHeight,z=Jt(P)?P.length:1;const J=z/2,q=$.color,K=$.textStrokeColor,G=$.textStrokeWidth;let D=A;s?(O=L,A==="inner"&&(_===S-1?D=this.options.reverse?"left":"right":_===0?D=this.options.reverse?"right":"left":D="center"),i==="top"?c==="near"||y!==0?V=-z*j+j/2:c==="center"?V=-ee.highest.height/2-J*j+j:V=-ee.highest.height+j/2:c==="near"||y!==0?V=j/2:c==="center"?V=ee.highest.height/2-J*j:V=ee.highest.height-z*j,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(y))):(k=L,V=(1-z)*j/2);let H;if($.showLabelBackdrop){const ne=zn($.backdropPadding),N=ee.heights[_],le=ee.widths[_];let me=V-ne.top,he=0-ne.left;switch(oe){case"middle":me-=N/2;break;case"bottom":me-=N;break}switch(A){case"center":he-=le/2;break;case"right":he-=le;break;case"inner":_===S-1?he-=le:_>0&&(he-=le/2);break}H={left:he,top:me,width:le+ne.width,height:N+ne.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:y,color:q,strokeColor:K,strokeWidth:G,textAlign:D,textBaseline:oe,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-yi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const 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(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[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(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,g;this.isHorizontal()?(c=ta(t,this.left,s)-s/2,u=ta(t,this.right,a)+a/2,f=g=l):(f=ta(t,this.top,s)-s/2,g=ta(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&oh(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,u=s.textOffset;na(r,c,0,u,l,a)}i&&sh(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=xn(r.font),s=zn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ct(n)?(l+=s.bottom,Jt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:f,rotation:g}=$$(this,l,n,a);na(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:F$(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=at(t.grid&&t.grid.z,-1),i=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ca.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class xh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;B$(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,j$(t,s,r),this.override&&ln.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in ln[i]&&(delete ln[i][r],this.override&&delete ea[r])}}function j$(e,t,n){const r=$i(Object.create(null),[n?ln.get(n):{},ln.get(t),e.defaults]);ln.set(t,r),e.defaultRoutes&&z$(t,e.defaultRoutes),e.descriptors&&ln.describe(t,e.descriptors)}function z$(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");ln.route(o,i,l,a)})}function B$(e){return"id"in e&&"defaults"in e}class V${constructor(){this.controllers=new xh(xi,"datasets",!0),this.elements=new xh(bo,"elements"),this.plugins=new xh(Object,"plugins"),this.scales=new xh(ca,"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,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):$t(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=tb(t);Ht(r["before"+i],[],r),n[t](r),Ht(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var zi=new V$;class H${constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(Ht(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){wt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=at(r.options&&r.options.plugins,{}),o=W$(r);return i===!1&&!n?[]:q$(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function W$(e){const t={},n=[],r=Object.keys(zi.plugins.items);for(let o=0;o<r.length;o++)n.push(zi.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function U$(e,t){return!t&&e===!1?null:e===!0?{}:e}function q$(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=U$(r[l],i);c!==null&&o.push({plugin:a,options:G$(e.config,{plugin:a,local:n[l]},c,s)})}return o}function G$(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Eb(e,t){const n=ln.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Y$(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function K$(e,t){return e===t?"_index_":"_value_"}function mE(e){if(e==="x"||e==="y"||e==="r")return e}function X$(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ob(e,...t){if(mE(e))return e;for(const n of t){const r=n.axis||X$(n.position)||e.length>1&&mE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function vE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Q$(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return vE(e,"x",n[0])||vE(e,"y",n[0])}return{}}function Z$(e,t){const n=ea[e.type]||{scales:{}},r=t.scales||{},i=Eb(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Ct(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Ob(s,a,Q$(s,e),ln.scales[a.type]),c=K$(l,i),u=n.scales||{};o[s]=ou(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Eb(a,t),u=(ea[a]||{}).scales||{};Object.keys(u).forEach(f=>{const g=Y$(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),ou(o[p],[{axis:g},r[p],u[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];ou(a,[ln.scales[a.type],ln.scale])}),o}function bE(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Z$(e,t)}function yE(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function J$(e){return e=e||{},e.data=yE(e.data),bE(e),e}const xE=new Map,wE=new Set;function wh(e,t){let n=xE.get(e);return n||(n=t(),xE.set(e,n),wE.add(n)),n}const wu=(e,t,n)=>{const r=Jo(t,n);r!==void 0&&e.add(r)};class e8{constructor(t){this._config=J$(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=yE(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),bE(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return wh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return wh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return wh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>wu(l,t,f))),u.forEach(f=>wu(l,i,f)),u.forEach(f=>wu(l,ea[o]||{},f)),u.forEach(f=>wu(l,ln,f)),u.forEach(f=>wu(l,lb,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),wE.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ea[n]||{},ln.datasets[n]||{},{type:n},ln,lb]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=_E(this._resolverCache,t,i);let l=s;if(n8(s,n)){o.$shared=!1,r=es(r)?r():r;const c=this.createResolver(t,r,a);l=xl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=_E(this._resolverCache,t,r);return Ct(n)?xl(o,n,void 0,i):o}}function _E(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:fb(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const t8=e=>Ct(e)&&Object.getOwnPropertyNames(e).some(t=>es(e[t]));function n8(e,t){const{isScriptable:n,isIndexable:r}=CC(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(es(a)||t8(a))||s&&Jt(a))return!0}return!1}var r8="4.4.1";const i8=["top","bottom","left","right","chartArea"];function SE(e,t){return e==="top"||e==="bottom"||i8.indexOf(e)===-1&&t==="x"}function CE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function EE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ht(n&&n.onComplete,[e],t)}function o8(e){const t=e.chart,n=t.options.animation;Ht(n&&n.onProgress,[e],t)}function OE(e){return gb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const _h={},PE=e=>{const t=OE(e);return Object.values(_h).filter(n=>n.canvas===t).pop()};function s8(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function a8(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Sh(e,t,n){return e.options.clip?e[n]:t[n]}function l8(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Sh(n,t,"left"),right:Sh(n,t,"right"),top:Sh(r,t,"top"),bottom:Sh(r,t,"bottom")}:t}class Jr{static register(...t){zi.add(...t),kE()}static unregister(...t){zi.remove(...t),kE()}constructor(t,n){const r=this.config=new e8(n),i=OE(t),o=PE(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||E$(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=uF(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,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 H$,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OF(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],_h[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}vo.listen(this,"complete",EE),vo.listen(this,"progress",o8),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return wt(t)?n&&o?o:i?r/i: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 zi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():AC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wC(this.canvas,this.ctx),this}stop(){return vo.stop(this),this}resize(t,n){vo.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,AC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ht(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};$t(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=Ob(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$t(o,s=>{const a=s.options,l=a.id,c=Ob(l,a),u=at(a.type,s.dtype);(a.position===void 0||SE(a.position,c)!==SE(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const g=zi.getScale(u);f=new g({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),$t(i,(s,a)=>{s||delete r[a]}),$t(r,s=>{Xn.configure(this,s,s.options),Xn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(CE("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||Eb(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=zi.getController(a),{datasetElementType:c,dataElementType:u}=ln.datasets[a];Object.assign(l,{dataElementType:zi.getElement(u),datasetElementType:c&&zi.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){$t(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||$t(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(CE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$t(this.scales,t=>{Xn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!rC(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;s8(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!rC(i,r(o)))return;return Array.from(i).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;Xn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],$t(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,es(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(vo.has(this)?this.attached&&!vo.running(this)&&vo.start(this):(this.draw(),EE({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const 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){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=l8(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&oh(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&sh(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return mo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=i$.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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},r.push(i)),i}getContext(){return this.$context||(this.$context=ns(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);su(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),vo.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete _h[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};$t(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){$t(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$t(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Jf(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=mF(t),c=a8(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ht(o.onHover,[t,a,this],this),l&&Ht(o.onClick,[t,a,this],this));const u=!Jf(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Me(Jr,"defaults",ln),Me(Jr,"instances",_h),Me(Jr,"overrides",ea),Me(Jr,"registry",zi),Me(Jr,"version",r8),Me(Jr,"getChart",PE);function kE(){return $t(Jr.instances,e=>e._plugins.invalidate())}function c8(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+pn,r-pn),e.closePath(),e.clip()}function u8(e){return db(e,["outerStart","outerEnd","innerStart","innerEnd"])}function d8(e,t,n,r){const i=u8(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return In(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:In(i.innerStart,0,s),innerEnd:In(i.innerEnd,0,s)}}function Sl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ch(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),g=u>0?u+r+n+c:0;let p=0;const v=i-l;if(r){const $=u>0?u-r:0,J=f>0?f-r:0,q=($+J)/2,K=q!==0?v*q/(q+r):v;p=(v-K)/2}const y=Math.max(.001,v*f-n/en)/f,x=(v-y)/2,_=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=d8(t,g,f,S-_),A=f-C,L=f-P,F=_+C/A,j=S-P/L,z=g+O,V=g+k,oe=_+O/z,ee=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const G=Sl(L,j,s,a);e.arc(G.x,G.y,P,j,S+pn)}const J=Sl(V,S,s,a);if(e.lineTo(J.x,J.y),k>0){const G=Sl(V,ee,s,a);e.arc(G.x,G.y,k,S+pn,ee+Math.PI)}const q=(S-k/g+(_+O/g))/2;if(e.arc(s,a,g,S-k/g,q,!0),e.arc(s,a,g,q,_+O/g,!0),O>0){const G=Sl(z,oe,s,a);e.arc(G.x,G.y,O,oe+Math.PI,_-pn)}const K=Sl(A,_,s,a);if(e.lineTo(K.x,K.y),C>0){const G=Sl(A,F,s,a);e.arc(G.x,G.y,C,_-pn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,J=Math.sin(F)*f+a;e.lineTo($,J);const q=Math.cos(j)*f+s,K=Math.sin(j)*f+a;e.lineTo(q,K)}e.closePath()}function f8(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Ch(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%tn||tn))}return Ch(e,t,n,r,l,i),e.fill(),l}function h8(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(o){Ch(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%tn||tn))}p&&c8(e,t,v),o||(Ch(e,t,n,r,v,i),e.stroke())}class Cl extends bo{constructor(n){super();Me(this,"circumference");Me(this,"endAngle");Me(this,"fullCircles");Me(this,"innerRadius");Me(this,"outerRadius");Me(this,"pixelMargin");Me(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=lC(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,y=at(g,c-l)>=tn||lu(s,l,c),x=po(a,u+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(o+s)/2,g=(a+l+u+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>tn?Math.floor(i/tn):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(en,i||0)),u=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,f8(n,this,u,s,a),h8(n,this,u,s,a),n.restore()}}Me(Cl,"id","arc"),Me(Cl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Me(Cl,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(Cl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function ME(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function p8(e,t,n){e.lineTo(n.x,n.y)}function g8(e){return e.stepped?$F:e.tension||e.cubicInterpolationMode==="monotone"?jF:p8}function DE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function m8(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=DE(i,n,r),u=g8(o);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):u(e,y,v,g,o.stepped),y=v);return l&&(v=i[(a+(g?c:0))%s],u(e,y,v,g,o.stepped)),!!l}function v8(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=DE(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,g,p,v,y,x,_;const S=P=>(s+(c?a-P:P))%o,C=()=>{y!==x&&(e.lineTo(u,x),e.lineTo(u,y),e.lineTo(u,_))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<y?y=O:O>x&&(x=O),u=(f*u+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,y=x=O),_=O}C()}function Pb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?v8:m8}function b8(e){return e.stepped?v9:e.tension||e.cubicInterpolationMode==="monotone"?b9:sa}function y8(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),ME(e,t.options),e.stroke(i)}function x8(e,t,n,r){const{segments:i,options:o}=t,s=Pb(t);for(const a of i)ME(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const w8=typeof Path2D=="function";function _8(e,t,n,r){w8&&!t.options.segment?y8(e,t,n,r):x8(e,t,n,r)}class rs extends bo{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){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;c9(this._points,r,t,i,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=C9(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=jC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=b8(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const y=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Pb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Pb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),_8(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(rs,"id","line"),Me(rs,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(rs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(rs,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function TE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class _u extends bo{constructor(n){super();Me(this,"parsed");Me(this,"skip");Me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return TE(this,n,"x",r)}inYRange(n,r){return TE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!mo(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,ub(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(_u,"id","point"),Me(_u,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(_u,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function AE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,u=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function is(e,t,n,r){return e?0:In(t,n,r)}function S8(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=SC(r);return{t:is(i.top,o.top,0,n),r:is(i.right,o.right,0,t),b:is(i.bottom,o.bottom,0,n),l:is(i.left,o.left,0,t)}}function C8(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=ra(i),s=Math.min(t,n),a=e.borderSkipped,l=r||Ct(i);return{topLeft:is(!l||a.top||a.left,o.topLeft,0,s),topRight:is(!l||a.top||a.right,o.topRight,0,s),bottomLeft:is(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:is(!l||a.bottom||a.right,o.bottomRight,0,s)}}function E8(e){const t=AE(e),n=t.right-t.left,r=t.bottom-t.top,i=S8(e,n/2,r/2),o=C8(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function kb(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&AE(e,r);return a&&(i||po(t,a.left,a.right))&&(o||po(n,a.top,a.bottom))}function O8(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function P8(e,t){e.rect(t.x,t.y,t.w,t.h)}function Mb(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class Su extends bo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=E8(this),a=O8(s.radius)?fu:P8;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Mb(s,n,o)),t.clip(),a(t,Mb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Mb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return kb(this,t,n,r)}inXRange(t,n){return kb(this,t,null,n)}inYRange(t,n){return kb(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(Su,"id","bar"),Me(Su,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(Su,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var k8=Object.freeze({__proto__:null,ArcElement:Cl,BarElement:Su,LineElement:rs,PointElement:_u});const Db=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],IE=Db.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function NE(e){return Db[e%Db.length]}function RE(e){return IE[e%IE.length]}function M8(e,t){return e.borderColor=NE(t),e.backgroundColor=RE(t),++t}function D8(e,t){return e.backgroundColor=e.data.map(()=>NE(t++)),t}function T8(e,t){return e.backgroundColor=e.data.map(()=>RE(t++)),t}function A8(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof aa?t=D8(n,t):i instanceof pu?t=T8(n,t):i&&(t=M8(n,t))}}function LE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function I8(e){return e&&(e.borderColor||e.backgroundColor)}var N8={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(LE(r)||I8(i)||o&&LE(o)))return;const s=A8(e);r.forEach(s)}};function R8(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,f,g,p,v,y;for(s[l++]=e[u],f=0;f<o-2;f++){let x=0,_=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,_+=e[S].y;x/=O,_/=O;const k=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:L,y:F}=e[u];for(p=v=-1,S=k;S<A;S++)v=.5*Math.abs((L-x)*(e[S].y-F)-(L-e[S].x)*(_-F)),v>p&&(p=v,g=e[S],y=S);s[l++]=g,u=y}return s[l++]=e[c],s}function L8(e,t,n,r){let i=0,o=0,s,a,l,c,u,f,g,p,v,y;const x=[],_=t+n-1,S=e[t].x,P=e[_].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===u)c<v?(v=c,f=s):c>y&&(y=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!wt(f)&&!wt(g)){const A=Math.min(f,g),L=Math.max(f,g);A!==p&&A!==k&&x.push({...e[A],x:i}),L!==p&&L!==k&&x.push({...e[L],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),u=O,o=0,v=y=c,f=g=p=s}}return x}function FE(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function $E(e){e.data.datasets.forEach(t=>{FE(t)})}function F8(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=In(go(t,o.axis,s).lo,0,n-1)),c?i=In(go(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var $8={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){$E(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(nn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:g}=F8(l,c);const p=n.threshold||4*r;if(g<=p){FE(i);return}wt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=R8(c,f,g,r,n);break;case"min-max":v=L8(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){$E(e)}};function j8(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=Ab(l,c,i);const u=Tb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:i[l],end:i[c]});continue}const f=jC(t,u);for(const g of f){const p=Tb(n,o[g.start],o[g.end],g.loop),v=$C(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:jE(u,p,"start",Math.max)},end:{[n]:jE(u,p,"end",Math.min)}})}}return s}function Tb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Tr(i),o=Tr(o)),{property:e,start:i,end:o}}function z8(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=Ab(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function Ab(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function jE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function zE(e,t){let n=[],r=!1;return Jt(e)?(r=!0,n=e):n=z8(e,t),n.length?new rs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function BE(e){return e&&e.fill!==!1}function B8(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!fn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function V8(e,t,n){const r=q8(e);if(Ct(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return fn(i)&&Math.floor(i)===i?H8(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function H8(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function W8(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ct(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function U8(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ct(e)?r=e.value:r=t.getBaseValue(),r}function q8(e){const t=e.options,n=t.fill;let r=at(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function G8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=Y8(t,n);a.push(zE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)K8(i,s[u],a)}return new rs({points:i,options:{}})}function Y8(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function K8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=X8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function X8(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],f=s[u.start][n],g=s[u.end][n];if(po(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class VE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:tn},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function Q8(e){const{chart:t,fill:n,line:r}=e;if(fn(n))return Z8(t,n);if(n==="stack")return G8(e);if(n==="shape")return!0;const i=J8(e);return i instanceof VE?i:zE(i,r)}function Z8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function J8(e){return(e.scale||{}).getPointPositionForValue?tj(e):ej(e)}function ej(e){const{scale:t={},fill:n}=e,r=W8(n,t);if(fn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function tj(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=U8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new VE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Ib(e,t,n){const r=Q8(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};r&&i.points.length&&(oh(e,n),nj(e,{line:i,target:r,above:u,below:f,area:n,scale:o,axis:s}),sh(e))}function nj(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(HE(e,r,s.top),WE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),HE(e,r,s.bottom)),WE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function HE(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],f=i[Ab(l,c,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function WE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=j8(n,r,i);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,rj(e,s,p&&Tb(i,u,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():UE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||UE(e,r,u,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function rj(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function UE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var ij={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof rs&&(l={visible:e.isDatasetVisible(s),index:s,fill:V8(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=B8(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Ib(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;BE(o)&&Ib(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!BE(r)||n.drawTime!=="beforeDatasetDraw"||Ib(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const qE=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},oj=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class GE extends bo{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,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ht(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=xn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qE(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-u;return this.legendItems.forEach((v,y)=>{const x=r+n/2+o.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=u,c[c.length-(y>0?0:1)]=0,p+=u,g++),l[y]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:S,itemHeight:C}=sj(r,n,o,x,i);_>0&&p+C+2*a>u&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[_]={left:v,top:p,col:y,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=_l(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Kn(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Kn(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Kn(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Kn(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;oh(t,this),this._draw(),sh(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=ln.color,l=_l(t.rtl,this.left,this.width),c=xn(s.font),{padding:u}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=qE(s,f),_=function(k,A,L){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const F=at(L.lineWidth,1);if(i.fillStyle=at(L.fillStyle,a),i.lineCap=at(L.lineCap,"butt"),i.lineDashOffset=at(L.lineDashOffset,0),i.lineJoin=at(L.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=at(L.strokeStyle,a),i.setLineDash(at(L.lineDash,[])),s.usePointStyle){const j={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},z=l.xPlus(k,v/2),V=A+g;_C(i,j,z,V,s.pointStyleWidth&&v)}else{const j=A+Math.max((f-y)/2,0),z=l.leftForLtr(k,v),V=ra(L.borderRadius);i.beginPath(),Object.values(V).some(oe=>oe!==0)?fu(i,{x:z,y:j,w:v,h:y,radius:V}):i.rect(z,j,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,A,L){na(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:Kn(o,this.left+u,this.right-r[0]),y:this.top+u+P,line:0}:p={x:this.left+u,y:Kn(o,this.top+P+u,this.bottom-n[0].height),line:0},NC(this.ctx,t.textDirection);const O=x+u;this.legendItems.forEach((k,A)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const L=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+L;let z=p.x,V=p.y;l.setWidth(this.width),C?A>0&&z+j+u>this.right&&(V=p.y+=O,p.line++,z=p.x=Kn(o,this.left+u,this.right-r[p.line])):A>0&&V+O>this.bottom&&(z=p.x=z+n[p.line].width+u,p.line++,V=p.y=Kn(o,this.top+P+u,this.bottom-n[p.line].height));const oe=l.x(z);if(_(oe,V,k),z=PF(F,z+v+g,C?z+j:this.right,t.rtl),S(l.x(z),V,k),C)p.x+=j+u;else if(typeof k.text!="string"){const ee=c.lineHeight;p.y+=YE(k,ee)+u}else p.y+=O}),RC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=xn(n.font),i=zn(n.padding);if(!n.display)return;const o=_l(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),u=this.top+c,f=Kn(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+Kn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=Kn(a,f,f+g);s.textAlign=o.textAlign(ob(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,na(s,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=xn(t.font),r=zn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(po(t,this.left,this.right)&&po(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],po(t,i.left,i.left+i.width)&&po(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!cj(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=oj(i,r);i&&!o&&Ht(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&Ht(n.onHover,[t,r,this],this)}else r&&Ht(n.onClick,[t,r,this],this)}}function sj(e,t,n,r,i){const o=aj(r,e,t,n),s=lj(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function aj(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function lj(e,t,n){let r=e;return typeof t.text!="string"&&(r=YE(t,n)),r}function YE(e,t){const n=e.text?e.text.length:0;return t*n}function cj(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var uj={id:"legend",_element:GE,start(e,t,n){const r=e.legend=new GE({ctx:e.ctx,options:n,chart:e});Xn.configure(e,r,n),Xn.addBox(e,r)},stop(e){Xn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Xn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=zn(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:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(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)}}};class Nb extends bo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Jt(r.text)?r.text.length:1;this._padding=zn(r.padding);const o=i*xn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,u,f;return this.isHorizontal()?(u=Kn(a,r,o),f=n+t,c=o-r):(s.position==="left"?(u=r+t,f=Kn(a,i,n),l=en*-.5):(u=o-t,f=Kn(a,n,i),l=en*.5),c=i-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=xn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);na(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:ob(n.align),textBaseline:"middle",translation:[s,a]})}}function dj(e,t){const n=new Nb({ctx:e.ctx,options:t,chart:e});Xn.configure(e,n,t),Xn.addBox(e,n),e.titleBlock=n}var fj={id:"title",_element:Nb,start(e,t,n){dj(e,n)},stop(e){const t=e.titleBlock;Xn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Xn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eh=new WeakMap;var hj={id:"subtitle",start(e,t,n){const r=new Nb({ctx:e.ctx,options:n,chart:e});Xn.configure(e,r,n),Xn.addBox(e,r),Eh.set(e,r)},stop(e){Xn.removeBox(e,Eh.get(e)),Eh.delete(e)},beforeUpdate(e,t,n){const r=Eh.get(e);Xn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cu={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=rb(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Bi(e,t){return t&&(Jt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function yo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
122
122
  `)>-1?e.split(`
123
- `):e}function pj(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=xn(t.bodyFont),c=xn(t.titleFont),u=xn(t.footerFont),f=o.length,g=i.length,p=r.length,v=zn(t.padding);let y=v.height,x=0,_=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*P+(_-p)*l.lineHeight+(_-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*u.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,$t(e.title,C),n.font=l.string,$t(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,$t(r,P=>{$t(P.before,C),$t(P.lines,C),$t(P.after,C)}),S=0,n.font=u.string,$t(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function gj(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function mj(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function vj(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),mj(c,e,t,n)&&(c="center"),c}function XE(e,t,n){const r=n.yAlign||t.yAlign||gj(e,n);return{xAlign:n.xAlign||t.xAlign||vj(e,t,n,r),yAlign:r}}function bj(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function yj(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function QE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=ra(s);let v=bj(t,a);const y=yj(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:In(v,0,r.width-t.width),y:In(y,0,r.height-t.height)}}function Oh(e,t,n){const r=zn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function ZE(e){return Bi([],yo(e))}function xj(e,t,n){return ns(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function JE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const e2={beforeTitle:ho,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:ho,beforeBody:ho,beforeLabel:ho,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return wt(n)||(t+=n),t},labelColor(e){const 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){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ho,afterBody:ho,beforeFooter:ho,footer:ho,afterFooter:ho};function hr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?e2[t].call(n,r):i}let t2=(Ux=class extends bo{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new HC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=xj(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=hr(r,"beforeTitle",this,t),o=hr(r,"title",this,t),s=hr(r,"afterTitle",this,t);let a=[];return a=Bi(a,yo(i)),a=Bi(a,yo(o)),a=Bi(a,yo(s)),a}getBeforeBody(t,n){return ZE(hr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return $t(t,o=>{const s={before:[],lines:[],after:[]},a=JE(r,o);Bi(s.before,yo(hr(a,"beforeLabel",this,o))),Bi(s.lines,hr(a,"label",this,o)),Bi(s.after,yo(hr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return ZE(hr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=hr(r,"beforeFooter",this,t),o=hr(r,"footer",this,t),s=hr(r,"afterFooter",this,t);let a=[];return a=Bi(a,yo(i)),a=Bi(a,yo(o)),a=Bi(a,yo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(pj(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,g)=>t.filter(u,f,g,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),$t(a,u=>{const f=JE(t.callbacks,u);i.push(hr(f,"labelColor",this,u)),o.push(hr(f,"labelPointStyle",this,u)),s.push(hr(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Cu[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=KE(this,r),c=Object.assign({},a,l),u=XE(this.chart,r,c),f=QE(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=ra(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,_,S,C,P,O;return o==="center"?(P=p+y/2,i==="left"?(x=g,_=x-s,C=P+s,O=P-s):(x=g+v,_=x+s,C=P-s,O=P+s),S=x):(i==="left"?_=g+Math.max(l,u)+s:i==="right"?_=g+v-Math.max(c,f)-s:_=this.caretX,o==="top"?(C=p,P=C-s,x=_-s,S=_+s):(C=p+y,P=C+s,x=_+s,S=_-s),O=C),{x1:x,x2:_,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=_l(r.rtl,this.x,this.width);for(t.x=Oh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=xn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=xn(o.bodyFont),f=Oh(this,"left",o),g=i.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,_=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ub(t,y,x,_),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,ub(t,y,x,_)}else{t.lineWidth=Ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),_=ra(s.borderRadius);Object.values(_).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,fu(t,{x:y,y:v,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),fu(t,{x,y:v+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=xn(r.bodyFont);let g=f.lineHeight,p=0;const v=_l(r.rtl,this.x,this.width),y=function(L){n.fillText(L,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let _,S,C,P,O,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=Oh(this,x,r),n.fillStyle=r.bodyColor,$t(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+u:c+2+u:0,P=0,k=i.length;P<k;++P){for(_=i[P],S=this.labelTextColors[P],n.fillStyle=S,$t(_.before,y),C=_.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,A=C.length;O<A;++O)y(C[O]),g=f.lineHeight;$t(_.after,y)}p=0,g=f.lineHeight,$t(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=_l(r.rtl,this.x,this.width);for(t.x=Oh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=xn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=ra(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-v),n.quadraticCurveTo(a+c,l+u,a+c-v,l+u),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Cu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=KE(this,t),l=Object.assign({},s,this._size),c=XE(n,t,l),u=QE(t,l,c,n);(i._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=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=zn(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=r,this.drawBackground(o,t,i,n),NC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),RC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Jf(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Jf(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Cu[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Me(Ux,"positioners",Cu),Ux);var wj={id:"tooltip",_element:t2,positioners:Cu,afterInit(e,t,n){n&&(e.tooltip=new t2({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:e2},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"]},_j=Object.freeze({__proto__:null,Colors:N8,Decimation:$8,Filler:ij,Legend:uj,SubTitle:hj,Title:fj,Tooltip:wj});const Sj=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Cj(e,t,n,r){const i=e.indexOf(t);if(i===-1)return Sj(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Ej=(e,t)=>e===null?null:In(Math.round(e),0,t);function n2(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Rb extends ca{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(wt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Cj(r,t,at(n,t),this._addedLabels),Ej(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return n2.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}Me(Rb,"id","category"),Me(Rb,"defaults",{ticks:{callback:n2}});function Oj(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:g}=e,p=o||1,v=u-1,{min:y,max:x}=t,_=!wt(s),S=!wt(a),C=!wt(c),P=(x-y)/(f+1);let O=oC((x-y)/v/p)*p,k,A,L,F;if(O<1e-14&&!_&&!S)return[{value:y},{value:x}];F=Math.ceil(x/O)-Math.floor(y/O),F>v&&(O=oC(F*O/v/p)*p),wt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(A=Math.floor(y/O)*O,L=Math.ceil(x/O)*O):(A=y,L=x),_&&S&&o&&xF((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,u)),O=(a-s)/F,A=s,L=a):C?(A=_?s:A,L=S?a:L,F=c-1,O=(L-A)/F):(F=(L-A)/O,au(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const j=Math.max(aC(O),aC(A));k=Math.pow(10,wt(l)?j:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let z=0;for(_&&(g&&A!==s?(n.push({value:s}),A<s&&z++,au(Math.round((A+z*O)*k)/k,s,r2(s,P,e))&&z++):A<s&&z++);z<F;++z){const V=Math.round((A+z*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&L!==a?n.length&&au(n[n.length-1].value,a,r2(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||L===a)&&n.push({value:L}),n}function r2(e,t,{horizontal:n,minRotation:r}){const i=yi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Ph extends ca{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 wt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=ji(i),c=ji(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,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,s=Oj(i,o);return t.bounds==="ticks"&&sC(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return uu(t,this.chart.options.locale,this.options.ticks.format)}}class Lb extends Ph{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?t:0,this.max=fn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=yi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me(Lb,"id","linear"),Me(Lb,"defaults",{ticks:{callback:rh.formatters.numeric}});const Eu=e=>Math.floor(ts(e)),ua=(e,t)=>Math.pow(10,Eu(e)+t);function i2(e){return e/Math.pow(10,Eu(e))===1}function o2(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function Pj(e,t){const n=t-e;let r=Eu(n);for(;o2(e,t,r)>10;)r++;for(;o2(e,t,r)<10;)r--;return Math.min(r,Eu(e))}function kj(e,{min:t,max:n}){t=Dr(e.min,t);const r=[],i=Eu(t);let o=Pj(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,o)),g=Dr(e.min,Math.round((l+u+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:i2(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+u+f*Math.pow(10,o))*s)/s;const p=Dr(e.max,g);return r.push({value:p,major:i2(p),significand:f}),r}class Fb extends ca{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ph.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return fn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?Math.max(0,t):null,this.max=fn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!fn(this._userMin)&&(this.min=t===ua(this.min,0)?ua(this.min,-1):ua(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(ua(r,-1)),s(ua(i,1)))),r<=0&&o(ua(i,-1)),i<=0&&s(ua(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=kj(n,this);return t.bounds==="ticks"&&sC(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":uu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ts(t),this._valueRange=ts(this.max)-ts(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ts(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Me(Fb,"id","logarithmic"),Me(Fb,"defaults",{ticks:{callback:rh.formatters.logarithmic,major:{enabled:!0}}});function $b(e){const t=e.ticks;if(t.display&&e.display){const n=zn(t.backdropPadding);return at(t.font&&t.font.size,ln.font.size)+n.height}return 0}function Mj(e,t,n){return n=Zt(n)?n:[n],{w:FF(e,t.string,n),h:n.length*t.lineHeight}}function s2(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Dj(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Jt/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),f=xn(c.font),g=Mj(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Tr(e.getIndexAngle(l)+a),v=Math.round(nb(p)),y=s2(v,u.x,g.w,0,180),x=s2(v,u.y,g.h,90,270);Tj(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Nj(e,r,i)}function Tj(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Aj(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(nb(Tr(l.angle+pn))),u=Fj(l.y,a.h,c),f=Rj(c),g=Lj(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:g,top:u,right:g+a.w,bottom:u+a.h}}function Ij(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(mo({x:n,y:r},t)||mo({x:n,y:o},t)||mo({x:i,y:r},t)||mo({x:i,y:o},t))}function Nj(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:$b(o)/2,additionalAngle:s?Jt/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const f=Aj(e,u,l);r.push(f),a==="auto"&&(f.visible=Ij(f,c),f.visible&&(c=f))}return r}function Rj(e){return e===0||e===180?"center":e<180?"left":"right"}function Lj(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Fj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function $j(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!wt(a)){const l=ra(t.borderRadius),c=zn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),fu(e,{x:u,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(u,f,g,p)}}function jj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));$j(n,s,o);const a=xn(s.font),{x:l,y:c,textAlign:u}=o;na(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function a2(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,en);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function zj(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),a2(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Bj(e,t,n){return ns(e,{label:n,index:t,type:"pointLabel"})}class Ou extends Ph{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=zn($b(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=fn(t)&&!isNaN(t)?t:0,this.max=fn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$b(this.options))}generateTickLabels(t){Ph.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ht(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Dj(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=en/(this._pointLabels.length||1),r=this.options.startAngle||0;return Tr(t*n+yi(r))}getDistanceFromCenterForValue(t){if(wt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(wt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Bj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-pn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),a2(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&jj(this,s),i.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);zj(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=u;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=xn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=zn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-u.size/2-f.top,s+f.width,u.size+f.height)}na(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(Ou,"id","radialLinear"),Me(Ou,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:rh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(Ou,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(Ou,"descriptors",{angleLines:{_fallback:"grid"}});const kh={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}},pr=Object.keys(kh);function l2(e,t){return e-t}function c2(e,t){if(wt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),fn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(yl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function u2(e,t,n,r){const i=pr.length;for(let o=pr.indexOf(e);o<i-1;++o){const s=kh[pr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return pr[o]}return pr[i-1]}function Vj(e,t,n,r,i){for(let o=pr.length-1;o>=pr.indexOf(n);o--){const s=pr[o];if(kh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return pr[n?pr.indexOf(n):0]}function Hj(e){for(let t=pr.indexOf(e)+1,n=pr.length;t<n;++t)if(kh[pr[t]].common)return pr[t]}function d2(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ib(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Wj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function f2(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:Wj(e,r,i,n)}class Pu extends ca{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={}){const r=t.time||(t.time={}),i=this._adapter=new J9._date(t.adapters.date);i.init(n),ou(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:c2(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=fn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=fn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=CF(i,o,s);return this._unit=n.unit||(r.autoSkip?u2(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Vj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Hj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),f2(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=In(n,0,s),r=In(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||u2(o.minUnit,n,r,this._getLabelCapacity(n)),a=at(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=yl(l)||l===!0,u={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)d2(u,g,v);return(g===r||i.bounds==="ticks"||p===1)&&d2(u,g,v),Object.keys(u).sort(l2).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Ht(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=yi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,f2(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(c2(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return dC(t.sort(l2))}}Me(Pu,"id","time"),Me(Pu,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Mh(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=go(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=go(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class jb extends Pu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Mh(n,this.min),this._tableRange=Mh(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Mh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Mh(this._table,r*this._tableRange+this._minPos,!0)}}Me(jb,"id","timeseries"),Me(jb,"defaults",Pu.defaults);var Uj=Object.freeze({__proto__:null,CategoryScale:Rb,LinearScale:Lb,LogarithmicScale:Fb,RadialLinearScale:Ou,TimeScale:Pu,TimeSeriesScale:jb});const qj=[Z9,k8,_j,Uj];/*!
123
+ `):e}function pj(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=xn(t.bodyFont),c=xn(t.titleFont),u=xn(t.footerFont),f=o.length,g=i.length,p=r.length,v=zn(t.padding);let y=v.height,x=0,_=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*P+(_-p)*l.lineHeight+(_-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*u.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,$t(e.title,C),n.font=l.string,$t(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,$t(r,P=>{$t(P.before,C),$t(P.lines,C),$t(P.after,C)}),S=0,n.font=u.string,$t(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function gj(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function mj(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function vj(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),mj(c,e,t,n)&&(c="center"),c}function XE(e,t,n){const r=n.yAlign||t.yAlign||gj(e,n);return{xAlign:n.xAlign||t.xAlign||vj(e,t,n,r),yAlign:r}}function bj(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function yj(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function QE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=ra(s);let v=bj(t,a);const y=yj(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:In(v,0,r.width-t.width),y:In(y,0,r.height-t.height)}}function Oh(e,t,n){const r=zn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function ZE(e){return Bi([],yo(e))}function xj(e,t,n){return ns(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function JE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const e2={beforeTitle:ho,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:ho,beforeBody:ho,beforeLabel:ho,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return wt(n)||(t+=n),t},labelColor(e){const 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){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ho,afterBody:ho,beforeFooter:ho,footer:ho,afterFooter:ho};function hr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?e2[t].call(n,r):i}let t2=(Ux=class extends bo{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new HC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=xj(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=hr(r,"beforeTitle",this,t),o=hr(r,"title",this,t),s=hr(r,"afterTitle",this,t);let a=[];return a=Bi(a,yo(i)),a=Bi(a,yo(o)),a=Bi(a,yo(s)),a}getBeforeBody(t,n){return ZE(hr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return $t(t,o=>{const s={before:[],lines:[],after:[]},a=JE(r,o);Bi(s.before,yo(hr(a,"beforeLabel",this,o))),Bi(s.lines,hr(a,"label",this,o)),Bi(s.after,yo(hr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return ZE(hr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=hr(r,"beforeFooter",this,t),o=hr(r,"footer",this,t),s=hr(r,"afterFooter",this,t);let a=[];return a=Bi(a,yo(i)),a=Bi(a,yo(o)),a=Bi(a,yo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(pj(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,g)=>t.filter(u,f,g,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),$t(a,u=>{const f=JE(t.callbacks,u);i.push(hr(f,"labelColor",this,u)),o.push(hr(f,"labelPointStyle",this,u)),s.push(hr(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Cu[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=KE(this,r),c=Object.assign({},a,l),u=XE(this.chart,r,c),f=QE(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=ra(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,_,S,C,P,O;return o==="center"?(P=p+y/2,i==="left"?(x=g,_=x-s,C=P+s,O=P-s):(x=g+v,_=x+s,C=P-s,O=P+s),S=x):(i==="left"?_=g+Math.max(l,u)+s:i==="right"?_=g+v-Math.max(c,f)-s:_=this.caretX,o==="top"?(C=p,P=C-s,x=_-s,S=_+s):(C=p+y,P=C+s,x=_+s,S=_-s),O=C),{x1:x,x2:_,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=_l(r.rtl,this.x,this.width);for(t.x=Oh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=xn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=xn(o.bodyFont),f=Oh(this,"left",o),g=i.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,_=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ub(t,y,x,_),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,ub(t,y,x,_)}else{t.lineWidth=Ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),_=ra(s.borderRadius);Object.values(_).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,fu(t,{x:y,y:v,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),fu(t,{x,y:v+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=xn(r.bodyFont);let g=f.lineHeight,p=0;const v=_l(r.rtl,this.x,this.width),y=function(L){n.fillText(L,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let _,S,C,P,O,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=Oh(this,x,r),n.fillStyle=r.bodyColor,$t(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+u:c+2+u:0,P=0,k=i.length;P<k;++P){for(_=i[P],S=this.labelTextColors[P],n.fillStyle=S,$t(_.before,y),C=_.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,A=C.length;O<A;++O)y(C[O]),g=f.lineHeight;$t(_.after,y)}p=0,g=f.lineHeight,$t(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=_l(r.rtl,this.x,this.width);for(t.x=Oh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=xn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=ra(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-v),n.quadraticCurveTo(a+c,l+u,a+c-v,l+u),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Cu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=KE(this,t),l=Object.assign({},s,this._size),c=XE(n,t,l),u=QE(t,l,c,n);(i._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=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=zn(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=r,this.drawBackground(o,t,i,n),NC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),RC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Jf(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Jf(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Cu[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Me(Ux,"positioners",Cu),Ux);var wj={id:"tooltip",_element:t2,positioners:Cu,afterInit(e,t,n){n&&(e.tooltip=new t2({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:e2},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"]},_j=Object.freeze({__proto__:null,Colors:N8,Decimation:$8,Filler:ij,Legend:uj,SubTitle:hj,Title:fj,Tooltip:wj});const Sj=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Cj(e,t,n,r){const i=e.indexOf(t);if(i===-1)return Sj(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Ej=(e,t)=>e===null?null:In(Math.round(e),0,t);function n2(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Rb extends ca{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(wt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Cj(r,t,at(n,t),this._addedLabels),Ej(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return n2.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}Me(Rb,"id","category"),Me(Rb,"defaults",{ticks:{callback:n2}});function Oj(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:g}=e,p=o||1,v=u-1,{min:y,max:x}=t,_=!wt(s),S=!wt(a),C=!wt(c),P=(x-y)/(f+1);let O=oC((x-y)/v/p)*p,k,A,L,F;if(O<1e-14&&!_&&!S)return[{value:y},{value:x}];F=Math.ceil(x/O)-Math.floor(y/O),F>v&&(O=oC(F*O/v/p)*p),wt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(A=Math.floor(y/O)*O,L=Math.ceil(x/O)*O):(A=y,L=x),_&&S&&o&&xF((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,u)),O=(a-s)/F,A=s,L=a):C?(A=_?s:A,L=S?a:L,F=c-1,O=(L-A)/F):(F=(L-A)/O,au(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const j=Math.max(aC(O),aC(A));k=Math.pow(10,wt(l)?j:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let z=0;for(_&&(g&&A!==s?(n.push({value:s}),A<s&&z++,au(Math.round((A+z*O)*k)/k,s,r2(s,P,e))&&z++):A<s&&z++);z<F;++z){const V=Math.round((A+z*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&L!==a?n.length&&au(n[n.length-1].value,a,r2(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||L===a)&&n.push({value:L}),n}function r2(e,t,{horizontal:n,minRotation:r}){const i=yi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Ph extends ca{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 wt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=ji(i),c=ji(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,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,s=Oj(i,o);return t.bounds==="ticks"&&sC(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return uu(t,this.chart.options.locale,this.options.ticks.format)}}class Lb extends Ph{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?t:0,this.max=fn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=yi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me(Lb,"id","linear"),Me(Lb,"defaults",{ticks:{callback:rh.formatters.numeric}});const Eu=e=>Math.floor(ts(e)),ua=(e,t)=>Math.pow(10,Eu(e)+t);function i2(e){return e/Math.pow(10,Eu(e))===1}function o2(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function Pj(e,t){const n=t-e;let r=Eu(n);for(;o2(e,t,r)>10;)r++;for(;o2(e,t,r)<10;)r--;return Math.min(r,Eu(e))}function kj(e,{min:t,max:n}){t=Dr(e.min,t);const r=[],i=Eu(t);let o=Pj(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,o)),g=Dr(e.min,Math.round((l+u+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:i2(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+u+f*Math.pow(10,o))*s)/s;const p=Dr(e.max,g);return r.push({value:p,major:i2(p),significand:f}),r}class Fb extends ca{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ph.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return fn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?Math.max(0,t):null,this.max=fn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!fn(this._userMin)&&(this.min=t===ua(this.min,0)?ua(this.min,-1):ua(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(ua(r,-1)),s(ua(i,1)))),r<=0&&o(ua(i,-1)),i<=0&&s(ua(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=kj(n,this);return t.bounds==="ticks"&&sC(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":uu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ts(t),this._valueRange=ts(this.max)-ts(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ts(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Me(Fb,"id","logarithmic"),Me(Fb,"defaults",{ticks:{callback:rh.formatters.logarithmic,major:{enabled:!0}}});function $b(e){const t=e.ticks;if(t.display&&e.display){const n=zn(t.backdropPadding);return at(t.font&&t.font.size,ln.font.size)+n.height}return 0}function Mj(e,t,n){return n=Jt(n)?n:[n],{w:FF(e,t.string,n),h:n.length*t.lineHeight}}function s2(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Dj(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?en/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),f=xn(c.font),g=Mj(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Tr(e.getIndexAngle(l)+a),v=Math.round(nb(p)),y=s2(v,u.x,g.w,0,180),x=s2(v,u.y,g.h,90,270);Tj(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Nj(e,r,i)}function Tj(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Aj(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(nb(Tr(l.angle+pn))),u=Fj(l.y,a.h,c),f=Rj(c),g=Lj(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:g,top:u,right:g+a.w,bottom:u+a.h}}function Ij(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(mo({x:n,y:r},t)||mo({x:n,y:o},t)||mo({x:i,y:r},t)||mo({x:i,y:o},t))}function Nj(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:$b(o)/2,additionalAngle:s?en/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const f=Aj(e,u,l);r.push(f),a==="auto"&&(f.visible=Ij(f,c),f.visible&&(c=f))}return r}function Rj(e){return e===0||e===180?"center":e<180?"left":"right"}function Lj(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Fj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function $j(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!wt(a)){const l=ra(t.borderRadius),c=zn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),fu(e,{x:u,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(u,f,g,p)}}function jj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));$j(n,s,o);const a=xn(s.font),{x:l,y:c,textAlign:u}=o;na(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function a2(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,tn);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function zj(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),a2(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Bj(e,t,n){return ns(e,{label:n,index:t,type:"pointLabel"})}class Ou extends Ph{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=zn($b(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=fn(t)&&!isNaN(t)?t:0,this.max=fn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$b(this.options))}generateTickLabels(t){Ph.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Ht(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Dj(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=tn/(this._pointLabels.length||1),r=this.options.startAngle||0;return Tr(t*n+yi(r))}getDistanceFromCenterForValue(t){if(wt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(wt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Bj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-pn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),a2(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&jj(this,s),i.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);zj(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=u;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=xn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=zn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-u.size/2-f.top,s+f.width,u.size+f.height)}na(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(Ou,"id","radialLinear"),Me(Ou,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:rh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(Ou,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(Ou,"descriptors",{angleLines:{_fallback:"grid"}});const kh={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}},pr=Object.keys(kh);function l2(e,t){return e-t}function c2(e,t){if(wt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),fn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(yl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function u2(e,t,n,r){const i=pr.length;for(let o=pr.indexOf(e);o<i-1;++o){const s=kh[pr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return pr[o]}return pr[i-1]}function Vj(e,t,n,r,i){for(let o=pr.length-1;o>=pr.indexOf(n);o--){const s=pr[o];if(kh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return pr[n?pr.indexOf(n):0]}function Hj(e){for(let t=pr.indexOf(e)+1,n=pr.length;t<n;++t)if(kh[pr[t]].common)return pr[t]}function d2(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ib(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Wj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function f2(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:Wj(e,r,i,n)}class Pu extends ca{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={}){const r=t.time||(t.time={}),i=this._adapter=new J9._date(t.adapters.date);i.init(n),ou(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:c2(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=fn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=fn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=CF(i,o,s);return this._unit=n.unit||(r.autoSkip?u2(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Vj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Hj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),f2(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=In(n,0,s),r=In(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||u2(o.minUnit,n,r,this._getLabelCapacity(n)),a=at(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=yl(l)||l===!0,u={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)d2(u,g,v);return(g===r||i.bounds==="ticks"||p===1)&&d2(u,g,v),Object.keys(u).sort(l2).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Ht(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=yi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,f2(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(c2(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return dC(t.sort(l2))}}Me(Pu,"id","time"),Me(Pu,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Mh(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=go(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=go(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class jb extends Pu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Mh(n,this.min),this._tableRange=Mh(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Mh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Mh(this._table,r*this._tableRange+this._minPos,!0)}}Me(jb,"id","timeseries"),Me(jb,"defaults",Pu.defaults);var Uj=Object.freeze({__proto__:null,CategoryScale:Rb,LinearScale:Lb,LogarithmicScale:Fb,RadialLinearScale:Ou,TimeScale:Pu,TimeSeriesScale:jb});const qj=[Z9,k8,_j,Uj];/*!
124
124
  * chartjs-plugin-datalabels v2.2.0
125
125
  * https://chartjs-plugin-datalabels.netlify.app
126
126
  * (c) 2017-2022 chartjs-plugin-datalabels contributors
127
127
  * Released under the MIT license
128
128
  */var h2=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),ku={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
129
- `)):Array.isArray(n)?e.push.apply(e,n):wt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*h2)/h2}};function zb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function Gj(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var Yj=0,p2=1,g2=2,m2=4,v2=8;function Dh(e,t,n){var r=Yj;return e<n.left?r|=p2:e>n.right&&(r|=g2),t<n.top?r|=v2:t>n.bottom&&(r|=m2),r}function Kj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Dh(n,r,t),a=Dh(i,o,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&v2?(c=n+(i-n)*(t.top-r)/(o-r),u=t.top):l&m2?(c=n+(i-n)*(t.bottom-r)/(o-r),u=t.bottom):l&g2?(u=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&p2&&(u=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=u,s=Dh(n,r,t)):(i=c,o=u,a=Dh(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Th(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=Kj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),Gj(i,o,e.vx,e.vy,t.align)}var Ah={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return Th({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=zb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Th({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=zb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Th({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=zb(e,t.origin);return Th({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},xo=ku.rasterize;function Xj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function Qj(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function Zj(e){return e instanceof Cl?Ah.arc:e instanceof _u?Ah.point:e instanceof Su?Ah.bar:Ah.fallback}function Jj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+i-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function ez(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),Jj(e,xo(t.x)+o/2,xo(t.y)+o/2,xo(t.w)-o,xo(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function tz(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function nz(e,t,n){var r=e.shadowBlur,i=n.stroked,o=xo(n.x),s=xo(n.y),a=xo(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function rz(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,g;if(!(!l||!s&&!f))for(n=tz(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),g=0,l=t.length;g<l;++g)nz(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var b2=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};$i(b2.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=xn(tn([n.font,{}],r,o)),a=tn([n.color,ln.color],r,o);return{align:tn([n.align,"center"],r,o),anchor:tn([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:tn([n.backgroundColor,null],r,o),borderColor:tn([n.borderColor,null],r,o),borderRadius:tn([n.borderRadius,0],r,o),borderWidth:tn([n.borderWidth,0],r,o),clamp:tn([n.clamp,!1],r,o),clip:tn([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:tn([n.offset,4],r,o),opacity:tn([n.opacity,1],r,o),origin:Qj(i._el,r),padding:zn(tn([n.padding,4],r,o)),positioner:Zj(i._el),rotation:tn([n.rotation,0],r,o)*(Math.PI/180),size:ku.textSize(i._ctx,t,s),textAlign:tn([n.textAlign,"start"],r,o),textShadowBlur:tn([n.textShadowBlur,0],r,o),textShadowColor:tn([n.textShadowColor,a],r,o),textStrokeColor:tn([n.textStrokeColor,a],r,o),textStrokeWidth:tn([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=tn([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=at(Ht(o.formatter,[s,e]),s),l=wt(a)?[]:ku.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=Xj(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=ku.bound(0,i.opacity,1),r.translate(xo(t.x),xo(t.y)),r.rotate(i.rotation),ez(r,o.frame,i),rz(r,i.lines,o.text,i),r.restore())}});var iz=Number.MIN_SAFE_INTEGER||-9007199254740991,oz=Number.MAX_SAFE_INTEGER||9007199254740991;function Mu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function y2(e,t){var n=oz,r=iz,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Ih(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var x2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};$i(x2.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Mu(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Ih(t[0],t[1]),Ih(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Ih(n[0],n[1]),Ih(n[0],n[3])),i=0;i<r.length;++i)if(o=y2(t,r[i]),s=y2(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Mu({x:t.x,y:t.y},r,n),Mu({x:t.x+t.w,y:t.y},r,n),Mu({x:t.x+t.w,y:t.y+t.h},r,n),Mu({x:t.x,y:t.y+t.h},r,n)]}});function w2(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,u*=o*f,c+=t.offset*i,u+=t.offset*o,{x:r.x+c,y:r.y+u}}function sz(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function az(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=w2(a,r.model(),o),i._box.update(s,o,r.rotation()));return sz(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var Du={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new x2,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&az(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=w2(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},lz=function(e){if(wt(e))return null;var t=e,n,r,i;if(Ct(e))if(!wt(e.label))t=e.label;else if(!wt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},cz={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:lz,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},gr="$datalabels",_2="$default";function uz(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=$i({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push($i({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return $t(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||_2]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function Bb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&Ht(s,[i,r])===!0&&(e[gr]._dirty=!0,n.update(i)))}}function dz(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&Bb(e,t.leave,n,i),o&&Bb(e,t.enter,r,i))}function fz(e,t){var n=e[gr],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=Du.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,dz(e,r,i,o,t)}}function hz(e,t){var n=e[gr],r=n._listeners.click,i=r&&Du.lookup(n._labels,t);i&&Bb(e,r,i,t)}var pz={id:"datalabels",defaults:cz,beforeInit:function(e){e[gr]={_actives:[]}},beforeUpdate:function(e){var t=e[gr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[gr],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=uz(a,n),c=t.meta.data||[],u=e.ctx,f,g,p,v,y,x,_,S;for(u.save(),f=0,p=c.length;f<p;++f)if(_=c[f],_[gr]=[],s&&_&&e.getDataVisibility(f)&&!_.skip)for(g=0,v=l.labels.length;g<v;++g)y=l.labels[g],x=y._key,S=new b2(y,u,_,f),S.$groups={_set:r,_key:x||_2},S.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},S.update(S.$context),_[gr].push(S),o.push(S);u.restore(),$i(i._listeners,l.listeners,{merger:function(C,P,O){P[C]=P[C]||{},P[C][t.index]=O[C],i._listened=!0}})},afterUpdate:function(e){e[gr]._labels=Du.prepare(e[gr]._datasets)},afterDatasetsDraw:function(e){Du.draw(e,e[gr]._labels)},beforeEvent:function(e,t){if(e[gr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":fz(e,n);break;case"click":hz(e,n);break}}},afterEvent:function(e){var t=e[gr],n=t._actives,r=t._actives=e.getActiveElements(),i=ku.arrayDiff(n,r),o,s,a,l,c,u,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[gr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||i.length)&&(Du.update(t._labels),e.render()),delete t._dirty}};Jr.register(...qj),Jr.register(pz);function S2({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=pe(l=>l.themeStyle);m.useEffect(()=>{var u,f,g,p;(f=(u=o==null?void 0:o.chart)==null?void 0:u.font)!=null&&f.family&&(Jr.defaults.font={...Jr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Jr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}}return w.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:w.jsx("canvas",{ref:n})})}function wi(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var gz=["color"],C2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,gz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mz=["color"],vz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,mz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bz=["color"],E2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,bz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yz=["color"],da=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,yz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xz=["color"],wz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,xz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_z=["color"],Sz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,_z);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Cz=["color"],O2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Ez=["color"],Oz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Ez);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pz=["color"],kz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Pz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mz=["color"],P2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Mz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Dz=["color"],k2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Dz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});function Tz(e,t){var s,a,l,c;const n=pe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map((u,f)=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(g=>g[u]),backgroundColor:r==null?void 0:r[f%r.length],borderColor:i==null?void 0:i[f%i.length]}))}function Az(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=Vi(e);let r=[];const i=pe.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(g=>({x:g[t[0]],y:g[t[1]],r:g[t[2]],label:g[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(g=>g[n==null?void 0:n[1]]))].map((g,p)=>{const v=e.filter(y=>y[n==null?void 0:n[1]]===g);return{label:g,data:v.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[p%o.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function Iz(e,t){var s,a,l,c;const n=pe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,g)=>r==null?void 0:r[g%r.length]),borderColor:t.map((f,g)=>i==null?void 0:i[g%i.length])}))}function Nz(e){let t=-1,n=0;return e.forEach((r,i)=>{const o=Object.keys(r).length;o>n&&(t=i,n=o)}),t}function Vi(e){if(e.length===0)return{dimensionKeys:[],metricKeys:[]};const t=Nz(e),n=Object.keys(e[t]),r=n.filter(o=>{var s,a,l,c,u,f,g,p;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[o])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[o])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[o])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[o])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[o])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[o])=="string"||typeof((g=e==null?void 0:e[2])==null?void 0:g[o])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[o])=="string")});r.length===0&&r.push(n[0]);const i=n.filter(o=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[o])===+((a=e==null?void 0:e[t])==null?void 0:a[o])});return{dimensionKeys:r,metricKeys:i}}function Vb(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n[s],data:o.data,label:o.label})):e}function M2({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const i=e.reduce((o,s)=>{const a=s[t],l=s[n],c=s[r];return o[a]||(o[a]={[t]:a}),o[a][l]=c,o},{});return Object.values(i)}function Hb(e,t){var s;const n=pe.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=Ws.cloneDeep(r);return Ws.merge(i,e,t)}function D2(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function Rz({frame:e}){const t=pe(S=>S.isDashboardEditing),n=pe(S=>S.filterValues),r=pe(S=>S.isVisualEditing),i=pe(S=>S.selectedSheetId);pe(S=>S.currentBreakpoint);const{removeFrame:o}=pe(S=>S.actions),s=pe(S=>S.actions.setIsVisualEditing),a=ve(S=>S.actions.setFilterValues),l=ve(S=>S.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=ve(S=>S.actions),g=ve(S=>S.actions.setSelectedConnectionId),p=ve(S=>S.actions.setSelectedDatabaseName),v=ve(S=>S.actions.setSelectedSchemaName),y=ve(S=>S.actions.setSelectedTableName),x=e.cards.find(S=>S.id===e.activeCardId);function _(){s(!r),c(x);const{dimensionKeys:S}=Vi((x==null?void 0:x.data)||[]);f(S),u(e),x!=null&&x.connectionId&&g(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&p(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&y(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return w.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&w.jsxs("div",{className:"flex items-center gap-2",children:[r?w.jsx(wz,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):w.jsx(Sz,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),w.jsx(da,{onClick:()=>o(i,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function Lz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Wb="dismissableLayer.update",Fz="dismissableLayer.pointerDownOutside",$z="dismissableLayer.focusOutside";let T2;const jz=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),El=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(jz),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),y=st(t,L=>g(L)),x=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(_),C=f?x.indexOf(f):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,O=C>=S,k=zz(L=>{const F=L.target,j=[...u.branches].some(z=>z.contains(F));!O||j||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},p),A=Bz(L=>{const F=L.target;[...u.branches].some(z=>z.contains(F))||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},p);return Lz(L=>{C===u.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(T2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),A2(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=T2)}},[f,p,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),A2())},[f,u]),m.useEffect(()=>{const L=()=>v({});return document.addEventListener(Wb,L),()=>document.removeEventListener(Wb,L)},[]),m.createElement(He.div,ae({},c,{ref:y,style:{pointerEvents:P?O?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function zz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){I2(Fz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Bz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&I2($z,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function A2(){const e=new CustomEvent(Wb);document.dispatchEvent(e)}function I2(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?__(i,o):i.dispatchEvent(o)}const Vz=["top","right","bottom","left"],os=Math.min,Ar=Math.max,Nh=Math.round,Rh=Math.floor,ss=e=>({x:e,y:e}),Hz={left:"right",right:"left",bottom:"top",top:"bottom"},Wz={start:"end",end:"start"};function Ub(e,t,n){return Ar(e,os(t,n))}function wo(e,t){return typeof e=="function"?e(t):e}function _o(e){return e.split("-")[0]}function Ol(e){return e.split("-")[1]}function qb(e){return e==="x"?"y":"x"}function Gb(e){return e==="y"?"height":"width"}function Pl(e){return["top","bottom"].includes(_o(e))?"y":"x"}function Yb(e){return qb(Pl(e))}function Uz(e,t,n){n===void 0&&(n=!1);const r=Ol(e),i=Yb(e),o=Gb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Lh(s)),[s,Lh(s)]}function qz(e){const t=Lh(e);return[Kb(e),t,Kb(t)]}function Kb(e){return e.replace(/start|end/g,t=>Wz[t])}function Gz(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function Yz(e,t,n,r){const i=Ol(e);let o=Gz(_o(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Kb)))),o}function Lh(e){return e.replace(/left|right|bottom|top/g,t=>Hz[t])}function Kz(e){return{top:0,right:0,bottom:0,left:0,...e}}function N2(e){return typeof e!="number"?Kz(e):{top:e,right:e,bottom:e,left:e}}function Fh(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function R2(e,t,n){let{reference:r,floating:i}=e;const o=Pl(t),s=Yb(t),a=Gb(s),l=_o(t),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Ol(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const Xz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=R2(c,r,l),g=r,p={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:_}=a[y],{x:S,y:C,data:P,reset:O}=await _({x:u,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=S??u,f=C??f,p={...p,[x]:{...p[x],...P}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:u,y:f}=R2(c,g,l)),y=-1;continue}}return{x:u,y:f,placement:g,strategy:i,middlewareData:p}};async function Tu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=wo(t,e),v=N2(p),x=a[g?f==="floating"?"reference":"floating":f],_=Fh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Fh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:C,strategy:l}):S);return{top:(_.top-O.top+v.top)/P.y,bottom:(O.bottom-_.bottom+v.bottom)/P.y,left:(_.left-O.left+v.left)/P.x,right:(O.right-_.right+v.right)/P.x}}const L2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=wo(e,t)||{};if(c==null)return{};const f=N2(u),g={x:n,y:r},p=Yb(i),v=Gb(p),y=await s.getDimensions(c),x=p==="y",_=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=o.reference[v]+o.reference[p]-g[p]-o.floating[v],O=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=k?k[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(k)))&&(A=a.floating[C]||o.floating[v]);const L=P/2-O/2,F=A/2-y[v]/2-1,j=os(f[_],F),z=os(f[S],F),V=j,oe=A-y[v]-z,ee=A/2-y[v]/2+L,$=Ub(V,ee,oe),J=!l.arrow&&Ol(i)!=null&&ee!=$&&o.reference[v]/2-(ee<V?j:z)-y[v]/2<0,q=J?ee<V?ee-V:ee-oe:0;return{[p]:g[p]+q,data:{[p]:$,centerOffset:ee-$-q,...J&&{alignmentOffset:q}},reset:J}}}),Qz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=wo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const _=_o(i),S=_o(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=g||(S||!y?[Lh(a)]:qz(a));!g&&v!=="none"&&P.push(...Yz(a,y,v,C));const O=[a,...P],k=await Tu(t,x),A=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(k[_]),f){const V=Uz(i,s,C);A.push(k[V[0]],k[V[1]])}if(L=[...L,{placement:i,overflows:A}],!A.every(V=>V<=0)){var F,j;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,oe=O[V];if(oe)return{data:{index:V,overflows:L},reset:{placement:oe}};let ee=(j=L.filter($=>$.overflows[0]<=0).sort(($,J)=>$.overflows[1]-J.overflows[1])[0])==null?void 0:j.placement;if(!ee)switch(p){case"bestFit":{var z;const $=(z=L.map(J=>[J.placement,J.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((J,q)=>J[1]-q[1])[0])==null?void 0:z[0];$&&(ee=$);break}case"initialPlacement":ee=a;break}if(i!==ee)return{reset:{placement:ee}}}return{}}}};function F2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $2(e){return Vz.some(t=>e[t]>=0)}const Zz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=wo(e,t);switch(r){case"referenceHidden":{const o=await Tu(t,{...i,elementContext:"reference"}),s=F2(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:$2(s)}}}case"escaped":{const o=await Tu(t,{...i,altBoundary:!0}),s=F2(o,n.floating);return{data:{escapedOffsets:s,escaped:$2(s)}}}default:return{}}}}};async function Jz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=_o(n),a=Ol(n),l=Pl(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=wo(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*u,y:g*c}:{x:g*c,y:p*u}}const eB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Jz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},tB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:_,y:S}=x;return{x:_,y:S}}},...l}=wo(e,t),c={x:n,y:r},u=await Tu(t,l),f=Pl(_o(i)),g=qb(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",_=g==="y"?"bottom":"right",S=p+u[x],C=p-u[_];p=Ub(S,p,C)}if(s){const x=f==="y"?"top":"left",_=f==="y"?"bottom":"right",S=v+u[x],C=v-u[_];v=Ub(S,v,C)}const y=a.fn({...t,[g]:p,[f]:v});return{...y,data:{x:y.x-n,y:y.y-r}}}}},nB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=wo(e,t),u={x:n,y:r},f=Pl(i),g=qb(f);let p=u[g],v=u[f];const y=wo(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=g==="y"?"height":"width",P=o.reference[g]-o.floating[C]+x.mainAxis,O=o.reference[g]+o.reference[C]-x.mainAxis;p<P?p=P:p>O&&(p=O)}if(c){var _,S;const C=g==="y"?"width":"height",P=["top","left"].includes(_o(i)),O=o.reference[f]-o.floating[C]+(P&&((_=s.offset)==null?void 0:_[f])||0)+(P?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(P?0:((S=s.offset)==null?void 0:S[f])||0)-(P?x.crossAxis:0);v<O?v=O:v>k&&(v=k)}return{[g]:p,[f]:v}}}},rB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=wo(e,t),l=await Tu(t,a),c=_o(n),u=Ol(n),f=Pl(n)==="y",{width:g,height:p}=r.floating;let v,y;c==="top"||c==="bottom"?(v=c,y=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=c,v=u==="end"?"top":"bottom");const x=p-l[v],_=g-l[y],S=!t.middlewareData.shift;let C=x,P=_;if(f){const k=g-l.left-l.right;P=u||S?os(_,k):k}else{const k=p-l.top-l.bottom;C=u||S?os(x,k):k}if(S&&!u){const k=Ar(l.left,0),A=Ar(l.right,0),L=Ar(l.top,0),F=Ar(l.bottom,0);f?P=g-2*(k!==0||A!==0?k+A:Ar(l.left,l.right)):C=p-2*(L!==0||F!==0?L+F:Ar(l.top,l.bottom))}await s({...t,availableWidth:P,availableHeight:C});const O=await i.getDimensions(o.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function as(e){return j2(e)?(e.nodeName||"").toLowerCase():"#document"}function Ir(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function So(e){var t;return(t=(j2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j2(e){return e instanceof Node||e instanceof Ir(e).Node}function Co(e){return e instanceof Element||e instanceof Ir(e).Element}function Hi(e){return e instanceof HTMLElement||e instanceof Ir(e).HTMLElement}function z2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ir(e).ShadowRoot}function Au(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function iB(e){return["table","td","th"].includes(as(e))}function Xb(e){const t=Qb(),n=ei(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function oB(e){let t=kl(e);for(;Hi(t)&&!$h(t);){if(Xb(t))return t;t=kl(t)}return null}function Qb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $h(e){return["html","body","#document"].includes(as(e))}function ei(e){return Ir(e).getComputedStyle(e)}function jh(e){return Co(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function kl(e){if(as(e)==="html")return e;const t=e.assignedSlot||e.parentNode||z2(e)&&e.host||So(e);return z2(t)?t.host:t}function B2(e){const t=kl(e);return $h(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hi(t)&&Au(t)?t:B2(t)}function Iu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=B2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Ir(i);return o?t.concat(s,s.visualViewport||[],Au(i)?i:[],s.frameElement&&n?Iu(s.frameElement):[]):t.concat(i,Iu(i,[],n))}function V2(e){const t=ei(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Hi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Nh(n)!==o||Nh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Zb(e){return Co(e)?e:e.contextElement}function Ml(e){const t=Zb(e);if(!Hi(t))return ss(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=V2(t);let s=(o?Nh(n.width):n.width)/r,a=(o?Nh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const sB=ss(0);function H2(e){const t=Ir(e);return!Qb()||!t.visualViewport?sB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ir(e)?!1:t}function fa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Zb(e);let s=ss(1);t&&(r?Co(r)&&(s=Ml(r)):s=Ml(e));const a=aB(o,n,r)?H2(o):ss(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const g=Ir(o),p=r&&Co(r)?Ir(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const y=Ml(v),x=v.getBoundingClientRect(),_=ei(v),S=x.left+(v.clientLeft+parseFloat(_.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=S,c+=C,v=Ir(v).frameElement}}return Fh({width:u,height:f,x:l,y:c})}function lB(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Hi(n),o=So(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=ss(1);const l=ss(0);if((i||!i&&r!=="fixed")&&((as(n)!=="body"||Au(o))&&(s=jh(n)),Hi(n))){const c=fa(n);a=Ml(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function cB(e){return Array.from(e.getClientRects())}function W2(e){return fa(So(e)).left+jh(e).scrollLeft}function uB(e){const t=So(e),n=jh(e),r=e.ownerDocument.body,i=Ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+W2(e);const a=-n.scrollTop;return ei(r).direction==="rtl"&&(s+=Ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function dB(e,t){const n=Ir(e),r=So(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Qb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function fB(e,t){const n=fa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Hi(e)?Ml(e):ss(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function U2(e,t,n){let r;if(t==="viewport")r=dB(e,n);else if(t==="document")r=uB(So(e));else if(Co(t))r=fB(t,n);else{const i=H2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Fh(r)}function q2(e,t){const n=kl(e);return n===t||!Co(n)||$h(n)?!1:ei(n).position==="fixed"||q2(n,t)}function hB(e,t){const n=t.get(e);if(n)return n;let r=Iu(e,[],!1).filter(a=>Co(a)&&as(a)!=="body"),i=null;const o=ei(e).position==="fixed";let s=o?kl(e):e;for(;Co(s)&&!$h(s);){const a=ei(s),l=Xb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Au(s)&&!l&&q2(e,s))?r=r.filter(u=>u!==s):i=a,s=kl(s)}return t.set(e,r),r}function pB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?hB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=U2(t,u,i);return c.top=Ar(f.top,c.top),c.right=os(f.right,c.right),c.bottom=os(f.bottom,c.bottom),c.left=Ar(f.left,c.left),c},U2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gB(e){return V2(e)}function mB(e,t,n){const r=Hi(t),i=So(t),o=n==="fixed",s=fa(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ss(0);if(r||!r&&!o)if((as(t)!=="body"||Au(i))&&(a=jh(t)),r){const c=fa(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=W2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function G2(e,t){return!Hi(e)||ei(e).position==="fixed"?null:t?t(e):e.offsetParent}function Y2(e,t){const n=Ir(e);if(!Hi(e))return n;let r=G2(e,t);for(;r&&iB(r)&&ei(r).position==="static";)r=G2(r,t);return r&&(as(r)==="html"||as(r)==="body"&&ei(r).position==="static"&&!Xb(r))?n:r||oB(e)||n}const vB=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Y2,o=this.getDimensions;return{reference:mB(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function bB(e){return ei(e).direction==="rtl"}const yB={convertOffsetParentRelativeRectToViewportRelativeRect:lB,getDocumentElement:So,getClippingRect:pB,getOffsetParent:Y2,getElementRects:vB,getClientRects:cB,getDimensions:gB,getScale:Ml,isElement:Co,isRTL:bB};function xB(e,t){let n=null,r;const i=So(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=Rh(u),v=Rh(i.clientWidth-(c+f)),y=Rh(i.clientHeight-(u+g)),x=Rh(c),S={rootMargin:-p+"px "+-v+"px "+-y+"px "+-x+"px",threshold:Ar(0,os(1,l))||1};let C=!0;function P(O){const k=O[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(P,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return s(!0),o}function wB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Zb(e),u=i||o?[...c?Iu(c):[],...Iu(t)]:[];u.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),o&&_.addEventListener("resize",n)});const f=c&&a?xB(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(_=>{let[S]=_;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,y=l?fa(e):null;l&&x();function x(){const _=fa(e);y&&(_.x!==y.x||_.y!==y.y||_.width!==y.width||_.height!==y.height)&&n(),y=_,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const _B=(e,t,n)=>{const r=new Map,i={platform:yB,...n},o={...i.platform,_c:r};return Xz(e,t,{...i,platform:o})},SB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?L2({element:r.current,padding:i}).fn(n):{}:r?L2({element:r,padding:i}).fn(n):{}}}};var zh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Bh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Bh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Bh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function K2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function X2(e,t){const n=K2(e);return Math.round(t*n)/n}function Q2(e){const t=ue.useRef(e);return zh(()=>{t.current=e}),t}function CB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=ue.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=ue.useState(r);Bh(g,r)||p(r);const[v,y]=ue.useState(null),[x,_]=ue.useState(null),S=ue.useCallback(J=>{J!=k.current&&(k.current=J,y(J))},[y]),C=ue.useCallback(J=>{J!==A.current&&(A.current=J,_(J))},[_]),P=o||v,O=s||x,k=ue.useRef(null),A=ue.useRef(null),L=ue.useRef(u),F=Q2(l),j=Q2(i),z=ue.useCallback(()=>{if(!k.current||!A.current)return;const J={placement:t,strategy:n,middleware:g};j.current&&(J.platform=j.current),_B(k.current,A.current,J).then(q=>{const K={...q,isPositioned:!0};V.current&&!Bh(L.current,K)&&(L.current=K,DN.flushSync(()=>{f(K)}))})},[g,t,n,j]);zh(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[c]);const V=ue.useRef(!1);zh(()=>(V.current=!0,()=>{V.current=!1}),[]),zh(()=>{if(P&&(k.current=P),O&&(A.current=O),P&&O){if(F.current)return F.current(P,O,z);z()}},[P,O,z,F]);const oe=ue.useMemo(()=>({reference:k,floating:A,setReference:S,setFloating:C}),[S,C]),ee=ue.useMemo(()=>({reference:P,floating:O}),[P,O]),$=ue.useMemo(()=>{const J={position:n,left:0,top:0};if(!ee.floating)return J;const q=X2(ee.floating,u.x),K=X2(ee.floating,u.y);return a?{...J,transform:"translate("+q+"px, "+K+"px)",...K2(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,a,ee.floating,u.x,u.y]);return ue.useMemo(()=>({...u,update:z,refs:oe,elements:ee,floatingStyles:$}),[u,z,oe,ee,$])}function Vh(e){const[t,n]=m.useState(void 0);return qn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Z2="Popper",[J2,Wi]=An(Z2),[EB,eO]=J2(Z2),OB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(EB,{scope:t,anchor:r,onAnchorChange:i},n)},PB="PopperAnchor",kB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=eO(PB,n),s=m.useRef(null),a=st(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(He.div,ae({},i,{ref:a}))}),tO="PopperContent",[MB,Pfe]=J2(tO),DB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:C="partial",hideWhenDetached:P=!1,updatePositionStrategy:O="optimized",onPlaced:k,...A}=e,L=eO(tO,u),[F,j]=m.useState(null),z=st(t,We=>j(We)),[V,oe]=m.useState(null),ee=Vh(V),$=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,J=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,q=f+(p!=="center"?"-"+p:""),K=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},G=Array.isArray(_)?_:[_],D=G.length>0,H={padding:K,boundary:G.filter(TB),altBoundary:D},{refs:ne,floatingStyles:N,placement:le,isPositioned:me,middlewareData:he}=CB({strategy:"fixed",placement:q,whileElementsMounted:(...We)=>wB(...We,{animationFrame:O==="always"}),elements:{reference:L.anchor},middleware:[eB({mainAxis:g+J,alignmentAxis:v}),x&&tB({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?nB():void 0,...H}),x&&Qz({...H}),rB({...H,apply:({elements:We,rects:Xe,availableWidth:be,availableHeight:Qe})=>{const{width:it,height:Dt}=Xe.reference,bt=We.floating.style;bt.setProperty("--radix-popper-available-width",`${be}px`),bt.setProperty("--radix-popper-available-height",`${Qe}px`),bt.setProperty("--radix-popper-anchor-width",`${it}px`),bt.setProperty("--radix-popper-anchor-height",`${Dt}px`)}}),V&&SB({element:V,padding:y}),AB({arrowWidth:$,arrowHeight:J}),P&&Zz({strategy:"referenceHidden",...H})]}),[de,re]=nO(le),Q=On(k);qn(()=>{me&&(Q==null||Q())},[me,Q]);const ie=(i=he.arrow)===null||i===void 0?void 0:i.x,we=(o=he.arrow)===null||o===void 0?void 0:o.y,U=((s=he.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ie,je]=m.useState();return qn(()=>{F&&je(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:me?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=he.transformOrigin)===null||a===void 0?void 0:a.x,(l=he.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(MB,{scope:u,placedSide:de,onArrowChange:oe,arrowX:ie,arrowY:we,shouldHideArrow:U},m.createElement(He.div,ae({"data-side":de,"data-align":re},A,{ref:z,style:{...A.style,animation:me?void 0:"none",opacity:(c=he.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function TB(e){return e!==null}const AB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,y]=nO(a),x={start:"0%",center:"50%",end:"100%"}[y],_=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,S=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",P="";return v==="bottom"?(C=f?x:`${_}px`,P=`${-p}px`):v==="top"?(C=f?x:`${_}px`,P=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,P=f?x:`${S}px`):v==="left"&&(C=`${l.floating.width+p}px`,P=f?x:`${S}px`),{data:{x:C,y:P}}}});function nO(e){const[t,n="center"]=e.split("-");return[t,n]}const Nu=OB,Ru=kB,Lu=DB,Hh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?Tt.createPortal(m.createElement(He.div,ae({},i,{ref:t})),r):null}),rO=m.forwardRef((e,t)=>m.createElement(He.span,ae({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),IB=rO,[Wh,kfe]=An("Tooltip",[Wi]),Jb=Wi(),NB="TooltipProvider",RB=700,e0="tooltip.open",[LB,t0]=Wh(NB),FB=e=>{const{__scopeTooltip:t,delayDuration:n=RB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(LB,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:i},o)},n0="Tooltip",[$B,Uh]=Wh(n0),jB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=t0(n0,e.__scopeTooltip),c=Jb(t),[u,f]=m.useState(null),g=ur(),p=m.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[_=!1,S]=tr({prop:r,defaultProp:i,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(e0))):l.onClose(),o==null||o(A)}}),C=m.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,S(!0)},[S]),O=m.useCallback(()=>{window.clearTimeout(p.current),S(!1)},[S]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,S(!0)},y)},[y,S]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Nu,c,m.createElement($B,{scope:t,contentId:g,open:_,stateAttribute:C,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():P()},[l.isOpenDelayed,k,P]),onTriggerLeave:m.useCallback(()=>{v?O():window.clearTimeout(p.current)},[O,v]),onOpen:P,onClose:O,disableHoverableContent:v},n))},iO="TooltipTrigger",oO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Uh(iO,n),o=t0(iO,n),s=Jb(n),a=m.useRef(null),l=st(t,a,i.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Ru,ae({asChild:!0},s),m.createElement(He.button,ae({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Oe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})))}),zB="TooltipPortal",[Mfe,BB]=Wh(zB,{forceMount:void 0}),Fu="TooltipContent",VB=m.forwardRef((e,t)=>{const n=BB(Fu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Uh(Fu,e.__scopeTooltip);return m.createElement(yn,{present:r||s.open},s.disableHoverableContent?m.createElement(sO,ae({side:i},o,{ref:t})):m.createElement(HB,ae({side:i},o,{ref:t})))}),HB=m.forwardRef((e,t)=>{const n=Uh(Fu,e.__scopeTooltip),r=t0(Fu,e.__scopeTooltip),i=m.useRef(null),o=st(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,y)=>{const x=v.currentTarget,_={x:v.clientX,y:v.clientY},S=UB(_,x.getBoundingClientRect()),C=qB(_,S),P=GB(y.getBoundingClientRect()),O=KB([...C,...P]);a(O),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),y=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",y)}}},[l,u,p,g]),m.useEffect(()=>{if(s){const v=y=>{const x=y.target,_={x:y.clientX,y:y.clientY},S=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),C=!YB(_,s);S?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,g]),m.createElement(sO,ae({},e,{ref:o}))}),[WB,Dfe]=Wh(n0,{isInside:!1}),sO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=Uh(Fu,n),c=Jb(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(e0,u),()=>document.removeEventListener(e0,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(El,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Lu,ae({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(w_,null,r),m.createElement(WB,{scope:n,isInside:!0},m.createElement(IB,{id:l.contentId,role:"tooltip"},i||r))))});function UB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function GB(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function YB(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function KB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),XB(t)}function XB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const QB=FB,ZB=jB,JB=oO,aO=VB,eV=QB,r0=ZB,lO=JB,qh=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(aO,{ref:r,sideOffset:t,className:ke("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qh.displayName=aO.displayName;const cO=ue.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:ke("w-full caption-bottom text-sm",e),...t})}));cO.displayName="Table";const uO=ue.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:ke("[&_tr]:border-b",e),...t}));uO.displayName="TableHeader";const dO=ue.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:ke("[&_tr:last-child]:border-0",e),...t}));dO.displayName="TableBody";const tV=ue.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:ke("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));tV.displayName="TableFooter";const Gh=ue.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Gh.displayName="TableRow";const fO=ue.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:ke("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));fO.displayName="TableHead";const i0=ue.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:ke("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));i0.displayName="TableCell";const nV=ue.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:ke("mt-4 text-sm text-muted-foreground",e),...t}));nV.displayName="TableCaption";/**
129
+ `)):Array.isArray(n)?e.push.apply(e,n):wt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*h2)/h2}};function zb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function Gj(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var Yj=0,p2=1,g2=2,m2=4,v2=8;function Dh(e,t,n){var r=Yj;return e<n.left?r|=p2:e>n.right&&(r|=g2),t<n.top?r|=v2:t>n.bottom&&(r|=m2),r}function Kj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Dh(n,r,t),a=Dh(i,o,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&v2?(c=n+(i-n)*(t.top-r)/(o-r),u=t.top):l&m2?(c=n+(i-n)*(t.bottom-r)/(o-r),u=t.bottom):l&g2?(u=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&p2&&(u=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=u,s=Dh(n,r,t)):(i=c,o=u,a=Dh(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Th(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=Kj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),Gj(i,o,e.vx,e.vy,t.align)}var Ah={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return Th({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=zb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Th({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=zb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Th({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=zb(e,t.origin);return Th({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},xo=ku.rasterize;function Xj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function Qj(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function Zj(e){return e instanceof Cl?Ah.arc:e instanceof _u?Ah.point:e instanceof Su?Ah.bar:Ah.fallback}function Jj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+i-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function ez(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),Jj(e,xo(t.x)+o/2,xo(t.y)+o/2,xo(t.w)-o,xo(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function tz(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function nz(e,t,n){var r=e.shadowBlur,i=n.stroked,o=xo(n.x),s=xo(n.y),a=xo(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function rz(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,g;if(!(!l||!s&&!f))for(n=tz(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),g=0,l=t.length;g<l;++g)nz(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var b2=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};$i(b2.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=xn(nn([n.font,{}],r,o)),a=nn([n.color,ln.color],r,o);return{align:nn([n.align,"center"],r,o),anchor:nn([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:nn([n.backgroundColor,null],r,o),borderColor:nn([n.borderColor,null],r,o),borderRadius:nn([n.borderRadius,0],r,o),borderWidth:nn([n.borderWidth,0],r,o),clamp:nn([n.clamp,!1],r,o),clip:nn([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:nn([n.offset,4],r,o),opacity:nn([n.opacity,1],r,o),origin:Qj(i._el,r),padding:zn(nn([n.padding,4],r,o)),positioner:Zj(i._el),rotation:nn([n.rotation,0],r,o)*(Math.PI/180),size:ku.textSize(i._ctx,t,s),textAlign:nn([n.textAlign,"start"],r,o),textShadowBlur:nn([n.textShadowBlur,0],r,o),textShadowColor:nn([n.textShadowColor,a],r,o),textStrokeColor:nn([n.textStrokeColor,a],r,o),textStrokeWidth:nn([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=nn([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=at(Ht(o.formatter,[s,e]),s),l=wt(a)?[]:ku.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=Xj(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=ku.bound(0,i.opacity,1),r.translate(xo(t.x),xo(t.y)),r.rotate(i.rotation),ez(r,o.frame,i),rz(r,i.lines,o.text,i),r.restore())}});var iz=Number.MIN_SAFE_INTEGER||-9007199254740991,oz=Number.MAX_SAFE_INTEGER||9007199254740991;function Mu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function y2(e,t){var n=oz,r=iz,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Ih(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var x2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};$i(x2.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Mu(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Ih(t[0],t[1]),Ih(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Ih(n[0],n[1]),Ih(n[0],n[3])),i=0;i<r.length;++i)if(o=y2(t,r[i]),s=y2(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Mu({x:t.x,y:t.y},r,n),Mu({x:t.x+t.w,y:t.y},r,n),Mu({x:t.x+t.w,y:t.y+t.h},r,n),Mu({x:t.x,y:t.y+t.h},r,n)]}});function w2(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,u*=o*f,c+=t.offset*i,u+=t.offset*o,{x:r.x+c,y:r.y+u}}function sz(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function az(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=w2(a,r.model(),o),i._box.update(s,o,r.rotation()));return sz(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var Du={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new x2,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&az(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=w2(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},lz=function(e){if(wt(e))return null;var t=e,n,r,i;if(Ct(e))if(!wt(e.label))t=e.label;else if(!wt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},cz={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:lz,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},gr="$datalabels",_2="$default";function uz(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=$i({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push($i({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return $t(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||_2]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function Bb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&Ht(s,[i,r])===!0&&(e[gr]._dirty=!0,n.update(i)))}}function dz(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&Bb(e,t.leave,n,i),o&&Bb(e,t.enter,r,i))}function fz(e,t){var n=e[gr],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=Du.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,dz(e,r,i,o,t)}}function hz(e,t){var n=e[gr],r=n._listeners.click,i=r&&Du.lookup(n._labels,t);i&&Bb(e,r,i,t)}var pz={id:"datalabels",defaults:cz,beforeInit:function(e){e[gr]={_actives:[]}},beforeUpdate:function(e){var t=e[gr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[gr],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=uz(a,n),c=t.meta.data||[],u=e.ctx,f,g,p,v,y,x,_,S;for(u.save(),f=0,p=c.length;f<p;++f)if(_=c[f],_[gr]=[],s&&_&&e.getDataVisibility(f)&&!_.skip)for(g=0,v=l.labels.length;g<v;++g)y=l.labels[g],x=y._key,S=new b2(y,u,_,f),S.$groups={_set:r,_key:x||_2},S.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},S.update(S.$context),_[gr].push(S),o.push(S);u.restore(),$i(i._listeners,l.listeners,{merger:function(C,P,O){P[C]=P[C]||{},P[C][t.index]=O[C],i._listened=!0}})},afterUpdate:function(e){e[gr]._labels=Du.prepare(e[gr]._datasets)},afterDatasetsDraw:function(e){Du.draw(e,e[gr]._labels)},beforeEvent:function(e,t){if(e[gr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":fz(e,n);break;case"click":hz(e,n);break}}},afterEvent:function(e){var t=e[gr],n=t._actives,r=t._actives=e.getActiveElements(),i=ku.arrayDiff(n,r),o,s,a,l,c,u,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[gr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||i.length)&&(Du.update(t._labels),e.render()),delete t._dirty}};Jr.register(...qj),Jr.register(pz);function S2({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=pe(l=>l.themeStyle);m.useEffect(()=>{var u,f,g,p;(f=(u=o==null?void 0:o.chart)==null?void 0:u.font)!=null&&f.family&&(Jr.defaults.font={...Jr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Jr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}}return w.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:w.jsx("canvas",{ref:n})})}function wi(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var gz=["color"],C2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,gz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),mz=["color"],vz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,mz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bz=["color"],E2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,bz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yz=["color"],da=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,yz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xz=["color"],wz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,xz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_z=["color"],Sz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,_z);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Cz=["color"],O2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Ez=["color"],Oz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Ez);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pz=["color"],kz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Pz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mz=["color"],P2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Mz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Dz=["color"],k2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=wi(e,Dz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});function Tz(e,t){var s,a,l,c;const n=pe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map((u,f)=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(g=>g[u]),backgroundColor:r==null?void 0:r[f%r.length],borderColor:i==null?void 0:i[f%i.length]}))}function Az(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=Vi(e);let r=[];const i=pe.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(g=>({x:g[t[0]],y:g[t[1]],r:g[t[2]],label:g[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(g=>g[n==null?void 0:n[1]]))].map((g,p)=>{const v=e.filter(y=>y[n==null?void 0:n[1]]===g);return{label:g,data:v.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[p%o.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function Iz(e,t){var s,a,l,c;const n=pe.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,g)=>r==null?void 0:r[g%r.length]),borderColor:t.map((f,g)=>i==null?void 0:i[g%i.length])}))}function Nz(e){let t=-1,n=0;return e.forEach((r,i)=>{const o=Object.keys(r).length;o>n&&(t=i,n=o)}),t}function Vi(e){if(e.length===0)return{dimensionKeys:[],metricKeys:[]};const t=Nz(e),n=Object.keys(e[t]),r=n.filter(o=>{var s,a,l,c,u,f,g,p;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[o])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[o])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[o])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[o])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[o])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[o])=="string"||typeof((g=e==null?void 0:e[2])==null?void 0:g[o])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[o])=="string")});r.length===0&&r.push(n[0]);const i=n.filter(o=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[o])===+((a=e==null?void 0:e[t])==null?void 0:a[o])});return{dimensionKeys:r,metricKeys:i}}function Vb(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n[s],data:o.data,label:o.label})):e}function M2({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const i=e.reduce((o,s)=>{const a=s[t],l=s[n],c=s[r];return o[a]||(o[a]={[t]:a}),o[a][l]=c,o},{});return Object.values(i)}function Hb(e,t){var s;const n=pe.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=Ws.cloneDeep(r);return Ws.merge(i,e,t)}function D2(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function Rz({frame:e}){const t=pe(S=>S.isDashboardEditing),n=pe(S=>S.filterValues),r=pe(S=>S.isVisualEditing),i=pe(S=>S.selectedSheetId);pe(S=>S.currentBreakpoint);const{removeFrame:o}=pe(S=>S.actions),s=pe(S=>S.actions.setIsVisualEditing),a=ve(S=>S.actions.setFilterValues),l=ve(S=>S.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=ve(S=>S.actions),g=ve(S=>S.actions.setSelectedConnectionId),p=ve(S=>S.actions.setSelectedDatabaseName),v=ve(S=>S.actions.setSelectedSchemaName),y=ve(S=>S.actions.setSelectedTableName),x=e.cards.find(S=>S.id===e.activeCardId);function _(){s(!r),c(x);const{dimensionKeys:S}=Vi((x==null?void 0:x.data)||[]);f(S),u(e),x!=null&&x.connectionId&&g(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&p(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&y(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return w.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&w.jsxs("div",{className:"flex items-center gap-2",children:[r?w.jsx(wz,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):w.jsx(Sz,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),w.jsx(da,{onClick:()=>o(i,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function Lz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Wb="dismissableLayer.update",Fz="dismissableLayer.pointerDownOutside",$z="dismissableLayer.focusOutside";let T2;const jz=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),El=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(jz),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),y=st(t,L=>g(L)),x=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(_),C=f?x.indexOf(f):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,O=C>=S,k=zz(L=>{const F=L.target,j=[...u.branches].some(z=>z.contains(F));!O||j||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},p),A=Bz(L=>{const F=L.target;[...u.branches].some(z=>z.contains(F))||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},p);return Lz(L=>{C===u.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(T2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),A2(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=T2)}},[f,p,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),A2())},[f,u]),m.useEffect(()=>{const L=()=>v({});return document.addEventListener(Wb,L),()=>document.removeEventListener(Wb,L)},[]),m.createElement(He.div,ae({},c,{ref:y,style:{pointerEvents:P?O?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function zz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){I2(Fz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Bz(e,t=globalThis==null?void 0:globalThis.document){const n=On(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&I2($z,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function A2(){const e=new CustomEvent(Wb);document.dispatchEvent(e)}function I2(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?__(i,o):i.dispatchEvent(o)}const Vz=["top","right","bottom","left"],os=Math.min,Ar=Math.max,Nh=Math.round,Rh=Math.floor,ss=e=>({x:e,y:e}),Hz={left:"right",right:"left",bottom:"top",top:"bottom"},Wz={start:"end",end:"start"};function Ub(e,t,n){return Ar(e,os(t,n))}function wo(e,t){return typeof e=="function"?e(t):e}function _o(e){return e.split("-")[0]}function Ol(e){return e.split("-")[1]}function qb(e){return e==="x"?"y":"x"}function Gb(e){return e==="y"?"height":"width"}function Pl(e){return["top","bottom"].includes(_o(e))?"y":"x"}function Yb(e){return qb(Pl(e))}function Uz(e,t,n){n===void 0&&(n=!1);const r=Ol(e),i=Yb(e),o=Gb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Lh(s)),[s,Lh(s)]}function qz(e){const t=Lh(e);return[Kb(e),t,Kb(t)]}function Kb(e){return e.replace(/start|end/g,t=>Wz[t])}function Gz(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function Yz(e,t,n,r){const i=Ol(e);let o=Gz(_o(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Kb)))),o}function Lh(e){return e.replace(/left|right|bottom|top/g,t=>Hz[t])}function Kz(e){return{top:0,right:0,bottom:0,left:0,...e}}function N2(e){return typeof e!="number"?Kz(e):{top:e,right:e,bottom:e,left:e}}function Fh(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function R2(e,t,n){let{reference:r,floating:i}=e;const o=Pl(t),s=Yb(t),a=Gb(s),l=_o(t),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Ol(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const Xz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=R2(c,r,l),g=r,p={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:_}=a[y],{x:S,y:C,data:P,reset:O}=await _({x:u,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=S??u,f=C??f,p={...p,[x]:{...p[x],...P}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:u,y:f}=R2(c,g,l)),y=-1;continue}}return{x:u,y:f,placement:g,strategy:i,middlewareData:p}};async function Tu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=wo(t,e),v=N2(p),x=a[g?f==="floating"?"reference":"floating":f],_=Fh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Fh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:C,strategy:l}):S);return{top:(_.top-O.top+v.top)/P.y,bottom:(O.bottom-_.bottom+v.bottom)/P.y,left:(_.left-O.left+v.left)/P.x,right:(O.right-_.right+v.right)/P.x}}const L2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=wo(e,t)||{};if(c==null)return{};const f=N2(u),g={x:n,y:r},p=Yb(i),v=Gb(p),y=await s.getDimensions(c),x=p==="y",_=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=o.reference[v]+o.reference[p]-g[p]-o.floating[v],O=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=k?k[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(k)))&&(A=a.floating[C]||o.floating[v]);const L=P/2-O/2,F=A/2-y[v]/2-1,j=os(f[_],F),z=os(f[S],F),V=j,oe=A-y[v]-z,ee=A/2-y[v]/2+L,$=Ub(V,ee,oe),J=!l.arrow&&Ol(i)!=null&&ee!=$&&o.reference[v]/2-(ee<V?j:z)-y[v]/2<0,q=J?ee<V?ee-V:ee-oe:0;return{[p]:g[p]+q,data:{[p]:$,centerOffset:ee-$-q,...J&&{alignmentOffset:q}},reset:J}}}),Qz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=wo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const _=_o(i),S=_o(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=g||(S||!y?[Lh(a)]:qz(a));!g&&v!=="none"&&P.push(...Yz(a,y,v,C));const O=[a,...P],k=await Tu(t,x),A=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(k[_]),f){const V=Uz(i,s,C);A.push(k[V[0]],k[V[1]])}if(L=[...L,{placement:i,overflows:A}],!A.every(V=>V<=0)){var F,j;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,oe=O[V];if(oe)return{data:{index:V,overflows:L},reset:{placement:oe}};let ee=(j=L.filter($=>$.overflows[0]<=0).sort(($,J)=>$.overflows[1]-J.overflows[1])[0])==null?void 0:j.placement;if(!ee)switch(p){case"bestFit":{var z;const $=(z=L.map(J=>[J.placement,J.overflows.filter(q=>q>0).reduce((q,K)=>q+K,0)]).sort((J,q)=>J[1]-q[1])[0])==null?void 0:z[0];$&&(ee=$);break}case"initialPlacement":ee=a;break}if(i!==ee)return{reset:{placement:ee}}}return{}}}};function F2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $2(e){return Vz.some(t=>e[t]>=0)}const Zz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=wo(e,t);switch(r){case"referenceHidden":{const o=await Tu(t,{...i,elementContext:"reference"}),s=F2(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:$2(s)}}}case"escaped":{const o=await Tu(t,{...i,altBoundary:!0}),s=F2(o,n.floating);return{data:{escapedOffsets:s,escaped:$2(s)}}}default:return{}}}}};async function Jz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=_o(n),a=Ol(n),l=Pl(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=wo(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*u,y:g*c}:{x:g*c,y:p*u}}const eB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Jz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},tB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:_,y:S}=x;return{x:_,y:S}}},...l}=wo(e,t),c={x:n,y:r},u=await Tu(t,l),f=Pl(_o(i)),g=qb(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",_=g==="y"?"bottom":"right",S=p+u[x],C=p-u[_];p=Ub(S,p,C)}if(s){const x=f==="y"?"top":"left",_=f==="y"?"bottom":"right",S=v+u[x],C=v-u[_];v=Ub(S,v,C)}const y=a.fn({...t,[g]:p,[f]:v});return{...y,data:{x:y.x-n,y:y.y-r}}}}},nB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=wo(e,t),u={x:n,y:r},f=Pl(i),g=qb(f);let p=u[g],v=u[f];const y=wo(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=g==="y"?"height":"width",P=o.reference[g]-o.floating[C]+x.mainAxis,O=o.reference[g]+o.reference[C]-x.mainAxis;p<P?p=P:p>O&&(p=O)}if(c){var _,S;const C=g==="y"?"width":"height",P=["top","left"].includes(_o(i)),O=o.reference[f]-o.floating[C]+(P&&((_=s.offset)==null?void 0:_[f])||0)+(P?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(P?0:((S=s.offset)==null?void 0:S[f])||0)-(P?x.crossAxis:0);v<O?v=O:v>k&&(v=k)}return{[g]:p,[f]:v}}}},rB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=wo(e,t),l=await Tu(t,a),c=_o(n),u=Ol(n),f=Pl(n)==="y",{width:g,height:p}=r.floating;let v,y;c==="top"||c==="bottom"?(v=c,y=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=c,v=u==="end"?"top":"bottom");const x=p-l[v],_=g-l[y],S=!t.middlewareData.shift;let C=x,P=_;if(f){const k=g-l.left-l.right;P=u||S?os(_,k):k}else{const k=p-l.top-l.bottom;C=u||S?os(x,k):k}if(S&&!u){const k=Ar(l.left,0),A=Ar(l.right,0),L=Ar(l.top,0),F=Ar(l.bottom,0);f?P=g-2*(k!==0||A!==0?k+A:Ar(l.left,l.right)):C=p-2*(L!==0||F!==0?L+F:Ar(l.top,l.bottom))}await s({...t,availableWidth:P,availableHeight:C});const O=await i.getDimensions(o.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function as(e){return j2(e)?(e.nodeName||"").toLowerCase():"#document"}function Ir(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function So(e){var t;return(t=(j2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j2(e){return e instanceof Node||e instanceof Ir(e).Node}function Co(e){return e instanceof Element||e instanceof Ir(e).Element}function Hi(e){return e instanceof HTMLElement||e instanceof Ir(e).HTMLElement}function z2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ir(e).ShadowRoot}function Au(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function iB(e){return["table","td","th"].includes(as(e))}function Xb(e){const t=Qb(),n=ei(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function oB(e){let t=kl(e);for(;Hi(t)&&!$h(t);){if(Xb(t))return t;t=kl(t)}return null}function Qb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $h(e){return["html","body","#document"].includes(as(e))}function ei(e){return Ir(e).getComputedStyle(e)}function jh(e){return Co(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function kl(e){if(as(e)==="html")return e;const t=e.assignedSlot||e.parentNode||z2(e)&&e.host||So(e);return z2(t)?t.host:t}function B2(e){const t=kl(e);return $h(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hi(t)&&Au(t)?t:B2(t)}function Iu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=B2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Ir(i);return o?t.concat(s,s.visualViewport||[],Au(i)?i:[],s.frameElement&&n?Iu(s.frameElement):[]):t.concat(i,Iu(i,[],n))}function V2(e){const t=ei(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Hi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Nh(n)!==o||Nh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Zb(e){return Co(e)?e:e.contextElement}function Ml(e){const t=Zb(e);if(!Hi(t))return ss(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=V2(t);let s=(o?Nh(n.width):n.width)/r,a=(o?Nh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const sB=ss(0);function H2(e){const t=Ir(e);return!Qb()||!t.visualViewport?sB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ir(e)?!1:t}function fa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Zb(e);let s=ss(1);t&&(r?Co(r)&&(s=Ml(r)):s=Ml(e));const a=aB(o,n,r)?H2(o):ss(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const g=Ir(o),p=r&&Co(r)?Ir(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const y=Ml(v),x=v.getBoundingClientRect(),_=ei(v),S=x.left+(v.clientLeft+parseFloat(_.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=S,c+=C,v=Ir(v).frameElement}}return Fh({width:u,height:f,x:l,y:c})}function lB(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Hi(n),o=So(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=ss(1);const l=ss(0);if((i||!i&&r!=="fixed")&&((as(n)!=="body"||Au(o))&&(s=jh(n)),Hi(n))){const c=fa(n);a=Ml(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function cB(e){return Array.from(e.getClientRects())}function W2(e){return fa(So(e)).left+jh(e).scrollLeft}function uB(e){const t=So(e),n=jh(e),r=e.ownerDocument.body,i=Ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+W2(e);const a=-n.scrollTop;return ei(r).direction==="rtl"&&(s+=Ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function dB(e,t){const n=Ir(e),r=So(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Qb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function fB(e,t){const n=fa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Hi(e)?Ml(e):ss(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function U2(e,t,n){let r;if(t==="viewport")r=dB(e,n);else if(t==="document")r=uB(So(e));else if(Co(t))r=fB(t,n);else{const i=H2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Fh(r)}function q2(e,t){const n=kl(e);return n===t||!Co(n)||$h(n)?!1:ei(n).position==="fixed"||q2(n,t)}function hB(e,t){const n=t.get(e);if(n)return n;let r=Iu(e,[],!1).filter(a=>Co(a)&&as(a)!=="body"),i=null;const o=ei(e).position==="fixed";let s=o?kl(e):e;for(;Co(s)&&!$h(s);){const a=ei(s),l=Xb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Au(s)&&!l&&q2(e,s))?r=r.filter(u=>u!==s):i=a,s=kl(s)}return t.set(e,r),r}function pB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?hB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=U2(t,u,i);return c.top=Ar(f.top,c.top),c.right=os(f.right,c.right),c.bottom=os(f.bottom,c.bottom),c.left=Ar(f.left,c.left),c},U2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gB(e){return V2(e)}function mB(e,t,n){const r=Hi(t),i=So(t),o=n==="fixed",s=fa(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ss(0);if(r||!r&&!o)if((as(t)!=="body"||Au(i))&&(a=jh(t)),r){const c=fa(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=W2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function G2(e,t){return!Hi(e)||ei(e).position==="fixed"?null:t?t(e):e.offsetParent}function Y2(e,t){const n=Ir(e);if(!Hi(e))return n;let r=G2(e,t);for(;r&&iB(r)&&ei(r).position==="static";)r=G2(r,t);return r&&(as(r)==="html"||as(r)==="body"&&ei(r).position==="static"&&!Xb(r))?n:r||oB(e)||n}const vB=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Y2,o=this.getDimensions;return{reference:mB(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function bB(e){return ei(e).direction==="rtl"}const yB={convertOffsetParentRelativeRectToViewportRelativeRect:lB,getDocumentElement:So,getClippingRect:pB,getOffsetParent:Y2,getElementRects:vB,getClientRects:cB,getDimensions:gB,getScale:Ml,isElement:Co,isRTL:bB};function xB(e,t){let n=null,r;const i=So(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=Rh(u),v=Rh(i.clientWidth-(c+f)),y=Rh(i.clientHeight-(u+g)),x=Rh(c),S={rootMargin:-p+"px "+-v+"px "+-y+"px "+-x+"px",threshold:Ar(0,os(1,l))||1};let C=!0;function P(O){const k=O[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(P,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return s(!0),o}function wB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Zb(e),u=i||o?[...c?Iu(c):[],...Iu(t)]:[];u.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),o&&_.addEventListener("resize",n)});const f=c&&a?xB(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(_=>{let[S]=_;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,y=l?fa(e):null;l&&x();function x(){const _=fa(e);y&&(_.x!==y.x||_.y!==y.y||_.width!==y.width||_.height!==y.height)&&n(),y=_,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const _B=(e,t,n)=>{const r=new Map,i={platform:yB,...n},o={...i.platform,_c:r};return Xz(e,t,{...i,platform:o})},SB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?L2({element:r.current,padding:i}).fn(n):{}:r?L2({element:r,padding:i}).fn(n):{}}}};var zh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Bh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Bh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Bh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function K2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function X2(e,t){const n=K2(e);return Math.round(t*n)/n}function Q2(e){const t=ue.useRef(e);return zh(()=>{t.current=e}),t}function CB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=ue.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=ue.useState(r);Bh(g,r)||p(r);const[v,y]=ue.useState(null),[x,_]=ue.useState(null),S=ue.useCallback(J=>{J!=k.current&&(k.current=J,y(J))},[y]),C=ue.useCallback(J=>{J!==A.current&&(A.current=J,_(J))},[_]),P=o||v,O=s||x,k=ue.useRef(null),A=ue.useRef(null),L=ue.useRef(u),F=Q2(l),j=Q2(i),z=ue.useCallback(()=>{if(!k.current||!A.current)return;const J={placement:t,strategy:n,middleware:g};j.current&&(J.platform=j.current),_B(k.current,A.current,J).then(q=>{const K={...q,isPositioned:!0};V.current&&!Bh(L.current,K)&&(L.current=K,DN.flushSync(()=>{f(K)}))})},[g,t,n,j]);zh(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[c]);const V=ue.useRef(!1);zh(()=>(V.current=!0,()=>{V.current=!1}),[]),zh(()=>{if(P&&(k.current=P),O&&(A.current=O),P&&O){if(F.current)return F.current(P,O,z);z()}},[P,O,z,F]);const oe=ue.useMemo(()=>({reference:k,floating:A,setReference:S,setFloating:C}),[S,C]),ee=ue.useMemo(()=>({reference:P,floating:O}),[P,O]),$=ue.useMemo(()=>{const J={position:n,left:0,top:0};if(!ee.floating)return J;const q=X2(ee.floating,u.x),K=X2(ee.floating,u.y);return a?{...J,transform:"translate("+q+"px, "+K+"px)",...K2(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:K}},[n,a,ee.floating,u.x,u.y]);return ue.useMemo(()=>({...u,update:z,refs:oe,elements:ee,floatingStyles:$}),[u,z,oe,ee,$])}function Vh(e){const[t,n]=m.useState(void 0);return qn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Z2="Popper",[J2,Wi]=An(Z2),[EB,eO]=J2(Z2),OB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(EB,{scope:t,anchor:r,onAnchorChange:i},n)},PB="PopperAnchor",kB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=eO(PB,n),s=m.useRef(null),a=st(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(He.div,ae({},i,{ref:a}))}),tO="PopperContent",[MB,Pfe]=J2(tO),DB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:C="partial",hideWhenDetached:P=!1,updatePositionStrategy:O="optimized",onPlaced:k,...A}=e,L=eO(tO,u),[F,j]=m.useState(null),z=st(t,We=>j(We)),[V,oe]=m.useState(null),ee=Vh(V),$=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,J=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,q=f+(p!=="center"?"-"+p:""),K=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},G=Array.isArray(_)?_:[_],D=G.length>0,H={padding:K,boundary:G.filter(TB),altBoundary:D},{refs:ne,floatingStyles:N,placement:le,isPositioned:me,middlewareData:he}=CB({strategy:"fixed",placement:q,whileElementsMounted:(...We)=>wB(...We,{animationFrame:O==="always"}),elements:{reference:L.anchor},middleware:[eB({mainAxis:g+J,alignmentAxis:v}),x&&tB({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?nB():void 0,...H}),x&&Qz({...H}),rB({...H,apply:({elements:We,rects:Xe,availableWidth:be,availableHeight:Qe})=>{const{width:it,height:Dt}=Xe.reference,bt=We.floating.style;bt.setProperty("--radix-popper-available-width",`${be}px`),bt.setProperty("--radix-popper-available-height",`${Qe}px`),bt.setProperty("--radix-popper-anchor-width",`${it}px`),bt.setProperty("--radix-popper-anchor-height",`${Dt}px`)}}),V&&SB({element:V,padding:y}),AB({arrowWidth:$,arrowHeight:J}),P&&Zz({strategy:"referenceHidden",...H})]}),[de,re]=nO(le),Q=On(k);qn(()=>{me&&(Q==null||Q())},[me,Q]);const ie=(i=he.arrow)===null||i===void 0?void 0:i.x,we=(o=he.arrow)===null||o===void 0?void 0:o.y,U=((s=he.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ie,je]=m.useState();return qn(()=>{F&&je(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:me?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=he.transformOrigin)===null||a===void 0?void 0:a.x,(l=he.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(MB,{scope:u,placedSide:de,onArrowChange:oe,arrowX:ie,arrowY:we,shouldHideArrow:U},m.createElement(He.div,ae({"data-side":de,"data-align":re},A,{ref:z,style:{...A.style,animation:me?void 0:"none",opacity:(c=he.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function TB(e){return e!==null}const AB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,y]=nO(a),x={start:"0%",center:"50%",end:"100%"}[y],_=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,S=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",P="";return v==="bottom"?(C=f?x:`${_}px`,P=`${-p}px`):v==="top"?(C=f?x:`${_}px`,P=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,P=f?x:`${S}px`):v==="left"&&(C=`${l.floating.width+p}px`,P=f?x:`${S}px`),{data:{x:C,y:P}}}});function nO(e){const[t,n="center"]=e.split("-");return[t,n]}const Nu=OB,Ru=kB,Lu=DB,Hh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?Tt.createPortal(m.createElement(He.div,ae({},i,{ref:t})),r):null}),rO=m.forwardRef((e,t)=>m.createElement(He.span,ae({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),IB=rO,[Wh,kfe]=An("Tooltip",[Wi]),Jb=Wi(),NB="TooltipProvider",RB=700,e0="tooltip.open",[LB,t0]=Wh(NB),FB=e=>{const{__scopeTooltip:t,delayDuration:n=RB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(LB,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:i},o)},n0="Tooltip",[$B,Uh]=Wh(n0),jB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=t0(n0,e.__scopeTooltip),c=Jb(t),[u,f]=m.useState(null),g=ur(),p=m.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[_=!1,S]=tr({prop:r,defaultProp:i,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(e0))):l.onClose(),o==null||o(A)}}),C=m.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,S(!0)},[S]),O=m.useCallback(()=>{window.clearTimeout(p.current),S(!1)},[S]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,S(!0)},y)},[y,S]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Nu,c,m.createElement($B,{scope:t,contentId:g,open:_,stateAttribute:C,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():P()},[l.isOpenDelayed,k,P]),onTriggerLeave:m.useCallback(()=>{v?O():window.clearTimeout(p.current)},[O,v]),onOpen:P,onClose:O,disableHoverableContent:v},n))},iO="TooltipTrigger",oO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Uh(iO,n),o=t0(iO,n),s=Jb(n),a=m.useRef(null),l=st(t,a,i.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Ru,ae({asChild:!0},s),m.createElement(He.button,ae({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Oe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})))}),zB="TooltipPortal",[Mfe,BB]=Wh(zB,{forceMount:void 0}),Fu="TooltipContent",VB=m.forwardRef((e,t)=>{const n=BB(Fu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Uh(Fu,e.__scopeTooltip);return m.createElement(yn,{present:r||s.open},s.disableHoverableContent?m.createElement(sO,ae({side:i},o,{ref:t})):m.createElement(HB,ae({side:i},o,{ref:t})))}),HB=m.forwardRef((e,t)=>{const n=Uh(Fu,e.__scopeTooltip),r=t0(Fu,e.__scopeTooltip),i=m.useRef(null),o=st(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,y)=>{const x=v.currentTarget,_={x:v.clientX,y:v.clientY},S=UB(_,x.getBoundingClientRect()),C=qB(_,S),P=GB(y.getBoundingClientRect()),O=KB([...C,...P]);a(O),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),y=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",y)}}},[l,u,p,g]),m.useEffect(()=>{if(s){const v=y=>{const x=y.target,_={x:y.clientX,y:y.clientY},S=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),C=!YB(_,s);S?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,g]),m.createElement(sO,ae({},e,{ref:o}))}),[WB,Dfe]=Wh(n0,{isInside:!1}),sO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=Uh(Fu,n),c=Jb(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(e0,u),()=>document.removeEventListener(e0,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(El,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Lu,ae({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(w_,null,r),m.createElement(WB,{scope:n,isInside:!0},m.createElement(IB,{id:l.contentId,role:"tooltip"},i||r))))});function UB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function GB(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function YB(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function KB(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),XB(t)}function XB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const QB=FB,ZB=jB,JB=oO,aO=VB,eV=QB,r0=ZB,lO=JB,qh=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(aO,{ref:r,sideOffset:t,className:ke("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qh.displayName=aO.displayName;const cO=ue.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:ke("w-full caption-bottom text-sm",e),...t})}));cO.displayName="Table";const uO=ue.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:ke("[&_tr]:border-b",e),...t}));uO.displayName="TableHeader";const dO=ue.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:ke("[&_tr:last-child]:border-0",e),...t}));dO.displayName="TableBody";const tV=ue.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:ke("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));tV.displayName="TableFooter";const Gh=ue.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Gh.displayName="TableRow";const fO=ue.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:ke("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));fO.displayName="TableHead";const i0=ue.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:ke("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));i0.displayName="TableCell";const nV=ue.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:ke("mt-4 text-sm text-muted-foreground",e),...t}));nV.displayName="TableCaption";/**
130
130
  * table-core
131
131
  *
132
132
  * Copyright (c) TanStack
@@ -444,7 +444,7 @@ Check the top-level render call using <`+se+">.")}return Y}}function Ua(M,Y){{if
444
444
  *
445
445
  * This source code is licensed under the MIT license found in the
446
446
  * LICENSE file in the root directory of this source tree.
447
- */var UP;function XU(){if(UP)return Ku;UP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Ku.Fragment=n,Ku.jsx=s,Ku.jsxs=s,Ku}process.env.NODE_ENV==="production"?ay.exports=XU():ay.exports=KU();var _e=ay.exports;function Xu(e){return e.mode==="multiple"}function Qu(e){return e.mode==="range"}function yp(e){return e.mode==="single"}var QU={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function ZU(e,t){return Ki(e,"LLLL y",t)}function JU(e,t){return Ki(e,"d",t)}function eq(e,t){return Ki(e,"LLLL",t)}function tq(e){return"".concat(e)}function nq(e,t){return Ki(e,"cccccc",t)}function rq(e,t){return Ki(e,"yyyy",t)}var iq=Object.freeze({__proto__:null,formatCaption:ZU,formatDay:JU,formatMonthCaption:eq,formatWeekNumber:tq,formatWeekdayName:nq,formatYearCaption:rq}),oq=function(e,t,n){return Ki(e,"do MMMM (EEEE)",n)},sq=function(){return"Month: "},aq=function(){return"Go to next month"},lq=function(){return"Go to previous month"},cq=function(e,t){return Ki(e,"cccc",t)},uq=function(e){return"Week n. ".concat(e)},dq=function(){return"Year: "},fq=Object.freeze({__proto__:null,labelDay:oq,labelMonthDropdown:sq,labelNext:aq,labelPrevious:lq,labelWeekNumber:uq,labelWeekday:cq,labelYearDropdown:dq});function hq(){var e="buttons",t=QU,n=AP,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:iq,labels:fq,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function pq(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=vr(r):t&&(o=new Date(t,0,1)),i?s=ey(i):n&&(s=new Date(n,11,31)),{fromDate:o?$l(o):void 0,toDate:s?$l(s):void 0}}var qP=m.createContext(void 0);function gq(e){var t,n=e.initialProps,r=hq(),i=pq(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(yp(n)||Xu(n)||Qu(n))&&(l=n.onSelect);var c=Ke(Ke(Ke({},r),n),{captionLayout:a,classNames:Ke(Ke({},r.classNames),n.classNames),components:Ke({},n.components),formatters:Ke(Ke({},r.formatters),n.formatters),fromDate:o,labels:Ke(Ke({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ke(Ke({},r.modifiers),n.modifiers),modifiersClassNames:Ke(Ke({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ke(Ke({},r.styles),n.styles),toDate:s});return _e.jsx(qP.Provider,{value:c,children:e.children})}function qt(){var e=m.useContext(qP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function GP(e){var t=qt(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return _e.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function mq(e){return _e.jsx("svg",Ke({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:_e.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function YP(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=qt(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:mq;return _e.jsxs("div",{className:a,style:l,children:[_e.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),_e.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),_e.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,_e.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function vq(e){var t,n=qt(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return _e.jsx(_e.Fragment,{});if(!i)return _e.jsx(_e.Fragment,{});var f=[];if(GU(r,i))for(var g=vr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(sy(g,p));else for(var g=vr(new Date),p=0;p<=11;p++)f.push(sy(g,p));var v=function(x){var _=Number(x.target.value),S=sy(vr(e.displayMonth),_);e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YP;return _e.jsx(y,{name:"months","aria-label":u(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return _e.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function bq(e){var t,n=e.displayMonth,r=qt(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return _e.jsx(_e.Fragment,{});if(!o)return _e.jsx(_e.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),y=p;y<=v;y++)g.push(VP(DP(new Date),y));var x=function(S){var C=VP(vr(n),Number(S.target.value));e.onChange(C)},_=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YP;return _e.jsx(_,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:u(n,{locale:s}),children:g.map(function(S){return _e.jsx("option",{value:S.getFullYear(),children:u(S,{locale:s})},S.getFullYear())})})}function yq(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function xq(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Uu(o,i)<0){var c=-1*(l-1);i=Ei(o,c)}return s&&Uu(i,s)<0&&(i=s),vr(i)}function wq(){var e=qt(),t=xq(e),n=yq(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=vr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function _q(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=vr(e),o=vr(Ei(i,r)),s=Uu(o,i),a=[],l=0;l<s;l++){var c=Ei(i,l);a.push(c)}return n&&(a=a.reverse()),a}function Sq(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=vr(e);if(!n)return Ei(a,s);var l=Uu(n,e);if(!(l<o))return Ei(a,s)}}function Cq(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=vr(e);if(!n)return Ei(a,-s);var l=Uu(a,n);if(!(l<=0))return Ei(a,-s)}}var KP=m.createContext(void 0);function Eq(e){var t=qt(),n=wq(),r=n[0],i=n[1],o=_q(r,t),s=Sq(r,t),a=Cq(r,t),l=function(f){return o.some(function(g){return iy(f,g)})},c=function(f,g){l(f)||(g&&BP(f,g)?i(Ei(f,1+t.numberOfMonths*-1)):i(f))},u={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return _e.jsx(KP.Provider,{value:u,children:e.children})}function Zu(){var e=m.useContext(KP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function XP(e){var t,n=qt(),r=n.classNames,i=n.styles,o=n.components,s=Zu().goToMonth,a=function(u){s(Ei(u,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:GP,c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth});return _e.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[_e.jsx("div",{className:r.vhidden,children:c}),_e.jsx(vq,{onChange:a,displayMonth:e.displayMonth}),_e.jsx(bq,{onChange:a,displayMonth:e.displayMonth})]})}function Oq(e){return _e.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Pq(e){return _e.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var xp=m.forwardRef(function(e,t){var n=qt(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Ke(Ke({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),_e.jsx("button",Ke({},e,{ref:t,type:"button",className:s,style:a}))});function kq(e){var t,n,r=qt(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return _e.jsx(_e.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:o}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:Pq,_=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Oq;return _e.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&_e.jsx(xp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?_e.jsx(x,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(_,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&_e.jsx(xp,{name:"next-month","aria-label":v,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?_e.jsx(_,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function QP(e){var t=qt().numberOfMonths,n=Zu(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return iy(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return _e.jsx(kq,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function Mq(e){var t,n=qt(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:GP,c;return i?c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=_e.jsx(XP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=_e.jsxs(_e.Fragment,{children:[_e.jsx(XP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_e.jsx(QP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=_e.jsxs(_e.Fragment,{children:[_e.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(QP,{displayMonth:e.displayMonth,id:e.id})]}),_e.jsx("div",{className:r.caption,style:o.caption,children:c})}function Dq(e){var t=qt(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?_e.jsx("tfoot",{className:i,style:r.tfoot,children:_e.jsx("tr",{children:_e.jsx("td",{colSpan:8,children:n})})}):_e.jsx(_e.Fragment,{})}function Tq(e,t,n){for(var r=n?wa(new Date):Gi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=rr(r,o);i.push(s)}return i}function Aq(){var e=qt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Tq(i,o,s);return _e.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_e.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return _e.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:i}),children:a(u,{locale:i})},f)})]})}function Iq(){var e,t=qt(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:Aq;return _e.jsx("thead",{style:r.head,className:n.head,children:_e.jsx(o,{})})}function Nq(e){var t=qt(),n=t.locale,r=t.formatters.formatDay;return _e.jsx(_e.Fragment,{children:r(e.date,{locale:n})})}var ly=m.createContext(void 0);function Rq(e){if(!Xu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _e.jsx(ly.Provider,{value:t,children:e.children})}return _e.jsx(Lq,{initialProps:e.initialProps,children:e.children})}function Lq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,u,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,u,f);var v=!!(u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=!!(!u.selected&&o&&(r==null?void 0:r.length)===o);if(!y){var x=r?HP([],r,!0):[];if(u.selected){var _=x.findIndex(function(S){return mr(c,S)});x.splice(_,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=o&&r.length>o-1,f=r.some(function(g){return mr(g,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return _e.jsx(ly.Provider,{value:l,children:n})}function cy(){var e=m.useContext(ly);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Fq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?mr(i,e)&&mr(r,e)?void 0:mr(i,e)?{from:i,to:void 0}:mr(r,e)?void 0:ry(r,e)?{from:e,to:i}:{from:r,to:e}:i?ry(e,i)?{from:i,to:e}:{from:e,to:i}:r?BP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var uy=m.createContext(void 0);function $q(e){if(!Qu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _e.jsx(uy.Provider,{value:t,children:e.children})}return _e.jsx(jq,{initialProps:e.initialProps,children:e.children})}function jq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,y){var x,_;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,y);var S=Fq(p,r);(_=t.onSelect)===null||_===void 0||_.call(t,S,p,v,y)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],s?(u.range_end=[s],mr(o,s)||(u.range_middle=[{after:o,before:s}])):u.range_end=[o]):s&&(u.range_start=[s],u.range_end=[s]),a&&(o&&!s&&u.disabled.push({after:oy(o,a-1),before:rr(o,a-1)}),o&&s&&u.disabled.push({after:o,before:rr(o,a-1)}),!o&&s&&u.disabled.push({after:oy(s,a-1),before:rr(s,a-1)})),l){if(o&&!s&&(u.disabled.push({before:rr(o,-l+1)}),u.disabled.push({after:rr(o,l-1)})),o&&s){var f=Yi(s,o)+1,g=l-f;u.disabled.push({before:oy(o,g)}),u.disabled.push({after:rr(s,g)})}!o&&s&&(u.disabled.push({before:rr(s,-l+1)}),u.disabled.push({after:rr(s,l-1)}))}return _e.jsx(uy.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function dy(){var e=m.useContext(uy);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function wp(e){return Array.isArray(e)?HP([],e,!0):e!==void 0?[e]:[]}function zq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=wp(i)}),t}var Oi;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Oi||(Oi={}));var Bq=Oi.Selected,ko=Oi.Disabled,Vq=Oi.Hidden,Hq=Oi.Today,fy=Oi.RangeEnd,hy=Oi.RangeMiddle,py=Oi.RangeStart,Wq=Oi.Outside;function Uq(e,t,n){var r,i=(r={},r[Bq]=wp(e.selected),r[ko]=wp(e.disabled),r[Vq]=wp(e.hidden),r[Hq]=[e.today],r[fy]=[],r[hy]=[],r[py]=[],r[Wq]=[],r);return e.fromDate&&i[ko].push({before:e.fromDate}),e.toDate&&i[ko].push({after:e.toDate}),Xu(e)?i[ko]=i[ko].concat(t.modifiers[ko]):Qu(e)&&(i[ko]=i[ko].concat(n.modifiers[ko]),i[py]=n.modifiers[py],i[hy]=n.modifiers[hy],i[fy]=n.modifiers[fy]),i}var ZP=m.createContext(void 0);function qq(e){var t=qt(),n=cy(),r=dy(),i=Uq(t,n,r),o=zq(t.modifiers),s=Ke(Ke({},i),o);return _e.jsx(ZP.Provider,{value:s,children:e.children})}function JP(){var e=m.useContext(ZP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Gq(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Yq(e){return!!(e&&typeof e=="object"&&"from"in e)}function Kq(e){return!!(e&&typeof e=="object"&&"after"in e)}function Xq(e){return!!(e&&typeof e=="object"&&"before"in e)}function Qq(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Zq(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Yi(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Yi(e,r)>=0&&Yi(i,e)>=0;return s}return i?mr(i,e):r?mr(r,e):!1}function Jq(e){return J0(e)}function eG(e){return Array.isArray(e)&&e.every(J0)}function tG(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Jq(n))return mr(e,n);if(eG(n))return n.includes(e);if(Yq(n))return Zq(e,n);if(Qq(n))return n.dayOfWeek.includes(e.getDay());if(Gq(n)){var r=Yi(n.before,e),i=Yi(n.after,e),o=r>0,s=i<0,a=ry(n.before,n.after);return a?s&&o:o||s}return Kq(n)?Yi(e,n.after)>0:Xq(n)?Yi(n.before,e)>0:typeof n=="function"?n(e):!1})}function gy(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return tG(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!iy(e,n)&&(i.outside=!0),i}function nG(e,t){for(var n=vr(e[0]),r=ey(e[e.length-1]),i,o,s=n;s<=r;){var a=gy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=rr(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=rr(s,1)}return o||i}var rG=365;function ek(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,u=i.toDate,f=i.locale,g={day:rr,week:Z0,month:Ei,year:UW,startOfWeek:function(x){return i.ISOWeek?wa(x):Gi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?TP(x):ty(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=qW([c,p]):r==="after"&&u&&(p=GW([u,p]));var v=!0;if(o){var y=gy(p,o);v=!y.disabled&&!y.hidden}return v?p:a.count>rG?a.lastFocused:ek(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Ke(Ke({},a),{count:a.count+1})})}var tk=m.createContext(void 0);function iG(e){var t=Zu(),n=JP(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=nG(t.displayMonths,n),u=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=qt(),v=function(x,_){if(i){var S=ek(i,{moveBy:x,direction:_,context:p,modifiers:n});mr(i,S)||(t.goToDate(S,i),g(S))}},y={focusedDay:i,focusTarget:u,blur:f,focus:g,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return _e.jsx(tk.Provider,{value:y,children:e.children})}function my(){var e=m.useContext(tk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function oG(e,t){var n=JP(),r=gy(e,n,t);return r}var vy=m.createContext(void 0);function sG(e){if(!yp(e.initialProps)){var t={selected:void 0};return _e.jsx(vy.Provider,{value:t,children:e.children})}return _e.jsx(aG,{initialProps:e.initialProps,children:e.children})}function aG(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return _e.jsx(vy.Provider,{value:i,children:n})}function nk(){var e=m.useContext(vy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function lG(e,t){var n=qt(),r=nk(),i=cy(),o=dy(),s=my(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,_=s.focusStartOfWeek,S=s.focusEndOfWeek,C=function(q){var K,G,D,H;yp(n)?(K=r.onDayClick)===null||K===void 0||K.call(r,e,t,q):Xu(n)?(G=i.onDayClick)===null||G===void 0||G.call(i,e,t,q):Qu(n)?(D=o.onDayClick)===null||D===void 0||D.call(o,e,t,q):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,q)},P=function(q){var K;g(e),(K=n.onDayFocus)===null||K===void 0||K.call(n,e,t,q)},O=function(q){var K;f(),(K=n.onDayBlur)===null||K===void 0||K.call(n,e,t,q)},k=function(q){var K;(K=n.onDayMouseEnter)===null||K===void 0||K.call(n,e,t,q)},A=function(q){var K;(K=n.onDayMouseLeave)===null||K===void 0||K.call(n,e,t,q)},L=function(q){var K;(K=n.onDayPointerEnter)===null||K===void 0||K.call(n,e,t,q)},F=function(q){var K;(K=n.onDayPointerLeave)===null||K===void 0||K.call(n,e,t,q)},j=function(q){var K;(K=n.onDayTouchCancel)===null||K===void 0||K.call(n,e,t,q)},z=function(q){var K;(K=n.onDayTouchEnd)===null||K===void 0||K.call(n,e,t,q)},V=function(q){var K;(K=n.onDayTouchMove)===null||K===void 0||K.call(n,e,t,q)},oe=function(q){var K;(K=n.onDayTouchStart)===null||K===void 0||K.call(n,e,t,q)},ee=function(q){var K;(K=n.onDayKeyUp)===null||K===void 0||K.call(n,e,t,q)},$=function(q){var K;switch(q.key){case"ArrowLeft":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":q.preventDefault(),q.stopPropagation(),c();break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),u();break;case"PageUp":q.preventDefault(),q.stopPropagation(),q.shiftKey?y():p();break;case"PageDown":q.preventDefault(),q.stopPropagation(),q.shiftKey?x():v();break;case"Home":q.preventDefault(),q.stopPropagation(),_();break;case"End":q.preventDefault(),q.stopPropagation(),S();break}(K=n.onDayKeyDown)===null||K===void 0||K.call(n,e,t,q)},J={onClick:C,onFocus:P,onBlur:O,onKeyDown:$,onKeyUp:ee,onMouseEnter:k,onMouseLeave:A,onPointerEnter:L,onPointerLeave:F,onTouchCancel:j,onTouchEnd:z,onTouchMove:V,onTouchStart:oe};return J}function cG(){var e=qt(),t=nk(),n=cy(),r=dy(),i=yp(e)?t.selected:Xu(e)?n.selected:Qu(e)?r.selected:void 0;return i}function uG(e){return Object.values(Oi).includes(e)}function dG(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(uG(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function fG(e,t){var n=Ke({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Ke(Ke({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function hG(e,t,n){var r,i,o,s=qt(),a=my(),l=oG(e,t),c=lG(e,l),u=cG(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&mr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=dG(s,l).join(" "),p=fG(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:Nq,x=_e.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),_={style:p,className:g,children:x,role:"gridcell"},S=a.focusTarget&&mr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&mr(a.focusedDay,e),P=Ke(Ke(Ke({},_),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||S?0:-1,r)),c),O={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:P,divProps:_};return O}function pG(e){var t=m.useRef(null),n=hG(e.date,e.displayMonth,t);return n.isHidden?_e.jsx("div",{role:"gridcell"}):n.isButton?_e.jsx(xp,Ke({name:"day",ref:t},n.buttonProps)):_e.jsx("div",Ke({},n.divProps))}function gG(e){var t=e.number,n=e.dates,r=qt(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!i)return _e.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:u});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return _e.jsx(xp,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:u})}function mG(e){var t,n,r=qt(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:pG,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:gG,u;return s&&(u=_e.jsx("td",{className:o.cell,style:i.cell,children:_e.jsx(c,{number:e.weekNumber,dates:e.dates})})),_e.jsxs("tr",{className:o.row,style:i.row,children:[u,e.dates.map(function(f){return _e.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:_e.jsx(l,{displayMonth:e.displayMonth,date:f})},WU(f))})]})}function rk(e,t,n){for(var r=n!=null&&n.ISOWeek?TP(t):ty(t,n),i=n!=null&&n.ISOWeek?wa(e):Gi(e,n),o=Yi(r,i),s=[],a=0;a<=o;a++)s.push(rr(i,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?IP(u):RP(u,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function vG(e,t){var n=rk(vr(e),ey(e),t);if(t!=null&&t.useFixedWeeks){var r=qU(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=Z0(o,6-r),a=rk(Z0(o,1),s,t);n.push.apply(n,a)}}return n}function bG(e){var t,n,r,i=qt(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,u=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=vG(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),y=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Iq,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:mG,_=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Dq;return _e.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&_e.jsx(y,{}),_e.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(S){return _e.jsx(x,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),_e.jsx(_,{displayMonth:e.displayMonth})]})}function yG(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xG=yG()?m.useLayoutEffect:m.useEffect,by=!1,wG=0;function ik(){return"react-day-picker-".concat(++wG)}function _G(e){var t,n=e??(by?ik():null),r=m.useState(n),i=r[0],o=r[1];return xG(function(){i===null&&o(ik())},[]),m.useEffect(function(){by===!1&&(by=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function SG(e){var t,n,r=qt(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=Zu().displayMonths,c=_G(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,y=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Ke(Ke({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Ke(Ke({},g),s.caption_end)),y&&(f.push(o.caption_between),g=Ke(Ke({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Mq;return _e.jsxs("div",{className:f.join(" "),style:g,children:[_e.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(bG,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function CG(e){var t=qt(),n=t.classNames,r=t.styles;return _e.jsx("div",{className:n.months,style:r.months,children:e.children})}function EG(e){var t,n,r=e.initialProps,i=qt(),o=my(),s=Zu(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var u=[i.classNames.root,i.className];i.numberOfMonths>1&&u.push(i.classNames.multiple_months),i.showWeekNumber&&u.push(i.classNames.with_weeknumber);var f=Ke(Ke({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,y){var x;return Ke(Ke({},v),(x={},x[y]=r[y],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:CG;return _e.jsx("div",Ke({className:u.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:_e.jsx(p,{children:s.displayMonths.map(function(v,y){return _e.jsx(SG,{displayIndex:y,displayMonth:v},y)})})}))}function OG(e){var t=e.children,n=YU(e,["children"]);return _e.jsx(gq,{initialProps:n,children:_e.jsx(Eq,{children:_e.jsx(sG,{initialProps:n,children:_e.jsx(Rq,{initialProps:n,children:_e.jsx($q,{initialProps:n,children:_e.jsx(qq,{children:_e.jsx(iG,{children:t})})})})})})})}function PG(e){return _e.jsx(OG,Ke({},e,{children:_e.jsx(EG,{initialProps:e})}))}function ok({className:e,classNames:t,showOutsideDays:n=!0,...r}){return w.jsx(PG,{showOutsideDays:n,className:ke("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ke(X0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ke(X0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>w.jsx(tH,{...i,className:"h-4 w-4"}),IconRight:({...i})=>w.jsx(VO,{...i,className:"h-4 w-4"})},...r})}ok.displayName="Calendar";let yy=0;function _p(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:sk()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:sk()),yy++,()=>{yy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),yy--}},[])}function sk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const xy="focusScope.autoFocusOnMount",wy="focusScope.autoFocusOnUnmount",ak={bubbles:!1,cancelable:!0},Sp=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=On(i),u=On(o),f=m.useRef(null),g=st(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(p.paused||!a)return;const P=C.target;a.contains(P)?f.current=P:ps(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const P=C.relatedTarget;P!==null&&(a.contains(P)||ps(f.current,{select:!0}))},_=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&ps(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const S=new MutationObserver(_);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){uk.add(p);const y=document.activeElement;if(!a.contains(y)){const _=new CustomEvent(xy,ak);a.addEventListener(xy,c),a.dispatchEvent(_),_.defaultPrevented||(kG(IG(lk(a)),{select:!0}),document.activeElement===y&&ps(a))}return()=>{a.removeEventListener(xy,c),setTimeout(()=>{const _=new CustomEvent(wy,ak);a.addEventListener(wy,u),a.dispatchEvent(_),_.defaultPrevented||ps(y??document.body,{select:!0}),a.removeEventListener(wy,u),uk.remove(p)},0)}}},[a,c,u,p]);const v=m.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,_=document.activeElement;if(x&&_){const S=y.currentTarget,[C,P]=MG(S);C&&P?!y.shiftKey&&_===P?(y.preventDefault(),n&&ps(C,{select:!0})):y.shiftKey&&_===C&&(y.preventDefault(),n&&ps(P,{select:!0})):_===S&&y.preventDefault()}},[n,r,p.paused]);return m.createElement(He.div,ae({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function kG(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function MG(e){const t=lk(e),n=ck(t,e),r=ck(t.reverse(),e);return[n,r]}function lk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ck(e,t){for(const n of e)if(!DG(n,{upTo:t}))return n}function DG(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TG(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TG(e)&&t&&e.select()}}const uk=AG();function AG(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dk(e,t),e.unshift(t)},remove(t){var n;e=dk(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function dk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function IG(e){return e.filter(t=>t.tagName!=="A")}var NG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zl=new WeakMap,Cp=new WeakMap,Ep={},_y=0,fk=function(e){return e&&(e.host||fk(e.parentNode))},RG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LG=function(e,t,n,r){var i=RG(t,Array.isArray(e)?e:[e]);Ep[n]||(Ep[n]=new WeakMap);var o=Ep[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))u(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",y=(zl.get(g)||0)+1,x=(o.get(g)||0)+1;zl.set(g,y),o.set(g,x),s.push(g),y===1&&v&&Cp.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return u(t),a.clear(),_y++,function(){s.forEach(function(f){var g=zl.get(f)-1,p=o.get(f)-1;zl.set(f,g),o.set(f,p),g||(Cp.has(f)||f.removeAttribute(r),Cp.delete(f)),p||f.removeAttribute(n)}),_y--,_y||(zl=new WeakMap,zl=new WeakMap,Cp=new WeakMap,Ep={})}},Op=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||NG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),LG(r,i,n,"aria-hidden")):function(){return null}},Xi=function(){return Xi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Xi.apply(this,arguments)};function hk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function FG(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Pp="right-scroll-bar-position",kp="width-before-scroll-bar",$G="with-scroll-bars-hidden",jG="--removed-body-scroll-bar-size";function zG(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BG(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function VG(e,t){return BG(t||null,function(n){return e.forEach(function(r){return zG(r,n)})})}function HG(e){return e}function WG(e,t){t===void 0&&(t=HG);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function UG(e){e===void 0&&(e={});var t=WG(null);return t.options=Xi({async:!0,ssr:!1},e),t}var pk=function(e){var t=e.sideCar,n=hk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return ue.createElement(r,Xi({},n))};pk.isSideCarExport=!0;function qG(e,t){return e.useMedium(t),pk}var gk=UG(),Sy=function(){},Mp=ue.forwardRef(function(e,t){var n=ue.useRef(null),r=ue.useState({onScrollCapture:Sy,onWheelCapture:Sy,onTouchMoveCapture:Sy}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,S=hk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,P=VG([n,t]),O=Xi(Xi({},S),i);return ue.createElement(ue.Fragment,null,u&&ue.createElement(C,{sideCar:gk,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),s?ue.cloneElement(ue.Children.only(a),Xi(Xi({},O),{ref:P})):ue.createElement(_,Xi({},O,{className:l,ref:P}),a))});Mp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mp.classNames={fullWidth:kp,zeroRight:Pp};var mk,GG=function(){if(mk)return mk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GG();return t&&e.setAttribute("nonce",t),e}function KG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=YG())&&(KG(t,n),XG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZG=function(){var e=QG();return function(t,n){ue.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vk=function(){var e=ZG(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},JG={left:0,top:0,right:0,gap:0},Cy=function(e){return parseInt(e||"",10)||0},eY=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Cy(n),Cy(r),Cy(i)]},tY=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JG;var t=eY(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nY=vk(),rY=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
447
+ */var UP;function XU(){if(UP)return Ku;UP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Ku.Fragment=n,Ku.jsx=s,Ku.jsxs=s,Ku}process.env.NODE_ENV==="production"?ay.exports=XU():ay.exports=KU();var _e=ay.exports;function Xu(e){return e.mode==="multiple"}function Qu(e){return e.mode==="range"}function yp(e){return e.mode==="single"}var QU={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function ZU(e,t){return Ki(e,"LLLL y",t)}function JU(e,t){return Ki(e,"d",t)}function eq(e,t){return Ki(e,"LLLL",t)}function tq(e){return"".concat(e)}function nq(e,t){return Ki(e,"cccccc",t)}function rq(e,t){return Ki(e,"yyyy",t)}var iq=Object.freeze({__proto__:null,formatCaption:ZU,formatDay:JU,formatMonthCaption:eq,formatWeekNumber:tq,formatWeekdayName:nq,formatYearCaption:rq}),oq=function(e,t,n){return Ki(e,"do MMMM (EEEE)",n)},sq=function(){return"Month: "},aq=function(){return"Go to next month"},lq=function(){return"Go to previous month"},cq=function(e,t){return Ki(e,"cccc",t)},uq=function(e){return"Week n. ".concat(e)},dq=function(){return"Year: "},fq=Object.freeze({__proto__:null,labelDay:oq,labelMonthDropdown:sq,labelNext:aq,labelPrevious:lq,labelWeekNumber:uq,labelWeekday:cq,labelYearDropdown:dq});function hq(){var e="buttons",t=QU,n=AP,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:iq,labels:fq,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function pq(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=vr(r):t&&(o=new Date(t,0,1)),i?s=ey(i):n&&(s=new Date(n,11,31)),{fromDate:o?$l(o):void 0,toDate:s?$l(s):void 0}}var qP=m.createContext(void 0);function gq(e){var t,n=e.initialProps,r=hq(),i=pq(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(yp(n)||Xu(n)||Qu(n))&&(l=n.onSelect);var c=Ke(Ke(Ke({},r),n),{captionLayout:a,classNames:Ke(Ke({},r.classNames),n.classNames),components:Ke({},n.components),formatters:Ke(Ke({},r.formatters),n.formatters),fromDate:o,labels:Ke(Ke({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ke(Ke({},r.modifiers),n.modifiers),modifiersClassNames:Ke(Ke({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ke(Ke({},r.styles),n.styles),toDate:s});return _e.jsx(qP.Provider,{value:c,children:e.children})}function Gt(){var e=m.useContext(qP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function GP(e){var t=Gt(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return _e.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function mq(e){return _e.jsx("svg",Ke({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:_e.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function YP(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=Gt(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:mq;return _e.jsxs("div",{className:a,style:l,children:[_e.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),_e.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),_e.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,_e.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function vq(e){var t,n=Gt(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return _e.jsx(_e.Fragment,{});if(!i)return _e.jsx(_e.Fragment,{});var f=[];if(GU(r,i))for(var g=vr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(sy(g,p));else for(var g=vr(new Date),p=0;p<=11;p++)f.push(sy(g,p));var v=function(x){var _=Number(x.target.value),S=sy(vr(e.displayMonth),_);e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YP;return _e.jsx(y,{name:"months","aria-label":u(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return _e.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function bq(e){var t,n=e.displayMonth,r=Gt(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return _e.jsx(_e.Fragment,{});if(!o)return _e.jsx(_e.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),y=p;y<=v;y++)g.push(VP(DP(new Date),y));var x=function(S){var C=VP(vr(n),Number(S.target.value));e.onChange(C)},_=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YP;return _e.jsx(_,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:u(n,{locale:s}),children:g.map(function(S){return _e.jsx("option",{value:S.getFullYear(),children:u(S,{locale:s})},S.getFullYear())})})}function yq(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function xq(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Uu(o,i)<0){var c=-1*(l-1);i=Ei(o,c)}return s&&Uu(i,s)<0&&(i=s),vr(i)}function wq(){var e=Gt(),t=xq(e),n=yq(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=vr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function _q(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=vr(e),o=vr(Ei(i,r)),s=Uu(o,i),a=[],l=0;l<s;l++){var c=Ei(i,l);a.push(c)}return n&&(a=a.reverse()),a}function Sq(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=vr(e);if(!n)return Ei(a,s);var l=Uu(n,e);if(!(l<o))return Ei(a,s)}}function Cq(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=vr(e);if(!n)return Ei(a,-s);var l=Uu(a,n);if(!(l<=0))return Ei(a,-s)}}var KP=m.createContext(void 0);function Eq(e){var t=Gt(),n=wq(),r=n[0],i=n[1],o=_q(r,t),s=Sq(r,t),a=Cq(r,t),l=function(f){return o.some(function(g){return iy(f,g)})},c=function(f,g){l(f)||(g&&BP(f,g)?i(Ei(f,1+t.numberOfMonths*-1)):i(f))},u={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return _e.jsx(KP.Provider,{value:u,children:e.children})}function Zu(){var e=m.useContext(KP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function XP(e){var t,n=Gt(),r=n.classNames,i=n.styles,o=n.components,s=Zu().goToMonth,a=function(u){s(Ei(u,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:GP,c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth});return _e.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[_e.jsx("div",{className:r.vhidden,children:c}),_e.jsx(vq,{onChange:a,displayMonth:e.displayMonth}),_e.jsx(bq,{onChange:a,displayMonth:e.displayMonth})]})}function Oq(e){return _e.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Pq(e){return _e.jsx("svg",Ke({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var xp=m.forwardRef(function(e,t){var n=Gt(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Ke(Ke({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),_e.jsx("button",Ke({},e,{ref:t,type:"button",className:s,style:a}))});function kq(e){var t,n,r=Gt(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return _e.jsx(_e.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:o}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:Pq,_=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Oq;return _e.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&_e.jsx(xp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?_e.jsx(x,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(_,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&_e.jsx(xp,{name:"next-month","aria-label":v,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?_e.jsx(_,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function QP(e){var t=Gt().numberOfMonths,n=Zu(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return iy(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return _e.jsx(kq,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function Mq(e){var t,n=Gt(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:GP,c;return i?c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=_e.jsx(XP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=_e.jsxs(_e.Fragment,{children:[_e.jsx(XP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_e.jsx(QP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=_e.jsxs(_e.Fragment,{children:[_e.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(QP,{displayMonth:e.displayMonth,id:e.id})]}),_e.jsx("div",{className:r.caption,style:o.caption,children:c})}function Dq(e){var t=Gt(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?_e.jsx("tfoot",{className:i,style:r.tfoot,children:_e.jsx("tr",{children:_e.jsx("td",{colSpan:8,children:n})})}):_e.jsx(_e.Fragment,{})}function Tq(e,t,n){for(var r=n?wa(new Date):Gi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=rr(r,o);i.push(s)}return i}function Aq(){var e=Gt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Tq(i,o,s);return _e.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_e.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return _e.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:i}),children:a(u,{locale:i})},f)})]})}function Iq(){var e,t=Gt(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:Aq;return _e.jsx("thead",{style:r.head,className:n.head,children:_e.jsx(o,{})})}function Nq(e){var t=Gt(),n=t.locale,r=t.formatters.formatDay;return _e.jsx(_e.Fragment,{children:r(e.date,{locale:n})})}var ly=m.createContext(void 0);function Rq(e){if(!Xu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _e.jsx(ly.Provider,{value:t,children:e.children})}return _e.jsx(Lq,{initialProps:e.initialProps,children:e.children})}function Lq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,u,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,u,f);var v=!!(u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=!!(!u.selected&&o&&(r==null?void 0:r.length)===o);if(!y){var x=r?HP([],r,!0):[];if(u.selected){var _=x.findIndex(function(S){return mr(c,S)});x.splice(_,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=o&&r.length>o-1,f=r.some(function(g){return mr(g,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return _e.jsx(ly.Provider,{value:l,children:n})}function cy(){var e=m.useContext(ly);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Fq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?mr(i,e)&&mr(r,e)?void 0:mr(i,e)?{from:i,to:void 0}:mr(r,e)?void 0:ry(r,e)?{from:e,to:i}:{from:r,to:e}:i?ry(e,i)?{from:i,to:e}:{from:e,to:i}:r?BP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var uy=m.createContext(void 0);function $q(e){if(!Qu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _e.jsx(uy.Provider,{value:t,children:e.children})}return _e.jsx(jq,{initialProps:e.initialProps,children:e.children})}function jq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,y){var x,_;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,y);var S=Fq(p,r);(_=t.onSelect)===null||_===void 0||_.call(t,S,p,v,y)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],s?(u.range_end=[s],mr(o,s)||(u.range_middle=[{after:o,before:s}])):u.range_end=[o]):s&&(u.range_start=[s],u.range_end=[s]),a&&(o&&!s&&u.disabled.push({after:oy(o,a-1),before:rr(o,a-1)}),o&&s&&u.disabled.push({after:o,before:rr(o,a-1)}),!o&&s&&u.disabled.push({after:oy(s,a-1),before:rr(s,a-1)})),l){if(o&&!s&&(u.disabled.push({before:rr(o,-l+1)}),u.disabled.push({after:rr(o,l-1)})),o&&s){var f=Yi(s,o)+1,g=l-f;u.disabled.push({before:oy(o,g)}),u.disabled.push({after:rr(s,g)})}!o&&s&&(u.disabled.push({before:rr(s,-l+1)}),u.disabled.push({after:rr(s,l-1)}))}return _e.jsx(uy.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function dy(){var e=m.useContext(uy);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function wp(e){return Array.isArray(e)?HP([],e,!0):e!==void 0?[e]:[]}function zq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=wp(i)}),t}var Oi;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Oi||(Oi={}));var Bq=Oi.Selected,ko=Oi.Disabled,Vq=Oi.Hidden,Hq=Oi.Today,fy=Oi.RangeEnd,hy=Oi.RangeMiddle,py=Oi.RangeStart,Wq=Oi.Outside;function Uq(e,t,n){var r,i=(r={},r[Bq]=wp(e.selected),r[ko]=wp(e.disabled),r[Vq]=wp(e.hidden),r[Hq]=[e.today],r[fy]=[],r[hy]=[],r[py]=[],r[Wq]=[],r);return e.fromDate&&i[ko].push({before:e.fromDate}),e.toDate&&i[ko].push({after:e.toDate}),Xu(e)?i[ko]=i[ko].concat(t.modifiers[ko]):Qu(e)&&(i[ko]=i[ko].concat(n.modifiers[ko]),i[py]=n.modifiers[py],i[hy]=n.modifiers[hy],i[fy]=n.modifiers[fy]),i}var ZP=m.createContext(void 0);function qq(e){var t=Gt(),n=cy(),r=dy(),i=Uq(t,n,r),o=zq(t.modifiers),s=Ke(Ke({},i),o);return _e.jsx(ZP.Provider,{value:s,children:e.children})}function JP(){var e=m.useContext(ZP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Gq(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Yq(e){return!!(e&&typeof e=="object"&&"from"in e)}function Kq(e){return!!(e&&typeof e=="object"&&"after"in e)}function Xq(e){return!!(e&&typeof e=="object"&&"before"in e)}function Qq(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Zq(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Yi(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Yi(e,r)>=0&&Yi(i,e)>=0;return s}return i?mr(i,e):r?mr(r,e):!1}function Jq(e){return J0(e)}function eG(e){return Array.isArray(e)&&e.every(J0)}function tG(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Jq(n))return mr(e,n);if(eG(n))return n.includes(e);if(Yq(n))return Zq(e,n);if(Qq(n))return n.dayOfWeek.includes(e.getDay());if(Gq(n)){var r=Yi(n.before,e),i=Yi(n.after,e),o=r>0,s=i<0,a=ry(n.before,n.after);return a?s&&o:o||s}return Kq(n)?Yi(e,n.after)>0:Xq(n)?Yi(n.before,e)>0:typeof n=="function"?n(e):!1})}function gy(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return tG(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!iy(e,n)&&(i.outside=!0),i}function nG(e,t){for(var n=vr(e[0]),r=ey(e[e.length-1]),i,o,s=n;s<=r;){var a=gy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=rr(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=rr(s,1)}return o||i}var rG=365;function ek(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,u=i.toDate,f=i.locale,g={day:rr,week:Z0,month:Ei,year:UW,startOfWeek:function(x){return i.ISOWeek?wa(x):Gi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?TP(x):ty(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=qW([c,p]):r==="after"&&u&&(p=GW([u,p]));var v=!0;if(o){var y=gy(p,o);v=!y.disabled&&!y.hidden}return v?p:a.count>rG?a.lastFocused:ek(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Ke(Ke({},a),{count:a.count+1})})}var tk=m.createContext(void 0);function iG(e){var t=Zu(),n=JP(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=nG(t.displayMonths,n),u=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=Gt(),v=function(x,_){if(i){var S=ek(i,{moveBy:x,direction:_,context:p,modifiers:n});mr(i,S)||(t.goToDate(S,i),g(S))}},y={focusedDay:i,focusTarget:u,blur:f,focus:g,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return _e.jsx(tk.Provider,{value:y,children:e.children})}function my(){var e=m.useContext(tk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function oG(e,t){var n=JP(),r=gy(e,n,t);return r}var vy=m.createContext(void 0);function sG(e){if(!yp(e.initialProps)){var t={selected:void 0};return _e.jsx(vy.Provider,{value:t,children:e.children})}return _e.jsx(aG,{initialProps:e.initialProps,children:e.children})}function aG(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return _e.jsx(vy.Provider,{value:i,children:n})}function nk(){var e=m.useContext(vy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function lG(e,t){var n=Gt(),r=nk(),i=cy(),o=dy(),s=my(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,_=s.focusStartOfWeek,S=s.focusEndOfWeek,C=function(q){var K,G,D,H;yp(n)?(K=r.onDayClick)===null||K===void 0||K.call(r,e,t,q):Xu(n)?(G=i.onDayClick)===null||G===void 0||G.call(i,e,t,q):Qu(n)?(D=o.onDayClick)===null||D===void 0||D.call(o,e,t,q):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,q)},P=function(q){var K;g(e),(K=n.onDayFocus)===null||K===void 0||K.call(n,e,t,q)},O=function(q){var K;f(),(K=n.onDayBlur)===null||K===void 0||K.call(n,e,t,q)},k=function(q){var K;(K=n.onDayMouseEnter)===null||K===void 0||K.call(n,e,t,q)},A=function(q){var K;(K=n.onDayMouseLeave)===null||K===void 0||K.call(n,e,t,q)},L=function(q){var K;(K=n.onDayPointerEnter)===null||K===void 0||K.call(n,e,t,q)},F=function(q){var K;(K=n.onDayPointerLeave)===null||K===void 0||K.call(n,e,t,q)},j=function(q){var K;(K=n.onDayTouchCancel)===null||K===void 0||K.call(n,e,t,q)},z=function(q){var K;(K=n.onDayTouchEnd)===null||K===void 0||K.call(n,e,t,q)},V=function(q){var K;(K=n.onDayTouchMove)===null||K===void 0||K.call(n,e,t,q)},oe=function(q){var K;(K=n.onDayTouchStart)===null||K===void 0||K.call(n,e,t,q)},ee=function(q){var K;(K=n.onDayKeyUp)===null||K===void 0||K.call(n,e,t,q)},$=function(q){var K;switch(q.key){case"ArrowLeft":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":q.preventDefault(),q.stopPropagation(),c();break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),u();break;case"PageUp":q.preventDefault(),q.stopPropagation(),q.shiftKey?y():p();break;case"PageDown":q.preventDefault(),q.stopPropagation(),q.shiftKey?x():v();break;case"Home":q.preventDefault(),q.stopPropagation(),_();break;case"End":q.preventDefault(),q.stopPropagation(),S();break}(K=n.onDayKeyDown)===null||K===void 0||K.call(n,e,t,q)},J={onClick:C,onFocus:P,onBlur:O,onKeyDown:$,onKeyUp:ee,onMouseEnter:k,onMouseLeave:A,onPointerEnter:L,onPointerLeave:F,onTouchCancel:j,onTouchEnd:z,onTouchMove:V,onTouchStart:oe};return J}function cG(){var e=Gt(),t=nk(),n=cy(),r=dy(),i=yp(e)?t.selected:Xu(e)?n.selected:Qu(e)?r.selected:void 0;return i}function uG(e){return Object.values(Oi).includes(e)}function dG(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(uG(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function fG(e,t){var n=Ke({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Ke(Ke({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function hG(e,t,n){var r,i,o,s=Gt(),a=my(),l=oG(e,t),c=lG(e,l),u=cG(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&mr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=dG(s,l).join(" "),p=fG(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:Nq,x=_e.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),_={style:p,className:g,children:x,role:"gridcell"},S=a.focusTarget&&mr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&mr(a.focusedDay,e),P=Ke(Ke(Ke({},_),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||S?0:-1,r)),c),O={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:P,divProps:_};return O}function pG(e){var t=m.useRef(null),n=hG(e.date,e.displayMonth,t);return n.isHidden?_e.jsx("div",{role:"gridcell"}):n.isButton?_e.jsx(xp,Ke({name:"day",ref:t},n.buttonProps)):_e.jsx("div",Ke({},n.divProps))}function gG(e){var t=e.number,n=e.dates,r=Gt(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!i)return _e.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:u});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return _e.jsx(xp,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:u})}function mG(e){var t,n,r=Gt(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:pG,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:gG,u;return s&&(u=_e.jsx("td",{className:o.cell,style:i.cell,children:_e.jsx(c,{number:e.weekNumber,dates:e.dates})})),_e.jsxs("tr",{className:o.row,style:i.row,children:[u,e.dates.map(function(f){return _e.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:_e.jsx(l,{displayMonth:e.displayMonth,date:f})},WU(f))})]})}function rk(e,t,n){for(var r=n!=null&&n.ISOWeek?TP(t):ty(t,n),i=n!=null&&n.ISOWeek?wa(e):Gi(e,n),o=Yi(r,i),s=[],a=0;a<=o;a++)s.push(rr(i,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?IP(u):RP(u,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function vG(e,t){var n=rk(vr(e),ey(e),t);if(t!=null&&t.useFixedWeeks){var r=qU(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=Z0(o,6-r),a=rk(Z0(o,1),s,t);n.push.apply(n,a)}}return n}function bG(e){var t,n,r,i=Gt(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,u=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=vG(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),y=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Iq,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:mG,_=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Dq;return _e.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&_e.jsx(y,{}),_e.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(S){return _e.jsx(x,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),_e.jsx(_,{displayMonth:e.displayMonth})]})}function yG(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var xG=yG()?m.useLayoutEffect:m.useEffect,by=!1,wG=0;function ik(){return"react-day-picker-".concat(++wG)}function _G(e){var t,n=e??(by?ik():null),r=m.useState(n),i=r[0],o=r[1];return xG(function(){i===null&&o(ik())},[]),m.useEffect(function(){by===!1&&(by=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function SG(e){var t,n,r=Gt(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=Zu().displayMonths,c=_G(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,y=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Ke(Ke({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Ke(Ke({},g),s.caption_end)),y&&(f.push(o.caption_between),g=Ke(Ke({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Mq;return _e.jsxs("div",{className:f.join(" "),style:g,children:[_e.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(bG,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function CG(e){var t=Gt(),n=t.classNames,r=t.styles;return _e.jsx("div",{className:n.months,style:r.months,children:e.children})}function EG(e){var t,n,r=e.initialProps,i=Gt(),o=my(),s=Zu(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var u=[i.classNames.root,i.className];i.numberOfMonths>1&&u.push(i.classNames.multiple_months),i.showWeekNumber&&u.push(i.classNames.with_weeknumber);var f=Ke(Ke({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,y){var x;return Ke(Ke({},v),(x={},x[y]=r[y],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:CG;return _e.jsx("div",Ke({className:u.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:_e.jsx(p,{children:s.displayMonths.map(function(v,y){return _e.jsx(SG,{displayIndex:y,displayMonth:v},y)})})}))}function OG(e){var t=e.children,n=YU(e,["children"]);return _e.jsx(gq,{initialProps:n,children:_e.jsx(Eq,{children:_e.jsx(sG,{initialProps:n,children:_e.jsx(Rq,{initialProps:n,children:_e.jsx($q,{initialProps:n,children:_e.jsx(qq,{children:_e.jsx(iG,{children:t})})})})})})})}function PG(e){return _e.jsx(OG,Ke({},e,{children:_e.jsx(EG,{initialProps:e})}))}function ok({className:e,classNames:t,showOutsideDays:n=!0,...r}){return w.jsx(PG,{showOutsideDays:n,className:ke("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ke(X0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ke(X0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>w.jsx(tH,{...i,className:"h-4 w-4"}),IconRight:({...i})=>w.jsx(VO,{...i,className:"h-4 w-4"})},...r})}ok.displayName="Calendar";let yy=0;function _p(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:sk()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:sk()),yy++,()=>{yy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),yy--}},[])}function sk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const xy="focusScope.autoFocusOnMount",wy="focusScope.autoFocusOnUnmount",ak={bubbles:!1,cancelable:!0},Sp=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=On(i),u=On(o),f=m.useRef(null),g=st(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(p.paused||!a)return;const P=C.target;a.contains(P)?f.current=P:ps(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const P=C.relatedTarget;P!==null&&(a.contains(P)||ps(f.current,{select:!0}))},_=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&ps(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const S=new MutationObserver(_);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){uk.add(p);const y=document.activeElement;if(!a.contains(y)){const _=new CustomEvent(xy,ak);a.addEventListener(xy,c),a.dispatchEvent(_),_.defaultPrevented||(kG(IG(lk(a)),{select:!0}),document.activeElement===y&&ps(a))}return()=>{a.removeEventListener(xy,c),setTimeout(()=>{const _=new CustomEvent(wy,ak);a.addEventListener(wy,u),a.dispatchEvent(_),_.defaultPrevented||ps(y??document.body,{select:!0}),a.removeEventListener(wy,u),uk.remove(p)},0)}}},[a,c,u,p]);const v=m.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,_=document.activeElement;if(x&&_){const S=y.currentTarget,[C,P]=MG(S);C&&P?!y.shiftKey&&_===P?(y.preventDefault(),n&&ps(C,{select:!0})):y.shiftKey&&_===C&&(y.preventDefault(),n&&ps(P,{select:!0})):_===S&&y.preventDefault()}},[n,r,p.paused]);return m.createElement(He.div,ae({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function kG(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function MG(e){const t=lk(e),n=ck(t,e),r=ck(t.reverse(),e);return[n,r]}function lk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ck(e,t){for(const n of e)if(!DG(n,{upTo:t}))return n}function DG(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TG(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TG(e)&&t&&e.select()}}const uk=AG();function AG(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dk(e,t),e.unshift(t)},remove(t){var n;e=dk(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function dk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function IG(e){return e.filter(t=>t.tagName!=="A")}var NG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zl=new WeakMap,Cp=new WeakMap,Ep={},_y=0,fk=function(e){return e&&(e.host||fk(e.parentNode))},RG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},LG=function(e,t,n,r){var i=RG(t,Array.isArray(e)?e:[e]);Ep[n]||(Ep[n]=new WeakMap);var o=Ep[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))u(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",y=(zl.get(g)||0)+1,x=(o.get(g)||0)+1;zl.set(g,y),o.set(g,x),s.push(g),y===1&&v&&Cp.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return u(t),a.clear(),_y++,function(){s.forEach(function(f){var g=zl.get(f)-1,p=o.get(f)-1;zl.set(f,g),o.set(f,p),g||(Cp.has(f)||f.removeAttribute(r),Cp.delete(f)),p||f.removeAttribute(n)}),_y--,_y||(zl=new WeakMap,zl=new WeakMap,Cp=new WeakMap,Ep={})}},Op=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||NG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),LG(r,i,n,"aria-hidden")):function(){return null}},Xi=function(){return Xi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Xi.apply(this,arguments)};function hk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function FG(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Pp="right-scroll-bar-position",kp="width-before-scroll-bar",$G="with-scroll-bars-hidden",jG="--removed-body-scroll-bar-size";function zG(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BG(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function VG(e,t){return BG(t||null,function(n){return e.forEach(function(r){return zG(r,n)})})}function HG(e){return e}function WG(e,t){t===void 0&&(t=HG);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function UG(e){e===void 0&&(e={});var t=WG(null);return t.options=Xi({async:!0,ssr:!1},e),t}var pk=function(e){var t=e.sideCar,n=hk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return ue.createElement(r,Xi({},n))};pk.isSideCarExport=!0;function qG(e,t){return e.useMedium(t),pk}var gk=UG(),Sy=function(){},Mp=ue.forwardRef(function(e,t){var n=ue.useRef(null),r=ue.useState({onScrollCapture:Sy,onWheelCapture:Sy,onTouchMoveCapture:Sy}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,S=hk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,P=VG([n,t]),O=Xi(Xi({},S),i);return ue.createElement(ue.Fragment,null,u&&ue.createElement(C,{sideCar:gk,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),s?ue.cloneElement(ue.Children.only(a),Xi(Xi({},O),{ref:P})):ue.createElement(_,Xi({},O,{className:l,ref:P}),a))});Mp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mp.classNames={fullWidth:kp,zeroRight:Pp};var mk,GG=function(){if(mk)return mk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GG();return t&&e.setAttribute("nonce",t),e}function KG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=YG())&&(KG(t,n),XG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZG=function(){var e=QG();return function(t,n){ue.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vk=function(){var e=ZG(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},JG={left:0,top:0,right:0,gap:0},Cy=function(e){return parseInt(e||"",10)||0},eY=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Cy(n),Cy(r),Cy(i)]},tY=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JG;var t=eY(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nY=vk(),rY=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
448
448
  .`.concat($G,` {
449
449
  overflow: hidden `).concat(r,`;
450
450
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -485,7 +485,7 @@ Check the top-level render call using <`+se+">.")}return Y}}function Ua(M,Y){{if
485
485
  .block-interactivity-`.concat(e,` {pointer-events: none;}
486
486
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
487
487
  `)},pY=0,Vl=[];function gY(e){var t=ue.useRef([]),n=ue.useRef([0,0]),r=ue.useRef(),i=ue.useState(pY++)[0],o=ue.useState(function(){return vk()})[0],s=ue.useRef(e);ue.useEffect(function(){s.current=e},[e]),ue.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=FG([e.lockRef.current],(e.shards||[]).map(Sk),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=ue.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var _=Tp(y),S=n.current,C="deltaX"in y?y.deltaX:S[0]-_[0],P="deltaY"in y?y.deltaY:S[1]-_[1],O,k=y.target,A=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in y&&A==="h"&&k.type==="range")return!1;var L=yk(A,k);if(!L)return!0;if(L?O=A:(O=A==="v"?"h":"v",L=yk(A,k)),!L)return!1;if(!r.current&&"changedTouches"in y&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return dY(F,x,y,F==="h"?C:P,!0)},[]),l=ue.useCallback(function(y){var x=y;if(!(!Vl.length||Vl[Vl.length-1]!==o)){var _="deltaY"in x?_k(x):Tp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&fY(O.delta,_)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(Sk).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=ue.useCallback(function(y,x,_,S){var C={name:y,delta:x,target:_,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),u=ue.useCallback(function(y){n.current=Tp(y),r.current=void 0},[]),f=ue.useCallback(function(y){c(y.type,_k(y),y.target,a(y,e.lockRef.current))},[]),g=ue.useCallback(function(y){c(y.type,Tp(y),y.target,a(y,e.lockRef.current))},[]);ue.useEffect(function(){return Vl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Bl),document.addEventListener("touchmove",l,Bl),document.addEventListener("touchstart",u,Bl),function(){Vl=Vl.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Bl),document.removeEventListener("touchmove",l,Bl),document.removeEventListener("touchstart",u,Bl)}},[]);var p=e.removeScrollBar,v=e.inert;return ue.createElement(ue.Fragment,null,v?ue.createElement(o,{styles:hY(i)}):null,p?ue.createElement(iY,{gapMode:"margin"}):null)}const mY=qG(gk,gY);var Ck=ue.forwardRef(function(e,t){return ue.createElement(Mp,Xi({},e,{ref:t,sideCar:mY}))});Ck.classNames=Mp.classNames;const Ap=Ck,Ek="Popover",[Ok,Yfe]=An(Ek,[Wi]),Oy=Wi(),[vY,Hl]=Ok(Ek),bY=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Oy(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,g]=tr({prop:r,defaultProp:i,onChange:o});return m.createElement(Nu,a,m.createElement(vY,{scope:t,contentId:ur(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},yY="PopoverTrigger",xY=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Hl(yY,n),o=Oy(n),s=st(t,i.triggerRef),a=m.createElement(He.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mk(i.open)},r,{ref:s,onClick:Oe(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Ru,ae({asChild:!0},o),a)}),Pk="PopoverPortal",[wY,_Y]=Ok(Pk,{forceMount:void 0}),SY=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Hl(Pk,t);return m.createElement(wY,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Hh,{asChild:!0,container:i},r)))},Ju="PopoverContent",CY=m.forwardRef((e,t)=>{const n=_Y(Ju,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Hl(Ju,e.__scopePopover);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(EY,ae({},i,{ref:t})):m.createElement(OY,ae({},i,{ref:t})))}),EY=m.forwardRef((e,t)=>{const n=Hl(Ju,e.__scopePopover),r=m.useRef(null),i=st(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Op(s)},[]),m.createElement(Ap,{as:co,allowPinchZoom:!0},m.createElement(kk,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),OY=m.forwardRef((e,t)=>{const n=Hl(Ju,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(kk,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),kk=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,g=Hl(Ju,n),p=Oy(n);return _p(),m.createElement(Sp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(El,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Lu,ae({"data-state":Mk(g.open),role:"dialog",id:g.contentId},p,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Mk(e){return e?"open":"closed"}const PY=bY,kY=xY,MY=SY,Dk=CY,Ip=PY,Np=kY,ed=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>w.jsx(MY,{children:w.jsx(Dk,{ref:i,align:t,sideOffset:n,className:ke("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ed.displayName=Dk.displayName;function DY({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=pe(C=>C.filterValues),{authToken:c}=lo(),u=pe(C=>C.actions.addOrUpdateFilterValue),f=pe(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=vi({queryKey:[e.sql],queryFn:()=>zc("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function _(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:mp(e),name:e.column,operation:"between",values:C};u(P),r(!1)}return p?w.jsx("div",{children:w.jsx(Wm,{className:" bg-foreground/10 h-8 w-[250px]"})}):y?w.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?w.jsx("div",{className:ke("grid gap-2",t),children:w.jsxs(Ip,{open:n,onOpenChange:r,children:[w.jsx(Np,{asChild:!0,children:w.jsxs(nt,{size:"sm",id:"date",variant:"outline",className:ke("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[w.jsx(BO,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?w.jsxs(w.Fragment,{children:[Ki(i.from,"LLL dd, y")," -"," ",Ki(i.to,"LLL dd, y")]}):Ki(i.from,"LLL dd, y"):w.jsx("span",{children:"Pick a date"})]})}),w.jsxs(ed,{className:"w-auto p-0",align:"start",children:[w.jsx(ok,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),w.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[w.jsx(nt,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),w.jsx(nt,{size:"sm",variant:"outline",onClick:_,children:"Clear"})]})]})]})}):null}function TY(){const e=pe(s=>s.dashboard.filters),t=pe(s=>s.isDashboardEditing),n=pe(s=>s.actions.removeFilter),r=pe(s=>s.actions.updateFilter),i=pe(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>xa.includes(s.dataType)?w.jsx(DY,{filter:s}):w.jsx(zW,{filter:s});return w.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-2 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>w.jsxs("div",{children:[w.jsx(Xo,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:w.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[w.jsxs("div",{className:"flex gap-1 items-center ",children:[w.jsx(Ci,{className:" inline-block text-sm ",children:s.title}),t&&w.jsx(da,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),w.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function Tk(){const e=pe(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});pe(i=>i.isDashboardEditing);const t=pe(i=>i.themeStyle);pe(i=>i.isVisualEditing);const n=pe(i=>i.selectedSheetId),r=pe(i=>i.actions.setSelectedSheetId);return e?w.jsxs(A_,{role:"dashboard-tabs-container",className:ke(" grow ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[w.jsx(TY,{}),e==null?void 0:e.map(i=>w.jsx(Ef,{className:"mt-0",value:i.id,children:w.jsx(a6,{})},i.id))]}):null}function Ak({children:e}){const t=new s_;return w.jsx(a4,{client:t,children:e})}function Py({children:e}){return new s_,w.jsx(M4,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:w.jsx(eV,{delayDuration:0,children:w.jsx(Ak,{children:e})})})}function Ik(e){return w.jsx(h_,{dashboardProps:e,children:w.jsx(Py,{children:w.jsx(x_,{...e,children:w.jsx(Tk,{})})})})}var AY=Object.defineProperty,IY=(e,t,n)=>t in e?AY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rp=(e,t,n)=>(IY(e,typeof t!="symbol"?t+"":t,n),n);const NY={stringify:e=>e,parse:e=>e},RY={stringify:e=>`${e}`,parse:e=>parseFloat(e)},LY={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},FY={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},$Y={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},ky={string:NY,number:RY,boolean:LY,function:FY,json:$Y},My=Symbol.for("r2wc.render"),Lp=Symbol.for("r2wc.connected"),Sa=Symbol.for("r2wc.context"),gs=Symbol.for("r2wc.props");function jY(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const g=zY(f);l[f]=g,c[g]=f}class u extends HTMLElement{constructor(){super(),Rp(this,r,!0),Rp(this,i),Rp(this,o,{}),Rp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[gs].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),y=a[g],x=ky[y];v&&x!=null&&x.parse&&(this[gs][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Lp]=!0,this[My]()}disconnectedCallback(){this[Lp]=!1,this[Sa]&&n.unmount(this[Sa]),delete this[Sa]}attributeChangedCallback(g,p,v){const y=c[g],x=a[y],_=ky[x];y in a&&_!=null&&_.parse&&(this[gs][y]=_.parse(v,this),this[My]())}[(r=Lp,i=Sa,o=gs,My)](){this[Lp]&&(this[Sa]?n.update(this[Sa],this[gs]):this[Sa]=n.mount(this.container,e,this[gs]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[gs][f]},set(v){this[gs][f]=v;const y=ky[p];if(y!=null&&y.stringify){const x=y.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return u}function zY(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function BY(e,t,n){const r=pf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function VY({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function HY({root:e}){e.unmount()}function WY(e,t={}){return jY(e,t,{mount:BY,update:VY,unmount:HY})}const UY=WY(Ik,{props:{id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",style:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}}),Dy=["Enter"," "],qY=["ArrowDown","PageUp","Home"],Nk=["ArrowUp","PageDown","End"],GY=[...qY,...Nk],YY={ltr:[...Dy,"ArrowRight"],rtl:[...Dy,"ArrowLeft"]},KY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fp="Menu",[td,XY,QY]=Sf(Fp),[Ca,Rk]=An(Fp,[QY,Wi,dl]),Ty=Wi(),Lk=dl(),[ZY,Ea]=Ca(Fp),[JY,nd]=Ca(Fp),eK=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ty(t),[l,c]=m.useState(null),u=m.useRef(!1),f=On(o),g=Us(i);return m.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Nu,a,m.createElement(ZY,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(JY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:g,modal:s},r)))},Fk=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Ty(n);return m.createElement(Ru,ae({},i,r,{ref:t}))}),$k="MenuPortal",[tK,jk]=Ca($k,{forceMount:void 0}),nK=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Ea($k,t);return m.createElement(tK,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Hh,{asChild:!0,container:i},r)))},Pi="MenuContent",[rK,Ay]=Ca(Pi),iK=m.forwardRef((e,t)=>{const n=jk(Pi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Pi,e.__scopeMenu),s=nd(Pi,e.__scopeMenu);return m.createElement(td.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(td.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(oK,ae({},i,{ref:t})):m.createElement(sK,ae({},i,{ref:t})))))}),oK=m.forwardRef((e,t)=>{const n=Ea(Pi,e.__scopeMenu),r=m.useRef(null),i=st(t,r);return m.useEffect(()=>{const o=r.current;if(o)return Op(o)},[]),m.createElement(Iy,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),sK=m.forwardRef((e,t)=>{const n=Ea(Pi,e.__scopeMenu);return m.createElement(Iy,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Iy=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...y}=e,x=Ea(Pi,n),_=nd(Pi,n),S=Ty(n),C=Lk(n),P=XY(n),[O,k]=m.useState(null),A=m.useRef(null),L=st(t,A,x.onContentChange),F=m.useRef(0),j=m.useRef(""),z=m.useRef(0),V=m.useRef(null),oe=m.useRef("right"),ee=m.useRef(0),$=v?Ap:m.Fragment,J=v?{as:co,allowPinchZoom:!0}:void 0,q=G=>{var D,H;const ne=j.current+G,N=P().filter(Q=>!Q.disabled),le=document.activeElement,me=(D=N.find(Q=>Q.ref.current===le))===null||D===void 0?void 0:D.textValue,he=N.map(Q=>Q.textValue),de=EK(he,ne,me),re=(H=N.find(Q=>Q.textValue===de))===null||H===void 0?void 0:H.ref.current;(function Q(ie){j.current=ie,window.clearTimeout(F.current),ie!==""&&(F.current=window.setTimeout(()=>Q(""),1e3))})(ne),re&&setTimeout(()=>re.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),_p();const K=m.useCallback(G=>{var D,H;return oe.current===((D=V.current)===null||D===void 0?void 0:D.side)&&PK(G,(H=V.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(rK,{scope:n,searchRef:j,onItemEnter:m.useCallback(G=>{K(G)&&G.preventDefault()},[K]),onItemLeave:m.useCallback(G=>{var D;K(G)||((D=A.current)===null||D===void 0||D.focus(),k(null))},[K]),onTriggerLeave:m.useCallback(G=>{K(G)&&G.preventDefault()},[K]),pointerGraceTimerRef:z,onPointerGraceIntentChange:m.useCallback(G=>{V.current=G},[])},m.createElement($,J,m.createElement(Sp,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,G=>{var D;G.preventDefault(),(D=A.current)===null||D===void 0||D.focus()}),onUnmountAutoFocus:s},m.createElement(El,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(Km,ae({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Oe(l,G=>{_.isUsingKeyboardRef.current||G.preventDefault()})}),m.createElement(Lu,ae({role:"menu","aria-orientation":"vertical","data-state":Uk(x.open),"data-radix-menu-content":"",dir:_.dir},S,y,{ref:L,style:{outline:"none",...y.style},onKeyDown:Oe(y.onKeyDown,G=>{const H=G.target.closest("[data-radix-menu-content]")===G.currentTarget,ne=G.ctrlKey||G.altKey||G.metaKey,N=G.key.length===1;H&&(G.key==="Tab"&&G.preventDefault(),!ne&&N&&q(G.key));const le=A.current;if(G.target!==le||!GY.includes(G.key))return;G.preventDefault();const he=P().filter(de=>!de.disabled).map(de=>de.ref.current);Nk.includes(G.key)&&he.reverse(),SK(he)}),onBlur:Oe(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(F.current),j.current="")}),onPointerMove:Oe(e.onPointerMove,rd(G=>{const D=G.target,H=ee.current!==G.clientX;if(G.currentTarget.contains(D)&&H){const ne=G.clientX>ee.current?"right":"left";oe.current=ne,ee.current=G.clientX}}))})))))))}),aK=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,ae({role:"group"},r,{ref:t}))}),lK=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,ae({},r,{ref:t}))}),Ny="MenuItem",zk="menu.itemSelect",Ry=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=nd(Ny,e.__scopeMenu),a=Ay(Ny,e.__scopeMenu),l=st(t,o),c=m.useRef(!1),u=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(zk,{bubbles:!0,cancelable:!0});f.addEventListener(zk,p=>r==null?void 0:r(p),{once:!0}),__(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(Bk,ae({},i,{ref:l,disabled:n,onClick:Oe(e.onClick,u),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Oe(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Oe(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||Dy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),Bk=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=Ay(Ny,n),a=Lk(n),l=m.useRef(null),c=st(t,l),[u,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var y;p(((y=v.textContent)!==null&&y!==void 0?y:"").trim())}},[o.children]),m.createElement(td.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Xm,ae({asChild:!0},a,{focusable:!r}),m.createElement(He.div,ae({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Oe(e.onPointerMove,rd(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Oe(e.onPointerLeave,rd(v=>s.onItemLeave(v))),onFocus:Oe(e.onFocus,()=>f(!0)),onBlur:Oe(e.onBlur,()=>f(!1))}))))}),cK=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(Hk,{scope:e.__scopeMenu,checked:n},m.createElement(Ry,ae({role:"menuitemcheckbox","aria-checked":jp(n)?"mixed":n},i,{ref:t,"data-state":Ly(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(jp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),uK="MenuRadioGroup",[dK,fK]=Ca(uK,{value:void 0,onValueChange:()=>{}}),hK=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=On(r);return m.createElement(dK,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(aK,ae({},i,{ref:t})))}),pK="MenuRadioItem",gK=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=fK(pK,e.__scopeMenu),o=n===i.value;return m.createElement(Hk,{scope:e.__scopeMenu,checked:o},m.createElement(Ry,ae({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":Ly(o),onSelect:Oe(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),Vk="MenuItemIndicator",[Hk,mK]=Ca(Vk,{checked:!1}),vK=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=mK(Vk,n);return m.createElement(yn,{present:r||jp(o.checked)||o.checked===!0},m.createElement(He.span,ae({},i,{ref:t,"data-state":Ly(o.checked)})))}),bK=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,ae({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),yK="MenuSub",[Xfe,Wk]=Ca(yK),$p="MenuSubTrigger",xK=m.forwardRef((e,t)=>{const n=Ea($p,e.__scopeMenu),r=nd($p,e.__scopeMenu),i=Wk($p,e.__scopeMenu),o=Ay($p,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(Fk,ae({asChild:!0},c),m.createElement(Bk,ae({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Uk(n.open)},e,{ref:_f(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(e.onPointerMove,rd(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(e.onPointerLeave,rd(f=>{var g;u();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const y=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=y==="right",_=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+_,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&YY[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),wK="MenuSubContent",_K=m.forwardRef((e,t)=>{const n=jk(Pi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Pi,e.__scopeMenu),s=nd(Pi,e.__scopeMenu),a=Wk(wK,e.__scopeMenu),l=m.useRef(null),c=st(t,l);return m.createElement(td.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(td.Slot,{scope:e.__scopeMenu},m.createElement(Iy,ae({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Oe(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),g=KY[s.dir].includes(u.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function Uk(e){return e?"open":"closed"}function jp(e){return e==="indeterminate"}function Ly(e){return jp(e)?"indeterminate":e?"checked":"unchecked"}function SK(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function CK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function EK(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=CK(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OK(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function PK(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return OK(n,t)}function rd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const kK=eK,MK=Fk,DK=nK,TK=iK,AK=lK,IK=Ry,NK=cK,RK=hK,LK=gK,FK=vK,$K=bK,jK=xK,zK=_K,qk="DropdownMenu",[BK,Qfe]=An(qk,[Rk]),$r=Rk(),[VK,Gk]=BK(qk),HK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=$r(t),c=m.useRef(null),[u=!1,f]=tr({prop:i,defaultProp:o,onChange:s});return m.createElement(VK,{scope:t,triggerId:ur(),triggerRef:c,contentId:ur(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(kK,ae({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},WK="DropdownMenuTrigger",UK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Gk(WK,n),s=$r(n);return m.createElement(MK,ae({asChild:!0},s),m.createElement(He.button,ae({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:_f(t,o.triggerRef),onPointerDown:Oe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Oe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),qK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$r(t);return m.createElement(DK,ae({},r,n))},GK="DropdownMenuContent",YK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Gk(GK,n),o=$r(n),s=m.useRef(!1);return m.createElement(TK,ae({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Oe(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),KK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(AK,ae({},i,r,{ref:t}))}),XK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(IK,ae({},i,r,{ref:t}))}),QK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(NK,ae({},i,r,{ref:t}))}),ZK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(RK,ae({},i,r,{ref:t}))}),JK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(LK,ae({},i,r,{ref:t}))}),eX=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(FK,ae({},i,r,{ref:t}))}),tX=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement($K,ae({},i,r,{ref:t}))}),nX=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(jK,ae({},i,r,{ref:t}))}),rX=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$r(n);return m.createElement(zK,ae({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),iX=HK,oX=UK,sX=qK,Yk=YK,Kk=KK,Xk=XK,Qk=QK,aX=ZK,Zk=JK,Jk=eX,eM=tX,tM=nX,nM=rX,rM=iX,iM=oX,lX=aX,cX=ue.forwardRef(({className:e,inset:t,children:n,...r},i)=>w.jsxs(tM,{ref:i,className:ke("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,w.jsx(VO,{className:"ml-auto h-4 w-4"})]}));cX.displayName=tM.displayName;const uX=ue.forwardRef(({className:e,...t},n)=>w.jsx(nM,{ref:n,className:ke("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));uX.displayName=nM.displayName;const Fy=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(sX,{children:w.jsx(Yk,{ref:r,sideOffset:t,className:ke("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Fy.displayName=Yk.displayName;const zp=ue.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(Xk,{ref:r,className:ke("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));zp.displayName=Xk.displayName;const dX=ue.forwardRef(({className:e,children:t,checked:n,...r},i)=>w.jsxs(Qk,{ref:i,className:ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(Jk,{children:w.jsx(tp,{className:"h-4 w-4"})})}),t]}));dX.displayName=Qk.displayName;const $y=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(Zk,{ref:r,className:ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(Jk,{children:w.jsx(HO,{className:"h-2 w-2 fill-current"})})}),t]}));$y.displayName=Zk.displayName;const oM=ue.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(Kk,{ref:r,className:ke("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));oM.displayName=Kk.displayName;const sM=ue.forwardRef(({className:e,...t},n)=>w.jsx(eM,{ref:n,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));sM.displayName=eM.displayName;function fX(){const{setTheme:e}=Hm(),t=pe(n=>n.actions.setDashboardTheme);return w.jsxs(rM,{children:[w.jsx(iM,{asChild:!0,children:w.jsxs(nt,{className:"h-7 p-2",variant:"outline",size:"sm",children:[w.jsx(xH,{strokeWidth:1.5,className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),w.jsx(hH,{strokeWidth:1.5,className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),w.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),w.jsxs(Fy,{align:"end",children:[w.jsx(zp,{onClick:()=>{e("light"),t("light")},children:"Light"}),w.jsx(zp,{onClick:()=>{e("dark"),t("dark")},children:"Dark"}),w.jsx(zp,{onClick:()=>{e("system"),t("system")},children:"System"})]})]})}function jy(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(i=>{var o;return{...i,cards:(o=i.cards)==null?void 0:o.map(s=>aM(s))}})}})}}function aM(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:hX(e.customCfg),data:[]}}function hX(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function ms(e){return`semaphor:bookmark:${e}`}const lM="Dialog",[cM,Zfe]=An(lM),[pX,ki]=cM(lM),gX=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=tr({prop:r,defaultProp:i,onChange:o});return m.createElement(pX,{scope:t,triggerRef:a,contentRef:l,contentId:ur(),titleId:ur(),descriptionId:ur(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},mX="DialogTrigger",vX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ki(mX,n),o=st(t,i.triggerRef);return m.createElement(He.button,ae({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":By(i.open)},r,{ref:o,onClick:Oe(e.onClick,i.onOpenToggle)}))}),uM="DialogPortal",[bX,dM]=cM(uM,{forceMount:void 0}),yX=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=ki(uM,t);return m.createElement(bX,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(yn,{present:n||o.open},m.createElement(Hh,{asChild:!0,container:i},s))))},zy="DialogOverlay",xX=m.forwardRef((e,t)=>{const n=dM(zy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ki(zy,e.__scopeDialog);return o.modal?m.createElement(yn,{present:r||o.open},m.createElement(wX,ae({},i,{ref:t}))):null}),wX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ki(zy,n);return m.createElement(Ap,{as:co,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(He.div,ae({"data-state":By(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),id="DialogContent",_X=m.forwardRef((e,t)=>{const n=dM(id,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ki(id,e.__scopeDialog);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(SX,ae({},i,{ref:t})):m.createElement(CX,ae({},i,{ref:t})))}),SX=m.forwardRef((e,t)=>{const n=ki(id,e.__scopeDialog),r=m.useRef(null),i=st(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Op(o)},[]),m.createElement(fM,ae({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())}))}),CX=m.forwardRef((e,t)=>{const n=ki(id,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(fM,ae({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),fM=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=ki(id,n),l=m.useRef(null),c=st(t,l);return _p(),m.createElement(m.Fragment,null,m.createElement(Sp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(El,ae({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":By(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),EX="DialogTitle",OX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ki(EX,n);return m.createElement(He.h2,ae({id:i.titleId},r,{ref:t}))}),PX="DialogDescription",kX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ki(PX,n);return m.createElement(He.p,ae({id:i.descriptionId},r,{ref:t}))}),MX="DialogClose",DX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ki(MX,n);return m.createElement(He.button,ae({type:"button"},r,{ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))}))});function By(e){return e?"open":"closed"}const TX=gX,AX=vX,IX=yX,hM=xX,pM=_X,gM=OX,mM=kX,NX=DX,Vy=TX,Hy=AX,RX=IX,vM=ue.forwardRef(({className:e,...t},n)=>w.jsx(hM,{ref:n,className:ke("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vM.displayName=hM.displayName;const Bp=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(RX,{children:[w.jsx(vM,{}),w.jsxs(pM,{ref:r,className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,w.jsxs(NX,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[w.jsx(EH,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bp.displayName=pM.displayName;const Vp=({className:e,...t})=>w.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Vp.displayName="DialogHeader";const Wy=({className:e,...t})=>w.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wy.displayName="DialogFooter";const Hp=ue.forwardRef(({className:e,...t},n)=>w.jsx(gM,{ref:n,className:ke("text-lg font-semibold leading-none tracking-tight",e),...t}));Hp.displayName=gM.displayName;const Wp=ue.forwardRef(({className:e,...t},n)=>w.jsx(mM,{ref:n,className:ke("text-sm text-muted-foreground",e),...t}));Wp.displayName=mM.displayName;const vs=ue.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:ke("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));vs.displayName="Input";function LX(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=pe(l=>l.dashboard);function a(){const l=jy(s),c=ms(s.id),u=JSON.parse(localStorage.getItem(c)||"[]");if(u.some(g=>g.name===e)){r(!0);return}u.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(u)),o(!1)}return w.jsxs(Vy,{open:i,onOpenChange:o,children:[w.jsx(Hy,{asChild:!0,children:w.jsxs(nt,{variant:"outline",className:"h-7 p-2",size:"sm",children:[w.jsx(YO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Lens"]})}),w.jsxs(Bp,{className:"sm:max-w-[425px]",children:[w.jsxs(Vp,{children:[w.jsx(Hp,{children:"Add a Lens"}),w.jsx(Wp,{children:"Lenses are private by default and are only visible to you."})]}),w.jsx("div",{className:"grid gap-4 py-4",children:w.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[w.jsx(Ci,{className:"text-right",children:"Name"}),w.jsx(vs,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&w.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),w.jsx(Wy,{children:w.jsx(nt,{variant:"outline",type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}function FX(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=pe(p=>p.dashboard),o=pe(p=>p.bookmarkKey),[s,a]=m.useState([]),l=pe(p=>p.actions.setDashboard),c=pe(p=>p.actions.setFilterValues),u=pe(p=>p.actions.setBookmarkKey);m.useEffect(()=>{const p=ms(i.id),v=JSON.parse(localStorage.getItem(p)||"[]");a(v);const y=v.find(x=>x.default);y&&y.name===o&&r(y.name)},[e,i,o]);function f(p){if(p===n)return;const v=s.find(x=>x.name===p),y=v==null?void 0:v.template;y&&(l(y),c(v.filterValues||[]),u(p==="Original"?"":p)),r(p)}function g(p){const v=ms(i.id),x=JSON.parse(localStorage.getItem(v)||"[]").filter(_=>_.name!==p);localStorage.setItem(v,JSON.stringify(x)),a(x)}return w.jsxs(rM,{open:e,onOpenChange:t,children:[w.jsx(iM,{asChild:!0,children:w.jsx(nt,{variant:"outline",className:"h-7 p-2",children:w.jsx(aH,{className:"h-4 w-4",strokeWidth:1.5})})}),w.jsxs(Fy,{className:"w-56",children:[w.jsx(oM,{children:"Lenses"}),w.jsx(sM,{}),w.jsxs(lX,{value:n,onValueChange:f,children:[w.jsx($y,{value:"Original",children:"Original"}),s.filter(p=>p.name!="Original").map((p,v)=>w.jsxs($y,{className:"xbg-red-100 flex justify-between",value:p.name,defaultChecked:p.name===o,children:[w.jsx("p",{children:p.name}),w.jsx(da,{onClick:y=>{y.preventDefault(),g(p.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},v))]})]})]})}function Up(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const bM="Checkbox",[$X,Jfe]=An(bM),[jX,zX]=$X(bM),BX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,g]=m.useState(null),p=st(t,C=>g(C)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,_]=tr({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>_(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,_]),m.createElement(jX,{scope:n,state:x,disabled:a},m.createElement(He.button,ae({type:"button",role:"checkbox","aria-checked":Oa(x)?"mixed":x,"aria-required":s,"data-state":yM(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onKeyDown:Oe(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Oe(e.onClick,C=>{_(P=>Oa(P)?!0:!P),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),y&&m.createElement(WX,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),VX="CheckboxIndicator",HX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=zX(VX,n);return m.createElement(yn,{present:r||Oa(o.state)||o.state===!0},m.createElement(He.span,ae({"data-state":yM(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),WX=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Up(n),a=Vh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=Oa(n),f.call(l,Oa(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",ae({type:"checkbox","aria-hidden":!0,defaultChecked:Oa(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Oa(e){return e==="indeterminate"}function yM(e){return Oa(e)?"indeterminate":e?"checked":"unchecked"}const xM=BX,UX=HX,od=ue.forwardRef(({className:e,...t},n)=>w.jsx(xM,{ref:n,className:ke("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:w.jsx(UX,{className:ke("flex items-center justify-center text-current"),children:w.jsx(tp,{className:"h-4 w-4"})})}));od.displayName=xM.displayName;function qX(){const[e,t]=m.useState(!1),n=pe(o=>o.dashboard),r=pe(o=>o.bookmarkKey);m.useEffect(()=>{if(!r){t(!1);return}const o=ms(n.id),a=JSON.parse(localStorage.getItem(o)||"[]").find(l=>l.name===r);t(a?a.default:!1)},[r,n.id]);function i(o){if(t(o),!r)return;const s=ms(n.id),l=JSON.parse(localStorage.getItem(s)||"[]").map(c=>(c.name===r?c.default=o:c.default=!1,c));console.log(l),localStorage.setItem(s,JSON.stringify(l))}return w.jsxs("div",{className:"flex items-center space-x-2",children:[w.jsx(od,{checked:e,onCheckedChange:i,id:"terms"}),w.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Set as default"})]})}function GX(){const e=pe(S=>S.bookmarkKey),t=pe(S=>S.dashboard);pe(S=>S.selectedSheetId);const n=pe(S=>S.isDashboardEditing),r=pe(S=>S.filterValues),i=pe(S=>S.isVisualEditing),o=pe(S=>S.showFilters),s=pe(S=>S.showDashboardJSON),a=pe(S=>S.onSaveFunction),l=pe(S=>S.actions.setShowFilters),{addFrame:c,setSelectedFrameId:u}=pe(S=>S.actions),{getSelectedSheet:f,setIsDashboardEditing:g,setShowDashboardJSON:p}=pe(S=>S.actions),v=f(),y=()=>{if(!n||!v)return;const S={id:qo(),title:"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}]},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]},C={id:qo(),cards:[S],activeCardId:S.id};c(v.id,C),u(C.id)},x=()=>{g(!0)};function _(){if(!e||e==="")return;const S=jy(t),C=ms(t.id),P=JSON.parse(localStorage.getItem(C)||"[]"),O=P.findIndex(k=>k.name===e);O!==-1?P[O]={name:e,template:S,default:P[O].default,filterValues:r}:P.push({name:e,template:S,filterValues:r}),localStorage.setItem(C,JSON.stringify(P)),a==null||a(S)}return w.jsxs("div",{className:`flex items-center justify-between gap-2
488
- px-2 pt-2`,role:"dashboard-controls",children:[!i&&w.jsxs("div",{className:"flex gap-3 items-center",children:[w.jsx(Ci,{children:e}),!!e&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:" text-muted-foreground",children:"|"}),w.jsx(qX,{})]})]}),w.jsxs("div",{className:"flex gap-2",children:[n&&!i&&w.jsx(LX,{}),!i&&w.jsx(FX,{}),n&&!i&&w.jsxs(nt,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!n,onClick:y,children:[w.jsx(YO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Frame"]}),!n&&w.jsx(nt,{variant:"outline",className:"h-7 p-2",onClick:x,size:"sm",children:w.jsx(qO,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&w.jsx(nt,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>{g(!1),p(!1)},size:"sm",children:w.jsx(da,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&w.jsx(nt,{className:"h-7 p-2",variant:"outline",onClick:_,size:"sm",children:w.jsx(vH,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&!i&&n&&w.jsx(nt,{className:"h-7 p-2",variant:"outline",onClick:()=>l(!0),size:"sm",children:w.jsx(WO,{className:"h-4 w-4",strokeWidth:1.5})}),!i&&n&&w.jsx("div",{className:" flex items-center space-x-2",children:w.jsx(nt,{className:"h-7 p-2",onClick:()=>p(!s),size:"sm",variant:"outline",children:w.jsx(iH,{className:"h-4 w-4",strokeWidth:1.5})})}),!i&&w.jsx(fX,{})]})]})}const wM=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{role:"editor-panel",ref:n,className:ke("flex grow h-full",e),...t}));wM.displayName="EditorPanel";const _M=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ke(" flex flex-col space-y-2 w-[270px]",e),...t}));_M.displayName="EditorAside";const SM=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ke(" grow",e),...t}));SM.displayName="EditorMain";const YX=[" ","Enter","ArrowUp","ArrowDown"],KX=[" ","Enter"],qp="Select",[Gp,Yp,XX]=Sf(qp),[Wl,ehe]=An(qp,[XX,Wi]),Uy=Wi(),[QX,Pa]=Wl(qp),[ZX,JX]=Wl(qp),eQ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:g,required:p}=e,v=Uy(t),[y,x]=m.useState(null),[_,S]=m.useState(null),[C,P]=m.useState(!1),O=Us(c),[k=!1,A]=tr({prop:r,defaultProp:i,onChange:o}),[L,F]=tr({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),z=y?!!y.closest("form"):!0,[V,oe]=m.useState(new Set),ee=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Nu,v,m.createElement(QX,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:_,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:ur(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(Gp.Provider,{scope:t},m.createElement(ZX,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{oe(J=>new Set(J).add($))},[]),onNativeOptionRemove:m.useCallback($=>{oe(J=>{const q=new Set(J);return q.delete($),q})},[])},n)),z?m.createElement(AM,{key:ee,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:L,onChange:$=>F($.target.value),disabled:g},L===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},tQ="SelectTrigger",nQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Uy(n),s=Pa(tQ,n),a=s.disabled||r,l=st(t,s.onTriggerChange),c=Yp(n),[u,f,g]=IM(v=>{const y=c().filter(S=>!S.disabled),x=y.find(S=>S.value===s.value),_=NM(y,v,x);_!==void 0&&s.onValueChange(_.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Ru,ae({asChild:!0},o),m.createElement(He.button,ae({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":TM(s.value)?"":void 0},i,{ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Oe(i.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const y=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&YX.includes(v.key)&&(p(),v.preventDefault())})})))}),rQ="SelectValue",iQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=Pa(rQ,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,f=st(t,l.onValueNodeChange);return qn(()=>{c(u)},[c,u]),m.createElement(He.span,ae({},a,{ref:f,style:{pointerEvents:"none"}}),TM(l.value)?m.createElement(m.Fragment,null,s):o)}),oQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(He.span,ae({"aria-hidden":!0},i,{ref:t}),r||"▼")}),sQ=e=>m.createElement(Hh,ae({asChild:!0},e)),Ul="SelectContent",aQ=m.forwardRef((e,t)=>{const n=Pa(Ul,e.__scopeSelect),[r,i]=m.useState();if(qn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Tt.createPortal(m.createElement(CM,{scope:e.__scopeSelect},m.createElement(Gp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(lQ,ae({},e,{ref:t}))}),Mo=10,[CM,ka]=Wl(Ul),lQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,..._}=e,S=Pa(Ul,n),[C,P]=m.useState(null),[O,k]=m.useState(null),A=st(t,de=>P(de)),[L,F]=m.useState(null),[j,z]=m.useState(null),V=Yp(n),[oe,ee]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return Op(C)},[C]),_p();const J=m.useCallback(de=>{const[re,...Q]=V().map(U=>U.ref.current),[ie]=Q.slice(-1),we=document.activeElement;for(const U of de)if(U===we||(U==null||U.scrollIntoView({block:"nearest"}),U===re&&O&&(O.scrollTop=0),U===ie&&O&&(O.scrollTop=O.scrollHeight),U==null||U.focus(),document.activeElement!==we))return},[V,O]),q=m.useCallback(()=>J([L,C]),[J,L,C]);m.useEffect(()=>{oe&&q()},[oe,q]);const{onOpenChange:K,triggerPointerDownPosRef:G}=S;m.useEffect(()=>{if(C){let de={x:0,y:0};const re=ie=>{var we,U,Ie,je;de={x:Math.abs(Math.round(ie.pageX)-((we=(U=G.current)===null||U===void 0?void 0:U.x)!==null&&we!==void 0?we:0)),y:Math.abs(Math.round(ie.pageY)-((Ie=(je=G.current)===null||je===void 0?void 0:je.y)!==null&&Ie!==void 0?Ie:0))}},Q=ie=>{de.x<=10&&de.y<=10?ie.preventDefault():C.contains(ie.target)||K(!1),document.removeEventListener("pointermove",re),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Q,{capture:!0})}}},[C,K,G]),m.useEffect(()=>{const de=()=>K(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[K]);const[D,H]=IM(de=>{const re=V().filter(we=>!we.disabled),Q=re.find(we=>we.ref.current===document.activeElement),ie=NM(re,de,Q);ie&&setTimeout(()=>ie.ref.current.focus())}),ne=m.useCallback((de,re,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===re||ie)&&(F(de),ie&&($.current=!0))},[S.value]),N=m.useCallback(()=>C==null?void 0:C.focus(),[C]),le=m.useCallback((de,re,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===re||ie)&&z(de)},[S.value]),me=r==="popper"?EM:cQ,he=me===EM?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(CM,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:L,onItemLeave:N,itemTextRefCallback:le,focusSelectedItem:q,selectedItemText:j,position:r,isPositioned:oe,searchRef:D},m.createElement(Ap,{as:co,allowPinchZoom:!0},m.createElement(Sp,{asChild:!0,trapped:S.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Oe(i,de=>{var re;(re=S.trigger)===null||re===void 0||re.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(El,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(me,ae({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:de=>de.preventDefault()},_,he,{onPlaced:()=>ee(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Oe(_.onKeyDown,de=>{const re=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!re&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let ie=V().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(de.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const we=de.target,U=ie.indexOf(we);ie=ie.slice(U+1)}setTimeout(()=>J(ie)),de.preventDefault()}})}))))))}),cQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pa(Ul,n),s=ka(Ul,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=st(t,A=>u(A)),g=Yp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:_,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&y&&x&&_){const A=o.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=_.getBoundingClientRect();if(o.dir!=="rtl"){const we=j.left-L.left,U=F.left-we,Ie=A.left-U,je=A.width+Ie,We=Math.max(je,L.width),Xe=window.innerWidth-Mo,be=w0(U,[Mo,Xe-We]);a.style.minWidth=je+"px",a.style.left=be+"px"}else{const we=L.right-j.right,U=window.innerWidth-F.right-we,Ie=window.innerWidth-A.right-U,je=A.width+Ie,We=Math.max(je,L.width),Xe=window.innerWidth-Mo,be=w0(U,[Mo,Xe-We]);a.style.minWidth=je+"px",a.style.right=be+"px"}const z=g(),V=window.innerHeight-Mo*2,oe=y.scrollHeight,ee=window.getComputedStyle(c),$=parseInt(ee.borderTopWidth,10),J=parseInt(ee.paddingTop,10),q=parseInt(ee.borderBottomWidth,10),K=parseInt(ee.paddingBottom,10),G=$+J+oe+K+q,D=Math.min(x.offsetHeight*5,G),H=window.getComputedStyle(y),ne=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),le=A.top+A.height/2-Mo,me=V-le,he=x.offsetHeight/2,de=x.offsetTop+he,re=$+J+de,Q=G-re;if(re<=le){const we=x===z[z.length-1].ref.current;a.style.bottom="0px";const U=c.clientHeight-y.offsetTop-y.offsetHeight,Ie=Math.max(me,he+(we?N:0)+U+q),je=re+Ie;a.style.height=je+"px"}else{const we=x===z[0].ref.current;a.style.top="0px";const Ie=Math.max(le,$+y.offsetTop+(we?ne:0)+he)+Q;a.style.height=Ie+"px",y.scrollTop=re-le+y.offsetTop}a.style.margin=`${Mo}px 0`,a.style.minHeight=D+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,y,x,_,o.dir,r]);qn(()=>C(),[C]);const[P,O]=m.useState();qn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(uQ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(He.div,ae({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),EM=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Mo,...o}=e,s=Uy(n);return m.createElement(Lu,ae({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[uQ,qy]=Wl(Ul,{}),OM="SelectViewport",dQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ka(OM,n),o=qy(OM,n),s=st(t,i.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Gp.Slot,{scope:n},m.createElement(He.div,ae({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Oe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&u){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-Mo*2,v=parseFloat(u.style.minHeight),y=parseFloat(u.style.height),x=Math.max(v,y);if(x<p){const _=x+g,S=Math.min(p,_),C=_-S;u.style.height=S+"px",u.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),fQ="SelectGroup",[hQ,pQ]=Wl(fQ),gQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ur();return m.createElement(hQ,{scope:n,id:i},m.createElement(He.div,ae({role:"group","aria-labelledby":i},r,{ref:t})))}),mQ="SelectLabel",vQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pQ(mQ,n);return m.createElement(He.div,ae({id:i.id},r,{ref:t}))}),Gy="SelectItem",[bQ,PM]=Wl(Gy),yQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Pa(Gy,n),l=ka(Gy,n),c=a.value===r,[u,f]=m.useState(o??""),[g,p]=m.useState(!1),v=st(t,_=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,_,r,i)}),y=ur(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(bQ,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(_=>{f(S=>{var C;return S||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Gp.ItemSlot,{scope:n,value:r,disabled:i,textValue:u},m.createElement(He.div,ae({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Oe(s.onFocus,()=>p(!0)),onBlur:Oe(s.onBlur,()=>p(!1)),onPointerUp:Oe(s.onPointerUp,x),onPointerMove:Oe(s.onPointerMove,_=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Oe(s.onKeyDown,_=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&_.key===" "||(KX.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})}))))}),Kp="SelectItemText",xQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Pa(Kp,n),a=ka(Kp,n),l=PM(Kp,n),c=JX(Kp,n),[u,f]=m.useState(null),g=st(t,_=>f(_),l.onItemTextChange,_=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,_,l.value,l.disabled)}),p=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return qn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(He.span,ae({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Tt.createPortal(o.children,s.valueNode):null)}),wQ="SelectItemIndicator",_Q=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return PM(wQ,n).isSelected?m.createElement(He.span,ae({"aria-hidden":!0},r,{ref:t})):null}),kM="SelectScrollUpButton",SQ=m.forwardRef((e,t)=>{const n=ka(kM,e.__scopeSelect),r=qy(kM,e.__scopeSelect),[i,o]=m.useState(!1),s=st(t,r.onScrollButtonChange);return qn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(DM,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),MM="SelectScrollDownButton",CQ=m.forwardRef((e,t)=>{const n=ka(MM,e.__scopeSelect),r=qy(MM,e.__scopeSelect),[i,o]=m.useState(!1),s=st(t,r.onScrollButtonChange);return qn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;o(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(DM,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),DM=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ka("SelectScrollButton",n),s=m.useRef(null),a=Yp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),qn(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(He.div,ae({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})}))}),EQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(He.div,ae({"aria-hidden":!0},r,{ref:t}))});function TM(e){return e===""||e===void 0}const AM=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=st(t,i),s=Up(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(rO,{asChild:!0},m.createElement("select",ae({},r,{ref:o,defaultValue:n})))});AM.displayName="BubbleSelect";function IM(e){const t=On(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function NM(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=OQ(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const PQ=eQ,RM=nQ,kQ=iQ,MQ=oQ,DQ=sQ,LM=aQ,TQ=dQ,AQ=gQ,FM=vQ,$M=yQ,IQ=xQ,NQ=_Q,jM=SQ,zM=CQ,BM=EQ,VM=PQ,HM=AQ,WM=kQ,Yy=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(RM,{ref:r,className:ke("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,w.jsx(MQ,{asChild:!0,children:w.jsx(np,{className:"h-4 w-4 opacity-50"})})]}));Yy.displayName=RM.displayName;const UM=ue.forwardRef(({className:e,...t},n)=>w.jsx(jM,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(nH,{className:"h-4 w-4"})}));UM.displayName=jM.displayName;const qM=ue.forwardRef(({className:e,...t},n)=>w.jsx(zM,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(np,{className:"h-4 w-4"})}));qM.displayName=zM.displayName;const Ky=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>w.jsx(DQ,{children:w.jsxs(LM,{ref:i,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[w.jsx(UM,{}),w.jsx(TQ,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),w.jsx(qM,{})]})}));Ky.displayName=LM.displayName;const Xp=ue.forwardRef(({className:e,...t},n)=>w.jsx(FM,{ref:n,className:ke("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Xp.displayName=FM.displayName;const Ma=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs($M,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(NQ,{children:w.jsx(tp,{className:"h-4 w-4"})})}),w.jsx(IQ,{children:t})]}));Ma.displayName=$M.displayName;const RQ=ue.forwardRef(({className:e,...t},n)=>w.jsx(BM,{ref:n,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));RQ.displayName=BM.displayName;function sd({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o,className:s,showIcon:a=!0}){const l=r?"Loading...":i?"Error":n;function c(){if(e==="Connection")return w.jsx(mH,{className:" size-4 rotate-90"});if(e==="Database")return w.jsx(oH,{className:"size-4"});if(e==="Schema")return w.jsx(pH,{className:"size-4"});if(e==="Table")return w.jsx(C0,{className:"size-4"})}return w.jsxs("div",{className:"flex gap-2 items-center",children:[a&&w.jsx("div",{className:" shrink-0",children:c()}),w.jsxs(VM,{value:l,onValueChange:o,children:[w.jsx(Yy,{className:ke("focus:ring-offset-0 focus:ring-1 h-9 w-[190px]",s),children:w.jsx(WM,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),w.jsx(Ky,{children:w.jsxs(HM,{children:[r?w.jsx(Xp,{children:"Loading..."}):w.jsx(Xp,{children:e}),w.jsx(w.Fragment,{children:t&&t.map((u,f)=>w.jsx(Ma,{value:u.id,children:u.name},f))}),(r||i)&&w.jsx(Ma,{value:l,children:l})]})})]})]})}function LQ({column:e}){const[t,n]=m.useState(!1),r=ve(u=>u.selectedTableName),i=ve(u=>u.selectedSchemaName),o=ve(u=>u.sqlGen),s=ve(u=>u.actions.setSqlGen),a=ve(u=>u.actions.setCardSql),l=ve(u=>u.actions.setRunSql);function c(u,f){const g=K0(u,o,f);s(g);const p=Y0(g,Si(i||""),Si(r));p&&(a(p),l(!0)),n(!1)}return w.jsxs(Ip,{open:t,onOpenChange:n,children:[w.jsx(Np,{asChild:!0,children:w.jsx(np,{className:" w-4 h-4 text-foreground/40 cursor-pointer"})}),w.jsx(ed,{align:"center",className:" p-0 w-18 rounded-md shadow-none ",children:w.jsxs("ul",{className:"text-xs ",children:[w.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),w.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),w.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),w.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),w.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function GM({column:e}){return w.jsxs(r0,{children:[w.jsx(oO,{asChild:!0,children:Hu.includes(e.data_type.toLowerCase())?w.jsx(SH,{className:"size-3"}):fs.includes(e.data_type.toLowerCase())?w.jsx(uH,{className:"size-3"}):xa.includes(e.data_type.toLowerCase())?w.jsx(BO,{className:"size-3"}):gp.includes(e.data_type.toLowerCase())?w.jsx(_H,{className:"size-3"}):w.jsx(yH,{className:"size-3"})}),w.jsx(qh,{children:w.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function FQ({schemaName:e,tableName:t,columns:n,status:r}){const i=ve(f=>f.sqlGen),o=ve(f=>f.actions.setRunSql),s=ve(f=>f.actions.setSqlGen),a=ve(f=>f.actions.setIsShowingVisual),l=ve(f=>f.actions.setCardSql);function c(f){const g=K0(f,i);s(g);const p=Y0(g,Si(e),Si(t));p&&(l(p),o(!0))}function u(){let g=vp(e,t);(v=>v.charAt(0)===v.charAt(0).toUpperCase())(t)&&(g=`"${t}"`),a(!1),l(`SELECT * FROM ${g} LIMIT 10`),o(!0)}return w.jsxs("div",{className:" grow flex flex-col px-6 space-y-4",children:[w.jsx("div",{className:" font-medium ",children:w.jsxs(nt,{disabled:r!=="Success",onClick:u,size:"sm",variant:"secondary",className:"flex w-full",children:[r!=="Success"?w.jsx(Al,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}):w.jsx(wH,{className:"size-4 mr-2"}),"Show top 10 rows"]})}),w.jsxs(Tl,{className:" flex-1 basis-0 overflow-y-auto rounded-md border border-muted py-2",children:[n==null?void 0:n.map(f=>w.jsxs("div",{onClick:()=>c(f),className:ke(" text-sm flex items-center justify-between px-2 py-[6px] mx-3 transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":CP(f,i)}),children:[w.jsxs("div",{className:"flex items-center space-x-2 ",children:[w.jsx(GM,{column:f}),w.jsx("span",{children:f.column_name})]}),fs.includes(f.data_type)&&w.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:w.jsx(LQ,{column:f})})]},f.column_name)),w.jsx(ju,{orientation:"vertical"}),w.jsx(ju,{orientation:"horizontal"})]})]})}function YM({ColumnsComponent:e}){const t=ve(z=>z.selectedConnectionId),n=ve(z=>z.selectedDatabaseName),r=ve(z=>z.selectedSchemaName),i=ve(z=>z.selectedTableName),o=ve(z=>z.actions.setSelectedTableName),{connectionItems:s,schemaItems:a,databaseItems:l,tableItems:c,columns:u,isConnectionsLoading:f,isConnectionsError:g,isDatabasesLoadingOrFetching:p,isDatabaseError:v,isSchemaLoadingOrFetching:y,isSchemaError:x,isColumnsError:_,isColumnsLoadingOrFetching:S,isAPIConnection:C,handleConnectionChange:P,handleDatabaseChange:O,handleSchemaChange:k,tableName:A,schemaName:L}=p_();function F(){return e?e(L,A,u):w.jsx(FQ,{schemaName:L,tableName:A,columns:u,status:S?"Loading...":_?"Error":"Success"})}function j(){window.location.href="mailto:support@semaphor.cloud?subject=Help&body=I need help with..."}return w.jsxs("aside",{className:" grow flex flex-col justify-between xbg-red-100 ",children:[w.jsxs("section",{className:"space-y-3 py-4 px-6",children:[w.jsx(sd,{items:s,title:"Connection",value:t||"",onChange:P,isLoading:f,isError:g}),!C&&w.jsxs(w.Fragment,{children:[w.jsx(sd,{onChange:O,isError:v,isLoading:p,items:l,value:n||"",title:"Database"}),w.jsx(sd,{onChange:k,isError:x,isLoading:y,items:a,value:r||"",title:"Schema"}),w.jsx(sd,{onChange:o,isError:v,items:c,isLoading:p,value:i||"",title:"Table"})]})]}),F(),w.jsx("div",{className:"justify-center items-end flex px-6 py-4",children:w.jsxs(nt,{onClick:j,size:"sm",variant:"secondary",className:"w-full",children:[w.jsx(fH,{className:"size-4 mr-2"}),"Help"]})})]})}const{createElement:ql,createContext:$Q,createRef:the,forwardRef:KM,useCallback:jr,useContext:XM,useEffect:Da,useImperativeHandle:QM,useLayoutEffect:jQ,useMemo:zQ,useRef:ni,useState:Qp}=ue,ZM=ue.useId,Zp=$Q(null);Zp.displayName="PanelGroupContext";const ad=jQ,BQ=typeof ZM=="function"?ZM:()=>null;let VQ=0;function Xy(e=null){const t=BQ(),n=ni(e||t||null);return n.current===null&&(n.current=""+VQ++),e??n.current}function JM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=XM(Zp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:_,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,j=Xy(s),z=ni({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ni({didLogMissingDefaultSizeWarning:!1}),ad(()=>{const{callbacks:oe,constraints:ee}=z.current;z.current.id=j,z.current.idIsFromProps=s!==void 0,z.current.order=g,oe.onCollapse=c,oe.onExpand=u,oe.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=i,ee.maxSize=a,ee.minSize=l}),ad(()=>{const oe=z.current;return A(oe),()=>{F(oe)}},[g,j,A,F]),QM(o,()=>({collapse:()=>{_(z.current)},expand:()=>{S(z.current)},getId(){return j},getSize(){return C(z.current)},isCollapsed(){return k(z.current)},isExpanded(){return!k(z.current)},resize:oe=>{L(z.current,oe)}}),[_,S,C,k,j,L]);const V=P(z.current,i);return ql(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const eD=KM((e,t)=>ql(JM,{...e,forwardedRef:t}));JM.displayName="Panel",eD.displayName="forwardRef(Panel)";function dt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const tD=10;function ld(e,t,n=tD){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function zr(e,t,n){return ld(e,t,n)===0}function Gl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];dt(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(ld(n,a)<0)if(o){const l=(i+a)/2;ld(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(tD)),n}function cd({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(zr(e,0))return t;const o=[...t],[s,a]=r;dt(s!=null),dt(a!=null);let l=0;if(i==="keyboard"){{const u=e<0?a:s,f=n[u];if(dt(f),f.collapsible){const g=t[u];dt(g!=null);const p=n[u];dt(p);const{collapsedSize:v=0,minSize:y=0}=p;if(zr(g,v)){const x=y-g;ld(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];dt(f);const{collapsible:g}=f;if(g){const p=t[u];dt(p!=null);const v=n[u];dt(v);const{collapsedSize:y=0,minSize:x=0}=v;if(zr(p,x)){const _=p-y;ld(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}}{const u=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];dt(v!=null);const x=Gl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=u,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];dt(p!=null);const v=p-g,y=Gl({panelConstraints:n,panelIndex:f,size:v});if(!zr(p,y)&&(l+=p-y,o[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(zr(l,0))return t;{const u=e<0?a:s,f=t[u];dt(f!=null);const g=f+l,p=Gl({panelConstraints:n,panelIndex:u,size:g});if(o[u]=p,!zr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const _=o[x];dt(_!=null);const S=_+v,C=Gl({panelConstraints:n,panelIndex:x,size:S});if(zr(_,C)||(v-=C-_,o[x]=C),zr(v,0))break;e>0?x--:x++}}}const c=o.reduce((u,f)=>f+u,0);return zr(c,100)?o:t}function HQ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];dt(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,i=v):(o+=y,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function ud(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function nD(e,t){const r=ud(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function rD(e,t){const n=nD(e,t);return n!=null?[n,n+1]:[-1,-1]}function iD(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Jp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function WQ(e,t,n){var r,i,o,s;const a=Jp(t),l=ud(e),c=a?l.indexOf(a):-1,u=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[u,f]}function UQ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ni({didWarnAboutMissingResizeHandle:!1}),ad(()=>{const s=ud(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=HQ({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];dt(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Da(()=>{const s=t.current;dt(s);const{panelDataArray:a}=s,l=iD(n);dt(l!=null,`No group found for id "${n}"`);const c=ud(n);dt(c);const u=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");dt(g);const[p,v]=WQ(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=a.findIndex(S=>S.id===p);if(_>=0){const S=a[_];dt(S);const C=r[_],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const A=cd({delta:zr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:rD(n,g),trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,i,o])}function oD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function sD(e){return e.type==="keydown"}function aD(e){return e.type.startsWith("mouse")}function lD(e){return e.type.startsWith("touch")}function cD(e,t){const n=e==="horizontal";if(aD(t))return n?t.clientX:t.clientY;if(lD(t)){const r=t.touches[0];return dt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function qQ(e,t,n,r){const i=n==="horizontal",o=Jp(t);dt(o);const s=o.getAttribute("data-panel-group-id");dt(s);let{initialCursorPosition:a}=r;const l=cD(n,e),c=iD(s);dt(c);const u=c.getBoundingClientRect(),f=i?u.width:u.height;return(l-a)/f*100}function GQ(e,t,n,r,i){if(sD(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:qQ(e,t,n,r)}function YQ({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];dt(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];dt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Yl(e,t,n){t.forEach((r,i)=>{const o=e[i];dt(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),u&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function eg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KQ({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Qy=null,Ta=null;function uD(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function XQ(){Ta!==null&&(document.head.removeChild(Ta),Qy=null,Ta=null)}function Zy(e){if(Qy===e)return;Qy=e;const t=uD(e);Ta===null&&(Ta=document.createElement("style"),document.head.appendChild(Ta)),Ta.innerHTML=`*{cursor: ${t}!important;}`}function QQ(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function dD(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function fD(e){return`react-resizable-panels:${e}`}function hD(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function pD(e,t){try{const n=fD(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function ZQ(e,t,n){var r,i;const o=(r=pD(e,n))!==null&&r!==void 0?r:{},s=hD(t);return(i=o[s])!==null&&i!==void 0?i:null}function JQ(e,t,n,r,i){var o;const s=fD(e),a=hD(t),l=(o=pD(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function gD({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!zr(r,100))for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=Gl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!zr(i,0))for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=s+i,l=Gl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,zr(i,0)))break}return n}const eZ=100,dd={getItem:e=>(dD(dd),dd.getItem(e)),setItem:(e,t)=>{dD(dd),dd.setItem(e,t)}},mD={};function vD({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=dd,style:c,tagName:u="div",...f}){const g=Xy(o),[p,v]=Qp(null),[y,x]=Qp([]),_=ni({}),S=ni(new Map),C=ni(0),P=ni({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ni({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ni({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),QM(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:D}=O.current;return D},setLayout:D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current,le=gD({layout:D,panelConstraints:N.map(me=>me.constraints)});oD(ne,le)||(x(le),O.current.layout=le,H&&H(le),Yl(N,le,_.current))}}),[]),ad(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),UQ({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:y,panelDataArray:O.current.panelDataArray,setLayout:x}),Da(()=>{const{panelDataArray:D}=O.current;if(e){if(y.length===0||y.length!==D.length)return;let H=mD[e];H==null&&(H=QQ(JQ,eZ),mD[e]=H);const ne=[...D],N=new Map(S.current);H(e,ne,N,y,l)}},[e,y,l]),Da(()=>{});const k=jr(D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(D.constraints.collapsible){const le=N.map(re=>re.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:de}=Xl(N,D,ne);if(dt(he!=null),he!==me){S.current.set(D.id,he);const Q=Kl(N,D)===N.length-1?he-me:me-he,ie=cd({delta:Q,layout:ne,panelConstraints:le,pivotIndices:de,trigger:"imperative-api"});eg(ne,ie)||(x(ie),O.current.layout=ie,H&&H(ie),Yl(N,ie,_.current))}}},[]),A=jr(D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(D.constraints.collapsible){const le=N.map(Q=>Q.constraints),{collapsedSize:me=0,panelSize:he,minSize:de=0,pivotIndices:re}=Xl(N,D,ne);if(he===me){const Q=S.current.get(D.id),ie=Q!=null&&Q>=de?Q:de,U=Kl(N,D)===N.length-1?he-ie:ie-he,Ie=cd({delta:U,layout:ne,panelConstraints:le,pivotIndices:re,trigger:"imperative-api"});eg(ne,Ie)||(x(Ie),O.current.layout=Ie,H&&H(Ie),Yl(N,Ie,_.current))}}},[]),L=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{panelSize:N}=Xl(ne,D,H);return dt(N!=null),N},[]),F=jr((D,H)=>{const{panelDataArray:ne}=O.current,N=Kl(ne,D);return KQ({defaultSize:H,dragState:p,layout:y,panelData:ne,panelIndex:N})},[p,y]),j=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:le,panelSize:me}=Xl(ne,D,H);return le===!0&&me===N},[]),z=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:le,panelSize:me}=Xl(ne,D,H);return dt(me!=null),!le||me>N},[]),V=jr(D=>{const{panelDataArray:H}=O.current;H.push(D),H.sort((ne,N)=>{const le=ne.order,me=N.order;return le==null&&me==null?0:le==null?-1:me==null?1:le-me}),O.current.panelDataArrayChanged=!0},[]);ad(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:D,onLayout:H,storage:ne}=P.current,{layout:N,panelDataArray:le}=O.current;let me=null;if(D){const de=ZQ(D,le,ne);de&&(S.current=new Map(Object.entries(de.expandToSizes)),me=de.layout)}me==null&&(me=YQ({panelDataArray:le}));const he=gD({layout:me,panelConstraints:le.map(de=>de.constraints)});oD(N,he)||(x(he),O.current.layout=he,H&&H(he),Yl(le,he,_.current))}});const oe=jr(D=>function(ne){ne.preventDefault();const{direction:N,dragState:le,id:me,keyboardResizeBy:he,onLayout:de}=P.current,{layout:re,panelDataArray:Q}=O.current,{initialLayout:ie}=le??{},we=rD(me,D);let U=GQ(ne,D,N,le,he);if(U===0)return;const Ie=N==="horizontal";document.dir==="rtl"&&Ie&&(U=-U);const je=Q.map(be=>be.constraints),We=cd({delta:U,layout:ie??re,panelConstraints:je,pivotIndices:we,trigger:sD(ne)?"keyboard":"mouse-or-touch"}),Xe=!eg(re,We);(aD(ne)||lD(ne))&&C.current!=U&&(C.current=U,Zy(Xe?Ie?"horizontal":"vertical":Ie?U<0?"horizontal-min":"horizontal-max":U<0?"vertical-min":"vertical-max")),Xe&&(x(We),O.current.layout=We,de&&de(We),Yl(Q,We,_.current))},[]),ee=jr((D,H)=>{const{onLayout:ne}=P.current,{layout:N,panelDataArray:le}=O.current,me=le.map(we=>we.constraints),{panelSize:he,pivotIndices:de}=Xl(le,D,N);dt(he!=null);const Q=Kl(le,D)===le.length-1?he-H:H-he,ie=cd({delta:Q,layout:N,panelConstraints:me,pivotIndices:de,trigger:"imperative-api"});eg(N,ie)||(x(ie),O.current.layout=ie,ne&&ne(ie),Yl(le,ie,_.current))},[]),$=jr((D,H)=>{const{direction:ne}=P.current,{layout:N}=O.current,le=Jp(D);dt(le);const me=cD(ne,H);v({dragHandleId:D,dragHandleRect:le.getBoundingClientRect(),initialCursorPosition:me,initialLayout:N})},[]),J=jr(()=>{XQ(),v(null)},[]),q=jr(D=>{const{panelDataArray:H}=O.current,ne=Kl(H,D);ne>=0&&(H.splice(ne,1),delete _.current[D.id],O.current.panelDataArrayChanged=!0)},[]),K=zQ(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:z,registerPanel:V,registerResizeHandle:oe,resizePanel:ee,startDragging:$,stopDragging:J,unregisterPanel:q}),[k,p,r,A,L,F,g,j,z,V,oe,ee,$,J,q]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ql(Zp.Provider,{value:K},ql(u,{...f,children:t,className:n,style:{...G,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const bD=KM((e,t)=>ql(vD,{...e,forwardedRef:t}));vD.displayName="PanelGroup",bD.displayName="forwardRef(PanelGroup)";function Kl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xl(e,t,n){const r=e.map(c=>c.constraints),i=Kl(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function tZ({disabled:e,handleId:t,resizeHandler:n}){Da(()=>{if(e||n==null)return;const r=Jp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");dt(s);const a=ud(s),l=nD(s,t);dt(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function yD({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ni(null),u=ni({onDragging:i});Da(()=>{u.current.onDragging=i});const f=XM(Zp);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:_}=f,S=Xy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Qp(!1),[k,A]=Qp(null),L=jr(()=>{const j=c.current;dt(j),j.blur(),_();const{onDragging:z}=u.current;z&&z(!1)},[_]);Da(()=>{if(n)A(null);else{const j=y(S);A(()=>j)}},[n,S,y]),Da(()=>{if(n||k==null||!C)return;const j=ee=>{k(ee)},z=ee=>{k(ee)},V=c.current;dt(V);const oe=V.ownerDocument;return oe.body.addEventListener("contextmenu",L),oe.body.addEventListener("mousemove",j),oe.body.addEventListener("touchmove",j),oe.body.addEventListener("mouseleave",z),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{oe.body.removeEventListener("contextmenu",L),oe.body.removeEventListener("mousemove",j),oe.body.removeEventListener("touchmove",j),oe.body.removeEventListener("mouseleave",z),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),tZ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:uD(g),touchAction:"none",userSelect:"none"};return ql(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const z=u.current;dt(z);const{onDragging:V}=z;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:j=>{x(S,j.nativeEvent);const z=u.current;dt(z);const{onDragging:V}=z;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}yD.displayName="PanelResizeHandle";const xD=({className:e,...t})=>w.jsx(bD,{className:ke("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),tg=eD,wD=({withHandle:e,className:t,...n})=>w.jsx(yD,{className:ke("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&w.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:w.jsx(lH,{className:"h-2.5 w-2.5"})})});function nZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){nZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function iZ(e,t){if(e==null)return{};var n=rZ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oZ(e,t){return sZ(e)||aZ(e,t)||lZ(e,t)||cZ()}function sZ(e){if(Array.isArray(e))return e}function aZ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function lZ(e,t){if(e){if(typeof e=="string")return CD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CD(e,t)}}function CD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
488
+ px-2 pt-2`,role:"dashboard-controls",children:[!i&&w.jsxs("div",{className:"flex gap-3 items-center",children:[w.jsx(Ci,{children:e}),!!e&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:" text-muted-foreground",children:"|"}),w.jsx(qX,{})]})]}),w.jsxs("div",{className:"flex gap-2",children:[n&&!i&&w.jsx(LX,{}),!i&&w.jsx(FX,{}),n&&!i&&w.jsxs(nt,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!n,onClick:y,children:[w.jsx(YO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Frame"]}),!n&&w.jsx(nt,{variant:"outline",className:"h-7 p-2",onClick:x,size:"sm",children:w.jsx(qO,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&w.jsx(nt,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>{g(!1),p(!1)},size:"sm",children:w.jsx(da,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&w.jsx(nt,{className:"h-7 p-2",variant:"outline",onClick:_,size:"sm",children:w.jsx(vH,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&!i&&n&&w.jsx(nt,{className:"h-7 p-2",variant:"outline",onClick:()=>l(!0),size:"sm",children:w.jsx(WO,{className:"h-4 w-4",strokeWidth:1.5})}),!i&&n&&w.jsx("div",{className:" flex items-center space-x-2",children:w.jsx(nt,{className:"h-7 p-2",onClick:()=>p(!s),size:"sm",variant:"outline",children:w.jsx(iH,{className:"h-4 w-4",strokeWidth:1.5})})}),!i&&w.jsx(fX,{})]})]})}const wM=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{role:"editor-panel",ref:n,className:ke("flex grow h-full",e),...t}));wM.displayName="EditorPanel";const _M=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ke(" flex flex-col space-y-2 w-[270px]",e),...t}));_M.displayName="EditorAside";const SM=m.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ke(" grow",e),...t}));SM.displayName="EditorMain";const YX=[" ","Enter","ArrowUp","ArrowDown"],KX=[" ","Enter"],qp="Select",[Gp,Yp,XX]=Sf(qp),[Wl,ehe]=An(qp,[XX,Wi]),Uy=Wi(),[QX,Pa]=Wl(qp),[ZX,JX]=Wl(qp),eQ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:g,required:p}=e,v=Uy(t),[y,x]=m.useState(null),[_,S]=m.useState(null),[C,P]=m.useState(!1),O=Us(c),[k=!1,A]=tr({prop:r,defaultProp:i,onChange:o}),[L,F]=tr({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),z=y?!!y.closest("form"):!0,[V,oe]=m.useState(new Set),ee=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Nu,v,m.createElement(QX,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:_,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:ur(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(Gp.Provider,{scope:t},m.createElement(ZX,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{oe(J=>new Set(J).add($))},[]),onNativeOptionRemove:m.useCallback($=>{oe(J=>{const q=new Set(J);return q.delete($),q})},[])},n)),z?m.createElement(AM,{key:ee,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:L,onChange:$=>F($.target.value),disabled:g},L===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},tQ="SelectTrigger",nQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Uy(n),s=Pa(tQ,n),a=s.disabled||r,l=st(t,s.onTriggerChange),c=Yp(n),[u,f,g]=IM(v=>{const y=c().filter(S=>!S.disabled),x=y.find(S=>S.value===s.value),_=NM(y,v,x);_!==void 0&&s.onValueChange(_.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Ru,ae({asChild:!0},o),m.createElement(He.button,ae({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":TM(s.value)?"":void 0},i,{ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Oe(i.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const y=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&YX.includes(v.key)&&(p(),v.preventDefault())})})))}),rQ="SelectValue",iQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=Pa(rQ,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,f=st(t,l.onValueNodeChange);return qn(()=>{c(u)},[c,u]),m.createElement(He.span,ae({},a,{ref:f,style:{pointerEvents:"none"}}),TM(l.value)?m.createElement(m.Fragment,null,s):o)}),oQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(He.span,ae({"aria-hidden":!0},i,{ref:t}),r||"▼")}),sQ=e=>m.createElement(Hh,ae({asChild:!0},e)),Ul="SelectContent",aQ=m.forwardRef((e,t)=>{const n=Pa(Ul,e.__scopeSelect),[r,i]=m.useState();if(qn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Tt.createPortal(m.createElement(CM,{scope:e.__scopeSelect},m.createElement(Gp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(lQ,ae({},e,{ref:t}))}),Mo=10,[CM,ka]=Wl(Ul),lQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,..._}=e,S=Pa(Ul,n),[C,P]=m.useState(null),[O,k]=m.useState(null),A=st(t,de=>P(de)),[L,F]=m.useState(null),[j,z]=m.useState(null),V=Yp(n),[oe,ee]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return Op(C)},[C]),_p();const J=m.useCallback(de=>{const[re,...Q]=V().map(U=>U.ref.current),[ie]=Q.slice(-1),we=document.activeElement;for(const U of de)if(U===we||(U==null||U.scrollIntoView({block:"nearest"}),U===re&&O&&(O.scrollTop=0),U===ie&&O&&(O.scrollTop=O.scrollHeight),U==null||U.focus(),document.activeElement!==we))return},[V,O]),q=m.useCallback(()=>J([L,C]),[J,L,C]);m.useEffect(()=>{oe&&q()},[oe,q]);const{onOpenChange:K,triggerPointerDownPosRef:G}=S;m.useEffect(()=>{if(C){let de={x:0,y:0};const re=ie=>{var we,U,Ie,je;de={x:Math.abs(Math.round(ie.pageX)-((we=(U=G.current)===null||U===void 0?void 0:U.x)!==null&&we!==void 0?we:0)),y:Math.abs(Math.round(ie.pageY)-((Ie=(je=G.current)===null||je===void 0?void 0:je.y)!==null&&Ie!==void 0?Ie:0))}},Q=ie=>{de.x<=10&&de.y<=10?ie.preventDefault():C.contains(ie.target)||K(!1),document.removeEventListener("pointermove",re),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Q,{capture:!0})}}},[C,K,G]),m.useEffect(()=>{const de=()=>K(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[K]);const[D,H]=IM(de=>{const re=V().filter(we=>!we.disabled),Q=re.find(we=>we.ref.current===document.activeElement),ie=NM(re,de,Q);ie&&setTimeout(()=>ie.ref.current.focus())}),ne=m.useCallback((de,re,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===re||ie)&&(F(de),ie&&($.current=!0))},[S.value]),N=m.useCallback(()=>C==null?void 0:C.focus(),[C]),le=m.useCallback((de,re,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===re||ie)&&z(de)},[S.value]),me=r==="popper"?EM:cQ,he=me===EM?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(CM,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:L,onItemLeave:N,itemTextRefCallback:le,focusSelectedItem:q,selectedItemText:j,position:r,isPositioned:oe,searchRef:D},m.createElement(Ap,{as:co,allowPinchZoom:!0},m.createElement(Sp,{asChild:!0,trapped:S.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Oe(i,de=>{var re;(re=S.trigger)===null||re===void 0||re.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(El,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(me,ae({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:de=>de.preventDefault()},_,he,{onPlaced:()=>ee(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Oe(_.onKeyDown,de=>{const re=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!re&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let ie=V().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(de.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const we=de.target,U=ie.indexOf(we);ie=ie.slice(U+1)}setTimeout(()=>J(ie)),de.preventDefault()}})}))))))}),cQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pa(Ul,n),s=ka(Ul,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=st(t,A=>u(A)),g=Yp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:_,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&y&&x&&_){const A=o.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=_.getBoundingClientRect();if(o.dir!=="rtl"){const we=j.left-L.left,U=F.left-we,Ie=A.left-U,je=A.width+Ie,We=Math.max(je,L.width),Xe=window.innerWidth-Mo,be=w0(U,[Mo,Xe-We]);a.style.minWidth=je+"px",a.style.left=be+"px"}else{const we=L.right-j.right,U=window.innerWidth-F.right-we,Ie=window.innerWidth-A.right-U,je=A.width+Ie,We=Math.max(je,L.width),Xe=window.innerWidth-Mo,be=w0(U,[Mo,Xe-We]);a.style.minWidth=je+"px",a.style.right=be+"px"}const z=g(),V=window.innerHeight-Mo*2,oe=y.scrollHeight,ee=window.getComputedStyle(c),$=parseInt(ee.borderTopWidth,10),J=parseInt(ee.paddingTop,10),q=parseInt(ee.borderBottomWidth,10),K=parseInt(ee.paddingBottom,10),G=$+J+oe+K+q,D=Math.min(x.offsetHeight*5,G),H=window.getComputedStyle(y),ne=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),le=A.top+A.height/2-Mo,me=V-le,he=x.offsetHeight/2,de=x.offsetTop+he,re=$+J+de,Q=G-re;if(re<=le){const we=x===z[z.length-1].ref.current;a.style.bottom="0px";const U=c.clientHeight-y.offsetTop-y.offsetHeight,Ie=Math.max(me,he+(we?N:0)+U+q),je=re+Ie;a.style.height=je+"px"}else{const we=x===z[0].ref.current;a.style.top="0px";const Ie=Math.max(le,$+y.offsetTop+(we?ne:0)+he)+Q;a.style.height=Ie+"px",y.scrollTop=re-le+y.offsetTop}a.style.margin=`${Mo}px 0`,a.style.minHeight=D+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,y,x,_,o.dir,r]);qn(()=>C(),[C]);const[P,O]=m.useState();qn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(uQ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(He.div,ae({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),EM=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Mo,...o}=e,s=Uy(n);return m.createElement(Lu,ae({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[uQ,qy]=Wl(Ul,{}),OM="SelectViewport",dQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ka(OM,n),o=qy(OM,n),s=st(t,i.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Gp.Slot,{scope:n},m.createElement(He.div,ae({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Oe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&u){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-Mo*2,v=parseFloat(u.style.minHeight),y=parseFloat(u.style.height),x=Math.max(v,y);if(x<p){const _=x+g,S=Math.min(p,_),C=_-S;u.style.height=S+"px",u.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),fQ="SelectGroup",[hQ,pQ]=Wl(fQ),gQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ur();return m.createElement(hQ,{scope:n,id:i},m.createElement(He.div,ae({role:"group","aria-labelledby":i},r,{ref:t})))}),mQ="SelectLabel",vQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pQ(mQ,n);return m.createElement(He.div,ae({id:i.id},r,{ref:t}))}),Gy="SelectItem",[bQ,PM]=Wl(Gy),yQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Pa(Gy,n),l=ka(Gy,n),c=a.value===r,[u,f]=m.useState(o??""),[g,p]=m.useState(!1),v=st(t,_=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,_,r,i)}),y=ur(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(bQ,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(_=>{f(S=>{var C;return S||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Gp.ItemSlot,{scope:n,value:r,disabled:i,textValue:u},m.createElement(He.div,ae({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Oe(s.onFocus,()=>p(!0)),onBlur:Oe(s.onBlur,()=>p(!1)),onPointerUp:Oe(s.onPointerUp,x),onPointerMove:Oe(s.onPointerMove,_=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Oe(s.onKeyDown,_=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&_.key===" "||(KX.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})}))))}),Kp="SelectItemText",xQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Pa(Kp,n),a=ka(Kp,n),l=PM(Kp,n),c=JX(Kp,n),[u,f]=m.useState(null),g=st(t,_=>f(_),l.onItemTextChange,_=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,_,l.value,l.disabled)}),p=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return qn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(He.span,ae({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Tt.createPortal(o.children,s.valueNode):null)}),wQ="SelectItemIndicator",_Q=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return PM(wQ,n).isSelected?m.createElement(He.span,ae({"aria-hidden":!0},r,{ref:t})):null}),kM="SelectScrollUpButton",SQ=m.forwardRef((e,t)=>{const n=ka(kM,e.__scopeSelect),r=qy(kM,e.__scopeSelect),[i,o]=m.useState(!1),s=st(t,r.onScrollButtonChange);return qn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(DM,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),MM="SelectScrollDownButton",CQ=m.forwardRef((e,t)=>{const n=ka(MM,e.__scopeSelect),r=qy(MM,e.__scopeSelect),[i,o]=m.useState(!1),s=st(t,r.onScrollButtonChange);return qn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;o(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(DM,ae({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),DM=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ka("SelectScrollButton",n),s=m.useRef(null),a=Yp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),qn(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(He.div,ae({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})}))}),EQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(He.div,ae({"aria-hidden":!0},r,{ref:t}))});function TM(e){return e===""||e===void 0}const AM=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=st(t,i),s=Up(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(rO,{asChild:!0},m.createElement("select",ae({},r,{ref:o,defaultValue:n})))});AM.displayName="BubbleSelect";function IM(e){const t=On(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function NM(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=OQ(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const PQ=eQ,RM=nQ,kQ=iQ,MQ=oQ,DQ=sQ,LM=aQ,TQ=dQ,AQ=gQ,FM=vQ,$M=yQ,IQ=xQ,NQ=_Q,jM=SQ,zM=CQ,BM=EQ,VM=PQ,HM=AQ,WM=kQ,Yy=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(RM,{ref:r,className:ke("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,w.jsx(MQ,{asChild:!0,children:w.jsx(np,{className:"h-4 w-4 opacity-50"})})]}));Yy.displayName=RM.displayName;const UM=ue.forwardRef(({className:e,...t},n)=>w.jsx(jM,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(nH,{className:"h-4 w-4"})}));UM.displayName=jM.displayName;const qM=ue.forwardRef(({className:e,...t},n)=>w.jsx(zM,{ref:n,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(np,{className:"h-4 w-4"})}));qM.displayName=zM.displayName;const Ky=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>w.jsx(DQ,{children:w.jsxs(LM,{ref:i,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[w.jsx(UM,{}),w.jsx(TQ,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),w.jsx(qM,{})]})}));Ky.displayName=LM.displayName;const Xp=ue.forwardRef(({className:e,...t},n)=>w.jsx(FM,{ref:n,className:ke("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Xp.displayName=FM.displayName;const Ma=ue.forwardRef(({className:e,children:t,...n},r)=>w.jsxs($M,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(NQ,{children:w.jsx(tp,{className:"h-4 w-4"})})}),w.jsx(IQ,{children:t})]}));Ma.displayName=$M.displayName;const RQ=ue.forwardRef(({className:e,...t},n)=>w.jsx(BM,{ref:n,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));RQ.displayName=BM.displayName;function sd({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o,className:s,showIcon:a=!0}){const l=r?"Loading...":i?"Error":n;function c(){if(e==="Connection")return w.jsx(mH,{className:" size-4 rotate-90"});if(e==="Database")return w.jsx(oH,{className:"size-4"});if(e==="Schema")return w.jsx(pH,{className:"size-4"});if(e==="Table")return w.jsx(C0,{className:"size-4"})}return w.jsxs("div",{className:"flex gap-2 items-center",children:[a&&w.jsx("div",{className:" shrink-0",children:c()}),w.jsxs(VM,{value:l,onValueChange:o,children:[w.jsx(Yy,{className:ke("focus:ring-offset-0 focus:ring-1 h-9 w-[190px]",s),children:w.jsx(WM,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),w.jsx(Ky,{children:w.jsxs(HM,{children:[r?w.jsx(Xp,{children:"Loading..."}):w.jsx(Xp,{children:e}),w.jsx(w.Fragment,{children:t&&t.map((u,f)=>w.jsx(Ma,{value:u.id,children:u.name},f))}),(r||i)&&w.jsx(Ma,{value:l,children:l})]})})]})]})}function LQ({column:e}){const[t,n]=m.useState(!1),r=ve(u=>u.selectedTableName),i=ve(u=>u.selectedSchemaName),o=ve(u=>u.sqlGen),s=ve(u=>u.actions.setSqlGen),a=ve(u=>u.actions.setCardSql),l=ve(u=>u.actions.setRunSql);function c(u,f){const g=K0(u,o,f);s(g);const p=Y0(g,Si(i||""),Si(r));p&&(a(p),l(!0)),n(!1)}return w.jsxs(Ip,{open:t,onOpenChange:n,children:[w.jsx(Np,{asChild:!0,children:w.jsx(np,{className:" w-4 h-4 text-foreground/40 cursor-pointer"})}),w.jsx(ed,{align:"center",className:" p-0 w-18 rounded-md shadow-none ",children:w.jsxs("ul",{className:"text-xs ",children:[w.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),w.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),w.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),w.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),w.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function GM({column:e}){return w.jsxs(r0,{children:[w.jsx(oO,{asChild:!0,children:Hu.includes(e.data_type.toLowerCase())?w.jsx(SH,{className:"size-3"}):fs.includes(e.data_type.toLowerCase())?w.jsx(uH,{className:"size-3"}):xa.includes(e.data_type.toLowerCase())?w.jsx(BO,{className:"size-3"}):gp.includes(e.data_type.toLowerCase())?w.jsx(_H,{className:"size-3"}):w.jsx(yH,{className:"size-3"})}),w.jsx(qh,{children:w.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function FQ({schemaName:e,tableName:t,columns:n,status:r}){const i=ve(f=>f.sqlGen),o=ve(f=>f.actions.setRunSql),s=ve(f=>f.actions.setSqlGen),a=ve(f=>f.actions.setIsShowingVisual),l=ve(f=>f.actions.setCardSql);function c(f){const g=K0(f,i);s(g);const p=Y0(g,Si(e),Si(t));p&&(l(p),o(!0))}function u(){let g=vp(e,t);(v=>v.charAt(0)===v.charAt(0).toUpperCase())(t)&&(g=`"${t}"`),a(!1),l(`SELECT * FROM ${g} LIMIT 10`),o(!0)}return w.jsxs("div",{className:" grow flex flex-col px-6 space-y-4",children:[w.jsx("div",{className:" font-medium ",children:w.jsxs(nt,{disabled:r!=="Success",onClick:u,size:"sm",variant:"secondary",className:"flex w-full",children:[r!=="Success"?w.jsx(Al,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}):w.jsx(wH,{className:"size-4 mr-2"}),"Show top 10 rows"]})}),w.jsxs(Tl,{className:" flex-1 basis-0 overflow-y-auto border-t border-b border-muted py-3",children:[n==null?void 0:n.map(f=>w.jsxs("div",{onClick:()=>c(f),className:ke(" text-sm flex items-center justify-between px-2 py-[6px] mx-3 transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":CP(f,i)}),children:[w.jsxs("div",{className:"flex items-center space-x-2 ",children:[w.jsx(GM,{column:f}),w.jsx("span",{children:f.column_name})]}),fs.includes(f.data_type)&&w.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:w.jsx(LQ,{column:f})})]},f.column_name)),w.jsx(ju,{orientation:"vertical"}),w.jsx(ju,{orientation:"horizontal"})]})]})}function YM({ColumnsComponent:e}){const t=ve(z=>z.selectedConnectionId),n=ve(z=>z.selectedDatabaseName),r=ve(z=>z.selectedSchemaName),i=ve(z=>z.selectedTableName),o=ve(z=>z.actions.setSelectedTableName),{connectionItems:s,schemaItems:a,databaseItems:l,tableItems:c,columns:u,isConnectionsLoading:f,isConnectionsError:g,isDatabasesLoadingOrFetching:p,isDatabaseError:v,isSchemaLoadingOrFetching:y,isSchemaError:x,isColumnsError:_,isColumnsLoadingOrFetching:S,isAPIConnection:C,handleConnectionChange:P,handleDatabaseChange:O,handleSchemaChange:k,tableName:A,schemaName:L}=p_();function F(){return e?e(L,A,u):w.jsx(FQ,{schemaName:L,tableName:A,columns:u,status:S?"Loading...":_?"Error":"Success"})}function j(){window.location.href="mailto:support@semaphor.cloud?subject=Help&body=I need help with..."}return w.jsxs("aside",{className:" grow flex flex-col justify-between xbg-red-100 ",children:[w.jsxs("section",{className:"space-y-3 py-4 px-6",children:[w.jsx(sd,{items:s,title:"Connection",value:t||"",onChange:P,isLoading:f,isError:g}),!C&&w.jsxs(w.Fragment,{children:[w.jsx(sd,{onChange:O,isError:v,isLoading:p,items:l,value:n||"",title:"Database"}),w.jsx(sd,{onChange:k,isError:x,isLoading:y,items:a,value:r||"",title:"Schema"}),w.jsx(sd,{onChange:o,isError:v,items:c,isLoading:p,value:i||"",title:"Table"})]})]}),F(),w.jsx("div",{className:"justify-center items-end flex px-6 py-4",children:w.jsxs(nt,{onClick:j,size:"sm",variant:"secondary",className:"w-full",children:[w.jsx(fH,{className:"size-4 mr-2"}),"Help"]})})]})}const{createElement:ql,createContext:$Q,createRef:the,forwardRef:KM,useCallback:jr,useContext:XM,useEffect:Da,useImperativeHandle:QM,useLayoutEffect:jQ,useMemo:zQ,useRef:ni,useState:Qp}=ue,ZM=ue.useId,Zp=$Q(null);Zp.displayName="PanelGroupContext";const ad=jQ,BQ=typeof ZM=="function"?ZM:()=>null;let VQ=0;function Xy(e=null){const t=BQ(),n=ni(e||t||null);return n.current===null&&(n.current=""+VQ++),e??n.current}function JM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=XM(Zp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:_,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,j=Xy(s),z=ni({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ni({didLogMissingDefaultSizeWarning:!1}),ad(()=>{const{callbacks:oe,constraints:ee}=z.current;z.current.id=j,z.current.idIsFromProps=s!==void 0,z.current.order=g,oe.onCollapse=c,oe.onExpand=u,oe.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=i,ee.maxSize=a,ee.minSize=l}),ad(()=>{const oe=z.current;return A(oe),()=>{F(oe)}},[g,j,A,F]),QM(o,()=>({collapse:()=>{_(z.current)},expand:()=>{S(z.current)},getId(){return j},getSize(){return C(z.current)},isCollapsed(){return k(z.current)},isExpanded(){return!k(z.current)},resize:oe=>{L(z.current,oe)}}),[_,S,C,k,j,L]);const V=P(z.current,i);return ql(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const eD=KM((e,t)=>ql(JM,{...e,forwardedRef:t}));JM.displayName="Panel",eD.displayName="forwardRef(Panel)";function dt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const tD=10;function ld(e,t,n=tD){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function zr(e,t,n){return ld(e,t,n)===0}function Gl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];dt(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(ld(n,a)<0)if(o){const l=(i+a)/2;ld(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(tD)),n}function cd({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(zr(e,0))return t;const o=[...t],[s,a]=r;dt(s!=null),dt(a!=null);let l=0;if(i==="keyboard"){{const u=e<0?a:s,f=n[u];if(dt(f),f.collapsible){const g=t[u];dt(g!=null);const p=n[u];dt(p);const{collapsedSize:v=0,minSize:y=0}=p;if(zr(g,v)){const x=y-g;ld(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];dt(f);const{collapsible:g}=f;if(g){const p=t[u];dt(p!=null);const v=n[u];dt(v);const{collapsedSize:y=0,minSize:x=0}=v;if(zr(p,x)){const _=p-y;ld(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}}{const u=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];dt(v!=null);const x=Gl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=u,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];dt(p!=null);const v=p-g,y=Gl({panelConstraints:n,panelIndex:f,size:v});if(!zr(p,y)&&(l+=p-y,o[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(zr(l,0))return t;{const u=e<0?a:s,f=t[u];dt(f!=null);const g=f+l,p=Gl({panelConstraints:n,panelIndex:u,size:g});if(o[u]=p,!zr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const _=o[x];dt(_!=null);const S=_+v,C=Gl({panelConstraints:n,panelIndex:x,size:S});if(zr(_,C)||(v-=C-_,o[x]=C),zr(v,0))break;e>0?x--:x++}}}const c=o.reduce((u,f)=>f+u,0);return zr(c,100)?o:t}function HQ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];dt(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,i=v):(o+=y,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function ud(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function nD(e,t){const r=ud(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function rD(e,t){const n=nD(e,t);return n!=null?[n,n+1]:[-1,-1]}function iD(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Jp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function WQ(e,t,n){var r,i,o,s;const a=Jp(t),l=ud(e),c=a?l.indexOf(a):-1,u=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[u,f]}function UQ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ni({didWarnAboutMissingResizeHandle:!1}),ad(()=>{const s=ud(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=HQ({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];dt(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Da(()=>{const s=t.current;dt(s);const{panelDataArray:a}=s,l=iD(n);dt(l!=null,`No group found for id "${n}"`);const c=ud(n);dt(c);const u=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");dt(g);const[p,v]=WQ(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=a.findIndex(S=>S.id===p);if(_>=0){const S=a[_];dt(S);const C=r[_],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const A=cd({delta:zr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:rD(n,g),trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,i,o])}function oD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function sD(e){return e.type==="keydown"}function aD(e){return e.type.startsWith("mouse")}function lD(e){return e.type.startsWith("touch")}function cD(e,t){const n=e==="horizontal";if(aD(t))return n?t.clientX:t.clientY;if(lD(t)){const r=t.touches[0];return dt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function qQ(e,t,n,r){const i=n==="horizontal",o=Jp(t);dt(o);const s=o.getAttribute("data-panel-group-id");dt(s);let{initialCursorPosition:a}=r;const l=cD(n,e),c=iD(s);dt(c);const u=c.getBoundingClientRect(),f=i?u.width:u.height;return(l-a)/f*100}function GQ(e,t,n,r,i){if(sD(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:qQ(e,t,n,r)}function YQ({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];dt(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];dt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Yl(e,t,n){t.forEach((r,i)=>{const o=e[i];dt(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),u&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function eg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function KQ({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Qy=null,Ta=null;function uD(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function XQ(){Ta!==null&&(document.head.removeChild(Ta),Qy=null,Ta=null)}function Zy(e){if(Qy===e)return;Qy=e;const t=uD(e);Ta===null&&(Ta=document.createElement("style"),document.head.appendChild(Ta)),Ta.innerHTML=`*{cursor: ${t}!important;}`}function QQ(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function dD(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function fD(e){return`react-resizable-panels:${e}`}function hD(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function pD(e,t){try{const n=fD(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function ZQ(e,t,n){var r,i;const o=(r=pD(e,n))!==null&&r!==void 0?r:{},s=hD(t);return(i=o[s])!==null&&i!==void 0?i:null}function JQ(e,t,n,r,i){var o;const s=fD(e),a=hD(t),l=(o=pD(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function gD({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!zr(r,100))for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=Gl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!zr(i,0))for(let o=0;o<t.length;o++){const s=n[o];dt(s!=null);const a=s+i,l=Gl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,zr(i,0)))break}return n}const eZ=100,dd={getItem:e=>(dD(dd),dd.getItem(e)),setItem:(e,t)=>{dD(dd),dd.setItem(e,t)}},mD={};function vD({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=dd,style:c,tagName:u="div",...f}){const g=Xy(o),[p,v]=Qp(null),[y,x]=Qp([]),_=ni({}),S=ni(new Map),C=ni(0),P=ni({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ni({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ni({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),QM(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:D}=O.current;return D},setLayout:D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current,le=gD({layout:D,panelConstraints:N.map(me=>me.constraints)});oD(ne,le)||(x(le),O.current.layout=le,H&&H(le),Yl(N,le,_.current))}}),[]),ad(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),UQ({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:y,panelDataArray:O.current.panelDataArray,setLayout:x}),Da(()=>{const{panelDataArray:D}=O.current;if(e){if(y.length===0||y.length!==D.length)return;let H=mD[e];H==null&&(H=QQ(JQ,eZ),mD[e]=H);const ne=[...D],N=new Map(S.current);H(e,ne,N,y,l)}},[e,y,l]),Da(()=>{});const k=jr(D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(D.constraints.collapsible){const le=N.map(re=>re.constraints),{collapsedSize:me=0,panelSize:he,pivotIndices:de}=Xl(N,D,ne);if(dt(he!=null),he!==me){S.current.set(D.id,he);const Q=Kl(N,D)===N.length-1?he-me:me-he,ie=cd({delta:Q,layout:ne,panelConstraints:le,pivotIndices:de,trigger:"imperative-api"});eg(ne,ie)||(x(ie),O.current.layout=ie,H&&H(ie),Yl(N,ie,_.current))}}},[]),A=jr(D=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:N}=O.current;if(D.constraints.collapsible){const le=N.map(Q=>Q.constraints),{collapsedSize:me=0,panelSize:he,minSize:de=0,pivotIndices:re}=Xl(N,D,ne);if(he===me){const Q=S.current.get(D.id),ie=Q!=null&&Q>=de?Q:de,U=Kl(N,D)===N.length-1?he-ie:ie-he,Ie=cd({delta:U,layout:ne,panelConstraints:le,pivotIndices:re,trigger:"imperative-api"});eg(ne,Ie)||(x(Ie),O.current.layout=Ie,H&&H(Ie),Yl(N,Ie,_.current))}}},[]),L=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{panelSize:N}=Xl(ne,D,H);return dt(N!=null),N},[]),F=jr((D,H)=>{const{panelDataArray:ne}=O.current,N=Kl(ne,D);return KQ({defaultSize:H,dragState:p,layout:y,panelData:ne,panelIndex:N})},[p,y]),j=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:le,panelSize:me}=Xl(ne,D,H);return le===!0&&me===N},[]),z=jr(D=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:N=0,collapsible:le,panelSize:me}=Xl(ne,D,H);return dt(me!=null),!le||me>N},[]),V=jr(D=>{const{panelDataArray:H}=O.current;H.push(D),H.sort((ne,N)=>{const le=ne.order,me=N.order;return le==null&&me==null?0:le==null?-1:me==null?1:le-me}),O.current.panelDataArrayChanged=!0},[]);ad(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:D,onLayout:H,storage:ne}=P.current,{layout:N,panelDataArray:le}=O.current;let me=null;if(D){const de=ZQ(D,le,ne);de&&(S.current=new Map(Object.entries(de.expandToSizes)),me=de.layout)}me==null&&(me=YQ({panelDataArray:le}));const he=gD({layout:me,panelConstraints:le.map(de=>de.constraints)});oD(N,he)||(x(he),O.current.layout=he,H&&H(he),Yl(le,he,_.current))}});const oe=jr(D=>function(ne){ne.preventDefault();const{direction:N,dragState:le,id:me,keyboardResizeBy:he,onLayout:de}=P.current,{layout:re,panelDataArray:Q}=O.current,{initialLayout:ie}=le??{},we=rD(me,D);let U=GQ(ne,D,N,le,he);if(U===0)return;const Ie=N==="horizontal";document.dir==="rtl"&&Ie&&(U=-U);const je=Q.map(be=>be.constraints),We=cd({delta:U,layout:ie??re,panelConstraints:je,pivotIndices:we,trigger:sD(ne)?"keyboard":"mouse-or-touch"}),Xe=!eg(re,We);(aD(ne)||lD(ne))&&C.current!=U&&(C.current=U,Zy(Xe?Ie?"horizontal":"vertical":Ie?U<0?"horizontal-min":"horizontal-max":U<0?"vertical-min":"vertical-max")),Xe&&(x(We),O.current.layout=We,de&&de(We),Yl(Q,We,_.current))},[]),ee=jr((D,H)=>{const{onLayout:ne}=P.current,{layout:N,panelDataArray:le}=O.current,me=le.map(we=>we.constraints),{panelSize:he,pivotIndices:de}=Xl(le,D,N);dt(he!=null);const Q=Kl(le,D)===le.length-1?he-H:H-he,ie=cd({delta:Q,layout:N,panelConstraints:me,pivotIndices:de,trigger:"imperative-api"});eg(N,ie)||(x(ie),O.current.layout=ie,ne&&ne(ie),Yl(le,ie,_.current))},[]),$=jr((D,H)=>{const{direction:ne}=P.current,{layout:N}=O.current,le=Jp(D);dt(le);const me=cD(ne,H);v({dragHandleId:D,dragHandleRect:le.getBoundingClientRect(),initialCursorPosition:me,initialLayout:N})},[]),J=jr(()=>{XQ(),v(null)},[]),q=jr(D=>{const{panelDataArray:H}=O.current,ne=Kl(H,D);ne>=0&&(H.splice(ne,1),delete _.current[D.id],O.current.panelDataArrayChanged=!0)},[]),K=zQ(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:z,registerPanel:V,registerResizeHandle:oe,resizePanel:ee,startDragging:$,stopDragging:J,unregisterPanel:q}),[k,p,r,A,L,F,g,j,z,V,oe,ee,$,J,q]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ql(Zp.Provider,{value:K},ql(u,{...f,children:t,className:n,style:{...G,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const bD=KM((e,t)=>ql(vD,{...e,forwardedRef:t}));vD.displayName="PanelGroup",bD.displayName="forwardRef(PanelGroup)";function Kl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xl(e,t,n){const r=e.map(c=>c.constraints),i=Kl(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function tZ({disabled:e,handleId:t,resizeHandler:n}){Da(()=>{if(e||n==null)return;const r=Jp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");dt(s);const a=ud(s),l=nD(s,t);dt(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function yD({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ni(null),u=ni({onDragging:i});Da(()=>{u.current.onDragging=i});const f=XM(Zp);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:_}=f,S=Xy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Qp(!1),[k,A]=Qp(null),L=jr(()=>{const j=c.current;dt(j),j.blur(),_();const{onDragging:z}=u.current;z&&z(!1)},[_]);Da(()=>{if(n)A(null);else{const j=y(S);A(()=>j)}},[n,S,y]),Da(()=>{if(n||k==null||!C)return;const j=ee=>{k(ee)},z=ee=>{k(ee)},V=c.current;dt(V);const oe=V.ownerDocument;return oe.body.addEventListener("contextmenu",L),oe.body.addEventListener("mousemove",j),oe.body.addEventListener("touchmove",j),oe.body.addEventListener("mouseleave",z),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{oe.body.removeEventListener("contextmenu",L),oe.body.removeEventListener("mousemove",j),oe.body.removeEventListener("touchmove",j),oe.body.removeEventListener("mouseleave",z),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),tZ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:uD(g),touchAction:"none",userSelect:"none"};return ql(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const z=u.current;dt(z);const{onDragging:V}=z;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:j=>{x(S,j.nativeEvent);const z=u.current;dt(z);const{onDragging:V}=z;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}yD.displayName="PanelResizeHandle";const xD=({className:e,...t})=>w.jsx(bD,{className:ke("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),tg=eD,wD=({withHandle:e,className:t,...n})=>w.jsx(yD,{className:ke("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&w.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:w.jsx(lH,{className:"h-2.5 w-2.5"})})});function nZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){nZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function iZ(e,t){if(e==null)return{};var n=rZ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oZ(e,t){return sZ(e)||aZ(e,t)||lZ(e,t)||cZ()}function sZ(e){if(Array.isArray(e))return e}function aZ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function lZ(e,t){if(e){if(typeof e=="string")return CD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CD(e,t)}}function CD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
489
489
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ED(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(r){uZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function fd(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function ng(e){return{}.toString.call(e).includes("Object")}function fZ(e){return!Object.keys(e).length}function hd(e){return typeof e=="function"}function hZ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pZ(e,t){return ng(t)||bs("changeType"),Object.keys(t).some(function(n){return!hZ(e,n)})&&bs("changeField"),t}function gZ(e){hd(e)||bs("selectorType")}function mZ(e){hd(e)||ng(e)||bs("handlerType"),ng(e)&&Object.values(e).some(function(t){return!hd(t)})&&bs("handlersType")}function vZ(e){e||bs("initialIsRequired"),ng(e)||bs("initialType"),fZ(e)&&bs("initialContent")}function bZ(e,t){throw new Error(e[t]||e.default)}var yZ={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},bs=fd(bZ)(yZ),rg={changes:pZ,selector:gZ,handler:mZ,initial:vZ};function xZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};rg.initial(e),rg.handler(t);var n={current:e},r=fd(SZ)(n,t),i=fd(_Z)(n),o=fd(rg.changes)(e),s=fd(wZ)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return rg.selector(c),c(n.current)}function l(c){dZ(r,i,o,s)(c)}return[a,l]}function wZ(e,t){return hd(t)?t(e.current):t}function _Z(e,t){return e.current=OD(OD({},e.current),t),t}function SZ(e,t,n){return hd(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var CZ={create:xZ},EZ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function OZ(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function PZ(e){return{}.toString.call(e).includes("Object")}function kZ(e){return e||kD("configIsRequired"),PZ(e)||kD("configType"),e.urls?(MZ(),{paths:{vs:e.urls.monacoBase}}):e}function MZ(){console.warn(PD.deprecation)}function DZ(e,t){throw new Error(e[t]||e.default)}var PD={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
490
490
  You are using deprecated way of configuration.
491
491
 
@@ -495,8 +495,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
495
495
  monaco.config({ paths: { vs: '...' } })
496
496
 
497
497
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
498
- `},kD=OZ(DZ)(PD),TZ={config:kZ},AZ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function MD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],MD(e[n],t[n]))}),SD(SD({},e),t)}var IZ={type:"cancelation",msg:"operation is manually canceled"};function Jy(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(IZ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var NZ=CZ.create({config:EZ,isInitialized:!1,resolve:null,reject:null,monaco:null}),DD=oZ(NZ,2),pd=DD[0],ig=DD[1];function RZ(e){var t=TZ.config(e),n=t.monaco,r=iZ(t,["monaco"]);ig(function(i){return{config:MD(i.config,r),monaco:n}})}function LZ(){var e=pd(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(ig({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Jy(ex);if(window.monaco&&window.monaco.editor)return TD(window.monaco),e.resolve(window.monaco),Jy(ex);AZ(FZ,jZ)(zZ)}return Jy(ex)}function FZ(e){return document.body.appendChild(e)}function $Z(e){var t=document.createElement("script");return e&&(t.src=e),t}function jZ(e){var t=pd(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=$Z("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function zZ(){var e=pd(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){TD(n),e.resolve(n)},function(n){e.reject(n)})}function TD(e){pd().monaco||ig({monaco:e})}function BZ(){return pd(function(e){var t=e.monaco;return t})}var ex=new Promise(function(e,t){return ig({resolve:e,reject:t})}),AD={config:RZ,init:LZ,__getMonacoInstance:BZ},VZ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},tx=VZ,HZ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},WZ=HZ;function UZ({children:e}){return m.createElement("div",{style:WZ.container},e)}var qZ=UZ,GZ=qZ;function YZ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...tx.wrapper,width:e,height:t},...s},!n&&m.createElement(GZ,null,r),m.createElement("div",{ref:i,style:{...tx.fullWidth,...!n&&tx.hide},className:o}))}var KZ=YZ,ID=m.memo(KZ);function XZ(e){m.useEffect(e,[])}var ND=XZ;function QZ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Br=QZ;function gd(){}function Ql(e,t,n,r){return ZZ(e,r)||JZ(e,t,n,r)}function ZZ(e,t){return e.editor.getModel(RD(e,t))}function JZ(e,t,n,r){return e.editor.createModel(t,n,r?RD(e,r):void 0)}function RD(e,t){return e.Uri.parse(t)}function eJ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=gd,onMount:_=gd}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(_),j=m.useRef(x),z=m.useRef(!1);ND(()=>{let $=AD.init();return $.then(J=>(A.current=J)&&O(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>k.current?ee():$.cancel()}),Br(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),J=Ql(A.current,e||"",r||n||"text",o||"");J!==$.getModel()&&$.setModel(J)}},[o],S),Br(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),J=Ql(A.current,t||"",i||n||"text",s||"");J!==$.getModel()&&$.setModel(J)}},[s],S),Br(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),Br(()=>{var $,J;(J=($=k.current)==null?void 0:$.getModel())==null||J.original.setValue(e||"")},[e],S),Br(()=>{let{original:$,modified:J}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(J,i||n||"text")},[n,r,i],S),Br(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],S),Br(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var q;if(!A.current)return;j.current(A.current);let $=Ql(A.current,e||"",r||n||"text",o||""),J=Ql(A.current,t||"",i||n||"text",s||"");(q=k.current)==null||q.setModel({original:$,modified:J})},[n,t,i,e,r,o,s]),oe=m.useCallback(()=>{var $;!z.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),z.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,A.current)},[S]),m.useEffect(()=>{!P&&!S&&oe()},[P,S,oe]);function ee(){var J,q,K,G;let $=(J=k.current)==null?void 0:J.getModel();a||((q=$==null?void 0:$.original)==null||q.dispose()),l||((K=$==null?void 0:$.modified)==null||K.dispose()),(G=k.current)==null||G.dispose()}return m.createElement(ID,{width:p,height:g,isEditorReady:S,loading:u,_ref:L,className:v,wrapperProps:y})}var tJ=eJ;m.memo(tJ);function nJ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var rJ=nJ,og=new Map;function iJ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:_=gd,onMount:S=gd,onChange:C,onValidate:P=gd}){let[O,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),z=m.useRef(null),V=m.useRef(S),oe=m.useRef(_),ee=m.useRef(),$=m.useRef(r),J=rJ(o),q=m.useRef(!1),K=m.useRef(!1);ND(()=>{let H=AD.init();return H.then(ne=>(F.current=ne)&&L(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>j.current?D():H.cancel()}),Br(()=>{var ne,N,le,me;let H=Ql(F.current,e||r||"",t||i||"",o||n||"");H!==((ne=j.current)==null?void 0:ne.getModel())&&(f&&og.set(J,(N=j.current)==null?void 0:N.saveViewState()),(le=j.current)==null||le.setModel(H),f&&((me=j.current)==null||me.restoreViewState(og.get(o))))},[o],O),Br(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),Br(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(K.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),K.current=!1))},[r],O),Br(()=>{var ne,N;let H=(ne=j.current)==null?void 0:ne.getModel();H&&i&&((N=F.current)==null||N.editor.setModelLanguage(H,i))},[i],O),Br(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),Br(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let G=m.useCallback(()=>{var H;if(!(!z.current||!F.current)&&!q.current){oe.current(F.current);let ne=o||n,N=Ql(F.current,r||e||"",t||i||"",ne||"");j.current=(H=F.current)==null?void 0:H.editor.create(z.current,{model:N,automaticLayout:!0,...c},u),f&&j.current.restoreViewState(og.get(ne)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),q.current=!0}},[e,t,n,r,i,o,c,u,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!A&&!O&&G()},[A,O,G]),$.current=r,m.useEffect(()=>{var H,ne;O&&C&&((H=ee.current)==null||H.dispose(),ee.current=(ne=j.current)==null?void 0:ne.onDidChangeModelContent(N=>{K.current||C(j.current.getValue(),N)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(ne=>{var le;let N=(le=j.current.getModel())==null?void 0:le.uri;if(N&&ne.find(me=>me.path===N.path)){let me=F.current.editor.getModelMarkers({resource:N});P==null||P(me)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function D(){var H,ne;(H=ee.current)==null||H.dispose(),g?f&&og.set(o,j.current.saveViewState()):(ne=j.current.getModel())==null||ne.dispose(),j.current.dispose()}return m.createElement(ID,{width:p,height:v,isEditorReady:O,loading:l,_ref:z,className:y,wrapperProps:x})}var oJ=iJ,LD=m.memo(oJ),nx=LD;function sJ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(6)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}function aJ({error:e,setShowAIDialog:t,setUserInputforAI:n,setTriggerAIRun:r}){return w.jsxs(D0,{openDelay:0,children:[w.jsx(T0,{asChild:!0,children:w.jsx(nt,{variant:"link",className:" p-0 h-5",children:w.jsx(rH,{className:"h-4 w-4 text-red-500"})})}),w.jsx(op,{align:"start",className:"w-[500px]",children:w.jsx("div",{className:"flex justify-between space-x-4",children:w.jsxs("div",{className:"grow space-y-1 flex flex-col ",children:[w.jsxs(nt,{onClick:()=>{t(!0),n(e),r(!0)},variant:"outline",children:[w.jsx(cH,{className:"h-4 w-4 mr-2"}),"Fix It"]}),w.jsx(Tl,{className:" min-h-0 max-h-[250px] overflow-scroll ",children:w.jsx("p",{className:" overflow-auto text-sm leading-relaxed font-mono ",children:e})})]})})})]})}function lJ({text:e,onCheckedChange:t,checked:n}){return w.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[w.jsx(od,{checked:n,onCheckedChange:t}),w.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function cJ(){const{authToken:e}=lo(),t=m.useRef(null),n=ve(a=>a.applyFilters),[r,i]=m.useState(""),o=ve(a=>a.filterValues),s=ve(a=>a.card.sql);return w.jsxs(D0,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await zc("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[w.jsx(T0,{asChild:!0,children:n&&w.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"|  Filter Query"})}),w.jsxs(op,{align:"end",className:"w-[600px] ",children:[w.jsx("div",{className:" flex justify-between space-x-4",children:w.jsx("div",{className:"bg-muted p-2 rounded-sm",children:w.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,w.jsx(E2,{onClick:()=>f3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),w.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[w.jsx(O2,{className:"h-4 w-4 opacity-70"}),w.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const rx=ue.forwardRef(({className:e,...t},n)=>w.jsx("textarea",{className:ke("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));rx.displayName="Textarea";function nhe(){}function rhe(){}function uJ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hJ={};function FD(e,t){return((t||hJ).jsx?fJ:dJ).test(e)}const pJ=/[ \t\n\f\r]/g;function gJ(e){return typeof e=="object"?e.type==="text"?$D(e.value):!1:$D(e)}function $D(e){return e.replace(pJ,"")===""}class md{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}md.prototype.property={},md.prototype.normal={},md.prototype.space=null;function jD(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new md(n,r,t)}function ix(e){return e.toLowerCase()}class ri{constructor(t,n){this.property=t,this.attribute=n}}ri.prototype.space=null,ri.prototype.boolean=!1,ri.prototype.booleanish=!1,ri.prototype.overloadedBoolean=!1,ri.prototype.number=!1,ri.prototype.commaSeparated=!1,ri.prototype.spaceSeparated=!1,ri.prototype.commaOrSpaceSeparated=!1,ri.prototype.mustUseProperty=!1,ri.prototype.defined=!1;let mJ=0;const ft=Aa(),wn=Aa(),zD=Aa(),Pe=Aa(),Gt=Aa(),Zl=Aa(),Vr=Aa();function Aa(){return 2**++mJ}const ox=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:wn,commaOrSpaceSeparated:Vr,commaSeparated:Zl,number:Pe,overloadedBoolean:zD,spaceSeparated:Gt},Symbol.toStringTag,{value:"Module"})),sx=Object.keys(ox);class ax extends ri{constructor(t,n,r,i){let o=-1;if(super(t,n),BD(this,"space",i),typeof r=="number")for(;++o<sx.length;){const s=sx[o];BD(this,sx[o],(r&ox[s])===ox[s])}}}ax.prototype.defined=!0;function BD(e,t,n){n&&(e[t]=n)}const vJ={}.hasOwnProperty;function Jl(e){const t={},n={};let r;for(r in e.properties)if(vJ.call(e.properties,r)){const i=e.properties[r],o=new ax(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ix(r)]=r,n[ix(o.attribute)]=r}return new md(t,n,e.space)}const VD=Jl({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),HD=Jl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function WD(e,t){return t in e?e[t]:t}function UD(e,t){return WD(e,t.toLowerCase())}const qD=Jl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:UD,properties:{xmlns:null,xmlnsXLink:null}}),GD=Jl({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:Gt,ariaCurrent:null,ariaDescribedBy:Gt,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:Gt,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:Gt,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Gt,ariaLevel:Pe,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:Gt,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:Gt,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:wn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null}}),bJ=Jl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:UD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zl,acceptCharset:Gt,accessKey:Gt,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Gt,autoFocus:ft,autoPlay:ft,blocking:Gt,capture:null,charSet:null,checked:ft,cite:null,className:Gt,cols:Pe,colSpan:null,content:null,contentEditable:wn,controls:ft,controlsList:Gt,coords:Pe|Zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:zD,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Gt,height:Pe,hidden:ft,high:Pe,href:null,hrefLang:null,htmlFor:Gt,httpEquiv:Gt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Gt,itemRef:Gt,itemScope:ft,itemType:Gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ft,optimum:Pe,pattern:null,ping:Gt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Gt,required:ft,reversed:ft,rows:Pe,rowSpan:Pe,sandbox:Gt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:wn,width:Pe,wrap:null,align:null,aLink:null,archive:Gt,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Pe,security:null,unselectable:null}}),yJ=Jl({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:WD,properties:{about:Vr,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:Gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zl,g2:Zl,glyphName:Zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:Vr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vr,rev:Vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vr,requiredFeatures:Vr,requiredFonts:Vr,requiredFormats:Vr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:Vr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vr,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),xJ=/^data[-\w.:]+$/i,YD=/-[a-z]/g,wJ=/[A-Z]/g;function _J(e,t){const n=ix(t);let r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(YD,CJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!YD.test(o)){let s=o.replace(wJ,SJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ax}return new i(r,t)}function SJ(e){return"-"+e.toLowerCase()}function CJ(e){return e.charAt(1).toUpperCase()}const EJ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},OJ=jD([HD,VD,qD,GD,bJ],"html"),lx=jD([HD,VD,qD,GD,yJ],"svg");function PJ(e){return e.join(" ").trim()}var KD={},XD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,kJ=/\n/g,MJ=/^\s*/,DJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,TJ=/^:\s*/,AJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,IJ=/^[;\s]*/,NJ=/^\s+|\s+$/g,RJ=`
499
- `,QD="/",ZD="*",Ia="",LJ="comment",FJ="declaration",$J=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var y=v.match(kJ);y&&(n+=y.length);var x=v.lastIndexOf(RJ);r=~x?v.length-x:r+v.length}function o(){var v={line:n,column:r};return function(y){return y.position=new s(v),c(),y}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var y=new Error(t.source+":"+n+":"+r+": "+v);if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(v){var y=v.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function c(){l(MJ)}function u(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=o();if(!(QD!=e.charAt(0)||ZD!=e.charAt(1))){for(var y=2;Ia!=e.charAt(y)&&(ZD!=e.charAt(y)||QD!=e.charAt(y+1));)++y;if(y+=2,Ia===e.charAt(y-1))return a("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,v({type:LJ,comment:x})}}function g(){var v=o(),y=l(DJ);if(y){if(f(),!l(TJ))return a("property missing ':'");var x=l(AJ),_=v({type:FJ,property:JD(y[0].replace(XD,Ia)),value:x?JD(x[0].replace(XD,Ia)):Ia});return l(IJ),_}}function p(){var v=[];u(v);for(var y;y=g();)y!==!1&&(v.push(y),u(v));return v}return c(),p()};function JD(e){return e?e.replace(NJ,Ia):Ia}var jJ=Ho&&Ho.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(KD,"__esModule",{value:!0});var zJ=jJ($J);function BJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,zJ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var eT=KD.default=BJ;const VJ=eT.default||eT,tT=nT("end"),cx=nT("start");function nT(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function HJ(e){const t=cx(e),n=tT(e);if(t&&n)return{start:t,end:n}}function vd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rT(e.position):"start"in e||"end"in e?rT(e):"line"in e||"column"in e?ux(e):""}function ux(e){return iT(e&&e.line)+":"+iT(e&&e.column)}function rT(e){return ux(e&&e.start)+"-"+ux(e&&e.end)}function iT(e){return e&&typeof e=="number"?e:1}class Qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=vd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Qn.prototype.file="",Qn.prototype.name="",Qn.prototype.reason="",Qn.prototype.message="",Qn.prototype.stack="",Qn.prototype.column=void 0,Qn.prototype.line=void 0,Qn.prototype.ancestors=void 0,Qn.prototype.cause=void 0,Qn.prototype.fatal=void 0,Qn.prototype.place=void 0,Qn.prototype.ruleId=void 0,Qn.prototype.source=void 0;const dx={}.hasOwnProperty,WJ=new Map,UJ=/[A-Z]/g,qJ=/-([a-z])/g,GJ=new Set(["table","tbody","thead","tfoot","tr"]),YJ=new Set(["td","th"]),oT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KJ(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ree(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nee(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lx:OJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=sT(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function sT(e,t,n){if(t.type==="element")return XJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JJ(e,t,n);if(t.type==="mdxjsEsm")return ZJ(e,t);if(t.type==="root")return eee(e,t,n);if(t.type==="text")return tee(e,t)}function XJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lx,e.schema=i),e.ancestors.push(t);const o=lT(e,t.tagName,!1),s=iee(e,t);let a=hx(e,t);return GJ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!gJ(l):!0})),aT(e,s,o,t),fx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function QJ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}bd(e,t.position)}function ZJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bd(e,t.position)}function JJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lx,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:lT(e,t.name,!0),s=oee(e,t),a=hx(e,t);return aT(e,s,o,t),fx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function eee(e,t,n){const r={};return fx(r,hx(e,t)),e.create(t,e.Fragment,r,n)}function tee(e,t){return t.value}function aT(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nee(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function ree(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=cx(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iee(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&dx.call(t.properties,i)){const o=see(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&YJ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oee(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bd(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else bd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:WJ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=sT(e,o,s);a!==void 0&&n.push(a)}return n}function see(e,t,n){const r=_J(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uJ(n):PJ(n)),r.property==="style"){let i=typeof n=="object"?n:aee(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lee(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?EJ[r.property]||r.property:r.attribute,n]}}function aee(e,t){const n={};try{VJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Qn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=oT+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(qJ,uee)),n[s]=o}}function lT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=FD(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=FD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return dx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);bd(e)}function bd(e,t){const n=new Qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=oT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lee(e){const t={};let n;for(n in e)dx.call(e,n)&&(t[cee(n)]=e[n]);return t}function cee(e){let t=e.replace(UJ,dee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uee(e,t){return t.toUpperCase()}function dee(e){return"-"+e.toLowerCase()}const px={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fee={};function hee(e,t){const n=t||fee,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return cT(e,r,i)}function cT(e,t,n){if(pee(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return uT(e.children,t,n)}return Array.isArray(e)?uT(e,t,n):""}function uT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=cT(e[i],t,n);return r.join("")}function pee(e){return!!(e&&typeof e=="object")}const dT=document.createElement("i");function gx(e){const t="&"+e+";";dT.innerHTML=t;const n=dT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ii(e,t){return e.length>0?(Qi(e,e.length,0,t),e):t}const fT={}.hasOwnProperty;function gee(e){const t={};let n=-1;for(;++n<e.length;)mee(t,e[n]);return t}function mee(e,t){let n;for(n in t){const i=(fT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){fT.call(i,s)||(i[s]=[]);const a=o[s];vee(i[s],Array.isArray(a)?a:a?[a]:[])}}}function vee(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Qi(e,0,0,r)}function hT(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ec(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bee=ys(new RegExp("\\p{P}","u")),Zi=ys(/[A-Za-z]/),Hr=ys(/[\dA-Za-z]/),yee=ys(/[#-'*+\--9=?A-Z^-~]/);function mx(e){return e!==null&&(e<32||e===127)}const vx=ys(/\d/),xee=ys(/[\dA-Fa-f]/),pT=ys(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function br(e){return e!==null&&(e<0||e===32)}function It(e){return e===-2||e===-1||e===32}function wee(e){return pT(e)||bee(e)}const _ee=ys(/\s/);function ys(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Hr(e.charCodeAt(n+1))&&Hr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Yt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return It(l)?(e.enter(n),a(l)):t(l)}function a(l){return It(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const See={tokenize:Cee};function Cee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Yt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Je(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Eee={tokenize:Oee},gT={tokenize:Pee};function Oee(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}_(r);let A=P;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},k),A++;return Qi(t.events,O+1,0,t.events.slice(P)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gT,u,f)(C)}function u(C){return i&&S(),_(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(gT,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),_(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),y(C)}function y(C){if(C===null){x(e.exit("chunkFlow"),!0),_(0),e.consume(C);return}return Je(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),y)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const A=t.events.length;let L=A,F,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){j=t.events[L][1].end;break}F=!0}for(_(r),k=A;k<t.events.length;)t.events[k][1].end=Object.assign({},j),k++;Qi(t.events,L+1,0,t.events.slice(A)),t.events.length=k}}function _(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Pee(e,t,n){return Yt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mT(e){if(e===null||br(e)||_ee(e))return 1;if(wee(e))return 2}function bx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const yx={name:"attention",tokenize:Mee,resolveAll:kee};function kee(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);vT(f,-l),vT(g,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ii(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ii(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=ii(c,bx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ii(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ii(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Qi(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Mee(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=mT(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=mT(l),f=!u||u===2&&i||n.includes(l),g=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(u||!f)),t(l)}}function vT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dee={name:"autolink",tokenize:Tee};function Tee(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Zi(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||Hr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Hr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||mx(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):yee(p)?(e.consume(p),c):n(p)}function u(p){return Hr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||Hr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const sg={tokenize:Aee,partial:!0};function Aee(e,t,n){return r;function r(o){return It(o)?Yt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Je(o)?t(o):n(o)}}const bT={name:"blockQuote",tokenize:Iee,continuation:{tokenize:Nee},exit:Ree};function Iee(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return It(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Nee(e,t,n){const r=this;return i;function i(s){return It(s)?Yt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(bT,t,n)(s)}}function Ree(e){e.exit("blockQuote")}const yT={name:"characterEscape",tokenize:Lee};function Lee(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return pT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const xT={name:"characterReference",tokenize:Fee};function Fee(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Hr,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=xee,u):(e.enter("characterReferenceValue"),o=7,s=vx,u(f))}function u(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===Hr&&!gx(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),u):n(f)}}const wT={tokenize:jee,partial:!0},_T={name:"codeFenced",tokenize:$ee,concrete:!0};function $ee(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(s++,e.consume(k),u):s<3?n(k):(e.exit("codeFencedFenceSequence"),It(k)?Yt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Je(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(wT,y,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):It(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Yt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Je(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function y(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return o>0&&It(k)?Yt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Je(k)?e.check(wT,y,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Je(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,A,L){let F=0;return j;function j($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),z}function z($){return k.enter("codeFencedFence"),It($)?Yt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),oe($)):L($)}function oe($){return $===a?(F++,k.consume($),oe):F>=s?(k.exit("codeFencedFenceSequence"),It($)?Yt(k,ee,"whitespace")($):ee($)):L($)}function ee($){return $===null||Je($)?(k.exit("codeFencedFence"),A($)):L($)}}}function jee(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const xx={name:"codeIndented",tokenize:Bee},zee={tokenize:Vee,partial:!0};function Bee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Yt(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Je(c)?e.attempt(zee,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Je(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Vee(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Yt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Je(s)?i(s):n(s)}}const Hee={name:"codeText",tokenize:qee,resolve:Wee,previous:Uee};function Wee(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Uee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qee(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,u(f)):Je(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Je(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function ST(e){const t={};let n=-1,r,i,o,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Gee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Qi(e,i,n-i+1,a))}}return!c}function Gee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,g=-1,p=n,v=0,y=0;const x=[y];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(y=g+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const _=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+_.length-1]),Qi(e,S,2,_)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const Yee={tokenize:Qee,resolve:Xee},Kee={tokenize:Zee,partial:!0};function Xee(e){return ST(e),e}function Qee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Je(a)?e.check(Kee,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Zee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Yt(e,o,"linePrefix")}function o(s){if(s===null||Je(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function CT(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(_){return _===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(_),e.exit(o),g):_===null||_===32||_===41||mx(_)?n(_):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(_))}function g(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(a),g(_)):_===null||_===60||Je(_)?n(_):(e.consume(_),_===92?v:p)}function v(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function y(_){return!u&&(_===null||_===41||br(_))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(_)):u<c&&_===40?(e.consume(_),u++,y):_===41?(e.consume(_),u--,y):_===null||_===32||_===40||mx(_)?n(_):(e.consume(_),_===92?x:y)}function x(_){return _===40||_===41||_===92?(e.consume(_),y):y(_)}}function ET(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Je(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!It(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function OT(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Je(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Yt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===s||g===null||Je(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:u)}function f(g){return g===s||g===92?(e.consume(g),u):u(g)}}function yd(e,t){let n;return r;function r(i){return Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):It(i)?Yt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Jee={name:"definition",tokenize:tte},ete={tokenize:nte,partial:!0};function tte(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return ET.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ec(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return br(p)?yd(e,c)(p):c(p)}function c(p){return CT(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(ete,f,f)(p)}function f(p){return It(p)?Yt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Je(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function nte(e,t,n){return r;function r(a){return br(a)?yd(e,i)(a):n(a)}function i(a){return OT(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return It(a)?Yt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Je(a)?t(a):n(a)}}const rte={name:"hardBreakEscape",tokenize:ite};function ite(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Je(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const ote={name:"headingAtx",tokenize:ate,resolve:ste};function ste(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Qi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ate(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||br(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Je(u)?(e.exit("atxHeading"),t(u)):It(u)?Yt(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||br(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const lte=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],PT=["pre","script","style","textarea"],cte={name:"htmlFlow",tokenize:hte,resolveTo:fte,concrete:!0},ute={tokenize:gte,partial:!0},dte={tokenize:pte,partial:!0};function fte(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hte(e,t,n){const r=this;let i,o,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),g):N===47?(e.consume(N),o=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:D):Zi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function g(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,a=0,v):Zi(N)?(e.consume(N),i=4,r.interrupt?t:D):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:D):n(N)}function v(N){const le="CDATA[";return N===le.charCodeAt(a++)?(e.consume(N),a===le.length?r.interrupt?t:V:v):n(N)}function y(N){return Zi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||br(N)){const le=N===47,me=s.toLowerCase();return!le&&!o&&PT.includes(me)?(i=1,r.interrupt?t(N):V(N)):lte.includes(s.toLowerCase())?(i=6,le?(e.consume(N),_):r.interrupt?t(N):V(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?S(N):C(N))}return N===45||Hr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function _(N){return N===62?(e.consume(N),r.interrupt?t:V):n(N)}function S(N){return It(N)?(e.consume(N),S):j(N)}function C(N){return N===47?(e.consume(N),j):N===58||N===95||Zi(N)?(e.consume(N),P):It(N)?(e.consume(N),C):j(N)}function P(N){return N===45||N===46||N===58||N===95||Hr(N)?(e.consume(N),P):O(N)}function O(N){return N===61?(e.consume(N),k):It(N)?(e.consume(N),O):C(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):It(N)?(e.consume(N),k):L(N)}function A(N){return N===l?(e.consume(N),l=null,F):N===null||Je(N)?n(N):(e.consume(N),A)}function L(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||br(N)?O(N):(e.consume(N),L)}function F(N){return N===47||N===62||It(N)?C(N):n(N)}function j(N){return N===62?(e.consume(N),z):n(N)}function z(N){return N===null||Je(N)?V(N):It(N)?(e.consume(N),z):n(N)}function V(N){return N===45&&i===2?(e.consume(N),J):N===60&&i===1?(e.consume(N),q):N===62&&i===4?(e.consume(N),H):N===63&&i===3?(e.consume(N),D):N===93&&i===5?(e.consume(N),G):Je(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ute,ne,oe)(N)):N===null||Je(N)?(e.exit("htmlFlowData"),oe(N)):(e.consume(N),V)}function oe(N){return e.check(dte,ee,ne)(N)}function ee(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),$}function $(N){return N===null||Je(N)?oe(N):(e.enter("htmlFlowData"),V(N))}function J(N){return N===45?(e.consume(N),D):V(N)}function q(N){return N===47?(e.consume(N),s="",K):V(N)}function K(N){if(N===62){const le=s.toLowerCase();return PT.includes(le)?(e.consume(N),H):V(N)}return Zi(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),K):V(N)}function G(N){return N===93?(e.consume(N),D):V(N)}function D(N){return N===62?(e.consume(N),H):N===45&&i===2?(e.consume(N),D):V(N)}function H(N){return N===null||Je(N)?(e.exit("htmlFlowData"),ne(N)):(e.consume(N),H)}function ne(N){return e.exit("htmlFlow"),t(N)}}function pte(e,t,n){const r=this;return i;function i(s){return Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function gte(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(sg,t,n)}}const mte={name:"htmlText",tokenize:vte};function vte(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),O):D===63?(e.consume(D),C):Zi(D)?(e.consume(D),L):n(D)}function c(D){return D===45?(e.consume(D),u):D===91?(e.consume(D),o=0,v):Zi(D)?(e.consume(D),S):n(D)}function u(D){return D===45?(e.consume(D),p):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),g):Je(D)?(s=f,q(D)):(e.consume(D),f)}function g(D){return D===45?(e.consume(D),p):f(D)}function p(D){return D===62?J(D):D===45?g(D):f(D)}function v(D){const H="CDATA[";return D===H.charCodeAt(o++)?(e.consume(D),o===H.length?y:v):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),x):Je(D)?(s=y,q(D)):(e.consume(D),y)}function x(D){return D===93?(e.consume(D),_):y(D)}function _(D){return D===62?J(D):D===93?(e.consume(D),_):y(D)}function S(D){return D===null||D===62?J(D):Je(D)?(s=S,q(D)):(e.consume(D),S)}function C(D){return D===null?n(D):D===63?(e.consume(D),P):Je(D)?(s=C,q(D)):(e.consume(D),C)}function P(D){return D===62?J(D):C(D)}function O(D){return Zi(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Hr(D)?(e.consume(D),k):A(D)}function A(D){return Je(D)?(s=A,q(D)):It(D)?(e.consume(D),A):J(D)}function L(D){return D===45||Hr(D)?(e.consume(D),L):D===47||D===62||br(D)?F(D):n(D)}function F(D){return D===47?(e.consume(D),J):D===58||D===95||Zi(D)?(e.consume(D),j):Je(D)?(s=F,q(D)):It(D)?(e.consume(D),F):J(D)}function j(D){return D===45||D===46||D===58||D===95||Hr(D)?(e.consume(D),j):z(D)}function z(D){return D===61?(e.consume(D),V):Je(D)?(s=z,q(D)):It(D)?(e.consume(D),z):F(D)}function V(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):Je(D)?(s=V,q(D)):It(D)?(e.consume(D),V):(e.consume(D),ee)}function oe(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):Je(D)?(s=oe,q(D)):(e.consume(D),oe)}function ee(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||br(D)?F(D):(e.consume(D),ee)}function $(D){return D===47||D===62||br(D)?F(D):n(D)}function J(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function q(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),K}function K(D){return It(D)?Yt(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):G(D)}function G(D){return e.enter("htmlTextData"),s(D)}}const wx={name:"labelEnd",tokenize:Ste,resolveTo:_te,resolveAll:wte},bte={tokenize:Cte},yte={tokenize:Ete},xte={tokenize:Ote};function wte(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function _te(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=ii(a,e.slice(o+1,o+r+3)),a=ii(a,[["enter",u,t]]),a=ii(a,bx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ii(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ii(a,e.slice(s+1)),a=ii(a,[["exit",l,t]]),Qi(e,o,e.length,a),e}function Ste(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(ec(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(bte,u,s?u:f)(g):g===91?e.attempt(yte,u,s?c:f)(g):s?u(g):f(g)}function c(g){return e.attempt(xte,u,f)(g)}function u(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function Cte(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return br(f)?yd(e,o)(f):o(f)}function o(f){return f===41?u(f):CT(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return br(f)?yd(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?OT(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return br(f)?yd(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Ete(e,t,n){const r=this;return i;function i(a){return ET.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ec(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ote(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Pte={name:"labelStartImage",tokenize:kte,resolveAll:wx.resolveAll};function kte(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Mte={name:"labelStartLink",tokenize:Dte,resolveAll:wx.resolveAll};function Dte(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const _x={name:"lineEnding",tokenize:Tte};function Tte(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Yt(e,t,"linePrefix")}}const ag={name:"thematicBreak",tokenize:Ate};function Ate(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Je(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),It(c)?Yt(e,a,"whitespace")(c):a(c))}}const yr={name:"list",tokenize:Rte,continuation:{tokenize:Lte},exit:$te},Ite={tokenize:jte,partial:!0},Nte={tokenize:Fte,partial:!0};function Rte(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:vx(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ag,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return vx(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(sg,r.interrupt?n:u,e.attempt(Ite,g,f))}function u(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return It(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Lte(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sg,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Yt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!It(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nte,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Yt(e,e.attempt(yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Fte(e,t,n){const r=this;return Yt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function $te(e){e.exit(this.containerState.type)}function jte(e,t,n){const r=this;return Yt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!It(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const kT={name:"setextUnderline",tokenize:Bte,resolveTo:zte};function zte(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Bte(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),It(c)?Yt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Je(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Vte={tokenize:Hte};function Hte(e){const t=this,n=e.attempt(sg,r,e.attempt(this.parser.constructs.flowInitial,i,Yt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Yee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Wte={resolveAll:DT()},Ute=MT("string"),qte=MT("text");function MT(e){return{tokenize:t,resolveAll:DT(e==="text"?Gte:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function DT(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Gte(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Yte(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:A(O),check:A(k),interrupt:A(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:y,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(z){return s=ii(s,z),x(),s[s.length-1]!==null?[]:(L(t,0),c.events=bx(o,c.events,c),c.events)}function g(z,V){return Xte(p(z),V)}function p(z){return Kte(s,z)}function v(){const{line:z,column:V,offset:oe,_index:ee,_bufferIndex:$}=r;return{line:z,column:V,offset:oe,_index:ee,_bufferIndex:$}}function y(z){i[z.line]=z.column,j()}function x(){let z;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<V.length;)_(V.charCodeAt(r._bufferIndex));else _(V)}}function _(z){u=u(z)}function S(z){Je(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,j()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function C(z,V){const oe=V||{};return oe.type=z,oe.start=v(),c.events.push(["enter",oe,c]),a.push(oe),oe}function P(z){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(z,V){L(z,V.from)}function k(z,V){V.restore()}function A(z,V){return oe;function oe(ee,$,J){let q,K,G,D;return Array.isArray(ee)?ne(ee):"tokenize"in ee?ne([ee]):H(ee);function H(he){return de;function de(re){const Q=re!==null&&he[re],ie=re!==null&&he.null,we=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return ne(we)(re)}}function ne(he){return q=he,K=0,he.length===0?J:N(he[K])}function N(he){return de;function de(re){return D=F(),G=he,he.partial||(c.currentConstruct=he),he.name&&c.parser.constructs.disable.null.includes(he.name)?me():he.tokenize.call(V?Object.assign(Object.create(c),V):c,l,le,me)(re)}}function le(he){return z(G,D),$}function me(he){return D.restore(),++K<q.length?N(q[K]):J}}}function L(z,V){z.resolveAll&&!o.includes(z)&&o.push(z),z.resolve&&Qi(c.events,V,c.events.length-V,z.resolve(c.events.slice(V),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function F(){const z=v(),V=c.previous,oe=c.currentConstruct,ee=c.events.length,$=Array.from(a);return{restore:J,from:ee};function J(){r=z,c.previous=V,c.currentConstruct=oe,c.events.length=ee,a=$,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Kte(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Xte(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
498
+ `},kD=OZ(DZ)(PD),TZ={config:kZ},AZ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function MD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],MD(e[n],t[n]))}),SD(SD({},e),t)}var IZ={type:"cancelation",msg:"operation is manually canceled"};function Jy(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(IZ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var NZ=CZ.create({config:EZ,isInitialized:!1,resolve:null,reject:null,monaco:null}),DD=oZ(NZ,2),pd=DD[0],ig=DD[1];function RZ(e){var t=TZ.config(e),n=t.monaco,r=iZ(t,["monaco"]);ig(function(i){return{config:MD(i.config,r),monaco:n}})}function LZ(){var e=pd(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(ig({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Jy(ex);if(window.monaco&&window.monaco.editor)return TD(window.monaco),e.resolve(window.monaco),Jy(ex);AZ(FZ,jZ)(zZ)}return Jy(ex)}function FZ(e){return document.body.appendChild(e)}function $Z(e){var t=document.createElement("script");return e&&(t.src=e),t}function jZ(e){var t=pd(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=$Z("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function zZ(){var e=pd(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){TD(n),e.resolve(n)},function(n){e.reject(n)})}function TD(e){pd().monaco||ig({monaco:e})}function BZ(){return pd(function(e){var t=e.monaco;return t})}var ex=new Promise(function(e,t){return ig({resolve:e,reject:t})}),AD={config:RZ,init:LZ,__getMonacoInstance:BZ},VZ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},tx=VZ,HZ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},WZ=HZ;function UZ({children:e}){return m.createElement("div",{style:WZ.container},e)}var qZ=UZ,GZ=qZ;function YZ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...tx.wrapper,width:e,height:t},...s},!n&&m.createElement(GZ,null,r),m.createElement("div",{ref:i,style:{...tx.fullWidth,...!n&&tx.hide},className:o}))}var KZ=YZ,ID=m.memo(KZ);function XZ(e){m.useEffect(e,[])}var ND=XZ;function QZ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Br=QZ;function gd(){}function Ql(e,t,n,r){return ZZ(e,r)||JZ(e,t,n,r)}function ZZ(e,t){return e.editor.getModel(RD(e,t))}function JZ(e,t,n,r){return e.editor.createModel(t,n,r?RD(e,r):void 0)}function RD(e,t){return e.Uri.parse(t)}function eJ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=gd,onMount:_=gd}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(_),j=m.useRef(x),z=m.useRef(!1);ND(()=>{let $=AD.init();return $.then(J=>(A.current=J)&&O(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>k.current?ee():$.cancel()}),Br(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),J=Ql(A.current,e||"",r||n||"text",o||"");J!==$.getModel()&&$.setModel(J)}},[o],S),Br(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),J=Ql(A.current,t||"",i||n||"text",s||"");J!==$.getModel()&&$.setModel(J)}},[s],S),Br(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),Br(()=>{var $,J;(J=($=k.current)==null?void 0:$.getModel())==null||J.original.setValue(e||"")},[e],S),Br(()=>{let{original:$,modified:J}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(J,i||n||"text")},[n,r,i],S),Br(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],S),Br(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var q;if(!A.current)return;j.current(A.current);let $=Ql(A.current,e||"",r||n||"text",o||""),J=Ql(A.current,t||"",i||n||"text",s||"");(q=k.current)==null||q.setModel({original:$,modified:J})},[n,t,i,e,r,o,s]),oe=m.useCallback(()=>{var $;!z.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),z.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,A.current)},[S]),m.useEffect(()=>{!P&&!S&&oe()},[P,S,oe]);function ee(){var J,q,K,G;let $=(J=k.current)==null?void 0:J.getModel();a||((q=$==null?void 0:$.original)==null||q.dispose()),l||((K=$==null?void 0:$.modified)==null||K.dispose()),(G=k.current)==null||G.dispose()}return m.createElement(ID,{width:p,height:g,isEditorReady:S,loading:u,_ref:L,className:v,wrapperProps:y})}var tJ=eJ;m.memo(tJ);function nJ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var rJ=nJ,og=new Map;function iJ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:_=gd,onMount:S=gd,onChange:C,onValidate:P=gd}){let[O,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),z=m.useRef(null),V=m.useRef(S),oe=m.useRef(_),ee=m.useRef(),$=m.useRef(r),J=rJ(o),q=m.useRef(!1),K=m.useRef(!1);ND(()=>{let H=AD.init();return H.then(ne=>(F.current=ne)&&L(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>j.current?D():H.cancel()}),Br(()=>{var ne,N,le,me;let H=Ql(F.current,e||r||"",t||i||"",o||n||"");H!==((ne=j.current)==null?void 0:ne.getModel())&&(f&&og.set(J,(N=j.current)==null?void 0:N.saveViewState()),(le=j.current)==null||le.setModel(H),f&&((me=j.current)==null||me.restoreViewState(og.get(o))))},[o],O),Br(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),Br(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(K.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),K.current=!1))},[r],O),Br(()=>{var ne,N;let H=(ne=j.current)==null?void 0:ne.getModel();H&&i&&((N=F.current)==null||N.editor.setModelLanguage(H,i))},[i],O),Br(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),Br(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let G=m.useCallback(()=>{var H;if(!(!z.current||!F.current)&&!q.current){oe.current(F.current);let ne=o||n,N=Ql(F.current,r||e||"",t||i||"",ne||"");j.current=(H=F.current)==null?void 0:H.editor.create(z.current,{model:N,automaticLayout:!0,...c},u),f&&j.current.restoreViewState(og.get(ne)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),q.current=!0}},[e,t,n,r,i,o,c,u,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!A&&!O&&G()},[A,O,G]),$.current=r,m.useEffect(()=>{var H,ne;O&&C&&((H=ee.current)==null||H.dispose(),ee.current=(ne=j.current)==null?void 0:ne.onDidChangeModelContent(N=>{K.current||C(j.current.getValue(),N)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(ne=>{var le;let N=(le=j.current.getModel())==null?void 0:le.uri;if(N&&ne.find(me=>me.path===N.path)){let me=F.current.editor.getModelMarkers({resource:N});P==null||P(me)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function D(){var H,ne;(H=ee.current)==null||H.dispose(),g?f&&og.set(o,j.current.saveViewState()):(ne=j.current.getModel())==null||ne.dispose(),j.current.dispose()}return m.createElement(ID,{width:p,height:v,isEditorReady:O,loading:l,_ref:z,className:y,wrapperProps:x})}var oJ=iJ,LD=m.memo(oJ),nx=LD;function sJ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(6)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}function aJ({error:e,setShowAIDialog:t,setUserInputforAI:n,setTriggerAIRun:r}){return w.jsxs(D0,{openDelay:0,children:[w.jsx(T0,{asChild:!0,children:w.jsx(nt,{variant:"link",className:" p-0 h-5",children:w.jsx(rH,{className:"h-4 w-4 text-red-500"})})}),w.jsx(op,{align:"start",className:"w-[500px]",children:w.jsx("div",{className:"flex justify-between space-x-4",children:w.jsxs("div",{className:"grow space-y-1 flex flex-col ",children:[w.jsxs(nt,{onClick:()=>{t(!0),n(e),r(!0)},variant:"outline",children:[w.jsx(cH,{className:"h-4 w-4 mr-2"}),"Fix It"]}),w.jsx(Tl,{className:" min-h-0 max-h-[250px] overflow-scroll ",children:w.jsx("p",{className:" overflow-auto text-sm leading-relaxed font-mono ",children:e})})]})})})]})}function lJ({text:e,onCheckedChange:t,checked:n}){return w.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[w.jsx(od,{checked:n,onCheckedChange:t}),w.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function cJ(){const{authToken:e}=lo(),t=m.useRef(null),n=ve(a=>a.applyFilters),[r,i]=m.useState(""),o=ve(a=>a.filterValues),s=ve(a=>a.card.sql);return w.jsxs(D0,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await zc("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[w.jsx(T0,{asChild:!0,children:n&&w.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"|  Filter Query"})}),w.jsxs(op,{align:"end",className:"w-[600px] ",children:[w.jsx("div",{className:" flex justify-between space-x-4",children:w.jsx("div",{className:"bg-muted p-2 rounded-sm",children:w.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,w.jsx(E2,{onClick:()=>f3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),w.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[w.jsx(O2,{className:"h-4 w-4 opacity-70"}),w.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const rx=ue.forwardRef(({className:e,...t},n)=>w.jsx("textarea",{className:ke("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));rx.displayName="Textarea";function nhe(){}function rhe(){}function uJ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const dJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hJ={};function FD(e,t){return((t||hJ).jsx?fJ:dJ).test(e)}const pJ=/[ \t\n\f\r]/g;function gJ(e){return typeof e=="object"?e.type==="text"?$D(e.value):!1:$D(e)}function $D(e){return e.replace(pJ,"")===""}class md{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}md.prototype.property={},md.prototype.normal={},md.prototype.space=null;function jD(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new md(n,r,t)}function ix(e){return e.toLowerCase()}class ri{constructor(t,n){this.property=t,this.attribute=n}}ri.prototype.space=null,ri.prototype.boolean=!1,ri.prototype.booleanish=!1,ri.prototype.overloadedBoolean=!1,ri.prototype.number=!1,ri.prototype.commaSeparated=!1,ri.prototype.spaceSeparated=!1,ri.prototype.commaOrSpaceSeparated=!1,ri.prototype.mustUseProperty=!1,ri.prototype.defined=!1;let mJ=0;const ft=Aa(),wn=Aa(),zD=Aa(),Pe=Aa(),Yt=Aa(),Zl=Aa(),Vr=Aa();function Aa(){return 2**++mJ}const ox=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:wn,commaOrSpaceSeparated:Vr,commaSeparated:Zl,number:Pe,overloadedBoolean:zD,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),sx=Object.keys(ox);class ax extends ri{constructor(t,n,r,i){let o=-1;if(super(t,n),BD(this,"space",i),typeof r=="number")for(;++o<sx.length;){const s=sx[o];BD(this,sx[o],(r&ox[s])===ox[s])}}}ax.prototype.defined=!0;function BD(e,t,n){n&&(e[t]=n)}const vJ={}.hasOwnProperty;function Jl(e){const t={},n={};let r;for(r in e.properties)if(vJ.call(e.properties,r)){const i=e.properties[r],o=new ax(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ix(r)]=r,n[ix(o.attribute)]=r}return new md(t,n,e.space)}const VD=Jl({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),HD=Jl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function WD(e,t){return t in e?e[t]:t}function UD(e,t){return WD(e,t.toLowerCase())}const qD=Jl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:UD,properties:{xmlns:null,xmlnsXLink:null}}),GD=Jl({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:Yt,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Pe,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:Yt,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:wn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null}}),bJ=Jl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:UD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zl,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Yt,autoFocus:ft,autoPlay:ft,blocking:Yt,capture:null,charSet:null,checked:ft,cite:null,className:Yt,cols:Pe,colSpan:null,content:null,contentEditable:wn,controls:ft,controlsList:Yt,coords:Pe|Zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:zD,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Yt,height:Pe,hidden:ft,high:Pe,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:ft,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ft,optimum:Pe,pattern:null,ping:Yt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Yt,required:ft,reversed:ft,rows:Pe,rowSpan:Pe,sandbox:Yt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:wn,width:Pe,wrap:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Pe,security:null,unselectable:null}}),yJ=Jl({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:WD,properties:{about:Vr,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zl,g2:Zl,glyphName:Zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:Vr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vr,rev:Vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vr,requiredFeatures:Vr,requiredFonts:Vr,requiredFormats:Vr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:Vr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vr,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),xJ=/^data[-\w.:]+$/i,YD=/-[a-z]/g,wJ=/[A-Z]/g;function _J(e,t){const n=ix(t);let r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(YD,CJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!YD.test(o)){let s=o.replace(wJ,SJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ax}return new i(r,t)}function SJ(e){return"-"+e.toLowerCase()}function CJ(e){return e.charAt(1).toUpperCase()}const EJ={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},OJ=jD([HD,VD,qD,GD,bJ],"html"),lx=jD([HD,VD,qD,GD,yJ],"svg");function PJ(e){return e.join(" ").trim()}var KD={},XD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,kJ=/\n/g,MJ=/^\s*/,DJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,TJ=/^:\s*/,AJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,IJ=/^[;\s]*/,NJ=/^\s+|\s+$/g,RJ=`
499
+ `,QD="/",ZD="*",Ia="",LJ="comment",FJ="declaration",$J=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var y=v.match(kJ);y&&(n+=y.length);var x=v.lastIndexOf(RJ);r=~x?v.length-x:r+v.length}function o(){var v={line:n,column:r};return function(y){return y.position=new s(v),c(),y}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var y=new Error(t.source+":"+n+":"+r+": "+v);if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(v){var y=v.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function c(){l(MJ)}function u(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=o();if(!(QD!=e.charAt(0)||ZD!=e.charAt(1))){for(var y=2;Ia!=e.charAt(y)&&(ZD!=e.charAt(y)||QD!=e.charAt(y+1));)++y;if(y+=2,Ia===e.charAt(y-1))return a("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,v({type:LJ,comment:x})}}function g(){var v=o(),y=l(DJ);if(y){if(f(),!l(TJ))return a("property missing ':'");var x=l(AJ),_=v({type:FJ,property:JD(y[0].replace(XD,Ia)),value:x?JD(x[0].replace(XD,Ia)):Ia});return l(IJ),_}}function p(){var v=[];u(v);for(var y;y=g();)y!==!1&&(v.push(y),u(v));return v}return c(),p()};function JD(e){return e?e.replace(NJ,Ia):Ia}var jJ=Ho&&Ho.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(KD,"__esModule",{value:!0});var zJ=jJ($J);function BJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,zJ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var eT=KD.default=BJ;const VJ=eT.default||eT,tT=nT("end"),cx=nT("start");function nT(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function HJ(e){const t=cx(e),n=tT(e);if(t&&n)return{start:t,end:n}}function vd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rT(e.position):"start"in e||"end"in e?rT(e):"line"in e||"column"in e?ux(e):""}function ux(e){return iT(e&&e.line)+":"+iT(e&&e.column)}function rT(e){return ux(e&&e.start)+"-"+ux(e&&e.end)}function iT(e){return e&&typeof e=="number"?e:1}class Qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=vd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Qn.prototype.file="",Qn.prototype.name="",Qn.prototype.reason="",Qn.prototype.message="",Qn.prototype.stack="",Qn.prototype.column=void 0,Qn.prototype.line=void 0,Qn.prototype.ancestors=void 0,Qn.prototype.cause=void 0,Qn.prototype.fatal=void 0,Qn.prototype.place=void 0,Qn.prototype.ruleId=void 0,Qn.prototype.source=void 0;const dx={}.hasOwnProperty,WJ=new Map,UJ=/[A-Z]/g,qJ=/-([a-z])/g,GJ=new Set(["table","tbody","thead","tfoot","tr"]),YJ=new Set(["td","th"]),oT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KJ(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ree(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nee(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lx:OJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=sT(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function sT(e,t,n){if(t.type==="element")return XJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JJ(e,t,n);if(t.type==="mdxjsEsm")return ZJ(e,t);if(t.type==="root")return eee(e,t,n);if(t.type==="text")return tee(e,t)}function XJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=lx,e.schema=i),e.ancestors.push(t);const o=lT(e,t.tagName,!1),s=iee(e,t);let a=hx(e,t);return GJ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!gJ(l):!0})),aT(e,s,o,t),fx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function QJ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}bd(e,t.position)}function ZJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bd(e,t.position)}function JJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=lx,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:lT(e,t.name,!0),s=oee(e,t),a=hx(e,t);return aT(e,s,o,t),fx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function eee(e,t,n){const r={};return fx(r,hx(e,t)),e.create(t,e.Fragment,r,n)}function tee(e,t){return t.value}function aT(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nee(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function ree(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=cx(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iee(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&dx.call(t.properties,i)){const o=see(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&YJ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oee(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bd(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else bd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:WJ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=sT(e,o,s);a!==void 0&&n.push(a)}return n}function see(e,t,n){const r=_J(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uJ(n):PJ(n)),r.property==="style"){let i=typeof n=="object"?n:aee(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lee(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?EJ[r.property]||r.property:r.attribute,n]}}function aee(e,t){const n={};try{VJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Qn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=oT+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(qJ,uee)),n[s]=o}}function lT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=FD(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=FD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return dx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);bd(e)}function bd(e,t){const n=new Qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=oT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lee(e){const t={};let n;for(n in e)dx.call(e,n)&&(t[cee(n)]=e[n]);return t}function cee(e){let t=e.replace(UJ,dee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uee(e,t){return t.toUpperCase()}function dee(e){return"-"+e.toLowerCase()}const px={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fee={};function hee(e,t){const n=t||fee,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return cT(e,r,i)}function cT(e,t,n){if(pee(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return uT(e.children,t,n)}return Array.isArray(e)?uT(e,t,n):""}function uT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=cT(e[i],t,n);return r.join("")}function pee(e){return!!(e&&typeof e=="object")}const dT=document.createElement("i");function gx(e){const t="&"+e+";";dT.innerHTML=t;const n=dT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ii(e,t){return e.length>0?(Qi(e,e.length,0,t),e):t}const fT={}.hasOwnProperty;function gee(e){const t={};let n=-1;for(;++n<e.length;)mee(t,e[n]);return t}function mee(e,t){let n;for(n in t){const i=(fT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){fT.call(i,s)||(i[s]=[]);const a=o[s];vee(i[s],Array.isArray(a)?a:a?[a]:[])}}}function vee(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Qi(e,0,0,r)}function hT(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ec(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bee=ys(new RegExp("\\p{P}","u")),Zi=ys(/[A-Za-z]/),Hr=ys(/[\dA-Za-z]/),yee=ys(/[#-'*+\--9=?A-Z^-~]/);function mx(e){return e!==null&&(e<32||e===127)}const vx=ys(/\d/),xee=ys(/[\dA-Fa-f]/),pT=ys(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function br(e){return e!==null&&(e<0||e===32)}function It(e){return e===-2||e===-1||e===32}function wee(e){return pT(e)||bee(e)}const _ee=ys(/\s/);function ys(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Hr(e.charCodeAt(n+1))&&Hr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Kt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return It(l)?(e.enter(n),a(l)):t(l)}function a(l){return It(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const See={tokenize:Cee};function Cee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Kt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Je(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Eee={tokenize:Oee},gT={tokenize:Pee};function Oee(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}_(r);let A=P;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},k),A++;return Qi(t.events,O+1,0,t.events.slice(P)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gT,u,f)(C)}function u(C){return i&&S(),_(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(gT,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),_(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),y(C)}function y(C){if(C===null){x(e.exit("chunkFlow"),!0),_(0),e.consume(C);return}return Je(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),y)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const A=t.events.length;let L=A,F,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){j=t.events[L][1].end;break}F=!0}for(_(r),k=A;k<t.events.length;)t.events[k][1].end=Object.assign({},j),k++;Qi(t.events,L+1,0,t.events.slice(A)),t.events.length=k}}function _(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Pee(e,t,n){return Kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mT(e){if(e===null||br(e)||_ee(e))return 1;if(wee(e))return 2}function bx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const yx={name:"attention",tokenize:Mee,resolveAll:kee};function kee(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);vT(f,-l),vT(g,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ii(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ii(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=ii(c,bx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ii(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ii(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Qi(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Mee(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=mT(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=mT(l),f=!u||u===2&&i||n.includes(l),g=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(u||!f)),t(l)}}function vT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dee={name:"autolink",tokenize:Tee};function Tee(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Zi(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||Hr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Hr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||mx(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):yee(p)?(e.consume(p),c):n(p)}function u(p){return Hr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||Hr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const sg={tokenize:Aee,partial:!0};function Aee(e,t,n){return r;function r(o){return It(o)?Kt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Je(o)?t(o):n(o)}}const bT={name:"blockQuote",tokenize:Iee,continuation:{tokenize:Nee},exit:Ree};function Iee(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return It(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Nee(e,t,n){const r=this;return i;function i(s){return It(s)?Kt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(bT,t,n)(s)}}function Ree(e){e.exit("blockQuote")}const yT={name:"characterEscape",tokenize:Lee};function Lee(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return pT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const xT={name:"characterReference",tokenize:Fee};function Fee(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Hr,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=xee,u):(e.enter("characterReferenceValue"),o=7,s=vx,u(f))}function u(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===Hr&&!gx(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),u):n(f)}}const wT={tokenize:jee,partial:!0},_T={name:"codeFenced",tokenize:$ee,concrete:!0};function $ee(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(s++,e.consume(k),u):s<3?n(k):(e.exit("codeFencedFenceSequence"),It(k)?Kt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Je(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(wT,y,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):It(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Kt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Je(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function y(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return o>0&&It(k)?Kt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Je(k)?e.check(wT,y,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Je(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,A,L){let F=0;return j;function j($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),z}function z($){return k.enter("codeFencedFence"),It($)?Kt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),oe($)):L($)}function oe($){return $===a?(F++,k.consume($),oe):F>=s?(k.exit("codeFencedFenceSequence"),It($)?Kt(k,ee,"whitespace")($):ee($)):L($)}function ee($){return $===null||Je($)?(k.exit("codeFencedFence"),A($)):L($)}}}function jee(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const xx={name:"codeIndented",tokenize:Bee},zee={tokenize:Vee,partial:!0};function Bee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Kt(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Je(c)?e.attempt(zee,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Je(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Vee(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Kt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Je(s)?i(s):n(s)}}const Hee={name:"codeText",tokenize:qee,resolve:Wee,previous:Uee};function Wee(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Uee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qee(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,u(f)):Je(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Je(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function ST(e){const t={};let n=-1,r,i,o,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Gee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Qi(e,i,n-i+1,a))}}return!c}function Gee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,g=-1,p=n,v=0,y=0;const x=[y];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(y=g+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const _=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+_.length-1]),Qi(e,S,2,_)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const Yee={tokenize:Qee,resolve:Xee},Kee={tokenize:Zee,partial:!0};function Xee(e){return ST(e),e}function Qee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Je(a)?e.check(Kee,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Zee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Kt(e,o,"linePrefix")}function o(s){if(s===null||Je(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function CT(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(_){return _===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(_),e.exit(o),g):_===null||_===32||_===41||mx(_)?n(_):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(_))}function g(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(a),g(_)):_===null||_===60||Je(_)?n(_):(e.consume(_),_===92?v:p)}function v(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function y(_){return!u&&(_===null||_===41||br(_))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(_)):u<c&&_===40?(e.consume(_),u++,y):_===41?(e.consume(_),u--,y):_===null||_===32||_===40||mx(_)?n(_):(e.consume(_),_===92?x:y)}function x(_){return _===40||_===41||_===92?(e.consume(_),y):y(_)}}function ET(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Je(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!It(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function OT(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Je(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Kt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===s||g===null||Je(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:u)}function f(g){return g===s||g===92?(e.consume(g),u):u(g)}}function yd(e,t){let n;return r;function r(i){return Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):It(i)?Kt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Jee={name:"definition",tokenize:tte},ete={tokenize:nte,partial:!0};function tte(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return ET.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ec(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return br(p)?yd(e,c)(p):c(p)}function c(p){return CT(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(ete,f,f)(p)}function f(p){return It(p)?Kt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Je(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function nte(e,t,n){return r;function r(a){return br(a)?yd(e,i)(a):n(a)}function i(a){return OT(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return It(a)?Kt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Je(a)?t(a):n(a)}}const rte={name:"hardBreakEscape",tokenize:ite};function ite(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Je(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const ote={name:"headingAtx",tokenize:ate,resolve:ste};function ste(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Qi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ate(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||br(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Je(u)?(e.exit("atxHeading"),t(u)):It(u)?Kt(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||br(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const lte=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],PT=["pre","script","style","textarea"],cte={name:"htmlFlow",tokenize:hte,resolveTo:fte,concrete:!0},ute={tokenize:gte,partial:!0},dte={tokenize:pte,partial:!0};function fte(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hte(e,t,n){const r=this;let i,o,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),g):N===47?(e.consume(N),o=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:D):Zi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function g(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,a=0,v):Zi(N)?(e.consume(N),i=4,r.interrupt?t:D):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:D):n(N)}function v(N){const le="CDATA[";return N===le.charCodeAt(a++)?(e.consume(N),a===le.length?r.interrupt?t:V:v):n(N)}function y(N){return Zi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||br(N)){const le=N===47,me=s.toLowerCase();return!le&&!o&&PT.includes(me)?(i=1,r.interrupt?t(N):V(N)):lte.includes(s.toLowerCase())?(i=6,le?(e.consume(N),_):r.interrupt?t(N):V(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?S(N):C(N))}return N===45||Hr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function _(N){return N===62?(e.consume(N),r.interrupt?t:V):n(N)}function S(N){return It(N)?(e.consume(N),S):j(N)}function C(N){return N===47?(e.consume(N),j):N===58||N===95||Zi(N)?(e.consume(N),P):It(N)?(e.consume(N),C):j(N)}function P(N){return N===45||N===46||N===58||N===95||Hr(N)?(e.consume(N),P):O(N)}function O(N){return N===61?(e.consume(N),k):It(N)?(e.consume(N),O):C(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):It(N)?(e.consume(N),k):L(N)}function A(N){return N===l?(e.consume(N),l=null,F):N===null||Je(N)?n(N):(e.consume(N),A)}function L(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||br(N)?O(N):(e.consume(N),L)}function F(N){return N===47||N===62||It(N)?C(N):n(N)}function j(N){return N===62?(e.consume(N),z):n(N)}function z(N){return N===null||Je(N)?V(N):It(N)?(e.consume(N),z):n(N)}function V(N){return N===45&&i===2?(e.consume(N),J):N===60&&i===1?(e.consume(N),q):N===62&&i===4?(e.consume(N),H):N===63&&i===3?(e.consume(N),D):N===93&&i===5?(e.consume(N),G):Je(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ute,ne,oe)(N)):N===null||Je(N)?(e.exit("htmlFlowData"),oe(N)):(e.consume(N),V)}function oe(N){return e.check(dte,ee,ne)(N)}function ee(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),$}function $(N){return N===null||Je(N)?oe(N):(e.enter("htmlFlowData"),V(N))}function J(N){return N===45?(e.consume(N),D):V(N)}function q(N){return N===47?(e.consume(N),s="",K):V(N)}function K(N){if(N===62){const le=s.toLowerCase();return PT.includes(le)?(e.consume(N),H):V(N)}return Zi(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),K):V(N)}function G(N){return N===93?(e.consume(N),D):V(N)}function D(N){return N===62?(e.consume(N),H):N===45&&i===2?(e.consume(N),D):V(N)}function H(N){return N===null||Je(N)?(e.exit("htmlFlowData"),ne(N)):(e.consume(N),H)}function ne(N){return e.exit("htmlFlow"),t(N)}}function pte(e,t,n){const r=this;return i;function i(s){return Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function gte(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(sg,t,n)}}const mte={name:"htmlText",tokenize:vte};function vte(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),O):D===63?(e.consume(D),C):Zi(D)?(e.consume(D),L):n(D)}function c(D){return D===45?(e.consume(D),u):D===91?(e.consume(D),o=0,v):Zi(D)?(e.consume(D),S):n(D)}function u(D){return D===45?(e.consume(D),p):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),g):Je(D)?(s=f,q(D)):(e.consume(D),f)}function g(D){return D===45?(e.consume(D),p):f(D)}function p(D){return D===62?J(D):D===45?g(D):f(D)}function v(D){const H="CDATA[";return D===H.charCodeAt(o++)?(e.consume(D),o===H.length?y:v):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),x):Je(D)?(s=y,q(D)):(e.consume(D),y)}function x(D){return D===93?(e.consume(D),_):y(D)}function _(D){return D===62?J(D):D===93?(e.consume(D),_):y(D)}function S(D){return D===null||D===62?J(D):Je(D)?(s=S,q(D)):(e.consume(D),S)}function C(D){return D===null?n(D):D===63?(e.consume(D),P):Je(D)?(s=C,q(D)):(e.consume(D),C)}function P(D){return D===62?J(D):C(D)}function O(D){return Zi(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Hr(D)?(e.consume(D),k):A(D)}function A(D){return Je(D)?(s=A,q(D)):It(D)?(e.consume(D),A):J(D)}function L(D){return D===45||Hr(D)?(e.consume(D),L):D===47||D===62||br(D)?F(D):n(D)}function F(D){return D===47?(e.consume(D),J):D===58||D===95||Zi(D)?(e.consume(D),j):Je(D)?(s=F,q(D)):It(D)?(e.consume(D),F):J(D)}function j(D){return D===45||D===46||D===58||D===95||Hr(D)?(e.consume(D),j):z(D)}function z(D){return D===61?(e.consume(D),V):Je(D)?(s=z,q(D)):It(D)?(e.consume(D),z):F(D)}function V(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):Je(D)?(s=V,q(D)):It(D)?(e.consume(D),V):(e.consume(D),ee)}function oe(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):Je(D)?(s=oe,q(D)):(e.consume(D),oe)}function ee(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||br(D)?F(D):(e.consume(D),ee)}function $(D){return D===47||D===62||br(D)?F(D):n(D)}function J(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function q(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),K}function K(D){return It(D)?Kt(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):G(D)}function G(D){return e.enter("htmlTextData"),s(D)}}const wx={name:"labelEnd",tokenize:Ste,resolveTo:_te,resolveAll:wte},bte={tokenize:Cte},yte={tokenize:Ete},xte={tokenize:Ote};function wte(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function _te(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=ii(a,e.slice(o+1,o+r+3)),a=ii(a,[["enter",u,t]]),a=ii(a,bx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ii(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ii(a,e.slice(s+1)),a=ii(a,[["exit",l,t]]),Qi(e,o,e.length,a),e}function Ste(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(ec(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(bte,u,s?u:f)(g):g===91?e.attempt(yte,u,s?c:f)(g):s?u(g):f(g)}function c(g){return e.attempt(xte,u,f)(g)}function u(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function Cte(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return br(f)?yd(e,o)(f):o(f)}function o(f){return f===41?u(f):CT(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return br(f)?yd(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?OT(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return br(f)?yd(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Ete(e,t,n){const r=this;return i;function i(a){return ET.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ec(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ote(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Pte={name:"labelStartImage",tokenize:kte,resolveAll:wx.resolveAll};function kte(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Mte={name:"labelStartLink",tokenize:Dte,resolveAll:wx.resolveAll};function Dte(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const _x={name:"lineEnding",tokenize:Tte};function Tte(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Kt(e,t,"linePrefix")}}const ag={name:"thematicBreak",tokenize:Ate};function Ate(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Je(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),It(c)?Kt(e,a,"whitespace")(c):a(c))}}const yr={name:"list",tokenize:Rte,continuation:{tokenize:Lte},exit:$te},Ite={tokenize:jte,partial:!0},Nte={tokenize:Fte,partial:!0};function Rte(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:vx(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ag,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return vx(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(sg,r.interrupt?n:u,e.attempt(Ite,g,f))}function u(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return It(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Lte(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sg,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Kt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!It(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nte,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Kt(e,e.attempt(yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Fte(e,t,n){const r=this;return Kt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function $te(e){e.exit(this.containerState.type)}function jte(e,t,n){const r=this;return Kt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!It(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const kT={name:"setextUnderline",tokenize:Bte,resolveTo:zte};function zte(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Bte(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),It(c)?Kt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Je(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Vte={tokenize:Hte};function Hte(e){const t=this,n=e.attempt(sg,r,e.attempt(this.parser.constructs.flowInitial,i,Kt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Yee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Wte={resolveAll:DT()},Ute=MT("string"),qte=MT("text");function MT(e){return{tokenize:t,resolveAll:DT(e==="text"?Gte:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function DT(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Gte(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Yte(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:A(O),check:A(k),interrupt:A(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:y,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(z){return s=ii(s,z),x(),s[s.length-1]!==null?[]:(L(t,0),c.events=bx(o,c.events,c),c.events)}function g(z,V){return Xte(p(z),V)}function p(z){return Kte(s,z)}function v(){const{line:z,column:V,offset:oe,_index:ee,_bufferIndex:$}=r;return{line:z,column:V,offset:oe,_index:ee,_bufferIndex:$}}function y(z){i[z.line]=z.column,j()}function x(){let z;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<V.length;)_(V.charCodeAt(r._bufferIndex));else _(V)}}function _(z){u=u(z)}function S(z){Je(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,j()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function C(z,V){const oe=V||{};return oe.type=z,oe.start=v(),c.events.push(["enter",oe,c]),a.push(oe),oe}function P(z){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(z,V){L(z,V.from)}function k(z,V){V.restore()}function A(z,V){return oe;function oe(ee,$,J){let q,K,G,D;return Array.isArray(ee)?ne(ee):"tokenize"in ee?ne([ee]):H(ee);function H(he){return de;function de(re){const Q=re!==null&&he[re],ie=re!==null&&he.null,we=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return ne(we)(re)}}function ne(he){return q=he,K=0,he.length===0?J:N(he[K])}function N(he){return de;function de(re){return D=F(),G=he,he.partial||(c.currentConstruct=he),he.name&&c.parser.constructs.disable.null.includes(he.name)?me():he.tokenize.call(V?Object.assign(Object.create(c),V):c,l,le,me)(re)}}function le(he){return z(G,D),$}function me(he){return D.restore(),++K<q.length?N(q[K]):J}}}function L(z,V){z.resolveAll&&!o.includes(z)&&o.push(z),z.resolve&&Qi(c.events,V,c.events.length-V,z.resolve(c.events.slice(V),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function F(){const z=v(),V=c.previous,oe=c.currentConstruct,ee=c.events.length,$=Array.from(a);return{restore:J,from:ee};function J(){r=z,c.previous=V,c.currentConstruct=oe,c.events.length=ee,a=$,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Kte(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Xte(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
500
500
  `;break}case-3:{s=`\r
501
501
  `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Qte=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Jee},disable:{null:[]},document:{42:yr,43:yr,45:yr,48:yr,49:yr,50:yr,51:yr,52:yr,53:yr,54:yr,55:yr,56:yr,57:yr,62:bT},flow:{35:ote,42:ag,45:[kT,ag],60:cte,61:kT,95:ag,96:_T,126:_T},flowInitial:{[-2]:xx,[-1]:xx,32:xx},insideSpan:{null:[yx,Wte]},string:{38:xT,92:yT},text:{[-5]:_x,[-4]:_x,[-3]:_x,33:Pte,38:xT,42:yx,60:[Dee,mte],91:Mte,92:[rte,yT],93:wx,95:yx,96:Hee}},Symbol.toStringTag,{value:"Module"}));function Zte(e){const n=gee([Qte,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(See),document:i(Eee),flow:i(Vte),string:i(Ute),text:i(qte)};return r;function i(o){return s;function s(a){return Yte(r,o,a)}}}function Jte(e){for(;!ST(e););return e}const TT=/[\0\t\n\r]/g;function ene(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,f,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(TT.lastIndex=f,c=TT.exec(o),g=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(g),!c){t=o.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(o.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const tne=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nne(e){return e.replace(tne,rne)}function rne(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return hT(n.slice(o?2:1),o?16:10)}return gx(n)||e}const AT={}.hasOwnProperty;function ine(e,t,n){return typeof t!="string"&&(n=t,t=void 0),one(n)(Jte(Zte(n).document().write(ene()(e,t,!0))))}function one(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Qe),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(je),blockQuote:o(Q),characterEscape:F,characterReference:F,codeFenced:o(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ie,s),codeText:o(we,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(U),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ie),hardBreakEscape:o(We),hardBreakTrailing:o(We),htmlFlow:o(Xe,s),htmlFlowData:F,htmlText:o(Xe,s),htmlTextData:F,image:o(be),label:s,link:o(Qe),listItem:o(Dt),listItemValue:g,listOrdered:o(it,f),listUnordered:o(it),paragraph:o(bt),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(je),strong:o(En),thematicBreak:o(Do)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:re,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:he,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:l(_),codeText:l($),codeTextData:j,data:j,definition:l(),definitionDestinationString:P,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(oe),htmlFlowData:j,htmlText:l(ee),htmlTextData:j,image:l(q),label:G,labelText:K,lineEnding:z,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:D,resourceTitleString:H,resource:ne,setextHeading:l(L),setextHeadingLineSequence:A,setextHeadingText:k,strong:l(),thematicBreak:l()}};IT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let Ee={type:"root",children:[]};const Re={stack:[Ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},qe=[];let Ze=-1;for(;++Ze<fe.length;)if(fe[Ze][1].type==="listOrdered"||fe[Ze][1].type==="listUnordered")if(fe[Ze][0]==="enter")qe.push(Ze);else{const Nt=qe.pop();Ze=i(fe,Nt,Ze)}for(Ze=-1;++Ze<fe.length;){const Nt=t[fe[Ze][0]];AT.call(Nt,fe[Ze][1].type)&&Nt[fe[Ze][1].type].call(Object.assign({sliceSerialize:fe[Ze][2].sliceSerialize},Re),fe[Ze][1])}if(Re.tokenStack.length>0){const Nt=Re.tokenStack[Re.tokenStack.length-1];(Nt[1]||NT).call(Re,void 0,Nt[0])}for(Ee.position={start:xs(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:xs(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)Ee=t.transforms[Ze](Ee)||Ee;return Ee}function i(fe,Ee,Re){let qe=Ee-1,Ze=-1,Nt=!1,Bt,gn,or,Vn;for(;++qe<=Re;){const mn=fe[qe];switch(mn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mn[0]==="enter"?Ze++:Ze--,Vn=void 0;break}case"lineEndingBlank":{mn[0]==="enter"&&(Bt&&!Vn&&!Ze&&!or&&(or=qe),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Ze&&mn[0]==="enter"&&mn[1].type==="listItemPrefix"||Ze===-1&&mn[0]==="exit"&&(mn[1].type==="listUnordered"||mn[1].type==="listOrdered")){if(Bt){let wr=qe;for(gn=void 0;wr--;){const Hn=fe[wr];if(Hn[1].type==="lineEnding"||Hn[1].type==="lineEndingBlank"){if(Hn[0]==="exit")continue;gn&&(fe[gn][1].type="lineEndingBlank",Nt=!0),Hn[1].type="lineEnding",gn=wr}else if(!(Hn[1].type==="linePrefix"||Hn[1].type==="blockQuotePrefix"||Hn[1].type==="blockQuotePrefixWhitespace"||Hn[1].type==="blockQuoteMarker"||Hn[1].type==="listItemIndent"))break}or&&(!gn||or<gn)&&(Bt._spread=!0),Bt.end=Object.assign({},gn?fe[gn][1].start:mn[1].end),fe.splice(gn||qe,0,["exit",Bt,mn[2]]),qe++,Re++}if(mn[1].type==="listItemPrefix"){const wr={type:"listItem",_spread:!1,start:Object.assign({},mn[1].start),end:void 0};Bt=wr,fe.splice(qe,0,["enter",wr,mn[2]]),qe++,Re++,or=void 0,Vn=!0}}}return fe[Ee][1]._spread=Nt,Re}function o(fe,Ee){return Re;function Re(qe){a.call(this,fe(qe),qe),Ee&&Ee.call(this,qe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,Ee,Re){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Ee,Re]),fe.position={start:xs(Ee.start),end:void 0}}function l(fe){return Ee;function Ee(Re){fe&&fe.call(this,Re),c.call(this,Re)}}function c(fe,Ee){const Re=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==fe.type&&(Ee?Ee.call(this,fe,qe[0]):(qe[1]||NT).call(this,fe,qe[0]));else throw new Error("Cannot close `"+fe.type+"` ("+vd({start:fe.start,end:fe.end})+"): it’s not open");Re.position.end=xs(fe.end)}function u(){return hee(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=fe}function v(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=fe}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=fe.replace(/(\r?\n|\r)$/g,"")}function S(fe){const Ee=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ee,Re.identifier=ec(this.sliceSerialize(fe)).toLowerCase()}function C(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=fe}function P(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=fe}function O(fe){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Re=this.sliceSerialize(fe).length;Ee.depth=Re}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function F(fe){const Re=this.stack[this.stack.length-1].children;let qe=Re[Re.length-1];(!qe||qe.type!=="text")&&(qe=cn(),qe.position={start:xs(fe.start),end:void 0},Re.push(qe)),this.stack.push(qe)}function j(fe){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(fe),Ee.position.end=xs(fe.end)}function z(fe){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Ee.children[Ee.children.length-1];Re.position.end=xs(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(F.call(this,fe),j.call(this,fe))}function V(){this.data.atHardBreak=!0}function oe(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=fe}function ee(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=fe}function $(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=fe}function J(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ee,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ee,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(fe){const Ee=this.sliceSerialize(fe),Re=this.stack[this.stack.length-2];Re.label=nne(Ee),Re.identifier=ec(Ee).toLowerCase()}function G(){const fe=this.stack[this.stack.length-1],Ee=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const qe=fe.children;Re.children=qe}else Re.alt=Ee}function D(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=fe}function H(){const fe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=fe}function ne(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function le(fe){const Ee=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ee,Re.identifier=ec(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function me(fe){this.data.characterReferenceType=fe.type}function he(fe){const Ee=this.sliceSerialize(fe),Re=this.data.characterReferenceType;let qe;Re?(qe=hT(Ee,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=gx(Ee);const Ze=this.stack.pop();Ze.value+=qe,Ze.position.end=xs(fe.end)}function de(fe){j.call(this,fe);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(fe)}function re(fe){j.call(this,fe);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(fe)}function Q(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function U(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function be(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function it(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function Dt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function En(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function Do(){return{type:"thematicBreak"}}}function xs(e){return{line:e.line,column:e.column,offset:e.offset}}function IT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?IT(e,r):sne(e,r)}}function sne(e,t){let n;for(n in t)if(AT.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function NT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vd({start:t.start,end:t.end})+") is still open")}function ane(e){const t=this;t.parser=n;function n(r){return ine(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lne(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function cne(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
502
502
  `}]}function une(e,t){const n=t.value?t.value+`