genus-ui 2.25.31 → 2.25.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +250 -247
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
- package/types/genus-slider/index.d.ts +1 -0
package/dist/index.umd.js
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
font-family: var(--textarea-label-font-family, 'Sofia Pro Regular');
|
|
61
61
|
font-size: var(--textarea-label-font-size, 1rem);
|
|
62
62
|
}
|
|
63
|
-
`;var va=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,
|
|
63
|
+
`;var va=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Ut=(i,t,e,n)=>{for(var s=n>1?void 0:n?Ca(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&va(t,e,s),s};b.GenusTextArea=class extends u.LitElement{constructor(){super(...arguments),this.labelText="",this.inputValue="",this.withoutLabel=!1,this.placeholderText="",this.readOnly=!1,this.getInputValue=t=>{this.dispatchEvent(new CustomEvent("typed",{detail:t.target.value}))},this._targetInput=null}updated(){this.inputValue===""&&this._targetInput!=null&&(this._targetInput.value="")}render(){return Gt.when(this.withoutLabel,()=>u.html`
|
|
64
64
|
<div class='form-field form-field--without-label'>
|
|
65
65
|
${this.readOnly?u.html`<textarea class='input-control' rows='5' readonly>${this.inputValue}</textarea>`:u.html`<textarea class='input-control' rows='5' @input=${this.getInputValue} placeholder='${this.placeholderText}'>${this.inputValue}</textarea>`}
|
|
66
66
|
</div>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<label class='input-label'>${this.labelText}</label>
|
|
70
70
|
${this.readOnly?u.html`<textarea class='input-control' rows='5' readonly>${this.inputValue}</textarea>`:u.html`<textarea class='input-control' rows='5' @input=${this.getInputValue} placeholder='${this.placeholderText}'>${this.inputValue}</textarea>`}
|
|
71
71
|
</div>
|
|
72
|
-
`)}},b.GenusTextArea.styles=[Ba,Ga,Ya,ya,xa],
|
|
72
|
+
`)}},b.GenusTextArea.styles=[Ba,Ga,Ya,ya,xa],Ut([m.property({attribute:"label-text"})],b.GenusTextArea.prototype,"labelText",2),Ut([m.property({attribute:"input-value"})],b.GenusTextArea.prototype,"inputValue",2),Ut([m.property({attribute:"without-label",type:Boolean})],b.GenusTextArea.prototype,"withoutLabel",2),Ut([m.property({attribute:"placeholder-text"})],b.GenusTextArea.prototype,"placeholderText",2),Ut([m.property({attribute:"read-only",type:Boolean})],b.GenusTextArea.prototype,"readOnly",2),Ut([m.state()],b.GenusTextArea.prototype,"_targetInput",2),b.GenusTextArea=Ut([m.customElement("genus-textarea")],b.GenusTextArea);const Ia=u.css`
|
|
73
73
|
input[type='text'], input[type='email'], input[type='password'], input[type='number']
|
|
74
74
|
{
|
|
75
75
|
border: var(--input-border, none);
|
|
@@ -1278,7 +1278,7 @@
|
|
|
1278
1278
|
width: var(--icon-width, 1.5625rem);
|
|
1279
1279
|
height: var(--icon-height, 1.5625rem);
|
|
1280
1280
|
}
|
|
1281
|
-
`;var Pr=Object.defineProperty,Lr=Object.getOwnPropertyDescriptor,
|
|
1281
|
+
`;var Pr=Object.defineProperty,Lr=Object.getOwnPropertyDescriptor,Kt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Lr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&Pr(t,e,s),s};b.GenusDataCard=class extends u.LitElement{constructor(){super(...arguments),this.dataCardTitle="",this.dataCardValue="",this.dataCardIcon="",this.dataCardLayoutDirection="row",this.withoutIcon=!1,this.isLoading=0}render(){return Gt.when(this.withoutIcon,()=>this.isLoading?u.html`
|
|
1282
1282
|
<div class='data-card-loader data-card-loader--no-icon'>
|
|
1283
1283
|
<div class='loader-line loader-line-1'></div>
|
|
1284
1284
|
<div class='loader-line loader-line-2'></div>
|
|
@@ -1302,7 +1302,7 @@
|
|
|
1302
1302
|
<h4 class='data-card__title'>${this.dataCardTitle}</h4>
|
|
1303
1303
|
<p class='data-card__text'>${this.dataCardValue}</p>
|
|
1304
1304
|
</div>
|
|
1305
|
-
`)}},b.GenusDataCard.styles=[Cr,kr,Ir,Er,Qr],
|
|
1305
|
+
`)}},b.GenusDataCard.styles=[Cr,kr,Ir,Er,Qr],Kt([m.property({attribute:"card-title"})],b.GenusDataCard.prototype,"dataCardTitle",2),Kt([m.property({attribute:"card-value"})],b.GenusDataCard.prototype,"dataCardValue",2),Kt([m.property({attribute:"data-card-icon"})],b.GenusDataCard.prototype,"dataCardIcon",2),Kt([m.property({attribute:"layout-direction"})],b.GenusDataCard.prototype,"dataCardLayoutDirection",2),Kt([m.property({type:Boolean,attribute:"without-icon"})],b.GenusDataCard.prototype,"withoutIcon",2),Kt([m.property({attribute:"is-loading",type:Number})],b.GenusDataCard.prototype,"isLoading",2),b.GenusDataCard=Kt([m.customElement("genus-data-card")],b.GenusDataCard);const Un=u.css`
|
|
1306
1306
|
.label-text
|
|
1307
1307
|
{
|
|
1308
1308
|
font-family: var(--label-text-font-family, 'Sofia Pro Regular');
|
|
@@ -1393,7 +1393,7 @@
|
|
|
1393
1393
|
-moz-column-gap: unset;
|
|
1394
1394
|
column-gap: unset;
|
|
1395
1395
|
}
|
|
1396
|
-
`,Sr="data:image/svg+xml;base64,PCEtLSA8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSIuLi9jc3Mvc3R5bGUuY3NzIiA/PiAtLT4NCjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGNsYXNzPSdjaGVja2JveC1pY29uLXN2ZyB1bmNoZWNrZWQtc3ZnJyBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KICAgIDxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHJ4PSIzLjUiIGZpbGw9IndoaXRlIiBzdHJva2U9IiNCOUJEQkEiLz4NCjwvc3ZnPg0K",Or="data:image/svg+xml;base64,PCEtLSA8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSIuLi9jc3Mvc3R5bGUuY3NzIiA/PiAtLT4NCjxzdmcgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBjbGFzcz0nY2hlY2tib3gtaWNvbi1zdmcgY2hlY2tlZC1zdmcnIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgICA8c3R5bGU+DQogICAgICAgIC5jaGVja2JveC1pY29uLXN2ZyBwYXRoIHsgZmlsbDogIzI5NDA2YTsgfQ0KICAgICAgICAuY2hlY2tlZC1zdmcgcGF0aCB7IGZpbGw6ICNmZGM1NGE7IH0NCiAgICA8L3N0eWxlPg0KICAgIA0KICAgIDxwYXRoIGQ9Ik0xNi4xOSAySDcuODFDNC4xNyAyIDIgNC4xNyAyIDcuODFWMTYuMThDMiAxOS44MyA0LjE3IDIyIDcuODEgMjJIMTYuMThDMTkuODIgMjIgMjEuOTkgMTkuODMgMjEuOTkgMTYuMTlWNy44MUMyMiA0LjE3IDE5LjgzIDIgMTYuMTkgMlpNMTYuNzggOS43TDExLjExIDE1LjM3QzEwLjk3IDE1LjUxIDEwLjc4IDE1LjU5IDEwLjU4IDE1LjU5QzEwLjM4IDE1LjU5IDEwLjE5IDE1LjUxIDEwLjA1IDE1LjM3TDcuMjIgMTIuNTRDNi45MyAxMi4yNSA2LjkzIDExLjc3IDcuMjIgMTEuNDhDNy41MSAxMS4xOSA3Ljk5IDExLjE5IDguMjggMTEuNDhMMTAuNTggMTMuNzhMMTUuNzIgOC42NEMxNi4wMSA4LjM1IDE2LjQ5IDguMzUgMTYuNzggOC42NEMxNy4wNyA4LjkzIDE3LjA3IDkuNCAxNi43OCA5LjdaIiBmaWxsPSIjMjkyRDMyIi8+DQo8L3N2Zz4NCg==";var Rr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,
|
|
1396
|
+
`,Sr="data:image/svg+xml;base64,PCEtLSA8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSIuLi9jc3Mvc3R5bGUuY3NzIiA/PiAtLT4NCjxzdmcgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIGNsYXNzPSdjaGVja2JveC1pY29uLXN2ZyB1bmNoZWNrZWQtc3ZnJyBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KICAgIDxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHJ4PSIzLjUiIGZpbGw9IndoaXRlIiBzdHJva2U9IiNCOUJEQkEiLz4NCjwvc3ZnPg0K",Or="data:image/svg+xml;base64,PCEtLSA8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSIuLi9jc3Mvc3R5bGUuY3NzIiA/PiAtLT4NCjxzdmcgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBjbGFzcz0nY2hlY2tib3gtaWNvbi1zdmcgY2hlY2tlZC1zdmcnIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgICA8c3R5bGU+DQogICAgICAgIC5jaGVja2JveC1pY29uLXN2ZyBwYXRoIHsgZmlsbDogIzI5NDA2YTsgfQ0KICAgICAgICAuY2hlY2tlZC1zdmcgcGF0aCB7IGZpbGw6ICNmZGM1NGE7IH0NCiAgICA8L3N0eWxlPg0KICAgIA0KICAgIDxwYXRoIGQ9Ik0xNi4xOSAySDcuODFDNC4xNyAyIDIgNC4xNyAyIDcuODFWMTYuMThDMiAxOS44MyA0LjE3IDIyIDcuODEgMjJIMTYuMThDMTkuODIgMjIgMjEuOTkgMTkuODMgMjEuOTkgMTYuMTlWNy44MUMyMiA0LjE3IDE5LjgzIDIgMTYuMTkgMlpNMTYuNzggOS43TDExLjExIDE1LjM3QzEwLjk3IDE1LjUxIDEwLjc4IDE1LjU5IDEwLjU4IDE1LjU5QzEwLjM4IDE1LjU5IDEwLjE5IDE1LjUxIDEwLjA1IDE1LjM3TDcuMjIgMTIuNTRDNi45MyAxMi4yNSA2LjkzIDExLjc3IDcuMjIgMTEuNDhDNy41MSAxMS4xOSA3Ljk5IDExLjE5IDguMjggMTEuNDhMMTAuNTggMTMuNzhMMTUuNzIgOC42NEMxNi4wMSA4LjM1IDE2LjQ5IDguMzUgMTYuNzggOC42NEMxNy4wNyA4LjkzIDE3LjA3IDkuNCAxNi43OCA5LjdaIiBmaWxsPSIjMjkyRDMyIi8+DQo8L3N2Zz4NCg==";var Rr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,Xt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Nr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&Rr(t,e,s),s};let gt=class extends u.LitElement{constructor(){super(),this.optionValue="",this.optionID="",this.inputName="",this.withoutIcon=!1,this.checkedBoxIcon="",this.uncheckedBoxIcon="",this.getInputValue=i=>{let t=i.target;this._internals.setFormValue(t.value),this.dispatchEvent(new CustomEvent("checked",{detail:t.value}))},this._internals=this.attachInternals()}render(){return this.withoutIcon?u.html`
|
|
1397
1397
|
<input type='checkbox' id='genus-checkbox-${this.optionID}' class='genus-checkbox' name=${this.inputName} @change=${this.getInputValue} value=${this.optionValue} />
|
|
1398
1398
|
<label class='label genus-checkbox-label genus-checkbox-label--without-icon' for='genus-checkbox-${this.optionID}'>
|
|
1399
1399
|
<span class="label-text"><slot></slot></span>
|
|
@@ -1405,7 +1405,7 @@
|
|
|
1405
1405
|
<img class="component-icon checkbox-icon unchecked-icon" src='${this.uncheckedBoxIcon||Sr}' />
|
|
1406
1406
|
<img class="component-icon checkbox-icon checked-icon" src='${this.checkedBoxIcon||Or}' />
|
|
1407
1407
|
</label>
|
|
1408
|
-
`}};gt.styles=[Un,zr,Kn,Tr,Xn],gt.formAssociated=!0,
|
|
1408
|
+
`}};gt.styles=[Un,zr,Kn,Tr,Xn],gt.formAssociated=!0,Xt([m.property({attribute:"option-value"})],gt.prototype,"optionValue",2),Xt([m.property({attribute:"option-id"})],gt.prototype,"optionID",2),Xt([m.property({attribute:"name",reflect:!0})],gt.prototype,"inputName",2),Xt([m.property({type:Boolean,attribute:"without-icon"})],gt.prototype,"withoutIcon",2),Xt([m.property({attribute:"checked-box-icon"})],gt.prototype,"checkedBoxIcon",2),Xt([m.property({attribute:"unchecked-box-icon"})],gt.prototype,"uncheckedBoxIcon",2),gt=Xt([m.customElement("genus-checkbox-option")],gt);const Hr=u.css`
|
|
1409
1409
|
.options-container { grid-area: oc; }
|
|
1410
1410
|
`,Vr=u.css`
|
|
1411
1411
|
.form-field
|
|
@@ -1847,14 +1847,14 @@
|
|
|
1847
1847
|
* https://www.chartjs.org
|
|
1848
1848
|
* (c) 2024 Chart.js Contributors
|
|
1849
1849
|
* Released under the MIT License
|
|
1850
|
-
*/function yt(){}const Sl=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function V(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Z(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function lt(i,t){return Z(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const Ol=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,rs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function R(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function T(i,t,e,n){let s,o,a;if(V(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(P(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function oi(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ai(i){if(V(i))return i.map(ai);if(P(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=ai(i[e[s]]);return t}return i}function ls(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Rl(i,t,e,n){if(!ls(i))return;const s=t[i],o=e[i];P(s)&&P(o)?xe(s,o,n):t[i]=ai(o)}function xe(i,t,e){const n=V(t)?t:[t],s=n.length;if(!P(i))return i;e=e||{};const o=e.merger||Rl;let a;for(let r=0;r<s;++r){if(a=n[r],!P(a))continue;const l=Object.keys(a);for(let A=0,c=l.length;A<c;++A)o(l[A],i,a,e)}return i}function ye(i,t){return xe(i,t,{merger:Nl})}function Nl(i,t,e){if(!ls(i))return;const n=t[i],s=e[i];P(n)&&P(s)?ye(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ai(s))}const As={"":i=>i,x:i=>i.x,y:i=>i.y};function Hl(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Vl(i){const t=Hl(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Ot(i,t){return(As[t]||(As[t]=Vl(t)))(i)}function Ki(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ve=i=>typeof i<"u",Rt=i=>typeof i=="function",cs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Fl(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const N=Math.PI,H=2*N,jl=H+N,ri=Number.POSITIVE_INFINITY,Wl=N/180,U=N/2,Xt=N/4,hs=N*2/3,Nt=Math.log10,Mt=Math.sign;function Ce(i,t,e){return Math.abs(i-t)<e}function ds(i){const t=Math.round(i);i=Ce(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Nt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Zl(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ge(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Ul(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function gs(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(i){return i*(N/180)}function Xi(i){return i*(180/N)}function us(i){if(!Z(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function fs(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*N&&(o+=H),{angle:o,distance:s}}function Ji(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Kl(i,t){return(i-t+jl)%H-N}function At(i){return(i%H+H)%H}function Ie(i,t,e,n){const s=At(i),o=At(t),a=At(e),r=At(o-s),l=At(a-s),A=At(s-o),c=At(s-a);return s===o||s===a||n&&o===a||r>l&&A<c}function J(i,t,e){return Math.max(t,Math.min(e,i))}function Xl(i){return J(i,-32768,32767)}function vt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function qi(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Ct=(i,t,e,n)=>qi(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Jl=(i,t,e)=>qi(i,e,n=>i[n][t]>=e);function ql(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const ps=["push","pop","shift","splice","unshift"];function _l(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ps.forEach(e=>{const n="_onData"+Ki(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function ws(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(ps.forEach(o=>{delete i[o]}),delete i._chartjs)}function ms(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const bs=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ms(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,bs.call(window,()=>{n=!1,i.apply(t,e)}))}}function $l(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const _i=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,tA=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Ds(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:A,max:c,minDefined:h,maxDefined:d}=a.getUserBounds();h&&(s=J(Math.min(Ct(r,l,A).lo,e?n:Ct(t,l,a.getPixelForValue(A)).lo),0,n-1)),d?o=J(Math.max(Ct(r,a.axis,c,!0).hi+1,e?0:Ct(t,l,a.getPixelForValue(c),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function Bs(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const li=i=>i===0||i===1,Gs=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*H/e)),Ys=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*H/e)+1,Ee={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(N*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>li(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>li(i)?i:Gs(i,.075,.3),easeOutElastic:i=>li(i)?i:Ys(i,.075,.3),easeInOutElastic(i){return li(i)?i:i<.5?.5*Gs(i*2,.1125,.45):.5+.5*Ys(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ee.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ee.easeInBounce(i*2)*.5:Ee.easeOutBounce(i*2-1)*.5+.5};function $i(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xs(i){return $i(i)?i:new Ye(i)}function tn(i){return $i(i)?i:new Ye(i).saturate(.5).darken(.1).hexString()}const eA=["x","y","borderWidth","radius","tension"],iA=["color","borderColor","backgroundColor"];function nA(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:iA},numbers:{type:"number",properties:eA}}),i.describe("animations",{_fallback:"animation"}),i.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 sA(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ys=new Map;function oA(i,t){t=t||{};const e=i+JSON.stringify(t);let n=ys.get(e);return n||(n=new Intl.NumberFormat(i,t),ys.set(e,n)),n}function ke(i,t,e){return oA(t,e).format(i)}const vs={values(i){return V(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const A=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(A<1e-4||A>1e15)&&(s="scientific"),o=aA(i,e)}const a=Nt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ke(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Nt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?vs.numeric.call(this,i,t,e):""}};function aA(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ai={formatters:vs};function rA(i){i.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,e)=>e.lineWidth,tickColor:(t,e)=>e.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:Ai.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Jt=Object.create(null),en=Object.create(null);function Qe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function nn(i,t,e){return typeof t=="string"?xe(Qe(i,t),e):xe(Qe(i,""),t)}class lA{constructor(t,e){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=n=>n.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=(n,s)=>tn(s.backgroundColor),this.hoverBorderColor=(n,s)=>tn(s.borderColor),this.hoverColor=(n,s)=>tn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return nn(this,t,e)}get(t){return Qe(this,t)}describe(t,e){return nn(en,t,e)}override(t,e){return nn(Jt,t,e)}route(t,e,n,s){const o=Qe(this,t),a=Qe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],A=a[s];return P(l)?Object.assign({},A,l):E(l,A)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var F=new lA({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nA,sA,rA]);function AA(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ci(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function cA(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,A,c,h,d;for(l=0;l<r;l++)if(h=e[l],h!=null&&!V(h))a=ci(i,s,o,a,h);else if(V(h))for(A=0,c=h.length;A<c;A++)d=h[A],d!=null&&!V(d)&&(a=ci(i,s,o,a,d));i.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return a}function qt(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Cs(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function sn(i,t,e,n){Is(i,t,e,n,null)}function Is(i,t,e,n,s){let o,a,r,l,A,c,h,d;const g=t.pointStyle,f=t.rotation,p=t.radius;let w=(f||0)*Wl;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(w),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),g){default:s?i.ellipse(e,n,s/2,p,0,0,H):i.arc(e,n,p,0,H),i.closePath();break;case"triangle":c=s?s/2:p,i.moveTo(e+Math.sin(w)*c,n-Math.cos(w)*p),w+=hs,i.lineTo(e+Math.sin(w)*c,n-Math.cos(w)*p),w+=hs,i.lineTo(e+Math.sin(w)*c,n-Math.cos(w)*p),i.closePath();break;case"rectRounded":A=p*.516,l=p-A,a=Math.cos(w+Xt)*l,h=Math.cos(w+Xt)*(s?s/2-A:l),r=Math.sin(w+Xt)*l,d=Math.sin(w+Xt)*(s?s/2-A:l),i.arc(e-h,n-r,A,w-N,w-U),i.arc(e+d,n-a,A,w-U,w),i.arc(e+h,n+r,A,w,w+U),i.arc(e-d,n+a,A,w+U,w+N),i.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,c=s?s/2:l,i.rect(e-c,n-l,2*c,2*l);break}w+=Xt;case"rectRot":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+d,n-a),i.lineTo(e+h,n+r),i.lineTo(e-d,n+a),i.closePath();break;case"crossRot":w+=Xt;case"cross":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"star":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a),w+=Xt,h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"line":a=s?s/2:Math.cos(w)*p,r=Math.sin(w)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(w)*(s?s/2:p),n+Math.sin(w)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function It(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function hi(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function di(i){i.restore()}function hA(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function dA(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function gA(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function uA(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,A=e+o.actualBoundingBoxDescent,c=s.strikethrough?(l+A)/2:A;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,c),i.lineTo(r,c),i.stroke()}}function fA(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function _t(i,t,e,n,s,o={}){const a=V(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,A;for(i.save(),i.font=s.string,gA(i,o),l=0;l<a.length;++l)A=a[l],o.backdrop&&fA(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(A,e,n,o.maxWidth)),i.fillText(A,e,n,o.maxWidth),uA(i,e,n,A,o),n+=Number(s.lineHeight);i.restore()}function Pe(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,1.5*N,N,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,N,U,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,n)}const pA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function mA(i,t){const e=(""+i).match(pA);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const bA=i=>+i||0;function on(i,t){const e={},n=P(t),s=n?Object.keys(t):t,o=P(i)?n?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=bA(o(a));return e}function Es(i){return on(i,{top:"y",right:"x",bottom:"y",left:"x"})}function $t(i){return on(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=Es(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function X(i,t){i=i||{},t=t||F.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=E(i.style,t.style);n&&!(""+n).match(wA)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:E(i.family,t.family),lineHeight:mA(E(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:E(i.weight,t.weight),string:""};return s.string=AA(s),s}function Le(i,t,e,n){let s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&a!==void 0)return a}function MA(i,t,e){const{min:n,max:s}=i,o=rs(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function an(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=zs("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>an([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return Qs(r,l,()=>CA(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ts(r).includes(l)},ownKeys(r){return Ts(r)},set(r,l,A){const c=r._storage||(r._storage=s());return r[l]=c[l]=A,delete r._keys,!0}})}function ue(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:ks(i,n),setContext:o=>ue(i,o,e,n),override:o=>ue(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return Qs(o,a,()=>BA(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function ks(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Rt(e)?e:()=>e,isIndexable:Rt(n)?n:()=>n}}const DA=(i,t)=>i?i+Ki(t):t,rn=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Qs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function BA(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return Rt(r)&&a.isScriptable(t)&&(r=GA(t,r,i,e)),V(r)&&r.length&&(r=YA(t,r,i,a.isIndexable)),rn(t,r)&&(r=ue(r,s,o&&o[t],a)),r}function GA(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),rn(i,l)&&(l=ln(s._scopes,s,i,l)),l}function YA(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(P(t[0])){const l=t,A=s._scopes.filter(c=>c!==l);t=[];for(const c of l){const h=ln(A,s,i,c);t.push(ue(h,o,a&&a[i],r))}}return t}function Ps(i,t,e){return Rt(i)?i(t,e):i}const xA=(i,t)=>i===!0?t:typeof i=="string"?Ot(t,i):void 0;function yA(i,t,e,n,s){for(const o of t){const a=xA(e,o);if(a){i.add(a);const r=Ps(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function ln(i,t,e,n){const s=t._rootScopes,o=Ps(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=Ls(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ls(r,a,o,l,n),l===null)?!1:an(Array.from(r),[""],s,o,()=>vA(t,e,n))}function Ls(i,t,e,n,s){for(;e;)e=yA(i,t,e,n,s);return e}function vA(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return V(s)&&P(e)?e:s||{}}function CA(i,t,e,n){let s;for(const o of t)if(s=zs(DA(o,i),e),typeof s<"u")return rn(i,s)?ln(e,n,i,s):s}function zs(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ts(i){let t=i._keys;return t||(t=i._keys=IA(i._scopes)),t}function IA(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Ss(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,A,c;for(r=0,l=n;r<l;++r)A=r+e,c=t[A],a[r]={r:s.parse(Ot(c,o),A)};return a}const EA=Number.EPSILON||1e-14,fe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Os=i=>i==="x"?"y":"x";function kA(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Ji(o,s),l=Ji(a,o);let A=r/(r+l),c=l/(r+l);A=isNaN(A)?0:A,c=isNaN(c)?0:c;const h=n*A,d=n*c;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+d*(a.x-s.x),y:o.y+d*(a.y-s.y)}}}function QA(i,t,e){const n=i.length;let s,o,a,r,l,A=fe(i,0);for(let c=0;c<n-1;++c)if(l=A,A=fe(i,c+1),!(!l||!A)){if(Ce(t[c],0,EA)){e[c]=e[c+1]=0;continue}s=e[c]/t[c],o=e[c+1]/t[c],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[c]=s*a*t[c],e[c+1]=o*a*t[c])}}function PA(i,t,e="x"){const n=Os(e),s=i.length;let o,a,r,l=fe(i,0);for(let A=0;A<s;++A){if(a=r,r=l,l=fe(i,A+1),!r)continue;const c=r[e],h=r[n];a&&(o=(c-a[e])/3,r[`cp1${e}`]=c-o,r[`cp1${n}`]=h-o*t[A]),l&&(o=(l[e]-c)/3,r[`cp2${e}`]=c+o,r[`cp2${n}`]=h+o*t[A])}}function LA(i,t="x"){const e=Os(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,A=fe(i,0);for(a=0;a<n;++a)if(r=l,l=A,A=fe(i,a+1),!!l){if(A){const c=A[t]-l[t];s[a]=c!==0?(A[e]-l[e])/c:0}o[a]=r?A?Mt(s[a-1])!==Mt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}QA(i,s,o),PA(i,o,t)}function gi(i,t,e){return Math.max(Math.min(i,e),t)}function zA(i,t){let e,n,s,o,a,r=It(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&It(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=gi(s.cp1x,t.left,t.right),s.cp1y=gi(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=gi(s.cp2x,t.left,t.right),s.cp2y=gi(s.cp2y,t.top,t.bottom)))}function TA(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(A=>!A.skip)),t.cubicInterpolationMode==="monotone")LA(i,s);else{let A=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=kA(A,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,A=r}t.capBezierPoints&&zA(i,e)}function An(){return typeof window<"u"&&typeof document<"u"}function cn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ui(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const fi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function SA(i,t){return fi(i).getPropertyValue(t)}const OA=["top","right","bottom","left"];function te(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=OA[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const RA=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function NA(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(RA(s,o,i.target))r=s,l=o;else{const A=t.getBoundingClientRect();r=n.clientX-A.left,l=n.clientY-A.top,a=!0}return{x:r,y:l,box:a}}function ee(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=fi(e),o=s.boxSizing==="border-box",a=te(s,"padding"),r=te(s,"border","width"),{x:l,y:A,box:c}=NA(i,e),h=a.left+(c&&r.left),d=a.top+(c&&r.top);let{width:g,height:f}=t;return o&&(g-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-h)/g*e.width/n),y:Math.round((A-d)/f*e.height/n)}}function HA(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&cn(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=fi(o),l=te(r,"border","width"),A=te(r,"padding");t=a.width-A.width-l.width,e=a.height-A.height-l.height,n=ui(r.maxWidth,o,"clientWidth"),s=ui(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||ri,maxHeight:s||ri}}const pi=i=>Math.round(i*10)/10;function VA(i,t,e,n){const s=fi(i),o=te(s,"margin"),a=ui(s.maxWidth,i,"clientWidth")||ri,r=ui(s.maxHeight,i,"clientHeight")||ri,l=HA(i,t,e);let{width:A,height:c}=l;if(s.boxSizing==="content-box"){const d=te(s,"border","width"),g=te(s,"padding");A-=g.width+d.width,c-=g.height+d.height}return A=Math.max(0,A-o.width),c=Math.max(0,n?A/n:c-o.height),A=pi(Math.min(A,a,l.maxWidth)),c=pi(Math.min(c,r,l.maxHeight)),A&&!c&&(c=pi(A/2)),(t!==void 0||e!==void 0)&&n&&l.height&&c>l.height&&(c=l.height,A=pi(Math.floor(c*n))),{width:A,height:c}}function Rs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const FA=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};An()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ns(i,t){const e=SA(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ie(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function jA(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function WA(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=ie(i,s,e),r=ie(s,o,e),l=ie(o,t,e),A=ie(a,r,e),c=ie(r,l,e);return ie(A,c,e)}const ZA=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},UA=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function pe(i,t,e){return i?ZA(t,e):UA()}function Hs(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Vs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Fs(i){return i==="angle"?{between:Ie,compare:Kl,normalize:At}:{between:vt,compare:(t,e)=>t-e,normalize:t=>t}}function js({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function KA(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=Fs(n),l=t.length;let{start:A,end:c,loop:h}=i,d,g;if(h){for(A+=l,c+=l,d=0,g=l;d<g&&a(r(t[A%l][n]),s,o);++d)A--,c--;A%=l,c%=l}return c<A&&(c+=l),{start:A,end:c,loop:h,style:i.style}}function Ws(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:A}=Fs(n),{start:c,end:h,loop:d,style:g}=KA(i,t,e),f=[];let p=!1,w=null,M,D,Y;const G=()=>l(s,Y,M)&&r(s,Y)!==0,B=()=>r(o,M)===0||l(o,Y,M),y=()=>p||G(),v=()=>!p||B();for(let C=c,I=c;C<=h;++C)D=t[C%a],!D.skip&&(M=A(D[n]),M!==Y&&(p=l(M,s,o),w===null&&y()&&(w=r(M,s)===0?C:I),w!==null&&v()&&(f.push(js({start:w,end:C,loop:d,count:a,style:g})),w=null),I=C,Y=M));return w!==null&&f.push(js({start:w,end:h,loop:d,count:a,style:g})),f}function Zs(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=Ws(n[s],i.points,t);o.length&&e.push(...o)}return e}function XA(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function JA(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const A=i[l%s];A.skip||A.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=A.stop?l:null):(a=l,r.skip&&(t=l)),r=A}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function qA(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=XA(e,s,o,n);if(n===!0)return Us(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,A=!!i._fullLoop&&a===0&&r===s-1;return Us(i,JA(e,a,l,A),e,t)}function Us(i,t,e,n){return!n||!n.setContext||!e?t:_A(i,t,e,n)}function _A(i,t,e,n){const s=i._chart.getContext(),o=Ks(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,A=[];let c=o,h=t[0].start,d=h;function g(f,p,w,M){const D=r?-1:1;if(f!==p){for(f+=l;e[f%l].skip;)f-=D;for(;e[p%l].skip;)p+=D;f%l!==p%l&&(A.push({start:f%l,end:p%l,loop:w,style:M}),c=M,h=p%l)}}for(const f of t){h=r?h:f.start;let p=e[h%l],w;for(d=h+1;d<=f.end;d++){const M=e[d%l];w=Ks(n.setContext(Ht(s,{type:"segment",p0:p,p1:M,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),$A(w,c)&&g(h,d-1,f.loop,c),p=M,c=w}h<d-1&&g(h,d-1,f.loop,c)}return A}function Ks(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function $A(i,t){if(!t)return!1;const e=[],n=function(s,o){return $i(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}/*!
|
|
1850
|
+
*/function yt(){}const Sl=(()=>{let i=0;return()=>i++})();function z(i){return i==null}function V(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Z(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function lt(i,t){return Z(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const Ol=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,rs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function R(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function T(i,t,e,n){let s,o,a;if(V(i))for(o=i.length,s=0;s<o;s++)t.call(e,i[s],s);else if(P(i))for(a=Object.keys(i),o=a.length,s=0;s<o;s++)t.call(e,i[a[s]],a[s])}function oi(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ai(i){if(V(i))return i.map(ai);if(P(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=ai(i[e[s]]);return t}return i}function ls(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Rl(i,t,e,n){if(!ls(i))return;const s=t[i],o=e[i];P(s)&&P(o)?xe(s,o,n):t[i]=ai(o)}function xe(i,t,e){const n=V(t)?t:[t],s=n.length;if(!P(i))return i;e=e||{};const o=e.merger||Rl;let a;for(let r=0;r<s;++r){if(a=n[r],!P(a))continue;const l=Object.keys(a);for(let A=0,c=l.length;A<c;++A)o(l[A],i,a,e)}return i}function ye(i,t){return xe(i,t,{merger:Nl})}function Nl(i,t,e){if(!ls(i))return;const n=t[i],s=e[i];P(n)&&P(s)?ye(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ai(s))}const As={"":i=>i,x:i=>i.x,y:i=>i.y};function Hl(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Vl(i){const t=Hl(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Ot(i,t){return(As[t]||(As[t]=Vl(t)))(i)}function Ki(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ve=i=>typeof i<"u",Rt=i=>typeof i=="function",cs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Fl(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const N=Math.PI,H=2*N,jl=H+N,ri=Number.POSITIVE_INFINITY,Wl=N/180,U=N/2,Jt=N/4,hs=N*2/3,Nt=Math.log10,Mt=Math.sign;function Ce(i,t,e){return Math.abs(i-t)<e}function ds(i){const t=Math.round(i);i=Ce(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Nt(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Zl(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ge(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Ul(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function gs(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(i){return i*(N/180)}function Xi(i){return i*(180/N)}function us(i){if(!Z(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function fs(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*N&&(o+=H),{angle:o,distance:s}}function Ji(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Kl(i,t){return(i-t+jl)%H-N}function At(i){return(i%H+H)%H}function Ie(i,t,e,n){const s=At(i),o=At(t),a=At(e),r=At(o-s),l=At(a-s),A=At(s-o),c=At(s-a);return s===o||s===a||n&&o===a||r>l&&A<c}function J(i,t,e){return Math.max(t,Math.min(e,i))}function Xl(i){return J(i,-32768,32767)}function vt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function qi(i,t,e){e=e||(a=>i[a]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const Ct=(i,t,e,n)=>qi(i,e,n?s=>{const o=i[s][t];return o<e||o===e&&i[s+1][t]===e}:s=>i[s][t]<e),Jl=(i,t,e)=>qi(i,e,n=>i[n][t]>=e);function ql(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const ps=["push","pop","shift","splice","unshift"];function _l(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ps.forEach(e=>{const n="_onData"+Ki(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o)}),a}})})}function ws(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(ps.forEach(o=>{delete i[o]}),delete i._chartjs)}function ms(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const bs=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ms(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,bs.call(window,()=>{n=!1,i.apply(t,e)}))}}function $l(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const _i=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,tA=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function Ds(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:a,_parsed:r}=i,l=a.axis,{min:A,max:c,minDefined:h,maxDefined:d}=a.getUserBounds();h&&(s=J(Math.min(Ct(r,l,A).lo,e?n:Ct(t,l,a.getPixelForValue(A)).lo),0,n-1)),d?o=J(Math.max(Ct(r,a.axis,c,!0).hi+1,e?0:Ct(t,l,a.getPixelForValue(c),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function Bs(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const li=i=>i===0||i===1,Gs=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*H/e)),Ys=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*H/e)+1,Ee={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(N*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>li(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>li(i)?i:Gs(i,.075,.3),easeOutElastic:i=>li(i)?i:Ys(i,.075,.3),easeInOutElastic(i){return li(i)?i:i<.5?.5*Gs(i*2,.1125,.45):.5+.5*Ys(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ee.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ee.easeInBounce(i*2)*.5:Ee.easeOutBounce(i*2-1)*.5+.5};function $i(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xs(i){return $i(i)?i:new Ye(i)}function tn(i){return $i(i)?i:new Ye(i).saturate(.5).darken(.1).hexString()}const eA=["x","y","borderWidth","radius","tension"],iA=["color","borderColor","backgroundColor"];function nA(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:iA},numbers:{type:"number",properties:eA}}),i.describe("animations",{_fallback:"animation"}),i.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 sA(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ys=new Map;function oA(i,t){t=t||{};const e=i+JSON.stringify(t);let n=ys.get(e);return n||(n=new Intl.NumberFormat(i,t),ys.set(e,n)),n}function ke(i,t,e){return oA(t,e).format(i)}const vs={values(i){return V(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const A=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(A<1e-4||A>1e15)&&(s="scientific"),o=aA(i,e)}const a=Nt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ke(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(Nt(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?vs.numeric.call(this,i,t,e):""}};function aA(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ai={formatters:vs};function rA(i){i.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,e)=>e.lineWidth,tickColor:(t,e)=>e.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:Ai.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const qt=Object.create(null),en=Object.create(null);function Qe(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function nn(i,t,e){return typeof t=="string"?xe(Qe(i,t),e):xe(Qe(i,""),t)}class lA{constructor(t,e){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=n=>n.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=(n,s)=>tn(s.backgroundColor),this.hoverBorderColor=(n,s)=>tn(s.borderColor),this.hoverColor=(n,s)=>tn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return nn(this,t,e)}get(t){return Qe(this,t)}describe(t,e){return nn(en,t,e)}override(t,e){return nn(qt,t,e)}route(t,e,n,s){const o=Qe(this,t),a=Qe(this,n),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],A=a[s];return P(l)?Object.assign({},A,l):E(l,A)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var F=new lA({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nA,sA,rA]);function AA(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ci(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function cA(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let a=0;const r=e.length;let l,A,c,h,d;for(l=0;l<r;l++)if(h=e[l],h!=null&&!V(h))a=ci(i,s,o,a,h);else if(V(h))for(A=0,c=h.length;A<c;A++)d=h[A],d!=null&&!V(d)&&(a=ci(i,s,o,a,d));i.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return a}function _t(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function Cs(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function sn(i,t,e,n){Is(i,t,e,n,null)}function Is(i,t,e,n,s){let o,a,r,l,A,c,h,d;const g=t.pointStyle,f=t.rotation,p=t.radius;let w=(f||0)*Wl;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(w),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),g){default:s?i.ellipse(e,n,s/2,p,0,0,H):i.arc(e,n,p,0,H),i.closePath();break;case"triangle":c=s?s/2:p,i.moveTo(e+Math.sin(w)*c,n-Math.cos(w)*p),w+=hs,i.lineTo(e+Math.sin(w)*c,n-Math.cos(w)*p),w+=hs,i.lineTo(e+Math.sin(w)*c,n-Math.cos(w)*p),i.closePath();break;case"rectRounded":A=p*.516,l=p-A,a=Math.cos(w+Jt)*l,h=Math.cos(w+Jt)*(s?s/2-A:l),r=Math.sin(w+Jt)*l,d=Math.sin(w+Jt)*(s?s/2-A:l),i.arc(e-h,n-r,A,w-N,w-U),i.arc(e+d,n-a,A,w-U,w),i.arc(e+h,n+r,A,w,w+U),i.arc(e-d,n+a,A,w+U,w+N),i.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,c=s?s/2:l,i.rect(e-c,n-l,2*c,2*l);break}w+=Jt;case"rectRot":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+d,n-a),i.lineTo(e+h,n+r),i.lineTo(e-d,n+a),i.closePath();break;case"crossRot":w+=Jt;case"cross":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"star":h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a),w+=Jt,h=Math.cos(w)*(s?s/2:p),a=Math.cos(w)*p,r=Math.sin(w)*p,d=Math.sin(w)*(s?s/2:p),i.moveTo(e-h,n-r),i.lineTo(e+h,n+r),i.moveTo(e+d,n-a),i.lineTo(e-d,n+a);break;case"line":a=s?s/2:Math.cos(w)*p,r=Math.sin(w)*p,i.moveTo(e-a,n-r),i.lineTo(e+a,n+r);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(w)*(s?s/2:p),n+Math.sin(w)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function It(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function hi(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function di(i){i.restore()}function hA(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function dA(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function gA(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function uA(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,A=e+o.actualBoundingBoxDescent,c=s.strikethrough?(l+A)/2:A;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(a,c),i.lineTo(r,c),i.stroke()}}function fA(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function $t(i,t,e,n,s,o={}){const a=V(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,A;for(i.save(),i.font=s.string,gA(i,o),l=0;l<a.length;++l)A=a[l],o.backdrop&&fA(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(A,e,n,o.maxWidth)),i.fillText(A,e,n,o.maxWidth),uA(i,e,n,A,o),n+=Number(s.lineHeight);i.restore()}function Pe(i,t){const{x:e,y:n,w:s,h:o,radius:a}=t;i.arc(e+a.topLeft,n+a.topLeft,a.topLeft,1.5*N,N,!0),i.lineTo(e,n+o-a.bottomLeft),i.arc(e+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,N,U,!0),i.lineTo(e+s-a.bottomRight,n+o),i.arc(e+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+s,n+a.topRight),i.arc(e+s-a.topRight,n+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,n)}const pA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,wA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function mA(i,t){const e=(""+i).match(pA);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const bA=i=>+i||0;function on(i,t){const e={},n=P(t),s=n?Object.keys(t):t,o=P(i)?n?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of s)e[a]=bA(o(a));return e}function Es(i){return on(i,{top:"y",right:"x",bottom:"y",left:"x"})}function te(i){return on(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=Es(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function X(i,t){i=i||{},t=t||F.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=E(i.style,t.style);n&&!(""+n).match(wA)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:E(i.family,t.family),lineHeight:mA(E(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:E(i.weight,t.weight),string:""};return s.string=AA(s),s}function Le(i,t,e,n){let s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&a!==void 0)return a}function MA(i,t,e){const{min:n,max:s}=i,o=rs(t,(s-n)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function an(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=zs("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>an([r,...i],t,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return Qs(r,l,()=>CA(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Ts(r).includes(l)},ownKeys(r){return Ts(r)},set(r,l,A){const c=r._storage||(r._storage=s());return r[l]=c[l]=A,delete r._keys,!0}})}function ue(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:ks(i,n),setContext:o=>ue(i,o,e,n),override:o=>ue(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return Qs(o,a,()=>BA(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function ks(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Rt(e)?e:()=>e,isIndexable:Rt(n)?n:()=>n}}const DA=(i,t)=>i?i+Ki(t):t,rn=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Qs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function BA(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=i;let r=n[t];return Rt(r)&&a.isScriptable(t)&&(r=GA(t,r,i,e)),V(r)&&r.length&&(r=YA(t,r,i,a.isIndexable)),rn(t,r)&&(r=ue(r,s,o&&o[t],a)),r}function GA(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||n);return r.delete(i),rn(i,l)&&(l=ln(s._scopes,s,i,l)),l}function YA(i,t,e,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(P(t[0])){const l=t,A=s._scopes.filter(c=>c!==l);t=[];for(const c of l){const h=ln(A,s,i,c);t.push(ue(h,o,a&&a[i],r))}}return t}function Ps(i,t,e){return Rt(i)?i(t,e):i}const xA=(i,t)=>i===!0?t:typeof i=="string"?Ot(t,i):void 0;function yA(i,t,e,n,s){for(const o of t){const a=xA(e,o);if(a){i.add(a);const r=Ps(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==n)return r}else if(a===!1&&typeof n<"u"&&e!==n)return null}return!1}function ln(i,t,e,n){const s=t._rootScopes,o=Ps(t._fallback,e,n),a=[...i,...s],r=new Set;r.add(n);let l=Ls(r,a,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ls(r,a,o,l,n),l===null)?!1:an(Array.from(r),[""],s,o,()=>vA(t,e,n))}function Ls(i,t,e,n,s){for(;e;)e=yA(i,t,e,n,s);return e}function vA(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return V(s)&&P(e)?e:s||{}}function CA(i,t,e,n){let s;for(const o of t)if(s=zs(DA(o,i),e),typeof s<"u")return rn(i,s)?ln(e,n,i,s):s}function zs(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ts(i){let t=i._keys;return t||(t=i._keys=IA(i._scopes)),t}function IA(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Ss(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,a=new Array(n);let r,l,A,c;for(r=0,l=n;r<l;++r)A=r+e,c=t[A],a[r]={r:s.parse(Ot(c,o),A)};return a}const EA=Number.EPSILON||1e-14,fe=(i,t)=>t<i.length&&!i[t].skip&&i[t],Os=i=>i==="x"?"y":"x";function kA(i,t,e,n){const s=i.skip?t:i,o=t,a=e.skip?t:e,r=Ji(o,s),l=Ji(a,o);let A=r/(r+l),c=l/(r+l);A=isNaN(A)?0:A,c=isNaN(c)?0:c;const h=n*A,d=n*c;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+d*(a.x-s.x),y:o.y+d*(a.y-s.y)}}}function QA(i,t,e){const n=i.length;let s,o,a,r,l,A=fe(i,0);for(let c=0;c<n-1;++c)if(l=A,A=fe(i,c+1),!(!l||!A)){if(Ce(t[c],0,EA)){e[c]=e[c+1]=0;continue}s=e[c]/t[c],o=e[c+1]/t[c],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[c]=s*a*t[c],e[c+1]=o*a*t[c])}}function PA(i,t,e="x"){const n=Os(e),s=i.length;let o,a,r,l=fe(i,0);for(let A=0;A<s;++A){if(a=r,r=l,l=fe(i,A+1),!r)continue;const c=r[e],h=r[n];a&&(o=(c-a[e])/3,r[`cp1${e}`]=c-o,r[`cp1${n}`]=h-o*t[A]),l&&(o=(l[e]-c)/3,r[`cp2${e}`]=c+o,r[`cp2${n}`]=h+o*t[A])}}function LA(i,t="x"){const e=Os(t),n=i.length,s=Array(n).fill(0),o=Array(n);let a,r,l,A=fe(i,0);for(a=0;a<n;++a)if(r=l,l=A,A=fe(i,a+1),!!l){if(A){const c=A[t]-l[t];s[a]=c!==0?(A[e]-l[e])/c:0}o[a]=r?A?Mt(s[a-1])!==Mt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}QA(i,s,o),PA(i,o,t)}function gi(i,t,e){return Math.max(Math.min(i,e),t)}function zA(i,t){let e,n,s,o,a,r=It(i[0],t);for(e=0,n=i.length;e<n;++e)a=o,o=r,r=e<n-1&&It(i[e+1],t),o&&(s=i[e],a&&(s.cp1x=gi(s.cp1x,t.left,t.right),s.cp1y=gi(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=gi(s.cp2x,t.left,t.right),s.cp2y=gi(s.cp2y,t.top,t.bottom)))}function TA(i,t,e,n,s){let o,a,r,l;if(t.spanGaps&&(i=i.filter(A=>!A.skip)),t.cubicInterpolationMode==="monotone")LA(i,s);else{let A=n?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=kA(A,r,i[Math.min(o+1,a-(n?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,A=r}t.capBezierPoints&&zA(i,e)}function An(){return typeof window<"u"&&typeof document<"u"}function cn(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ui(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const fi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function SA(i,t){return fi(i).getPropertyValue(t)}const OA=["top","right","bottom","left"];function ee(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=OA[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const RA=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function NA(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let a=!1,r,l;if(RA(s,o,i.target))r=s,l=o;else{const A=t.getBoundingClientRect();r=n.clientX-A.left,l=n.clientY-A.top,a=!0}return{x:r,y:l,box:a}}function ie(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=fi(e),o=s.boxSizing==="border-box",a=ee(s,"padding"),r=ee(s,"border","width"),{x:l,y:A,box:c}=NA(i,e),h=a.left+(c&&r.left),d=a.top+(c&&r.top);let{width:g,height:f}=t;return o&&(g-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-h)/g*e.width/n),y:Math.round((A-d)/f*e.height/n)}}function HA(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&cn(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=fi(o),l=ee(r,"border","width"),A=ee(r,"padding");t=a.width-A.width-l.width,e=a.height-A.height-l.height,n=ui(r.maxWidth,o,"clientWidth"),s=ui(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||ri,maxHeight:s||ri}}const pi=i=>Math.round(i*10)/10;function VA(i,t,e,n){const s=fi(i),o=ee(s,"margin"),a=ui(s.maxWidth,i,"clientWidth")||ri,r=ui(s.maxHeight,i,"clientHeight")||ri,l=HA(i,t,e);let{width:A,height:c}=l;if(s.boxSizing==="content-box"){const d=ee(s,"border","width"),g=ee(s,"padding");A-=g.width+d.width,c-=g.height+d.height}return A=Math.max(0,A-o.width),c=Math.max(0,n?A/n:c-o.height),A=pi(Math.min(A,a,l.maxWidth)),c=pi(Math.min(c,r,l.maxHeight)),A&&!c&&(c=pi(A/2)),(t!==void 0||e!==void 0)&&n&&l.height&&c>l.height&&(c=l.height,A=pi(Math.floor(c*n))),{width:A,height:c}}function Rs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(i.currentDevicePixelRatio=n,a.height=s,a.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const FA=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};An()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ns(i,t){const e=SA(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ne(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function jA(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function WA(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=ne(i,s,e),r=ne(s,o,e),l=ne(o,t,e),A=ne(a,r,e),c=ne(r,l,e);return ne(A,c,e)}const ZA=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},UA=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function pe(i,t,e){return i?ZA(t,e):UA()}function Hs(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Vs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Fs(i){return i==="angle"?{between:Ie,compare:Kl,normalize:At}:{between:vt,compare:(t,e)=>t-e,normalize:t=>t}}function js({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function KA(i,t,e){const{property:n,start:s,end:o}=e,{between:a,normalize:r}=Fs(n),l=t.length;let{start:A,end:c,loop:h}=i,d,g;if(h){for(A+=l,c+=l,d=0,g=l;d<g&&a(r(t[A%l][n]),s,o);++d)A--,c--;A%=l,c%=l}return c<A&&(c+=l),{start:A,end:c,loop:h,style:i.style}}function Ws(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:A}=Fs(n),{start:c,end:h,loop:d,style:g}=KA(i,t,e),f=[];let p=!1,w=null,M,D,Y;const G=()=>l(s,Y,M)&&r(s,Y)!==0,B=()=>r(o,M)===0||l(o,Y,M),y=()=>p||G(),v=()=>!p||B();for(let C=c,I=c;C<=h;++C)D=t[C%a],!D.skip&&(M=A(D[n]),M!==Y&&(p=l(M,s,o),w===null&&y()&&(w=r(M,s)===0?C:I),w!==null&&v()&&(f.push(js({start:w,end:C,loop:d,count:a,style:g})),w=null),I=C,Y=M));return w!==null&&f.push(js({start:w,end:h,loop:d,count:a,style:g})),f}function Zs(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=Ws(n[s],i.points,t);o.length&&e.push(...o)}return e}function XA(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function JA(i,t,e,n){const s=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const A=i[l%s];A.skip||A.stop?r.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=a=A.stop?l:null):(a=l,r.skip&&(t=l)),r=A}return a!==null&&o.push({start:t%s,end:a%s,loop:n}),o}function qA(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:a,end:r}=XA(e,s,o,n);if(n===!0)return Us(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,A=!!i._fullLoop&&a===0&&r===s-1;return Us(i,JA(e,a,l,A),e,t)}function Us(i,t,e,n){return!n||!n.setContext||!e?t:_A(i,t,e,n)}function _A(i,t,e,n){const s=i._chart.getContext(),o=Ks(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,A=[];let c=o,h=t[0].start,d=h;function g(f,p,w,M){const D=r?-1:1;if(f!==p){for(f+=l;e[f%l].skip;)f-=D;for(;e[p%l].skip;)p+=D;f%l!==p%l&&(A.push({start:f%l,end:p%l,loop:w,style:M}),c=M,h=p%l)}}for(const f of t){h=r?h:f.start;let p=e[h%l],w;for(d=h+1;d<=f.end;d++){const M=e[d%l];w=Ks(n.setContext(Ht(s,{type:"segment",p0:p,p1:M,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),$A(w,c)&&g(h,d-1,f.loop,c),p=M,c=w}h<d-1&&g(h,d-1,f.loop,c)}return A}function Ks(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function $A(i,t){if(!t)return!1;const e=[],n=function(s,o){return $i(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,n)!==JSON.stringify(t,n)}/*!
|
|
1851
1851
|
* Chart.js v4.4.7
|
|
1852
1852
|
* https://www.chartjs.org
|
|
1853
1853
|
* (c) 2024 Chart.js Contributors
|
|
1854
1854
|
* Released under the MIT License
|
|
1855
|
-
*/class tc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=bs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Et=new tc;const Xs="transparent",ec={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=xs(i||Xs),s=n.valid&&xs(t||Xs);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ic{constructor(t,e,n,s){const o=e[n];s=Le([t.to,s,o,t.from]);const a=Le([t.from,o,s]);this._active=!0,this._fn=t.fn||ec[t.type||typeof a],this._easing=Ee[t.easing]||Ee.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Le([t.to,e,s,t.from]),this._from=Le([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class Js{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(F.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(V(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=sc(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&nc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const A=a[l];if(A.charAt(0)==="$")continue;if(A==="options"){s.push(...this._animateOptions(t,e));continue}const c=e[A];let h=o[A];const d=n.get(A);if(h)if(d&&h.active()){h.update(d,c,r);continue}else h.cancel();if(!d||!d.duration){t[A]=c;continue}o[A]=h=new ic(d,t,A,c),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Et.add(this._chart,n),!0}}function nc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function sc(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function qs(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function oc(i,t,e){if(e===!1)return!1;const n=qs(i,e),s=qs(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function ac(i){let t,e,n,s;return P(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function _s(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function $s(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,A;if(t===null)return;let c=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(c=!0,n.all)continue;break}A=i.values[l],Z(A)&&(o||t===0||Mt(t)===Mt(A))&&(t+=A)}return!c&&!n.all?0:t}function rc(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,A,c;for(l=0,A=a.length;l<A;++l)c=a[l],r[l]={[s]:c,[o]:i[c]};return r}function hn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function lc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ac(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function cc(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function to(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function eo(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,A=a.axis,c=lc(o,a,n),h=t.length;let d;for(let g=0;g<h;++g){const f=t[g],{[l]:p,[A]:w}=f,M=f._stacks||(f._stacks={});d=M[A]=cc(s,c,p),d[r]=w,d._top=to(d,a,!0,n.type),d._bottom=to(d,a,!1,n.type);const D=d._visualValues||(d._visualValues={});D[r]=w}}function dn(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function hc(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dc(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ze(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const gn=i=>i==="reset"||i==="none",io=(i,t)=>t?i:Object.assign({},i),gc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:_s(e,!0),values:null};class pt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=hn(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&&ze(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(h,d,g,f)=>h==="x"?d:h==="r"?f:g,o=e.xAxisID=E(n.xAxisID,dn(t,"x")),a=e.yAxisID=E(n.yAxisID,dn(t,"y")),r=e.rAxisID=E(n.rAxisID,dn(t,"r")),l=e.indexAxis,A=e.iAxisID=s(l,o,a,r),c=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(A),e.vScale=this.getScaleForId(c)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ws(this._data,this),t._stacked&&ze(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(P(e)){const s=this._cachedMeta;this._data=rc(e,s)}else if(n!==e){if(n){ws(n,this);const s=this._cachedMeta;ze(s),s._parsed=[]}e&&Object.isExtensible(e)&&_l(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=hn(e.vScale,e),e.stack!==n.stack&&(s=!0,ze(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(eo(this,e._parsed),e._stacked=hn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,A=t>0&&n._parsed[t-1],c,h,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{V(s[t])?d=this.parseArrayData(n,s,t,e):P(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const g=()=>h[r]===null||A&&h[r]<A[r];for(c=0;c<e;++c)n._parsed[c+t]=h=d[c],l&&(g()&&(l=!1),A=h);n._sorted=l}a&&eo(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,A=o.getLabels(),c=o===a,h=new Array(s);let d,g,f;for(d=0,g=s;d<g;++d)f=d+n,h[d]={[r]:c||o.parse(A[f],f),[l]:a.parse(e[f],f)};return h}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,A,c,h;for(l=0,A=s;l<A;++l)c=l+n,h=e[c],r[l]={x:o.parse(h[0],c),y:a.parse(h[1],c)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,A=new Array(s);let c,h,d,g;for(c=0,h=s;c<h;++c)d=c+n,g=e[d],A[c]={x:o.parse(Ot(g,r),d),y:a.parse(Ot(g,l),d)};return A}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:_s(s,!0),values:e._stacks[t.axis]._visualValues};return $s(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=$s(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=gc(e,n,this.chart),A={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=Ac(r);let d,g;function f(){g=s[d];const p=g[r.axis];return!Z(g[t.axis])||c>p||h<p}for(d=0;d<a&&!(!f()&&(this.updateRangeFromParsed(A,t,g,l),o));++d);if(o){for(d=a-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(A,t,g,l);break}}return A}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],Z(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=ac(E(this.options.clip,oc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,A=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,o,r,l),c=r;c<r+l;++c){const h=s[c];h.hidden||(h.active&&A?a.push(h):h.draw(t,o))}for(c=0;c<a.length;++c)a[c].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=dc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=hc(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&ve(n);if(r)return io(r,l);const A=this.chart.config,c=A.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],d=A.getOptionScopes(this.getDataset(),c),g=Object.keys(F.elements[t]),f=()=>this.getContext(n,s,e),p=A.resolveNamedOptions(d,g,f,h);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(io(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const c=this.chart.config,h=c.datasetAnimationScopeKeys(this._type,e),d=c.getOptionScopes(this.getDataset(),h);l=c.createResolver(d,this.getContext(t,n,e))}const A=new Js(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(A)),A}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||gn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){gn(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!gn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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 e=this._data,n=this._cachedMeta.data;for(const[r,l,A]of this._syncList)this[r](l,A);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=A=>{for(A.length+=e,r=A.length-1;r>=a;r--)A[r]=A[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&ze(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}x(pt,"defaults",{}),x(pt,"datasetElementType",null),x(pt,"dataElementType",null);function uc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ms(n.sort((s,o)=>s-o))}return i._cache.$bar}function fc(i){const t=i.iScale,e=uc(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(ve(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function pc(i,t,e,n){const s=e.barThickness;let o,a;return z(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function wc(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const A=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:A}}function mc(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,A=r;Math.abs(a)>Math.abs(r)&&(l=r,A=a),t[e.axis]=A,t._custom={barStart:l,barEnd:A,start:s,end:o,min:a,max:r}}function no(i,t,e,n){return V(i)?mc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function so(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let A,c,h,d;for(A=e,c=e+n;A<c;++A)d=t[A],h={},h[s.axis]=r||s.parse(a[A],A),l.push(no(d,h,o,A));return l}function un(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function bc(i,t,e){return i!==0?Mt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Mc(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function Dc(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:A,bottom:c}=Mc(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=A:(e._bottom||0)===n?s=c:(o[oo(c,a,r,l)]=!0,s=A)),o[oo(s,a,r,l)]=!0,i.borderSkipped=o}function oo(i,t,e,n){return n?(i=Bc(i,t,e),i=ao(i,e,t)):i=ao(i,t,e),i}function Bc(i,t,e){return i===t?e:i===e?t:i}function ao(i,t,e){return i==="start"?t:i==="end"?e:i}function Gc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class wi extends pt{parsePrimitiveData(t,e,n,s){return so(t,e,n,s)}parseArrayData(t,e,n,s){return so(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,A=o.axis==="x"?r:l,c=a.axis==="x"?r:l,h=[];let d,g,f,p;for(d=n,g=n+s;d<g;++d)p=e[d],f={},f[o.axis]=o.parse(Ot(p,A),d),h.push(no(Ot(p,c),f,a,d));return h}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===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 e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=un(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),A=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s);for(let g=e;g<e+n;g++){const f=this.getParsed(g),p=o||z(f[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,c),M=(f._stacks||{})[r.axis],D={horizontal:A,base:p.base,enableBorderRadius:!M||un(f._custom)||a===M._top||a===M._bottom,x:A?p.head:w.center,y:A?w.center:p.head,height:A?w.size:Math.abs(p.size),width:A?Math.abs(p.size):w.size};d&&(D.options=h||this.resolveDataElementOptions(g,t[g].active?"active":s));const Y=D.options||t[g].options;Dc(D,Y,M,a),Gc(D,Y,c.ratio),this.updateElement(t[g],g,D,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=n.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[n.axis],A=c=>{const h=c._parsed.find(g=>g[n.axis]===l),d=h&&h[c.vScale.axis];if(z(d)||isNaN(d))return!0};for(const c of s)if(!(e!==void 0&&A(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||fc(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),A=l._custom,c=un(A);let h=l[e.axis],d=0,g=n?this.applyStack(e,l,n):h,f,p;g!==h&&(d=g-h,g=h),c&&(h=A.barStart,g=A.barEnd-A.barStart,h!==0&&Mt(h)!==Mt(A.barEnd)&&(d=0),d+=h);const w=!z(o)&&!c?o:d;let M=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(d+g):f=M,p=f-M,Math.abs(p)<a){p=bc(p,e,r)*a,h===r&&(M-=p/2);const D=e.getPixelForDecimal(0),Y=e.getPixelForDecimal(1),G=Math.min(D,Y),B=Math.max(D,Y);M=Math.max(Math.min(M,B),G),f=M+p,n&&!c&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(f)-e.getValueForPixel(M))}if(M===e.getPixelForValue(r)){const D=Mt(p)*e.getLineWidthForValue(r)/2;M+=D,p-=D}return{size:p,base:M,head:f,center:f+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=E(s.maxBarThickness,1/0);let r,l;if(e.grouped){const A=o?this._getStackCount(t):e.stackCount,c=s.barThickness==="flex"?wc(t,e,s,A):pc(t,e,s,A),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=c.start+c.chunk*h+c.chunk/2,l=Math.min(a,c.chunk*c.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}x(wi,"id","bar"),x(wi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),x(wi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class mi extends pt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=E(r[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=E(r&&r.r&&+r.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),A=a._custom;return{label:n[t]||"",value:"("+r+", "+l+(A?", "+A:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:A}=this._getSharedOptions(e,s),c=a.axis,h=r.axis;for(let d=e;d<e+n;d++){const g=t[d],f=!o&&this.getParsed(d),p={},w=p[c]=o?a.getPixelForDecimal(.5):a.getPixelForValue(f[c]),M=p[h]=o?r.getBasePixel():r.getPixelForValue(f[h]);p.skip=isNaN(w)||isNaN(M),A&&(p.options=l||this.resolveDataElementOptions(d,g.active?"active":s),o&&(p.options.radius=0)),this.updateElement(g,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=E(n&&n._custom,o),s}}x(mi,"id","bubble"),x(mi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),x(mi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Yc(i,t,e){let n=1,s=1,o=0,a=0;if(t<H){const r=i,l=r+t,A=Math.cos(r),c=Math.sin(r),h=Math.cos(l),d=Math.sin(l),g=(Y,G,B)=>Ie(Y,r,l,!0)?1:Math.max(G,G*e,B,B*e),f=(Y,G,B)=>Ie(Y,r,l,!0)?-1:Math.min(G,G*e,B,B*e),p=g(0,A,h),w=g(U,c,d),M=f(N,A,h),D=f(N+U,c,d);n=(p-M)/2,s=(w-D)/2,o=-(p+M)/2,a=-(w+D)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class ne extends pt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(P(n[t])){const{key:l="value"}=this._parsing;o=A=>+Ot(n[A],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=H,e=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(Ol(this.options.cutout,r),1),A=this._getRingWeight(this.index),{circumference:c,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:g,offsetX:f,offsetY:p}=Yc(h,c,l),w=(n.width-a)/d,M=(n.height-a)/g,D=Math.max(Math.min(w,M)/2,0),Y=rs(this.options.radius,D),G=Math.max(Y*l,0),B=(Y-G)/this._getVisibleDatasetWeightTotal();this.offsetX=f*Y,this.offsetY=p*Y,s.total=this.calculateTotal(),this.outerRadius=Y-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*A,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/H)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,A=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=o&&A.animateScale,g=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:w}=this._getSharedOptions(e,s);let M=this._getRotation(),D;for(D=0;D<e;++D)M+=this._circumference(D,o);for(D=e;D<e+n;++D){const Y=this._circumference(D,o),G=t[D],B={x:c+this.offsetX,y:h+this.offsetY,startAngle:M,endAngle:M+Y,circumference:Y,outerRadius:f,innerRadius:g};w&&(B.options=p||this.resolveDataElementOptions(D,G.active?"active":s)),M+=Y,this.updateElement(G,D,B,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}x(ne,"id","doughnut"),x(ne,"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"}),x(ne,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),x(ne,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class bi extends pt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Ds(e,s,a);this._drawStart=r,this._drawCount=l,Bs(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const A=this.resolveDatasetElementOptions(t);this.options.showLine||(A.borderWidth=0),A.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:A},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:A}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,s),d=a.axis,g=r.axis,{spanGaps:f,segment:p}=this.options,w=ge(f)?f:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none",D=e+n,Y=t.length;let G=e>0&&this.getParsed(e-1);for(let B=0;B<Y;++B){const y=t[B],v=M?y:{};if(B<e||B>=D){v.skip=!0;continue}const C=this.getParsed(B),I=z(C[g]),k=v[d]=a.getPixelForValue(C[d],B),Q=v[g]=o||I?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[g],B);v.skip=isNaN(k)||isNaN(Q)||I,v.stop=B>0&&Math.abs(C[d]-G[d])>w,p&&(v.parsed=C,v.raw=A.data[B]),h&&(v.options=c||this.resolveDataElementOptions(B,y.active?"active":s)),M||this.updateElement(y,B,v,s),G=C}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}x(bi,"id","line"),x(bi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),x(bi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Te extends pt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return Ss.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,l=a.options.animation,A=this._cachedMeta.rScale,c=A.xCenter,h=A.yCenter,d=A.getIndexAngle(0)-.5*N;let g=d,f;const p=360/this.countVisibleElements();for(f=0;f<e;++f)g+=this._computeAngle(f,s,p);for(f=e;f<e+n;f++){const w=t[f];let M=g,D=g+this._computeAngle(f,s,p),Y=a.getDataVisibility(f)?A.getDistanceFromCenterForValue(this.getParsed(f).r):0;g=D,o&&(l.animateScale&&(Y=0),l.animateRotate&&(M=D=d));const G={x:c,y:h,innerRadius:0,outerRadius:Y,startAngle:M,endAngle:D,options:this.resolveDataElementOptions(f,w.active?"active":s)};this.updateElement(w,f,G,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ft(this.resolveDataElementOptions(t,e).angle||n):0}}x(Te,"id","polarArea"),x(Te,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),x(Te,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class fn extends ne{}x(fn,"id","pie"),x(fn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mi extends pt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Ss.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],A=this.resolveDataElementOptions(r,l.active?"active":s),c=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:c.x,d=a?o.yCenter:c.y,g={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:A};this.updateElement(l,r,g,s)}}}x(Mi,"id","radar"),x(Mi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),x(Mi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Di extends pt{getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Ds(e,n,s);if(this._drawStart=o,this._drawCount=a,Bs(e)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=n;const A=this.resolveDatasetElementOptions(t);A.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:A},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:A}=this._cachedMeta,c=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(c),d=this.includeOptions(s,h),g=a.axis,f=r.axis,{spanGaps:p,segment:w}=this.options,M=ge(p)?p:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||s==="none";let Y=e>0&&this.getParsed(e-1);for(let G=e;G<e+n;++G){const B=t[G],y=this.getParsed(G),v=D?B:{},C=z(y[f]),I=v[g]=a.getPixelForValue(y[g],G),k=v[f]=o||C?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,y,l):y[f],G);v.skip=isNaN(I)||isNaN(k)||C,v.stop=G>0&&Math.abs(y[g]-Y[g])>M,w&&(v.parsed=y,v.raw=A.data[G]),d&&(v.options=h||this.resolveDataElementOptions(G,B.active?"active":s)),D||this.updateElement(B,G,v,s),Y=y}this.updateSharedOptions(h,s,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}x(Di,"id","scatter"),x(Di,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),x(Di,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var xc=Object.freeze({__proto__:null,BarController:wi,BubbleController:mi,DoughnutController:ne,LineController:bi,PieController:fn,PolarAreaController:Te,RadarController:Mi,ScatterController:Di});function se(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class pn{constructor(t){x(this,"options");this.options=t||{}}static override(t){Object.assign(pn.prototype,t)}init(){}formats(){return se()}parse(){return se()}format(){return se()}add(){return se()}diff(){return se()}startOf(){return se()}endOf(){return se()}}var yc={_date:pn};function vc(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Jl:Ct;if(n){if(s._sharedOptions){const A=o[0],c=typeof A.getRange=="function"&&A.getRange(t);if(c){const h=l(o,t,e-c),d=l(o,t,e+c);return{lo:h.lo,hi:d.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Se(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:A,data:c}=o[r],{lo:h,hi:d}=vc(o[r],t,a,s);for(let g=h;g<=d;++g){const f=c[g];f.skip||n(f,A,g)}}}function Cc(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function wn(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Se(i,e,t,function(r,l,A){!s&&!It(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:A})},!0),o}function Ic(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:A,endAngle:c}=a.getProps(["startAngle","endAngle"],n),{angle:h}=fs(a,{x:t.x,y:t.y});Ie(h,A,c)&&s.push({element:a,datasetIndex:r,index:l})}return Se(i,e,t,o),s}function Ec(i,t,e,n,s,o){let a=[];const r=Cc(e);let l=Number.POSITIVE_INFINITY;function A(c,h,d){const g=c.inRange(t.x,t.y,s);if(n&&!g)return;const f=c.getCenterPoint(s);if(!(!!o||i.isPointInArea(f))&&!g)return;const w=r(t,f);w<l?(a=[{element:c,datasetIndex:h,index:d}],l=w):w===l&&a.push({element:c,datasetIndex:h,index:d})}return Se(i,e,t,A),a}function mn(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?Ic(i,t,e,s):Ec(i,t,e,n,s,o)}function ro(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Se(i,e,t,(l,A,c)=>{l[a]&&l[a](t[e],s)&&(o.push({element:l,datasetIndex:A,index:c}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var kc={evaluateInteractionItems:Se,modes:{index(i,t,e,n){const s=ee(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?wn(i,s,o,n,a):mn(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(A=>{const c=r[0].index,h=A.data[c];h&&!h.skip&&l.push({element:h,datasetIndex:A.index,index:c})}),l):[]},dataset(i,t,e,n){const s=ee(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?wn(i,s,o,n,a):mn(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,A=i.getDatasetMeta(l).data;r=[];for(let c=0;c<A.length;++c)r.push({element:A[c],datasetIndex:l,index:c})}return r},point(i,t,e,n){const s=ee(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return wn(i,s,o,n,a)},nearest(i,t,e,n){const s=ee(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return mn(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=ee(t,i);return ro(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=ee(t,i);return ro(i,s,"y",e.intersect,n)}}};const lo=["left","top","right","bottom"];function Oe(i,t){return i.filter(e=>e.pos===t)}function Ao(i,t){return i.filter(e=>lo.indexOf(e.pos)===-1&&e.box.axis===t)}function Re(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Qc(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Pc(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!lo.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Lc(i,t){const e=Pc(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,A=e[r.stack],c=A&&r.stackWeight/A.weight;r.horizontal?(r.width=c?c*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=c?c*s:l&&t.availableHeight)}return e}function zc(i){const t=Qc(i),e=Re(t.filter(A=>A.box.fullSize),!0),n=Re(Oe(t,"left"),!0),s=Re(Oe(t,"right")),o=Re(Oe(t,"top"),!0),a=Re(Oe(t,"bottom")),r=Ao(t,"x"),l=Ao(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Oe(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function co(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function ho(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Tc(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!P(s)){e.size&&(i[s]-=e.size);const h=n[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,i[s]+=e.size}o.getPadding&&ho(a,o.getPadding());const r=Math.max(0,t.outerWidth-co(a,i,"left","right")),l=Math.max(0,t.outerHeight-co(a,i,"top","bottom")),A=r!==i.w,c=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:A,other:c}:{same:c,other:A}}function Sc(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Oc(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function Ne(i,t,e,n){const s=[];let o,a,r,l,A,c;for(o=0,a=i.length,A=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Oc(r.horizontal,t));const{same:h,other:d}=Tc(t,e,r,n);A|=h&&s.length,c=c||d,l.fullSize||s.push(r)}return A&&Ne(s,t,e,n)||c}function Bi(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function go(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,A=n[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/A.weight||1;if(r.horizontal){const h=t.w*c,d=A.size||l.height;ve(A.start)&&(a=A.start),l.fullSize?Bi(l,s.left,a,e.outerWidth-s.right-s.left,d):Bi(l,t.left+A.placed,a,h,d),A.start=a,A.placed+=h,a=l.bottom}else{const h=t.h*c,d=A.size||l.width;ve(A.start)&&(o=A.start),l.fullSize?Bi(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Bi(l,o,t.top+A.placed,d,h),A.start=o,A.placed+=h,o=l.right}}t.x=o,t.y=a}var et={addBox(i,t){i.boxes||(i.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(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=tt(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=zc(i.boxes),l=r.vertical,A=r.horizontal;T(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const c=l.reduce((p,w)=>w.box.options&&w.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},s);ho(d,tt(n));const g=Object.assign({maxPadding:d,w:o,h:a,x:s.left,y:s.top},s),f=Lc(l.concat(A),h);Ne(r.fullSize,g,h,f),Ne(l,g,h,f),Ne(A,g,h,f)&&Ne(l,g,h,f),Sc(g),go(r.leftAndTop,g,h,f),g.x+=g.w,g.y+=g.h,go(r.rightAndBottom,g,h,f),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},T(r.chartArea,p=>{const w=p.box;Object.assign(w,i.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class uo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Rc extends uo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gi="$chartjs",Nc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fo=i=>i===null||i==="";function Hc(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Gi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",fo(s)){const o=Ns(i,"width");o!==void 0&&(i.width=o)}if(fo(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ns(i,"height");o!==void 0&&(i.height=o)}return i}const po=FA?{passive:!0}:!1;function Vc(i,t,e){i&&i.addEventListener(t,e,po)}function Fc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,po)}function jc(i,t){const e=Nc[i.type]||i.type,{x:n,y:s}=ee(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Yi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Wc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.addedNodes,n),a=a&&!Yi(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Zc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.removedNodes,n),a=a&&!Yi(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const He=new Map;let wo=0;function mo(){const i=window.devicePixelRatio;i!==wo&&(wo=i,He.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Uc(i,t){He.size||window.addEventListener("resize",mo),He.set(i,t)}function Kc(i){He.delete(i),He.size||window.removeEventListener("resize",mo)}function Xc(i,t,e){const n=i.canvas,s=n&&cn(n);if(!s)return;const o=Ms((r,l)=>{const A=s.clientWidth;e(r,l),A<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],A=l.contentRect.width,c=l.contentRect.height;A===0&&c===0||o(A,c)});return a.observe(s),Uc(i,o),a}function bn(i,t,e){e&&e.disconnect(),t==="resize"&&Kc(i)}function Jc(i,t,e){const n=i.canvas,s=Ms(o=>{i.ctx!==null&&e(jc(o,i))},i);return Vc(n,t,s),s}class qc extends uo{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Hc(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Gi])return!1;const n=e[Gi].initial;["height","width"].forEach(o=>{const a=n[o];z(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Gi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Wc,detach:Zc,resize:Xc}[e]||Jc;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:bn,detach:bn,resize:bn}[e]||Fc)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return VA(t,e,n,s)}isAttached(t){const e=t&&cn(t);return!!(e&&e.isConnected)}}function _c(i){return!An()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Rc:qc}class wt{constructor(){x(this,"x");x(this,"y");x(this,"active",!1);x(this,"options");x(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ge(this.x)&&ge(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}x(wt,"defaults",{}),x(wt,"defaultRoutes");function $c(i,t){const e=i.options.ticks,n=th(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?ih(t):[],a=o.length,r=o[0],l=o[a-1],A=[];if(a>s)return nh(t,A,o,a/s),A;const c=eh(o,t,s);if(a>0){let h,d;const g=a>1?Math.round((l-r)/(a-1)):null;for(xi(t,A,c,z(g)?0:r-g,r),h=0,d=a-1;h<d;h++)xi(t,A,c,o[h],o[h+1]);return xi(t,A,c,l,z(g)?t.length:l+g),A}return xi(t,A,c),A}function th(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function eh(i,t,e){const n=sh(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Zl(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function ih(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function nh(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function xi(i,t,e,n,s){const o=E(n,0),a=Math.min(E(s,i.length),i.length);let r=0,l,A,c;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),c=o;c<0;)r++,c=Math.round(o+r*e);for(A=Math.max(o,0);A<a;A++)A===c&&(t.push(i[A]),r++,c=Math.round(o+r*e))}function sh(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const oh=i=>i==="left"?"right":i==="right"?"left":i,bo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Mo=(i,t)=>Math.min(t||i,i);function Do(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function ah(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),A;if(!(e&&(n===1?A=Math.max(l-o,a-l):t===0?A=(i.getPixelForTick(1)-l)/2:A=(l-i.getPixelForTick(s-1))/2,l+=s<t?A:-A,l<o-r||l>a+r)))return l}function rh(i,t){T(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Ve(i){return i.drawTicks?i.tickLength:0}function Bo(i,t){if(!i.display)return 0;const e=X(i.font,t),n=tt(i.padding);return(V(i.text)?i.text.length:1)*e.lineHeight+n.height}function lh(i,t){return Ht(i,{scale:t,type:"scale"})}function Ah(i,t,e){return Ht(i,{tick:e,index:t,type:"tick"})}function ch(i,t,e){let n=_i(i);return(e&&t!=="right"||!e&&t==="right")&&(n=oh(n)),n}function hh(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:A,scales:c}=l;let h=0,d,g,f;const p=a-s,w=r-o;if(i.isHorizontal()){if(g=$(n,o,r),P(e)){const M=Object.keys(e)[0],D=e[M];f=c[M].getPixelForValue(D)+p-t}else e==="center"?f=(A.bottom+A.top)/2+p-t:f=bo(i,e,t);d=r-o}else{if(P(e)){const M=Object.keys(e)[0],D=e[M];g=c[M].getPixelForValue(D)-w+t}else e==="center"?g=(A.left+A.right)/2-w+t:g=bo(i,e,t);f=$(n,a,s),h=e==="left"?-U:U}return{titleX:g,titleY:f,maxWidth:d,rotation:h}}class oe extends wt{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,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=lt(t,Number.POSITIVE_INFINITY),e=lt(e,Number.NEGATIVE_INFINITY),n=lt(n,Number.POSITIVE_INFINITY),s=lt(s,Number.NEGATIVE_INFINITY),{min:lt(t,n),max:lt(e,s),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,A=r.length;l<A;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:lt(e,lt(n,e)),max:lt(n,lt(e,n))}}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(){R(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=MA(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Do(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=$c(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,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(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(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=R(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Mo(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,A;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,g=J(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/n:g/(n-1),h+6>r&&(r=g/(n-(t.offset?.5:1)),l=this.maxHeight-Ve(t.grid)-e.padding-Bo(t.title,this.chart.options.font),A=Math.sqrt(h*h+d*d),a=Xi(Math.min(Math.asin(J((c.highest.height+6)/r,-1,1)),Math.asin(J(l/A,-1,1))-Math.asin(J(d/A,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Bo(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ve(o)+l):(t.height=this.maxHeight,t.width=Ve(o)+l),n.display&&this.ticks.length){const{first:A,last:c,widest:h,highest:d}=this._getLabelSizes(),g=n.padding*2,f=ft(this.labelRotation),p=Math.cos(f),w=Math.sin(f);if(r){const M=n.mirror?0:w*h.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+M+g)}else{const M=n.mirror?0:p*h.width+w*d.height;t.width=Math.min(this.maxWidth,t.width+M+g)}this._calculatePadding(A,c,w,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,A=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,g=0;l?A?(d=s*t.width,g=n*e.height):(d=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,g=e.width/2),this.paddingLeft=Math.max((d-c+a)*this.width/(this.width-c),0),this.paddingRight=Math.max((g-h+a)*this.width/(this.width-h),0)}else{let c=e.height/2,h=t.height/2;o==="start"?(c=0,h=t.height):o==="end"&&(c=e.height,h=0),this.paddingTop=c+a,this.paddingBottom=h+a}}_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(){R(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)z(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Do(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Mo(e,n));let A=0,c=0,h,d,g,f,p,w,M,D,Y,G,B;for(h=0;h<e;h+=l){if(f=t[h].label,p=this._resolveTickFontOptions(h),s.font=w=p.string,M=o[w]=o[w]||{data:{},gc:[]},D=p.lineHeight,Y=G=0,!z(f)&&!V(f))Y=ci(s,M.data,M.gc,Y,f),G=D;else if(V(f))for(d=0,g=f.length;d<g;++d)B=f[d],!z(B)&&!V(B)&&(Y=ci(s,M.data,M.gc,Y,B),G+=D);a.push(Y),r.push(G),A=Math.max(Y,A),c=Math.max(G,c)}rh(o,e);const y=a.indexOf(A),v=r.indexOf(c),C=I=>({width:a[I]||0,height:r[I]||0});return{first:C(0),last:C(e-1),widest:C(y),highest:C(v),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Xl(this._alignToPixels?qt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Ah(this.getContext(),t,n))}return this.$context||(this.$context=lh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,A=this.isHorizontal(),h=this.ticks.length+(l?1:0),d=Ve(o),g=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,w=p/2,M=function(W){return qt(n,W,p)};let D,Y,G,B,y,v,C,I,k,Q,L,q;if(a==="top")D=M(this.bottom),v=this.bottom-d,I=D-w,Q=M(t.top)+w,q=t.bottom;else if(a==="bottom")D=M(this.top),Q=t.top,q=M(t.bottom)-w,v=D+w,I=this.top+d;else if(a==="left")D=M(this.right),y=this.right-d,C=D-w,k=M(t.left)+w,L=t.right;else if(a==="right")D=M(this.left),k=t.left,L=M(t.right)-w,y=D+w,C=this.left+d;else if(e==="x"){if(a==="center")D=M((t.top+t.bottom)/2+.5);else if(P(a)){const W=Object.keys(a)[0],K=a[W];D=M(this.chart.scales[W].getPixelForValue(K))}Q=t.top,q=t.bottom,v=D+w,I=v+d}else if(e==="y"){if(a==="center")D=M((t.left+t.right)/2);else if(P(a)){const W=Object.keys(a)[0],K=a[W];D=M(this.chart.scales[W].getPixelForValue(K))}y=D-w,C=y-d,k=t.left,L=t.right}const ct=E(s.ticks.maxTicksLimit,h),S=Math.max(1,Math.ceil(h/ct));for(Y=0;Y<h;Y+=S){const W=this.getContext(Y),K=o.setContext(W),bt=r.setContext(W),it=K.lineWidth,me=K.color,Ni=bt.dash||[],be=bt.dashOffset,Je=K.tickWidth,le=K.tickColor,qe=K.tickBorderDash||[],Ae=K.tickBorderDashOffset;G=ah(this,Y,l),G!==void 0&&(B=qt(n,G,it),A?y=C=k=L=B:v=I=Q=q=B,g.push({tx1:y,ty1:v,tx2:C,ty2:I,x1:k,y1:Q,x2:L,y2:q,width:it,color:me,borderDash:Ni,borderDashOffset:be,tickWidth:Je,tickColor:le,tickBorderDash:qe,tickBorderDashOffset:Ae}))}return this._ticksLength=h,this._borderValue=D,g}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:A,padding:c,mirror:h}=o,d=Ve(n.grid),g=d+c,f=h?-c:g,p=-ft(this.labelRotation),w=[];let M,D,Y,G,B,y,v,C,I,k,Q,L,q="middle";if(s==="top")y=this.bottom-f,v=this._getXAxisLabelAlignment();else if(s==="bottom")y=this.top+f,v=this._getXAxisLabelAlignment();else if(s==="left"){const S=this._getYAxisLabelAlignment(d);v=S.textAlign,B=S.x}else if(s==="right"){const S=this._getYAxisLabelAlignment(d);v=S.textAlign,B=S.x}else if(e==="x"){if(s==="center")y=(t.top+t.bottom)/2+g;else if(P(s)){const S=Object.keys(s)[0],W=s[S];y=this.chart.scales[S].getPixelForValue(W)+g}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")B=(t.left+t.right)/2-g;else if(P(s)){const S=Object.keys(s)[0],W=s[S];B=this.chart.scales[S].getPixelForValue(W)}v=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const ct=this._getLabelSizes();for(M=0,D=r.length;M<D;++M){Y=r[M],G=Y.label;const S=o.setContext(this.getContext(M));C=this.getPixelForTick(M)+o.labelOffset,I=this._resolveTickFontOptions(M),k=I.lineHeight,Q=V(G)?G.length:1;const W=Q/2,K=S.color,bt=S.textStrokeColor,it=S.textStrokeWidth;let me=v;a?(B=C,v==="inner"&&(M===D-1?me=this.options.reverse?"left":"right":M===0?me=this.options.reverse?"right":"left":me="center"),s==="top"?A==="near"||p!==0?L=-Q*k+k/2:A==="center"?L=-ct.highest.height/2-W*k+k:L=-ct.highest.height+k/2:A==="near"||p!==0?L=k/2:A==="center"?L=ct.highest.height/2-W*k:L=ct.highest.height-Q*k,h&&(L*=-1),p!==0&&!S.showLabelBackdrop&&(B+=k/2*Math.sin(p))):(y=C,L=(1-Q)*k/2);let Ni;if(S.showLabelBackdrop){const be=tt(S.backdropPadding),Je=ct.heights[M],le=ct.widths[M];let qe=L-be.top,Ae=0-be.left;switch(q){case"middle":qe-=Je/2;break;case"bottom":qe-=Je;break}switch(v){case"center":Ae-=le/2;break;case"right":Ae-=le;break;case"inner":M===D-1?Ae-=le:M>0&&(Ae-=le/2);break}Ni={left:Ae,top:qe,width:le+be.width,height:Je+be.height,color:S.backdropColor}}w.push({label:G,font:I,textOffset:L,options:{rotation:p,color:K,strokeColor:bt,strokeWidth:it,textAlign:me,textBaseline:q,translation:[B,y],backdrop:Ni}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let A,c;return e==="left"?s?(c=this.right+o,n==="near"?A="left":n==="center"?(A="center",c+=l/2):(A="right",c+=l)):(c=this.right-r,n==="near"?A="right":n==="center"?(A="center",c-=l/2):(A="left",c=this.left)):e==="right"?s?(c=this.left+o,n==="near"?A="right":n==="center"?(A="center",c-=l/2):(A="left",c-=l)):(c=this.left+r,n==="near"?A="left":n==="center"?(A="center",c+=l/2):(A="right",c=this.right)):A="right",{textAlign:A,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,A,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(A.x,A.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({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:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let A,c,h,d;this.isHorizontal()?(A=qt(t,this.left,a)-a/2,c=qt(t,this.right,r)+r/2,h=d=l):(h=qt(t,this.top,a)-a/2,d=qt(t,this.bottom,r)+r/2,A=c=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(A,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&hi(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,A=a.label,c=a.textOffset;_t(n,A,0,c,l,r)}s&&di(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=X(n.font),a=tt(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=a.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:A,titleY:c,maxWidth:h,rotation:d}=hh(this,l,e,r);_t(t,n.text,0,0,o,{color:n.color,maxWidth:h,rotation:d,textAlign:ch(r,e,s),textBaseline:"middle",translation:[A,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=E(t.grid&&t.grid.z,-1),s=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==oe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return X(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class yi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;uh(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,dh(t,a,n),this.override&&F.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in F[s]&&(delete F[s][n],this.override&&delete Jt[n])}}function dh(i,t,e){const n=xe(Object.create(null),[e?F.get(e):{},F.get(t),i.defaults]);F.set(t,n),i.defaultRoutes&&gh(t,i.defaultRoutes),i.descriptors&&F.describe(t,i.descriptors)}function gh(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");F.route(o,s,l,r)})}function uh(i){return"id"in i&&"defaults"in i}class fh{constructor(){this.controllers=new yi(pt,"datasets",!0),this.elements=new yi(wt,"elements"),this.plugins=new yi(Object,"plugins"),this.scales=new yi(oe,"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,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):T(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Ki(t);R(n["before"+s],[],n),e[t](n),R(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Dt=new fh;class ph{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(R(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=E(n.options&&n.options.plugins,{}),o=wh(n);return s===!1&&!e?[]:bh(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function wh(i){const t={},e=[],n=Object.keys(Dt.plugins.items);for(let o=0;o<n.length;o++)e.push(Dt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function mh(i,t){return!t&&i===!1?null:i===!0?{}:i}function bh(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,A=mh(n[l],s);A!==null&&o.push({plugin:r,options:Mh(i.config,{plugin:r,local:e[l]},A,a)})}return o}function Mh(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mn(i,t){const e=F.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Dh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Bh(i,t){return i===t?"_index_":"_value_"}function Go(i){if(i==="x"||i==="y"||i==="r")return i}function Gh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Dn(i,...t){if(Go(i))return i;for(const e of t){const n=e.axis||Gh(e.position)||i.length>1&&Go(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Yo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Yh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Yo(i,"x",e[0])||Yo(i,"y",e[0])}return{}}function xh(i,t){const e=Jt[i.type]||{scales:{}},n=t.scales||{},s=Mn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Dn(a,r,Yh(a,i),F.scales[r.type]),A=Bh(l,s),c=e.scales||{};o[a]=ye(Object.create(null),[{axis:l},r,c[l],c[A]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Mn(r,t),c=(Jt[r]||{}).scales||{};Object.keys(c).forEach(h=>{const d=Dh(h,l),g=a[d+"AxisID"]||d;o[g]=o[g]||Object.create(null),ye(o[g],[{axis:d},n[g],c[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];ye(r,[F.scales[r.type],F.scale])}),o}function xo(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=xh(i,t)}function yo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function yh(i){return i=i||{},i.data=yo(i.data),xo(i),i}const vo=new Map,Co=new Set;function vi(i,t){let e=vo.get(i);return e||(e=t(),vo.set(i,e),Co.add(e)),e}const Fe=(i,t,e)=>{const n=Ot(t,e);n!==void 0&&i.add(n)};class vh{constructor(t){this._config=yh(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=yo(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(),xo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return vi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return vi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return vi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(c=>{t&&(l.add(t),c.forEach(h=>Fe(l,t,h))),c.forEach(h=>Fe(l,s,h)),c.forEach(h=>Fe(l,Jt[o]||{},h)),c.forEach(h=>Fe(l,F,h)),c.forEach(h=>Fe(l,en,h))});const A=Array.from(l);return A.length===0&&A.push(Object.create(null)),Co.has(e)&&a.set(e,A),A}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jt[e]||{},F.datasets[e]||{},{type:e},F,en]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Io(this._resolverCache,t,s);let l=a;if(Ih(a,e)){o.$shared=!1,n=Rt(n)?n():n;const A=this.createResolver(t,n,r);l=ue(a,n,A)}for(const A of e)o[A]=l[A];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Io(this._resolverCache,t,n);return P(e)?ue(o,e,void 0,s):o}}function Io(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:an(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const Ch=i=>P(i)&&Object.getOwnPropertyNames(i).some(t=>Rt(i[t]));function Ih(i,t){const{isScriptable:e,isIndexable:n}=ks(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(Rt(r)||Ch(r))||a&&V(r))return!0}return!1}var Eh="4.4.7";const kh=["top","bottom","left","right","chartArea"];function Eo(i,t){return i==="top"||i==="bottom"||kh.indexOf(i)===-1&&t==="x"}function ko(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Qo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[i],t)}function Qh(i){const t=i.chart,e=t.options.animation;R(e&&e.onProgress,[i],t)}function Po(i){return An()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ci={},Lo=i=>{const t=Po(i);return Object.values(Ci).filter(e=>e.canvas===t).pop()};function Ph(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function Lh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function Ii(i,t,e){return i.options.clip?i[e]:t[e]}function zh(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Ii(e,t,"left"),right:Ii(e,t,"right"),top:Ii(n,t,"top"),bottom:Ii(n,t,"bottom")}:t}class kt{static register(...t){Dt.add(...t),zo()}static unregister(...t){Dt.remove(...t),zo()}constructor(t,e){const n=this.config=new vh(e),s=Po(t),o=Lo(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_c(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,A=l&&l.height,c=l&&l.width;if(this.id=Sl(),this.ctx=r,this.canvas=l,this.width=c,this.height=A,this._options=a,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 ph,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$l(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Ci[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Et.listen(this,"complete",Qo),Et.listen(this,"progress",Qh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return z(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cs(this.canvas,this.ctx),this}stop(){return Et.stop(this),this}resize(t,e){Et.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Rs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),R(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};T(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Dn(a,r),A=l==="r",c=l==="x";return{options:r,dposition:A?"chartArea":c?"bottom":"left",dtype:A?"radialLinear":c?"category":"linear"}}))),T(o,a=>{const r=a.options,l=r.id,A=Dn(l,r),c=E(r.type,a.dtype);(r.position===void 0||Eo(r.position,A)!==Eo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let h=null;if(l in n&&n[l].type===c)h=n[l];else{const d=Dt.getScale(c);h=new d({id:l,type:c,ctx:this.ctx,chart:this}),n[h.id]=h}h.init(r,t)}),T(s,(a,r)=>{a||delete n[r]}),T(n,a=>{et.configure(this,a,a.options),et.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(ko("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||Mn(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=Dt.getController(r),{datasetElementType:A,dataElementType:c}=F.datasets[r];Object.assign(l,{dataElementType:Dt.getElement(c),datasetElementType:A&&Dt.getElement(A)}),a.controller=new l(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){T(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let A=0,c=this.data.datasets.length;A<c;A++){const{controller:h}=this.getDatasetMeta(A),d=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||T(o,A=>{A.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ko("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){T(this.scales,t=>{et.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!cs(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;Ph(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!cs(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;et.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],T(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Rt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Et.has(this)?this.attached&&!Et.running(this)&&Et.start(this):(this.draw(),Qo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=zh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&hi(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&di(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return It(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=kc.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);ve(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Et.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Cs(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ci[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,e=this.platform,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};T(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,A)=>{e.addEventListener(this,l,A),t[l]=A},s=(l,A)=>{t[l]&&(e.removeEventListener(this,l,A),delete t[l])},o=(l,A)=>{this.canvas&&this.resize(l,A)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){T(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},T(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const A=a&&this.getDatasetMeta(a.datasetIndex).controller;A&&A[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!oi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,A)=>l.filter(c=>!A.some(h=>c.datasetIndex===h.datasetIndex&&c.index===h.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=Fl(t),A=Lh(t,this._lastEvent,n,l);n&&(this._lastEvent=null,R(o.onHover,[t,r,this],this),l&&R(o.onClick,[t,r,this],this));const c=!oi(r,s);return(c||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=A,c}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}x(kt,"defaults",F),x(kt,"instances",Ci),x(kt,"overrides",Jt),x(kt,"registry",Dt),x(kt,"version",Eh),x(kt,"getChart",Lo);function zo(){return T(kt.instances,i=>i._plugins.invalidate())}function Th(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let A=s/r;i.beginPath(),i.arc(o,a,r,n-A,e+A),l>s?(A=s/l,i.arc(o,a,l,e+A,n-A,!0)):i.arc(o,a,s,e+U,n-U),i.closePath(),i.clip()}function Sh(i){return on(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Oh(i,t,e,n){const s=Sh(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const A=(e-Math.min(o,l))*n/2;return J(l,0,Math.min(o,A))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:J(s.innerStart,0,a),innerEnd:J(s.innerEnd,0,a)}}function we(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ei(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:A,innerRadius:c}=t,h=Math.max(t.outerRadius+n+e-A,0),d=c>0?c+n+e+A:0;let g=0;const f=s-l;if(n){const S=c>0?c-n:0,W=h>0?h-n:0,K=(S+W)/2,bt=K!==0?f*K/(K+n):f;g=(f-bt)/2}const p=Math.max(.001,f*h-e/N)/h,w=(f-p)/2,M=l+w+g,D=s-w-g,{outerStart:Y,outerEnd:G,innerStart:B,innerEnd:y}=Oh(t,d,h,D-M),v=h-Y,C=h-G,I=M+Y/v,k=D-G/C,Q=d+B,L=d+y,q=M+B/Q,ct=D-y/L;if(i.beginPath(),o){const S=(I+k)/2;if(i.arc(a,r,h,I,S),i.arc(a,r,h,S,k),G>0){const it=we(C,k,a,r);i.arc(it.x,it.y,G,k,D+U)}const W=we(L,D,a,r);if(i.lineTo(W.x,W.y),y>0){const it=we(L,ct,a,r);i.arc(it.x,it.y,y,D+U,ct+Math.PI)}const K=(D-y/d+(M+B/d))/2;if(i.arc(a,r,d,D-y/d,K,!0),i.arc(a,r,d,K,M+B/d,!0),B>0){const it=we(Q,q,a,r);i.arc(it.x,it.y,B,q+Math.PI,M-U)}const bt=we(v,M,a,r);if(i.lineTo(bt.x,bt.y),Y>0){const it=we(v,I,a,r);i.arc(it.x,it.y,Y,M-U,I)}}else{i.moveTo(a,r);const S=Math.cos(I)*h+a,W=Math.sin(I)*h+r;i.lineTo(S,W);const K=Math.cos(k)*h+a,bt=Math.sin(k)*h+r;i.lineTo(K,bt)}i.closePath()}function Rh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Ei(i,t,e,n,l,s);for(let A=0;A<o;++A)i.fill();isNaN(r)||(l=a+(r%H||H))}return Ei(i,t,e,n,l,s),i.fill(),l}function Nh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:A,borderJoinStyle:c,borderDash:h,borderDashOffset:d}=l,g=l.borderAlign==="inner";if(!A)return;i.setLineDash(h||[]),i.lineDashOffset=d,g?(i.lineWidth=A*2,i.lineJoin=c||"round"):(i.lineWidth=A,i.lineJoin=c||"bevel");let f=t.endAngle;if(o){Ei(i,t,e,n,f,s);for(let p=0;p<o;++p)i.stroke();isNaN(r)||(f=a+(r%H||H))}g&&Th(i,t,f),o||(Ei(i,t,e,n,f,s),i.stroke())}class je extends wt{constructor(e){super();x(this,"circumference");x(this,"endAngle");x(this,"fullCircles");x(this,"innerRadius");x(this,"outerRadius");x(this,"pixelMargin");x(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,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=fs(o,{x:e,y:n}),{startAngle:l,endAngle:A,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,f=E(d,A-l),p=Ie(a,l,A)&&l!==A,w=f>=H||p,M=vt(r,c+g,h+g);return w&&M}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:A,spacing:c}=this.options,h=(o+a)/2,d=(r+l+c+A)/2;return{x:n+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>H?Math.floor(s/H):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const A=1-Math.sin(Math.min(N,s||0)),c=o*A;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Rh(e,this,c,a,r),Nh(e,this,c,a,r),e.restore()}}x(je,"id","arc"),x(je,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),x(je,"defaultRoutes",{backgroundColor:"backgroundColor"}),x(je,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function To(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function Hh(i,t,e){i.lineTo(e.x,e.y)}function Vh(i){return i.stepped?hA:i.tension||i.cubicInterpolationMode==="monotone"?dA:Hh}function So(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),A=Math.min(o,r),c=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:A<l&&!c?n+A-l:A-l}}function Fh(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:A}=So(s,e,n),c=Vh(o);let{move:h=!0,reverse:d}=n||{},g,f,p;for(g=0;g<=A;++g)f=s[(r+(d?A-g:g))%a],!f.skip&&(h?(i.moveTo(f.x,f.y),h=!1):c(i,p,f,d,o.stepped),p=f);return l&&(f=s[(r+(d?A:0))%a],c(i,p,f,d,o.stepped)),!!l}function jh(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=So(s,e,n),{move:l=!0,reverse:A}=n||{};let c=0,h=0,d,g,f,p,w,M;const D=G=>(a+(A?r-G:G))%o,Y=()=>{p!==w&&(i.lineTo(c,w),i.lineTo(c,p),i.lineTo(c,M))};for(l&&(g=s[D(0)],i.moveTo(g.x,g.y)),d=0;d<=r;++d){if(g=s[D(d)],g.skip)continue;const G=g.x,B=g.y,y=G|0;y===f?(B<p?p=B:B>w&&(w=B),c=(h*c+G)/++h):(Y(),i.lineTo(G,B),f=y,h=0,p=w=B),M=B}Y()}function Bn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jh:Fh}function Wh(i){return i.stepped?jA:i.tension||i.cubicInterpolationMode==="monotone"?WA:ie}function Zh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),To(i,t.options),i.stroke(s)}function Uh(i,t,e,n){const{segments:s,options:o}=t,a=Bn(t);for(const r of s)To(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Kh=typeof Path2D=="function";function Xh(i,t,e,n){Kh&&!t.options.segment?Zh(i,t,e,n):Uh(i,t,e,n)}class Vt extends wt{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,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;TA(this._points,n,t,s,e),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=qA(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=Zs(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Wh(n);let A,c;for(A=0,c=a.length;A<c;++A){const{start:h,end:d}=a[A],g=o[h],f=o[d];if(g===f){r.push(g);continue}const p=Math.abs((s-g[e])/(f[e]-g[e])),w=l(g,f,p,n.stepped);w[e]=t[e],r.push(w)}return r.length===1?r[0]:r}pathSegment(t,e,n){return Bn(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=Bn(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Xh(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}x(Vt,"id","line"),x(Vt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),x(Vt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),x(Vt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Oo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class ki extends wt{constructor(e){super();x(this,"parsed");x(this,"skip");x(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return Oo(this,e,"x",n)}inYRange(e,n){return Oo(this,e,"y",n)}getCenterPoint(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){const s=this.options;this.skip||s.radius<.1||!It(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,sn(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}x(ki,"id","point"),x(ki,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),x(ki,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ro(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,A,c,h;return i.horizontal?(h=a/2,r=Math.min(e,s),l=Math.max(e,s),A=n-h,c=n+h):(h=o/2,r=e-h,l=e+h,A=Math.min(n,s),c=Math.max(n,s)),{left:r,top:A,right:l,bottom:c}}function Ft(i,t,e,n){return i?0:J(t,e,n)}function Jh(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=Es(n);return{t:Ft(s.top,o.top,0,e),r:Ft(s.right,o.right,0,t),b:Ft(s.bottom,o.bottom,0,e),l:Ft(s.left,o.left,0,t)}}function qh(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=$t(s),a=Math.min(t,e),r=i.borderSkipped,l=n||P(s);return{topLeft:Ft(!l||r.top||r.left,o.topLeft,0,a),topRight:Ft(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ft(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ft(!l||r.bottom||r.right,o.bottomRight,0,a)}}function _h(i){const t=Ro(i),e=t.right-t.left,n=t.bottom-t.top,s=Jh(i,e/2,n/2),o=qh(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Gn(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&Ro(i,n);return r&&(s||vt(t,r.left,r.right))&&(o||vt(e,r.top,r.bottom))}function $h(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function td(i,t){i.rect(t.x,t.y,t.w,t.h)}function Yn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class Qi extends wt{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:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:a}=_h(this),r=$h(a.radius)?Pe:td;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Yn(a,e,o)),t.clip(),r(t,Yn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,Yn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return Gn(this,t,e,n)}inXRange(t,e){return Gn(this,t,null,e)}inYRange(t,e){return Gn(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}x(Qi,"id","bar"),x(Qi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),x(Qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ed=Object.freeze({__proto__:null,ArcElement:je,BarElement:Qi,LineElement:Vt,PointElement:ki});const xn=["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)"],No=xn.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ho(i){return xn[i%xn.length]}function Vo(i){return No[i%No.length]}function id(i,t){return i.borderColor=Ho(t),i.backgroundColor=Vo(t),++t}function nd(i,t){return i.backgroundColor=i.data.map(()=>Ho(t++)),t}function sd(i,t){return i.backgroundColor=i.data.map(()=>Vo(t++)),t}function od(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof ne?t=nd(e,t):s instanceof Te?t=sd(e,t):s&&(t=id(e,t))}}function Fo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function ad(i){return i&&(i.borderColor||i.backgroundColor)}function rd(){return F.borderColor!=="rgba(0,0,0,0.1)"||F.backgroundColor!=="rgba(0,0,0,0.1)"}var ld={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,a=Fo(n)||ad(s)||o&&Fo(o)||rd();if(!e.forceOverride&&a)return;const r=od(i);n.forEach(r)}};function Ad(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const A=t+e-1;let c=t,h,d,g,f,p;for(a[l++]=i[c],h=0;h<o-2;h++){let w=0,M=0,D;const Y=Math.floor((h+1)*r)+1+t,G=Math.min(Math.floor((h+2)*r)+1,e)+t,B=G-Y;for(D=Y;D<G;D++)w+=i[D].x,M+=i[D].y;w/=B,M/=B;const y=Math.floor(h*r)+1+t,v=Math.min(Math.floor((h+1)*r)+1,e)+t,{x:C,y:I}=i[c];for(g=f=-1,D=y;D<v;D++)f=.5*Math.abs((C-w)*(i[D].y-I)-(C-i[D].x)*(M-I)),f>g&&(g=f,d=i[D],p=D);a[l++]=d,c=p}return a[l++]=i[A],a}function cd(i,t,e,n){let s=0,o=0,a,r,l,A,c,h,d,g,f,p;const w=[],M=t+e-1,D=i[t].x,G=i[M].x-D;for(a=t;a<t+e;++a){r=i[a],l=(r.x-D)/G*n,A=r.y;const B=l|0;if(B===c)A<f?(f=A,h=a):A>p&&(p=A,d=a),s=(o*s+r.x)/++o;else{const y=a-1;if(!z(h)&&!z(d)){const v=Math.min(h,d),C=Math.max(h,d);v!==g&&v!==y&&w.push({...i[v],x:s}),C!==g&&C!==y&&w.push({...i[C],x:s})}a>0&&y!==g&&w.push(i[y]),w.push(r),c=B,o=0,f=p=A,h=d=g=a}}return w}function jo(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Wo(i){i.data.datasets.forEach(t=>{jo(t)})}function hd(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:A}=o.getUserBounds();return l&&(n=J(Ct(t,o.axis,a).lo,0,e-1)),A?s=J(Ct(t,o.axis,r).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var dd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Wo(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=i.getDatasetMeta(o),A=a||s.data;if(Le([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const c=i.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||i.options.parsing)return;let{start:h,count:d}=hd(l,A);const g=e.threshold||4*n;if(d<=g){jo(s);return}z(a)&&(s._data=A,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let f;switch(e.algorithm){case"lttb":f=Ad(A,h,d,n,e);break;case"min-max":f=cd(A,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=f})},destroy(i){Wo(i)}};function gd(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:A}=r;A=vn(l,A,s);const c=yn(e,s[l],s[A],r.loop);if(!t.segments){a.push({source:r,target:c,start:s[l],end:s[A]});continue}const h=Zs(t,c);for(const d of h){const g=yn(e,o[d.start],o[d.end],d.loop),f=Ws(r,s,g);for(const p of f)a.push({source:p,target:d,start:{[e]:Zo(c,g,"start",Math.max)},end:{[e]:Zo(c,g,"end",Math.min)}})}}return a}function yn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=At(s),o=At(o)),{property:i,start:s,end:o}}function ud(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=vn(a,r,s);const l=s[a],A=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:A.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:A.y}))}),o}function vn(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Zo(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Uo(i,t){let e=[],n=!1;return V(i)?(n=!0,e=i):e=ud(i,t),e.length?new Vt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ko(i){return i&&i.fill!==!1}function fd(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Z(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function pd(i,t,e){const n=Md(i);if(P(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return Z(s)&&Math.floor(s)===s?wd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function wd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function md(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function bd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:P(i)?n=i.value:n=t.getBaseValue(),n}function Md(i){const t=i.options,e=t.fill;let n=E(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Dd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=Bd(t,e);r.push(Uo({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const A=o[l];for(let c=A.start;c<=A.end;c++)Gd(s,a[c],r)}return new Vt({points:s,options:{}})}function Bd(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Gd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Yd(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function Yd(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let A=0;A<o.length;A++){const c=o[A],h=a[c.start][e],d=a[c.end][e];if(vt(s,h,d)){r=s===h,l=s===d;break}}return{first:r,last:l,point:n}}class Xo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:H},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function xd(i){const{chart:t,fill:e,line:n}=i;if(Z(e))return yd(t,e);if(e==="stack")return Dd(i);if(e==="shape")return!0;const s=vd(i);return s instanceof Xo?s:Uo(s,n)}function yd(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function vd(i){return(i.scale||{}).getPointPositionForValue?Id(i):Cd(i)}function Cd(i){const{scale:t={},fill:e}=i,n=md(e,t);if(Z(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Id(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=bd(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new Xo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Cn(i,t,e){const n=xd(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,A=r.backgroundColor,{above:c=A,below:h=A}=l||{};n&&s.points.length&&(hi(i,e),Ed(i,{line:s,target:n,above:c,below:h,area:e,scale:o,axis:a}),di(i))}function Ed(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==s&&(Jo(i,n,a.top),qo(i,{line:e,target:n,color:s,scale:r,property:l}),i.restore(),i.save(),Jo(i,n,a.bottom)),qo(i,{line:e,target:n,color:o,scale:r,property:l}),i.restore()}function Jo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:A}=r,c=s[l],h=s[vn(l,A,s)];o?(i.moveTo(c.x,c.y),o=!1):(i.lineTo(c.x,e),i.lineTo(c.x,c.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(h.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function qo(i,t){const{line:e,target:n,property:s,color:o,scale:a}=t,r=gd(e,n,s);for(const{source:l,target:A,start:c,end:h}of r){const{style:{backgroundColor:d=o}={}}=l,g=n!==!0;i.save(),i.fillStyle=d,kd(i,a,g&&yn(s,c,h)),i.beginPath();const f=!!e.pathSegment(i,l);let p;if(g){f?i.closePath():_o(i,n,h,s);const w=!!n.pathSegment(i,A,{move:f,reverse:!0});p=f&&w,p||_o(i,n,c,s)}i.closePath(),i.fill(p?"evenodd":"nonzero"),i.restore()}}function kd(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,n,r-a,s-n),i.clip())}function _o(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Qd={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Vt&&(l={visible:i.isDatasetVisible(a),index:a,fill:pd(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=fd(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&Cn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;Ko(o)&&Cn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!Ko(n)||e.drawTime!=="beforeDatasetDraw"||Cn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $o=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Pd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ta extends wt{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,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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 e=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=X(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=$o(n,o);let A,c;e.font=s.string,this.isHorizontal()?(A=this.maxWidth,c=this._fitRows(a,o,r,l)+10):(c=this.maxHeight,A=this._fitCols(a,s,r,l)+10),this.width=Math.min(A,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],A=this.lineWidths=[0],c=s+r;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,g=-c;return this.legendItems.forEach((f,p)=>{const w=n+e/2+o.measureText(f.text).width;(p===0||A[A.length-1]+w+2*r>a)&&(h+=c,A[A.length-(p>0?0:1)]=0,g+=c,d++),l[p]={left:0,top:g,row:d,width:w,height:s},A[A.length-1]+=w+r}),h}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],A=this.columnSizes=[],c=a-t;let h=r,d=0,g=0,f=0,p=0;return this.legendItems.forEach((w,M)=>{const{itemWidth:D,itemHeight:Y}=Ld(n,e,o,w,s);M>0&&g+Y+2*r>c&&(h+=d+r,A.push({width:d,height:g}),f+=d+r,p++,d=g=0),l[M]={left:f,top:g,col:p,width:D,height:Y},d=Math.max(d,D),g+=Y+r}),h+=d,A.push({width:d,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=pe(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=$(n,this.left+s,this.right-this.lineWidths[r]);for(const A of e)r!==A.row&&(r=A.row,l=$(n,this.left+s,this.right-this.lineWidths[r])),A.top+=this.top+t+s,A.left=a.leftForLtr(a.x(l),A.width),l+=A.width+s}else{let r=0,l=$(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const A of e)A.col!==r&&(r=A.col,l=$(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),A.top=l,A.left+=this.left+s,A.left=a.leftForLtr(a.x(A.left),A.width),l+=A.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;hi(t,this),this._draw(),di(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=F.color,l=pe(t.rtl,this.left,this.width),A=X(a.font),{padding:c}=a,h=A.size,d=h/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=A.string;const{boxWidth:f,boxHeight:p,itemHeight:w}=$o(a,h),M=function(y,v,C){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;s.save();const I=E(C.lineWidth,1);if(s.fillStyle=E(C.fillStyle,r),s.lineCap=E(C.lineCap,"butt"),s.lineDashOffset=E(C.lineDashOffset,0),s.lineJoin=E(C.lineJoin,"miter"),s.lineWidth=I,s.strokeStyle=E(C.strokeStyle,r),s.setLineDash(E(C.lineDash,[])),a.usePointStyle){const k={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:I},Q=l.xPlus(y,f/2),L=v+d;Is(s,k,Q,L,a.pointStyleWidth&&f)}else{const k=v+Math.max((h-p)/2,0),Q=l.leftForLtr(y,f),L=$t(C.borderRadius);s.beginPath(),Object.values(L).some(q=>q!==0)?Pe(s,{x:Q,y:k,w:f,h:p,radius:L}):s.rect(Q,k,f,p),s.fill(),I!==0&&s.stroke()}s.restore()},D=function(y,v,C){_t(s,C.text,y,v+w/2,A,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},Y=this.isHorizontal(),G=this._computeTitleHeight();Y?g={x:$(o,this.left+c,this.right-n[0]),y:this.top+c+G,line:0}:g={x:this.left+c,y:$(o,this.top+G+c,this.bottom-e[0].height),line:0},Hs(this.ctx,t.textDirection);const B=w+c;this.legendItems.forEach((y,v)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const C=s.measureText(y.text).width,I=l.textAlign(y.textAlign||(y.textAlign=a.textAlign)),k=f+d+C;let Q=g.x,L=g.y;l.setWidth(this.width),Y?v>0&&Q+k+c>this.right&&(L=g.y+=B,g.line++,Q=g.x=$(o,this.left+c,this.right-n[g.line])):v>0&&L+B>this.bottom&&(Q=g.x=Q+e[g.line].width+c,g.line++,L=g.y=$(o,this.top+G+c,this.bottom-e[g.line].height));const q=l.x(Q);if(M(q,L,y),Q=tA(I,Q+f+d,Y?Q+k:this.right,t.rtl),D(l.x(Q),L,y),Y)g.x+=k+c;else if(typeof y.text!="string"){const ct=A.lineHeight;g.y+=ea(y,ct)+c}else g.y+=B}),Vs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=X(e.font),s=tt(e.padding);if(!e.display)return;const o=pe(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,A=s.top+l;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+A,h=$(t.align,h,this.right-d);else{const f=this.columnSizes.reduce((p,w)=>Math.max(p,w.height),0);c=A+$(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}const g=$(r,h,h+d);a.textAlign=o.textAlign(_i(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,_t(a,e.text,g,c,n)}_computeTitleHeight(){const t=this.options.title,e=X(t.font),n=tt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],vt(t,s.left,s.left+s.width)&&vt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Sd(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Pd(s,n);s&&!o&&R(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&R(e.onHover,[t,n,this],this)}else n&&R(e.onClick,[t,n,this],this)}}function Ld(i,t,e,n,s){const o=zd(n,i,t,e),a=Td(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function zd(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Td(i,t,e){let n=i;return typeof t.text!="string"&&(n=ea(t,e)),n}function ea(i,t){const e=i.text?i.text.length:0;return t*e}function Sd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Od={id:"legend",_element:ta,start(i,t,e){const n=i.legend=new ta({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n)},stop(i){et.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;et.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const A=l.controller.getStyle(e?0:void 0),c=tt(A.borderWidth);return{text:t[l.index].label,fillStyle:A.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:A.borderCapStyle,lineDash:A.borderDash,lineDashOffset:A.borderDashOffset,lineJoin:A.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:A.borderColor,pointStyle:n||A.pointStyle,rotation:A.rotation,textAlign:s||A.textAlign,borderRadius:a&&(r||A.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class In extends wt{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,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=V(n.text)?n.text.length:1;this._padding=tt(n.padding);const o=s*X(n.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:e,left:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,A,c,h;return this.isHorizontal()?(c=$(r,n,o),h=e+t,A=o-n):(a.position==="left"?(c=n+t,h=$(r,s,e),l=N*-.5):(c=o-t,h=$(r,e,s),l=N*.5),A=s-e),{titleX:c,titleY:h,maxWidth:A,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=X(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:A}=this._drawArgs(o);_t(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:A,textAlign:_i(e.align),textBaseline:"middle",translation:[a,r]})}}function Rd(i,t){const e=new In({ctx:i.ctx,options:t,chart:i});et.configure(i,e,t),et.addBox(i,e),i.titleBlock=e}var Nd={id:"title",_element:In,start(i,t,e){Rd(i,e)},stop(i){const t=i.titleBlock;et.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;et.configure(i,n,e),n.options=e},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 Pi=new WeakMap;var Hd={id:"subtitle",start(i,t,e){const n=new In({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n),Pi.set(i,n)},stop(i){et.removeBox(i,Pi.get(i)),Pi.delete(i)},beforeUpdate(i,t,e){const n=Pi.get(i);et.configure(i,n,e),n.options=e},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 We={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const A=l.getCenterPoint(),c=Ji(t,A);c<s&&(s=c,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Bt(i,t){return t&&(V(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Qt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1855
|
+
*/class tc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=bs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Et=new tc;const Xs="transparent",ec={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=xs(i||Xs),s=n.valid&&xs(t||Xs);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ic{constructor(t,e,n,s){const o=e[n];s=Le([t.to,s,o,t.from]);const a=Le([t.from,o,s]);this._active=!0,this._fn=t.fn||ec[t.type||typeof a],this._easing=Ee[t.easing]||Ee.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Le([t.to,e,s,t.from]),this._from=Le([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<n),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}class Js{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(F.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(V(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a)})})}_animateOptions(t,e){const n=e.options,s=sc(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&nc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const A=a[l];if(A.charAt(0)==="$")continue;if(A==="options"){s.push(...this._animateOptions(t,e));continue}const c=e[A];let h=o[A];const d=n.get(A);if(h)if(d&&h.active()){h.update(d,c,r);continue}else h.cancel();if(!d||!d.duration){t[A]=c;continue}o[A]=h=new ic(d,t,A,c),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Et.add(this._chart,n),!0}}function nc(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function sc(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function qs(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function oc(i,t,e){if(e===!1)return!1;const n=qs(i,e),s=qs(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function ac(i){let t,e,n,s;return P(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function _s(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function $s(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let a,r,l,A;if(t===null)return;let c=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(c=!0,n.all)continue;break}A=i.values[l],Z(A)&&(o||t===0||Mt(t)===Mt(A))&&(t+=A)}return!c&&!n.all?0:t}function rc(i,t){const{iScale:e,vScale:n}=t,s=e.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,A,c;for(l=0,A=a.length;l<A;++l)c=a[l],r[l]={[s]:c,[o]:i[c]};return r}function hn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function lc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ac(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function cc(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function to(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function eo(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,A=a.axis,c=lc(o,a,n),h=t.length;let d;for(let g=0;g<h;++g){const f=t[g],{[l]:p,[A]:w}=f,M=f._stacks||(f._stacks={});d=M[A]=cc(s,c,p),d[r]=w,d._top=to(d,a,!0,n.type),d._bottom=to(d,a,!1,n.type);const D=d._visualValues||(d._visualValues={});D[r]=w}}function dn(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function hc(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dc(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ze(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const gn=i=>i==="reset"||i==="none",io=(i,t)=>t?i:Object.assign({},i),gc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:_s(e,!0),values:null};class pt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=hn(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&&ze(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(h,d,g,f)=>h==="x"?d:h==="r"?f:g,o=e.xAxisID=E(n.xAxisID,dn(t,"x")),a=e.yAxisID=E(n.yAxisID,dn(t,"y")),r=e.rAxisID=E(n.rAxisID,dn(t,"r")),l=e.indexAxis,A=e.iAxisID=s(l,o,a,r),c=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(A),e.vScale=this.getScaleForId(c)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ws(this._data,this),t._stacked&&ze(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(P(e)){const s=this._cachedMeta;this._data=rc(e,s)}else if(n!==e){if(n){ws(n,this);const s=this._cachedMeta;ze(s),s._parsed=[]}e&&Object.isExtensible(e)&&_l(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=hn(e.vScale,e),e.stack!==n.stack&&(s=!0,ze(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(eo(this,e._parsed),e._stacked=hn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,r=o.axis;let l=t===0&&e===s.length?!0:n._sorted,A=t>0&&n._parsed[t-1],c,h,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{V(s[t])?d=this.parseArrayData(n,s,t,e):P(s[t])?d=this.parseObjectData(n,s,t,e):d=this.parsePrimitiveData(n,s,t,e);const g=()=>h[r]===null||A&&h[r]<A[r];for(c=0;c<e;++c)n._parsed[c+t]=h=d[c],l&&(g()&&(l=!1),A=h);n._sorted=l}a&&eo(this,d)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,A=o.getLabels(),c=o===a,h=new Array(s);let d,g,f;for(d=0,g=s;d<g;++d)f=d+n,h[d]={[r]:c||o.parse(A[f],f),[l]:a.parse(e[f],f)};return h}parseArrayData(t,e,n,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,A,c,h;for(l=0,A=s;l<A;++l)c=l+n,h=e[c],r[l]={x:o.parse(h[0],c),y:a.parse(h[1],c)};return r}parseObjectData(t,e,n,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,A=new Array(s);let c,h,d,g;for(c=0,h=s;c<h;++c)d=c+n,g=e[d],A[c]={x:o.parse(Ot(g,r),d),y:a.parse(Ot(g,l),d)};return A}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:_s(s,!0),values:e._stacks[t.axis]._visualValues};return $s(r,a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let a=o===null?NaN:o;const r=s&&n._stacks[e.axis];s&&r&&(s.values=r,a=$s(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,r=this._getOtherScale(t),l=gc(e,n,this.chart),A={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=Ac(r);let d,g;function f(){g=s[d];const p=g[r.axis];return!Z(g[t.axis])||c>p||h<p}for(d=0;d<a&&!(!f()&&(this.updateRangeFromParsed(A,t,g,l),o));++d);if(o){for(d=a-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(A,t,g,l);break}}return A}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],Z(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=ac(E(this.options.clip,oc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,A=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,o,r,l),c=r;c<r+l;++c){const h=s[c];h.hidden||(h.active&&A?a.push(h):h.draw(t,o))}for(c=0;c<a.length;++c)a[c].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=dc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=hc(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&ve(n);if(r)return io(r,l);const A=this.chart.config,c=A.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],d=A.getOptionScopes(this.getDataset(),c),g=Object.keys(F.elements[t]),f=()=>this.getContext(n,s,e),p=A.resolveNamedOptions(d,g,f,h);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(io(p,l))),p}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const c=this.chart.config,h=c.datasetAnimationScopeKeys(this._type,e),d=c.getOptionScopes(this.getDataset(),h);l=c.createResolver(d,this.getContext(t,n,e))}const A=new Js(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(A)),A}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||gn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:a}}updateElement(t,e,n,s){gn(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!gn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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 e=this._data,n=this._cachedMeta.data;for(const[r,l,A]of this._syncList)this[r](l,A);this._syncList=[];const s=n.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=A=>{for(A.length+=e,r=A.length-1;r>=a;r--)A[r]=A[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&ze(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}x(pt,"defaults",{}),x(pt,"datasetElementType",null),x(pt,"dataElementType",null);function uc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=ms(n.sort((s,o)=>s-o))}return i._cache.$bar}function fc(i){const t=i.iScale,e=uc(t,i.type);let n=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(ve(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return n}function pc(i,t,e,n){const s=e.barThickness;let o,a;return z(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:t.pixels[i]-o/2}}function wc(i,t,e,n){const s=t.pixels,o=s[i];let a=i>0?s[i-1]:null,r=i<s.length-1?s[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const A=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/n,ratio:e.barPercentage,start:A}}function mc(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,A=r;Math.abs(a)>Math.abs(r)&&(l=r,A=a),t[e.axis]=A,t._custom={barStart:l,barEnd:A,start:s,end:o,min:a,max:r}}function no(i,t,e,n){return V(i)?mc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function so(i,t,e,n){const s=i.iScale,o=i.vScale,a=s.getLabels(),r=s===o,l=[];let A,c,h,d;for(A=e,c=e+n;A<c;++A)d=t[A],h={},h[s.axis]=r||s.parse(a[A],A),l.push(no(d,h,o,A));return l}function un(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function bc(i,t,e){return i!==0?Mt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Mc(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function Dc(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:A,bottom:c}=Mc(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=A:(e._bottom||0)===n?s=c:(o[oo(c,a,r,l)]=!0,s=A)),o[oo(s,a,r,l)]=!0,i.borderSkipped=o}function oo(i,t,e,n){return n?(i=Bc(i,t,e),i=ao(i,e,t)):i=ao(i,t,e),i}function Bc(i,t,e){return i===t?e:i===e?t:i}function ao(i,t,e){return i==="start"?t:i==="end"?e:i}function Gc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class wi extends pt{parsePrimitiveData(t,e,n,s){return so(t,e,n,s)}parseArrayData(t,e,n,s){return so(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,A=o.axis==="x"?r:l,c=a.axis==="x"?r:l,h=[];let d,g,f,p;for(d=n,g=n+s;d<g;++d)p=e[d],f={},f[o.axis]=o.parse(Ot(p,A),d),h.push(no(Ot(p,c),f,a,d));return h}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===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 e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=un(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),A=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s);for(let g=e;g<e+n;g++){const f=this.getParsed(g),p=o||z(f[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,c),M=(f._stacks||{})[r.axis],D={horizontal:A,base:p.base,enableBorderRadius:!M||un(f._custom)||a===M._top||a===M._bottom,x:A?p.head:w.center,y:A?w.center:p.head,height:A?w.size:Math.abs(p.size),width:A?Math.abs(p.size):w.size};d&&(D.options=h||this.resolveDataElementOptions(g,t[g].active?"active":s));const Y=D.options||t[g].options;Dc(D,Y,M,a),Gc(D,Y,c.ratio),this.updateElement(t[g],g,D,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=n.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[n.axis],A=c=>{const h=c._parsed.find(g=>g[n.axis]===l),d=h&&h[c.vScale.axis];if(z(d)||isNaN(d))return!0};for(const c of s)if(!(e!==void 0&&A(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const r=t.barThickness;return{min:r||fc(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),A=l._custom,c=un(A);let h=l[e.axis],d=0,g=n?this.applyStack(e,l,n):h,f,p;g!==h&&(d=g-h,g=h),c&&(h=A.barStart,g=A.barEnd-A.barStart,h!==0&&Mt(h)!==Mt(A.barEnd)&&(d=0),d+=h);const w=!z(o)&&!c?o:d;let M=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?f=e.getPixelForValue(d+g):f=M,p=f-M,Math.abs(p)<a){p=bc(p,e,r)*a,h===r&&(M-=p/2);const D=e.getPixelForDecimal(0),Y=e.getPixelForDecimal(1),G=Math.min(D,Y),B=Math.max(D,Y);M=Math.max(Math.min(M,B),G),f=M+p,n&&!c&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(f)-e.getValueForPixel(M))}if(M===e.getPixelForValue(r)){const D=Mt(p)*e.getLineWidthForValue(r)/2;M+=D,p-=D}return{size:p,base:M,head:f,center:f+p/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,a=E(s.maxBarThickness,1/0);let r,l;if(e.grouped){const A=o?this._getStackCount(t):e.stackCount,c=s.barThickness==="flex"?wc(t,e,s,A):pc(t,e,s,A),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=c.start+c.chunk*h+c.chunk/2,l=Math.min(a,c.chunk*c.ratio)}else r=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}x(wi,"id","bar"),x(wi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),x(wi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class mi extends pt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=E(r[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let a=0;a<o.length;a++){const r=e[n+a];o[a]._custom=E(r&&r.r&&+r.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),A=a._custom;return{label:n[t]||"",value:"("+r+", "+l+(A?", "+A:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:A}=this._getSharedOptions(e,s),c=a.axis,h=r.axis;for(let d=e;d<e+n;d++){const g=t[d],f=!o&&this.getParsed(d),p={},w=p[c]=o?a.getPixelForDecimal(.5):a.getPixelForValue(f[c]),M=p[h]=o?r.getBasePixel():r.getPixelForValue(f[h]);p.skip=isNaN(w)||isNaN(M),A&&(p.options=l||this.resolveDataElementOptions(d,g.active?"active":s),o&&(p.options.radius=0)),this.updateElement(g,d,p,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=E(n&&n._custom,o),s}}x(mi,"id","bubble"),x(mi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),x(mi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Yc(i,t,e){let n=1,s=1,o=0,a=0;if(t<H){const r=i,l=r+t,A=Math.cos(r),c=Math.sin(r),h=Math.cos(l),d=Math.sin(l),g=(Y,G,B)=>Ie(Y,r,l,!0)?1:Math.max(G,G*e,B,B*e),f=(Y,G,B)=>Ie(Y,r,l,!0)?-1:Math.min(G,G*e,B,B*e),p=g(0,A,h),w=g(U,c,d),M=f(N,A,h),D=f(N+U,c,d);n=(p-M)/2,s=(w-D)/2,o=-(p+M)/2,a=-(w+D)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a}}class se extends pt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(P(n[t])){const{key:l="value"}=this._parsing;o=A=>+Ot(n[A],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=H,e=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(n.width,n.height)-a)/2,0),l=Math.min(Ol(this.options.cutout,r),1),A=this._getRingWeight(this.index),{circumference:c,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:g,offsetX:f,offsetY:p}=Yc(h,c,l),w=(n.width-a)/d,M=(n.height-a)/g,D=Math.max(Math.min(w,M)/2,0),Y=rs(this.options.radius,D),G=Math.max(Y*l,0),B=(Y-G)/this._getVisibleDatasetWeightTotal();this.offsetX=f*Y,this.offsetY=p*Y,s.total=this.calculateTotal(),this.outerRadius=Y-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*A,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/H)}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,r=a.chartArea,A=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=o&&A.animateScale,g=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:w}=this._getSharedOptions(e,s);let M=this._getRotation(),D;for(D=0;D<e;++D)M+=this._circumference(D,o);for(D=e;D<e+n;++D){const Y=this._circumference(D,o),G=t[D],B={x:c+this.offsetX,y:h+this.offsetY,startAngle:M,endAngle:M+Y,circumference:Y,outerRadius:f,innerRadius:g};w&&(B.options=p||this.resolveDataElementOptions(D,G.active?"active":s)),M+=Y,this.updateElement(G,D,B,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}x(se,"id","doughnut"),x(se,"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"}),x(se,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),x(se,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class bi extends pt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Ds(e,s,a);this._drawStart=r,this._drawCount=l,Bs(e)&&(r=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const A=this.resolveDatasetElementOptions(t);this.options.showLine||(A.borderWidth=0),A.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:A},t),this.updateElements(s,r,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:A}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,s),d=a.axis,g=r.axis,{spanGaps:f,segment:p}=this.options,w=ge(f)?f:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none",D=e+n,Y=t.length;let G=e>0&&this.getParsed(e-1);for(let B=0;B<Y;++B){const y=t[B],v=M?y:{};if(B<e||B>=D){v.skip=!0;continue}const C=this.getParsed(B),I=z(C[g]),k=v[d]=a.getPixelForValue(C[d],B),Q=v[g]=o||I?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[g],B);v.skip=isNaN(k)||isNaN(Q)||I,v.stop=B>0&&Math.abs(C[d]-G[d])>w,p&&(v.parsed=C,v.raw=A.data[B]),h&&(v.options=c||this.resolveDataElementOptions(B,y.active?"active":s)),M||this.updateElement(y,B,v,s),G=C}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}x(bi,"id","line"),x(bi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),x(bi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Te extends pt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=ke(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return Ss.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,n,s){const o=s==="reset",a=this.chart,l=a.options.animation,A=this._cachedMeta.rScale,c=A.xCenter,h=A.yCenter,d=A.getIndexAngle(0)-.5*N;let g=d,f;const p=360/this.countVisibleElements();for(f=0;f<e;++f)g+=this._computeAngle(f,s,p);for(f=e;f<e+n;f++){const w=t[f];let M=g,D=g+this._computeAngle(f,s,p),Y=a.getDataVisibility(f)?A.getDistanceFromCenterForValue(this.getParsed(f).r):0;g=D,o&&(l.animateScale&&(Y=0),l.animateRotate&&(M=D=d));const G={x:c,y:h,innerRadius:0,outerRadius:Y,startAngle:M,endAngle:D,options:this.resolveDataElementOptions(f,w.active?"active":s)};this.updateElement(w,f,G,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?ft(this.resolveDataElementOptions(t,e).angle||n):0}}x(Te,"id","polarArea"),x(Te,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),x(Te,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class fn extends se{}x(fn,"id","pie"),x(fn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mi extends pt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Ss.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+n;r++){const l=t[r],A=this.resolveDataElementOptions(r,l.active?"active":s),c=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:c.x,d=a?o.yCenter:c.y,g={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:A};this.updateElement(l,r,g,s)}}}x(Mi,"id","radar"),x(Mi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),x(Mi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Di extends pt{getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Ds(e,n,s);if(this._drawStart=o,this._drawCount=a,Bs(e)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=n;const A=this.resolveDatasetElementOptions(t);A.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:A},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:A}=this._cachedMeta,c=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(c),d=this.includeOptions(s,h),g=a.axis,f=r.axis,{spanGaps:p,segment:w}=this.options,M=ge(p)?p:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||s==="none";let Y=e>0&&this.getParsed(e-1);for(let G=e;G<e+n;++G){const B=t[G],y=this.getParsed(G),v=D?B:{},C=z(y[f]),I=v[g]=a.getPixelForValue(y[g],G),k=v[f]=o||C?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,y,l):y[f],G);v.skip=isNaN(I)||isNaN(k)||C,v.stop=G>0&&Math.abs(y[g]-Y[g])>M,w&&(v.parsed=y,v.raw=A.data[G]),d&&(v.options=h||this.resolveDataElementOptions(G,B.active?"active":s)),D||this.updateElement(B,G,v,s),Y=y}this.updateSharedOptions(h,s,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}x(Di,"id","scatter"),x(Di,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),x(Di,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var xc=Object.freeze({__proto__:null,BarController:wi,BubbleController:mi,DoughnutController:se,LineController:bi,PieController:fn,PolarAreaController:Te,RadarController:Mi,ScatterController:Di});function oe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class pn{constructor(t){x(this,"options");this.options=t||{}}static override(t){Object.assign(pn.prototype,t)}init(){}formats(){return oe()}parse(){return oe()}format(){return oe()}add(){return oe()}diff(){return oe()}startOf(){return oe()}endOf(){return oe()}}var yc={_date:pn};function vc(i,t,e,n){const{controller:s,data:o,_sorted:a}=i,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?Jl:Ct;if(n){if(s._sharedOptions){const A=o[0],c=typeof A.getRange=="function"&&A.getRange(t);if(c){const h=l(o,t,e-c),d=l(o,t,e+c);return{lo:h.lo,hi:d.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Se(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:A,data:c}=o[r],{lo:h,hi:d}=vc(o[r],t,a,s);for(let g=h;g<=d;++g){const f=c[g];f.skip||n(f,A,g)}}}function Cc(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,a=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function wn(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Se(i,e,t,function(r,l,A){!s&&!It(r,i.chartArea,0)||r.inRange(t.x,t.y,n)&&o.push({element:r,datasetIndex:l,index:A})},!0),o}function Ic(i,t,e,n){let s=[];function o(a,r,l){const{startAngle:A,endAngle:c}=a.getProps(["startAngle","endAngle"],n),{angle:h}=fs(a,{x:t.x,y:t.y});Ie(h,A,c)&&s.push({element:a,datasetIndex:r,index:l})}return Se(i,e,t,o),s}function Ec(i,t,e,n,s,o){let a=[];const r=Cc(e);let l=Number.POSITIVE_INFINITY;function A(c,h,d){const g=c.inRange(t.x,t.y,s);if(n&&!g)return;const f=c.getCenterPoint(s);if(!(!!o||i.isPointInArea(f))&&!g)return;const w=r(t,f);w<l?(a=[{element:c,datasetIndex:h,index:d}],l=w):w===l&&a.push({element:c,datasetIndex:h,index:d})}return Se(i,e,t,A),a}function mn(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?Ic(i,t,e,s):Ec(i,t,e,n,s,o)}function ro(i,t,e,n,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Se(i,e,t,(l,A,c)=>{l[a]&&l[a](t[e],s)&&(o.push({element:l,datasetIndex:A,index:c}),r=r||l.inRange(t.x,t.y,s))}),n&&!r?[]:o}var kc={evaluateInteractionItems:Se,modes:{index(i,t,e,n){const s=ie(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?wn(i,s,o,n,a):mn(i,s,o,!1,n,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(A=>{const c=r[0].index,h=A.data[c];h&&!h.skip&&l.push({element:h,datasetIndex:A.index,index:c})}),l):[]},dataset(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?wn(i,s,o,n,a):mn(i,s,o,!1,n,a);if(r.length>0){const l=r[0].datasetIndex,A=i.getDatasetMeta(l).data;r=[];for(let c=0;c<A.length;++c)r.push({element:A[c],datasetIndex:l,index:c})}return r},point(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return wn(i,s,o,n,a)},nearest(i,t,e,n){const s=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return mn(i,s,o,e.intersect,n,a)},x(i,t,e,n){const s=ie(t,i);return ro(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=ie(t,i);return ro(i,s,"y",e.intersect,n)}}};const lo=["left","top","right","bottom"];function Oe(i,t){return i.filter(e=>e.pos===t)}function Ao(i,t){return i.filter(e=>lo.indexOf(e.pos)===-1&&e.box.axis===t)}function Re(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Qc(i){const t=[];let e,n,s,o,a,r;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Pc(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!lo.includes(s))continue;const a=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Lc(i,t){const e=Pc(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,A=e[r.stack],c=A&&r.stackWeight/A.weight;r.horizontal?(r.width=c?c*n:l&&t.availableWidth,r.height=s):(r.width=n,r.height=c?c*s:l&&t.availableHeight)}return e}function zc(i){const t=Qc(i),e=Re(t.filter(A=>A.box.fullSize),!0),n=Re(Oe(t,"left"),!0),s=Re(Oe(t,"right")),o=Re(Oe(t,"top"),!0),a=Re(Oe(t,"bottom")),r=Ao(t,"x"),l=Ao(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Oe(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function co(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function ho(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Tc(i,t,e,n){const{pos:s,box:o}=e,a=i.maxPadding;if(!P(s)){e.size&&(i[s]-=e.size);const h=n[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,i[s]+=e.size}o.getPadding&&ho(a,o.getPadding());const r=Math.max(0,t.outerWidth-co(a,i,"left","right")),l=Math.max(0,t.outerHeight-co(a,i,"top","bottom")),A=r!==i.w,c=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:A,other:c}:{same:c,other:A}}function Sc(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Oc(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return n(i?["left","right"]:["top","bottom"])}function Ne(i,t,e,n){const s=[];let o,a,r,l,A,c;for(o=0,a=i.length,A=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Oc(r.horizontal,t));const{same:h,other:d}=Tc(t,e,r,n);A|=h&&s.length,c=c||d,l.fullSize||s.push(r)}return A&&Ne(s,t,e,n)||c}function Bi(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function go(i,t,e,n){const s=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,A=n[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/A.weight||1;if(r.horizontal){const h=t.w*c,d=A.size||l.height;ve(A.start)&&(a=A.start),l.fullSize?Bi(l,s.left,a,e.outerWidth-s.right-s.left,d):Bi(l,t.left+A.placed,a,h,d),A.start=a,A.placed+=h,a=l.bottom}else{const h=t.h*c,d=A.size||l.width;ve(A.start)&&(o=A.start),l.fullSize?Bi(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Bi(l,o,t.top+A.placed,d,h),A.start=o,A.placed+=h,o=l.right}}t.x=o,t.y=a}var et={addBox(i,t){i.boxes||(i.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(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=tt(i.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=zc(i.boxes),l=r.vertical,A=r.horizontal;T(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const c=l.reduce((p,w)=>w.box.options&&w.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},s);ho(d,tt(n));const g=Object.assign({maxPadding:d,w:o,h:a,x:s.left,y:s.top},s),f=Lc(l.concat(A),h);Ne(r.fullSize,g,h,f),Ne(l,g,h,f),Ne(A,g,h,f)&&Ne(l,g,h,f),Sc(g),go(r.leftAndTop,g,h,f),g.x+=g.w,g.y+=g.h,go(r.rightAndBottom,g,h,f),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},T(r.chartArea,p=>{const w=p.box;Object.assign(w,i.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class uo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Rc extends uo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gi="$chartjs",Nc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fo=i=>i===null||i==="";function Hc(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Gi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",fo(s)){const o=Ns(i,"width");o!==void 0&&(i.width=o)}if(fo(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ns(i,"height");o!==void 0&&(i.height=o)}return i}const po=FA?{passive:!0}:!1;function Vc(i,t,e){i&&i.addEventListener(t,e,po)}function Fc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,po)}function jc(i,t){const e=Nc[i.type]||i.type,{x:n,y:s}=ie(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Yi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Wc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.addedNodes,n),a=a&&!Yi(r.removedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Zc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Yi(r.removedNodes,n),a=a&&!Yi(r.addedNodes,n);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const He=new Map;let wo=0;function mo(){const i=window.devicePixelRatio;i!==wo&&(wo=i,He.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Uc(i,t){He.size||window.addEventListener("resize",mo),He.set(i,t)}function Kc(i){He.delete(i),He.size||window.removeEventListener("resize",mo)}function Xc(i,t,e){const n=i.canvas,s=n&&cn(n);if(!s)return;const o=Ms((r,l)=>{const A=s.clientWidth;e(r,l),A<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],A=l.contentRect.width,c=l.contentRect.height;A===0&&c===0||o(A,c)});return a.observe(s),Uc(i,o),a}function bn(i,t,e){e&&e.disconnect(),t==="resize"&&Kc(i)}function Jc(i,t,e){const n=i.canvas,s=Ms(o=>{i.ctx!==null&&e(jc(o,i))},i);return Vc(n,t,s),s}class qc extends uo{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Hc(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Gi])return!1;const n=e[Gi].initial;["height","width"].forEach(o=>{const a=n[o];z(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Gi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Wc,detach:Zc,resize:Xc}[e]||Jc;s[e]=a(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:bn,detach:bn,resize:bn}[e]||Fc)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return VA(t,e,n,s)}isAttached(t){const e=t&&cn(t);return!!(e&&e.isConnected)}}function _c(i){return!An()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Rc:qc}class wt{constructor(){x(this,"x");x(this,"y");x(this,"active",!1);x(this,"options");x(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return ge(this.x)&&ge(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}x(wt,"defaults",{}),x(wt,"defaultRoutes");function $c(i,t){const e=i.options.ticks,n=th(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?ih(t):[],a=o.length,r=o[0],l=o[a-1],A=[];if(a>s)return nh(t,A,o,a/s),A;const c=eh(o,t,s);if(a>0){let h,d;const g=a>1?Math.round((l-r)/(a-1)):null;for(xi(t,A,c,z(g)?0:r-g,r),h=0,d=a-1;h<d;h++)xi(t,A,c,o[h],o[h+1]);return xi(t,A,c,l,z(g)?t.length:l+g),A}return xi(t,A,c),A}function th(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function eh(i,t,e){const n=sh(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Zl(n);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function ih(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function nh(i,t,e,n){let s=0,o=e[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===o&&(t.push(i[a]),s++,o=e[s*n])}function xi(i,t,e,n,s){const o=E(n,0),a=Math.min(E(s,i.length),i.length);let r=0,l,A,c;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),c=o;c<0;)r++,c=Math.round(o+r*e);for(A=Math.max(o,0);A<a;A++)A===c&&(t.push(i[A]),r++,c=Math.round(o+r*e))}function sh(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const oh=i=>i==="left"?"right":i==="right"?"left":i,bo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Mo=(i,t)=>Math.min(t||i,i);function Do(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function ah(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(s),A;if(!(e&&(n===1?A=Math.max(l-o,a-l):t===0?A=(i.getPixelForTick(1)-l)/2:A=(l-i.getPixelForTick(s-1))/2,l+=s<t?A:-A,l<o-r||l>a+r)))return l}function rh(i,t){T(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function Ve(i){return i.drawTicks?i.tickLength:0}function Bo(i,t){if(!i.display)return 0;const e=X(i.font,t),n=tt(i.padding);return(V(i.text)?i.text.length:1)*e.lineHeight+n.height}function lh(i,t){return Ht(i,{scale:t,type:"scale"})}function Ah(i,t,e){return Ht(i,{tick:e,index:t,type:"tick"})}function ch(i,t,e){let n=_i(i);return(e&&t!=="right"||!e&&t==="right")&&(n=oh(n)),n}function hh(i,t,e,n){const{top:s,left:o,bottom:a,right:r,chart:l}=i,{chartArea:A,scales:c}=l;let h=0,d,g,f;const p=a-s,w=r-o;if(i.isHorizontal()){if(g=$(n,o,r),P(e)){const M=Object.keys(e)[0],D=e[M];f=c[M].getPixelForValue(D)+p-t}else e==="center"?f=(A.bottom+A.top)/2+p-t:f=bo(i,e,t);d=r-o}else{if(P(e)){const M=Object.keys(e)[0],D=e[M];g=c[M].getPixelForValue(D)-w+t}else e==="center"?g=(A.left+A.right)/2-w+t:g=bo(i,e,t);f=$(n,a,s),h=e==="left"?-U:U}return{titleX:g,titleY:f,maxWidth:d,rotation:h}}class ae extends wt{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,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=lt(t,Number.POSITIVE_INFINITY),e=lt(e,Number.NEGATIVE_INFINITY),n=lt(n,Number.POSITIVE_INFINITY),s=lt(s,Number.NEGATIVE_INFINITY),{min:lt(t,n),max:lt(e,s),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:n};const r=this.getMatchingVisibleMetas();for(let l=0,A=r.length;l<A;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(n=Math.max(n,a.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:lt(e,lt(n,e)),max:lt(n,lt(e,n))}}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(){R(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=MA(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Do(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=$c(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,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(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(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=R(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=Mo(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,A;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,g=J(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/n:g/(n-1),h+6>r&&(r=g/(n-(t.offset?.5:1)),l=this.maxHeight-Ve(t.grid)-e.padding-Bo(t.title,this.chart.options.font),A=Math.sqrt(h*h+d*d),a=Xi(Math.min(Math.asin(J((c.highest.height+6)/r,-1,1)),Math.asin(J(l/A,-1,1))-Math.asin(J(d/A,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Bo(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ve(o)+l):(t.height=this.maxHeight,t.width=Ve(o)+l),n.display&&this.ticks.length){const{first:A,last:c,widest:h,highest:d}=this._getLabelSizes(),g=n.padding*2,f=ft(this.labelRotation),p=Math.cos(f),w=Math.sin(f);if(r){const M=n.mirror?0:w*h.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+M+g)}else{const M=n.mirror?0:p*h.width+w*d.height;t.width=Math.min(this.maxWidth,t.width+M+g)}this._calculatePadding(A,c,w,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,A=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,g=0;l?A?(d=s*t.width,g=n*e.height):(d=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,g=e.width/2),this.paddingLeft=Math.max((d-c+a)*this.width/(this.width-c),0),this.paddingRight=Math.max((g-h+a)*this.width/(this.width-h),0)}else{let c=e.height/2,h=t.height/2;o==="start"?(c=0,h=t.height):o==="end"&&(c=e.height,h=0),this.paddingTop=c+a,this.paddingBottom=h+a}}_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(){R(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)z(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Do(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Mo(e,n));let A=0,c=0,h,d,g,f,p,w,M,D,Y,G,B;for(h=0;h<e;h+=l){if(f=t[h].label,p=this._resolveTickFontOptions(h),s.font=w=p.string,M=o[w]=o[w]||{data:{},gc:[]},D=p.lineHeight,Y=G=0,!z(f)&&!V(f))Y=ci(s,M.data,M.gc,Y,f),G=D;else if(V(f))for(d=0,g=f.length;d<g;++d)B=f[d],!z(B)&&!V(B)&&(Y=ci(s,M.data,M.gc,Y,B),G+=D);a.push(Y),r.push(G),A=Math.max(Y,A),c=Math.max(G,c)}rh(o,e);const y=a.indexOf(A),v=r.indexOf(c),C=I=>({width:a[I]||0,height:r[I]||0});return{first:C(0),last:C(e-1),widest:C(y),highest:C(v),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Xl(this._alignToPixels?_t(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Ah(this.getContext(),t,n))}return this.$context||(this.$context=lh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,A=this.isHorizontal(),h=this.ticks.length+(l?1:0),d=Ve(o),g=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,w=p/2,M=function(W){return _t(n,W,p)};let D,Y,G,B,y,v,C,I,k,Q,L,q;if(a==="top")D=M(this.bottom),v=this.bottom-d,I=D-w,Q=M(t.top)+w,q=t.bottom;else if(a==="bottom")D=M(this.top),Q=t.top,q=M(t.bottom)-w,v=D+w,I=this.top+d;else if(a==="left")D=M(this.right),y=this.right-d,C=D-w,k=M(t.left)+w,L=t.right;else if(a==="right")D=M(this.left),k=t.left,L=M(t.right)-w,y=D+w,C=this.left+d;else if(e==="x"){if(a==="center")D=M((t.top+t.bottom)/2+.5);else if(P(a)){const W=Object.keys(a)[0],K=a[W];D=M(this.chart.scales[W].getPixelForValue(K))}Q=t.top,q=t.bottom,v=D+w,I=v+d}else if(e==="y"){if(a==="center")D=M((t.left+t.right)/2);else if(P(a)){const W=Object.keys(a)[0],K=a[W];D=M(this.chart.scales[W].getPixelForValue(K))}y=D-w,C=y-d,k=t.left,L=t.right}const ct=E(s.ticks.maxTicksLimit,h),S=Math.max(1,Math.ceil(h/ct));for(Y=0;Y<h;Y+=S){const W=this.getContext(Y),K=o.setContext(W),bt=r.setContext(W),it=K.lineWidth,me=K.color,Ni=bt.dash||[],be=bt.dashOffset,Je=K.tickWidth,le=K.tickColor,qe=K.tickBorderDash||[],Ae=K.tickBorderDashOffset;G=ah(this,Y,l),G!==void 0&&(B=_t(n,G,it),A?y=C=k=L=B:v=I=Q=q=B,g.push({tx1:y,ty1:v,tx2:C,ty2:I,x1:k,y1:Q,x2:L,y2:q,width:it,color:me,borderDash:Ni,borderDashOffset:be,tickWidth:Je,tickColor:le,tickBorderDash:qe,tickBorderDashOffset:Ae}))}return this._ticksLength=h,this._borderValue=D,g}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:A,padding:c,mirror:h}=o,d=Ve(n.grid),g=d+c,f=h?-c:g,p=-ft(this.labelRotation),w=[];let M,D,Y,G,B,y,v,C,I,k,Q,L,q="middle";if(s==="top")y=this.bottom-f,v=this._getXAxisLabelAlignment();else if(s==="bottom")y=this.top+f,v=this._getXAxisLabelAlignment();else if(s==="left"){const S=this._getYAxisLabelAlignment(d);v=S.textAlign,B=S.x}else if(s==="right"){const S=this._getYAxisLabelAlignment(d);v=S.textAlign,B=S.x}else if(e==="x"){if(s==="center")y=(t.top+t.bottom)/2+g;else if(P(s)){const S=Object.keys(s)[0],W=s[S];y=this.chart.scales[S].getPixelForValue(W)+g}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")B=(t.left+t.right)/2-g;else if(P(s)){const S=Object.keys(s)[0],W=s[S];B=this.chart.scales[S].getPixelForValue(W)}v=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const ct=this._getLabelSizes();for(M=0,D=r.length;M<D;++M){Y=r[M],G=Y.label;const S=o.setContext(this.getContext(M));C=this.getPixelForTick(M)+o.labelOffset,I=this._resolveTickFontOptions(M),k=I.lineHeight,Q=V(G)?G.length:1;const W=Q/2,K=S.color,bt=S.textStrokeColor,it=S.textStrokeWidth;let me=v;a?(B=C,v==="inner"&&(M===D-1?me=this.options.reverse?"left":"right":M===0?me=this.options.reverse?"right":"left":me="center"),s==="top"?A==="near"||p!==0?L=-Q*k+k/2:A==="center"?L=-ct.highest.height/2-W*k+k:L=-ct.highest.height+k/2:A==="near"||p!==0?L=k/2:A==="center"?L=ct.highest.height/2-W*k:L=ct.highest.height-Q*k,h&&(L*=-1),p!==0&&!S.showLabelBackdrop&&(B+=k/2*Math.sin(p))):(y=C,L=(1-Q)*k/2);let Ni;if(S.showLabelBackdrop){const be=tt(S.backdropPadding),Je=ct.heights[M],le=ct.widths[M];let qe=L-be.top,Ae=0-be.left;switch(q){case"middle":qe-=Je/2;break;case"bottom":qe-=Je;break}switch(v){case"center":Ae-=le/2;break;case"right":Ae-=le;break;case"inner":M===D-1?Ae-=le:M>0&&(Ae-=le/2);break}Ni={left:Ae,top:qe,width:le+be.width,height:Je+be.height,color:S.backdropColor}}w.push({label:G,font:I,textOffset:L,options:{rotation:p,color:K,strokeColor:bt,strokeWidth:it,textAlign:me,textBaseline:q,translation:[B,y],backdrop:Ni}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let A,c;return e==="left"?s?(c=this.right+o,n==="near"?A="left":n==="center"?(A="center",c+=l/2):(A="right",c+=l)):(c=this.right-r,n==="near"?A="right":n==="center"?(A="center",c-=l/2):(A="left",c=this.left)):e==="right"?s?(c=this.left+o,n==="near"?A="right":n==="center"?(A="center",c-=l/2):(A="left",c-=l)):(c=this.left+r,n==="near"?A="left":n==="center"?(A="center",c+=l/2):(A="right",c=this.right)):A="right",{textAlign:A,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,A,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(A.x,A.y),n.stroke(),n.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({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:e,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let A,c,h,d;this.isHorizontal()?(A=_t(t,this.left,a)-a/2,c=_t(t,this.right,r)+r/2,h=d=l):(h=_t(t,this.top,a)-a/2,d=_t(t,this.bottom,r)+r/2,A=c=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(A,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&hi(n,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,A=a.label,c=a.textOffset;$t(n,A,0,c,l,r)}s&&di(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=X(n.font),a=tt(n.padding),r=n.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(l+=a.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;const{titleX:A,titleY:c,maxWidth:h,rotation:d}=hh(this,l,e,r);$t(t,n.text,0,0,o,{color:n.color,maxWidth:h,rotation:d,textAlign:ch(r,e,s),textBaseline:"middle",translation:[A,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=E(t.grid&&t.grid.z,-1),s=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ae.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[n]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return X(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class yi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;uh(e)&&(n=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,dh(t,a,n),this.override&&F.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in F[s]&&(delete F[s][n],this.override&&delete qt[n])}}function dh(i,t,e){const n=xe(Object.create(null),[e?F.get(e):{},F.get(t),i.defaults]);F.set(t,n),i.defaultRoutes&&gh(t,i.defaultRoutes),i.descriptors&&F.describe(t,i.descriptors)}function gh(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");F.route(o,s,l,r)})}function uh(i){return"id"in i&&"defaults"in i}class fh{constructor(){this.controllers=new yi(pt,"datasets",!0),this.elements=new yi(wt,"elements"),this.plugins=new yi(Object,"plugins"),this.scales=new yi(ae,"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,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):T(s,a=>{const r=n||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,n){const s=Ki(t);R(n["before"+s],[],n),e[t](n),R(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var Dt=new fh;class ph{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,n,s){s=s||{};for(const o of t){const a=o.plugin,r=a[n],l=[e,s,o.options];if(R(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=E(n.options&&n.options.plugins,{}),o=wh(n);return s===!1&&!e?[]:bh(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function wh(i){const t={},e=[],n=Object.keys(Dt.plugins.items);for(let o=0;o<n.length;o++)e.push(Dt.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function mh(i,t){return!t&&i===!1?null:i===!0?{}:i}function bh(i,{plugins:t,localIds:e},n,s){const o=[],a=i.getContext();for(const r of t){const l=r.id,A=mh(n[l],s);A!==null&&o.push({plugin:r,options:Mh(i.config,{plugin:r,local:e[l]},A,a)})}return o}function Mh(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(n,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mn(i,t){const e=F.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Dh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Bh(i,t){return i===t?"_index_":"_value_"}function Go(i){if(i==="x"||i==="y"||i==="r")return i}function Gh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Dn(i,...t){if(Go(i))return i;for(const e of t){const n=e.axis||Gh(e.position)||i.length>1&&Go(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Yo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Yh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return Yo(i,"x",e[0])||Yo(i,"y",e[0])}return{}}function xh(i,t){const e=qt[i.type]||{scales:{}},n=t.scales||{},s=Mn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(a=>{const r=n[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Dn(a,r,Yh(a,i),F.scales[r.type]),A=Bh(l,s),c=e.scales||{};o[a]=ye(Object.create(null),[{axis:l},r,c[l],c[A]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||Mn(r,t),c=(qt[r]||{}).scales||{};Object.keys(c).forEach(h=>{const d=Dh(h,l),g=a[d+"AxisID"]||d;o[g]=o[g]||Object.create(null),ye(o[g],[{axis:d},n[g],c[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];ye(r,[F.scales[r.type],F.scale])}),o}function xo(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=xh(i,t)}function yo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function yh(i){return i=i||{},i.data=yo(i.data),xo(i),i}const vo=new Map,Co=new Set;function vi(i,t){let e=vo.get(i);return e||(e=t(),vo.set(i,e),Co.add(e)),e}const Fe=(i,t,e)=>{const n=Ot(t,e);n!==void 0&&i.add(n)};class vh{constructor(t){this._config=yh(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=yo(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(),xo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return vi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return vi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return vi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,a=this._cachedScopes(t,n),r=a.get(e);if(r)return r;const l=new Set;e.forEach(c=>{t&&(l.add(t),c.forEach(h=>Fe(l,t,h))),c.forEach(h=>Fe(l,s,h)),c.forEach(h=>Fe(l,qt[o]||{},h)),c.forEach(h=>Fe(l,F,h)),c.forEach(h=>Fe(l,en,h))});const A=Array.from(l);return A.length===0&&A.push(Object.create(null)),Co.has(e)&&a.set(e,A),A}chartOptionScopes(){const{options:t,type:e}=this;return[t,qt[e]||{},F.datasets[e]||{},{type:e},F,en]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Io(this._resolverCache,t,s);let l=a;if(Ih(a,e)){o.$shared=!1,n=Rt(n)?n():n;const A=this.createResolver(t,n,r);l=ue(a,n,A)}for(const A of e)o[A]=l[A];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Io(this._resolverCache,t,n);return P(e)?ue(o,e,void 0,s):o}}function Io(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:an(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o}const Ch=i=>P(i)&&Object.getOwnPropertyNames(i).some(t=>Rt(i[t]));function Ih(i,t){const{isScriptable:e,isIndexable:n}=ks(i);for(const s of t){const o=e(s),a=n(s),r=(a||o)&&i[s];if(o&&(Rt(r)||Ch(r))||a&&V(r))return!0}return!1}var Eh="4.4.7";const kh=["top","bottom","left","right","chartArea"];function Eo(i,t){return i==="top"||i==="bottom"||kh.indexOf(i)===-1&&t==="x"}function ko(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Qo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[i],t)}function Qh(i){const t=i.chart,e=t.options.animation;R(e&&e.onProgress,[i],t)}function Po(i){return An()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ci={},Lo=i=>{const t=Po(i);return Object.values(Ci).filter(e=>e.canvas===t).pop()};function Ph(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const a=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=a)}}}function Lh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function Ii(i,t,e){return i.options.clip?i[e]:t[e]}function zh(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Ii(e,t,"left"),right:Ii(e,t,"right"),top:Ii(n,t,"top"),bottom:Ii(n,t,"bottom")}:t}class kt{static register(...t){Dt.add(...t),zo()}static unregister(...t){Dt.remove(...t),zo()}constructor(t,e){const n=this.config=new vh(e),s=Po(t),o=Lo(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||_c(s)),this.platform.updateConfig(n);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,A=l&&l.height,c=l&&l.width;if(this.id=Sl(),this.ctx=r,this.canvas=l,this.width=c,this.height=A,this._options=a,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 ph,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$l(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Ci[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Et.listen(this,"complete",Qo),Et.listen(this,"progress",Qh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return z(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cs(this.canvas,this.ctx),this}stop(){return Et.stop(this),this}resize(t,e){Et.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Rs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),R(n.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};T(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=Dn(a,r),A=l==="r",c=l==="x";return{options:r,dposition:A?"chartArea":c?"bottom":"left",dtype:A?"radialLinear":c?"category":"linear"}}))),T(o,a=>{const r=a.options,l=r.id,A=Dn(l,r),c=E(r.type,a.dtype);(r.position===void 0||Eo(r.position,A)!==Eo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let h=null;if(l in n&&n[l].type===c)h=n[l];else{const d=Dt.getScale(c);h=new d({id:l,type:c,ctx:this.ctx,chart:this}),n[h.id]=h}h.init(r,t)}),T(s,(a,r)=>{a||delete n[r]}),T(n,a=>{et.configure(this,a,a.options),et.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(ko("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let a=this.getDatasetMeta(n);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=r,a.indexAxis=o.indexAxis||Mn(r,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const l=Dt.getController(r),{datasetElementType:A,dataElementType:c}=F.datasets[r];Object.assign(l,{dataElementType:Dt.getElement(c),datasetElementType:A&&Dt.getElement(A)}),a.controller=new l(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){T(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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 a=0;for(let A=0,c=this.data.datasets.length;A<c;A++){const{controller:h}=this.getDatasetMeta(A),d=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||T(o,A=>{A.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ko("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){T(this.scales,t=>{et.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!cs(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const a=n==="_removeElements"?-o:o;Ph(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!cs(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;et.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],T(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Rt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Et.has(this)?this.attached&&!Et.running(this)&&Et.start(this):(this.draw(),Qo({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=zh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&hi(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&di(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return It(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=kc.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);ve(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Et.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Cs(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ci[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,e=this.platform,n=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};T(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,A)=>{e.addEventListener(this,l,A),t[l]=A},s=(l,A)=>{t[l]&&(e.removeEventListener(this,l,A),delete t[l])},o=(l,A)=>{this.canvas&&this.resize(l,A)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){T(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},T(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const A=a&&this.getDatasetMeta(a.datasetIndex).controller;A&&A[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!oi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,A)=>l.filter(c=>!A.some(h=>c.datasetIndex===h.datasetIndex&&c.index===h.index)),a=o(e,t),r=n?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,n,a),l=Fl(t),A=Lh(t,this._lastEvent,n,l);n&&(this._lastEvent=null,R(o.onHover,[t,r,this],this),l&&R(o.onClick,[t,r,this],this));const c=!oi(r,s);return(c||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=A,c}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}x(kt,"defaults",F),x(kt,"instances",Ci),x(kt,"overrides",qt),x(kt,"registry",Dt),x(kt,"version",Eh),x(kt,"getChart",Lo);function zo(){return T(kt.instances,i=>i._plugins.invalidate())}function Th(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let A=s/r;i.beginPath(),i.arc(o,a,r,n-A,e+A),l>s?(A=s/l,i.arc(o,a,l,e+A,n-A,!0)):i.arc(o,a,s,e+U,n-U),i.closePath(),i.clip()}function Sh(i){return on(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Oh(i,t,e,n){const s=Sh(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,n*t/2),r=l=>{const A=(e-Math.min(o,l))*n/2;return J(l,0,Math.min(o,A))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:J(s.innerStart,0,a),innerEnd:J(s.innerEnd,0,a)}}function we(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Ei(i,t,e,n,s,o){const{x:a,y:r,startAngle:l,pixelMargin:A,innerRadius:c}=t,h=Math.max(t.outerRadius+n+e-A,0),d=c>0?c+n+e+A:0;let g=0;const f=s-l;if(n){const S=c>0?c-n:0,W=h>0?h-n:0,K=(S+W)/2,bt=K!==0?f*K/(K+n):f;g=(f-bt)/2}const p=Math.max(.001,f*h-e/N)/h,w=(f-p)/2,M=l+w+g,D=s-w-g,{outerStart:Y,outerEnd:G,innerStart:B,innerEnd:y}=Oh(t,d,h,D-M),v=h-Y,C=h-G,I=M+Y/v,k=D-G/C,Q=d+B,L=d+y,q=M+B/Q,ct=D-y/L;if(i.beginPath(),o){const S=(I+k)/2;if(i.arc(a,r,h,I,S),i.arc(a,r,h,S,k),G>0){const it=we(C,k,a,r);i.arc(it.x,it.y,G,k,D+U)}const W=we(L,D,a,r);if(i.lineTo(W.x,W.y),y>0){const it=we(L,ct,a,r);i.arc(it.x,it.y,y,D+U,ct+Math.PI)}const K=(D-y/d+(M+B/d))/2;if(i.arc(a,r,d,D-y/d,K,!0),i.arc(a,r,d,K,M+B/d,!0),B>0){const it=we(Q,q,a,r);i.arc(it.x,it.y,B,q+Math.PI,M-U)}const bt=we(v,M,a,r);if(i.lineTo(bt.x,bt.y),Y>0){const it=we(v,I,a,r);i.arc(it.x,it.y,Y,M-U,I)}}else{i.moveTo(a,r);const S=Math.cos(I)*h+a,W=Math.sin(I)*h+r;i.lineTo(S,W);const K=Math.cos(k)*h+a,bt=Math.sin(k)*h+r;i.lineTo(K,bt)}i.closePath()}function Rh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Ei(i,t,e,n,l,s);for(let A=0;A<o;++A)i.fill();isNaN(r)||(l=a+(r%H||H))}return Ei(i,t,e,n,l,s),i.fill(),l}function Nh(i,t,e,n,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:A,borderJoinStyle:c,borderDash:h,borderDashOffset:d}=l,g=l.borderAlign==="inner";if(!A)return;i.setLineDash(h||[]),i.lineDashOffset=d,g?(i.lineWidth=A*2,i.lineJoin=c||"round"):(i.lineWidth=A,i.lineJoin=c||"bevel");let f=t.endAngle;if(o){Ei(i,t,e,n,f,s);for(let p=0;p<o;++p)i.stroke();isNaN(r)||(f=a+(r%H||H))}g&&Th(i,t,f),o||(Ei(i,t,e,n,f,s),i.stroke())}class je extends wt{constructor(e){super();x(this,"circumference");x(this,"endAngle");x(this,"fullCircles");x(this,"innerRadius");x(this,"outerRadius");x(this,"pixelMargin");x(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,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=fs(o,{x:e,y:n}),{startAngle:l,endAngle:A,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,f=E(d,A-l),p=Ie(a,l,A)&&l!==A,w=f>=H||p,M=vt(r,c+g,h+g);return w&&M}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:A,spacing:c}=this.options,h=(o+a)/2,d=(r+l+c+A)/2;return{x:n+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,a=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>H?Math.floor(s/H):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const A=1-Math.sin(Math.min(N,s||0)),c=o*A;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Rh(e,this,c,a,r),Nh(e,this,c,a,r),e.restore()}}x(je,"id","arc"),x(je,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),x(je,"defaultRoutes",{backgroundColor:"backgroundColor"}),x(je,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function To(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function Hh(i,t,e){i.lineTo(e.x,e.y)}function Vh(i){return i.stepped?hA:i.tension||i.cubicInterpolationMode==="monotone"?dA:Hh}function So(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:a,end:r}=t,l=Math.max(s,a),A=Math.min(o,r),c=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:t.loop,ilen:A<l&&!c?n+A-l:A-l}}function Fh(i,t,e,n){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:A}=So(s,e,n),c=Vh(o);let{move:h=!0,reverse:d}=n||{},g,f,p;for(g=0;g<=A;++g)f=s[(r+(d?A-g:g))%a],!f.skip&&(h?(i.moveTo(f.x,f.y),h=!1):c(i,p,f,d,o.stepped),p=f);return l&&(f=s[(r+(d?A:0))%a],c(i,p,f,d,o.stepped)),!!l}function jh(i,t,e,n){const s=t.points,{count:o,start:a,ilen:r}=So(s,e,n),{move:l=!0,reverse:A}=n||{};let c=0,h=0,d,g,f,p,w,M;const D=G=>(a+(A?r-G:G))%o,Y=()=>{p!==w&&(i.lineTo(c,w),i.lineTo(c,p),i.lineTo(c,M))};for(l&&(g=s[D(0)],i.moveTo(g.x,g.y)),d=0;d<=r;++d){if(g=s[D(d)],g.skip)continue;const G=g.x,B=g.y,y=G|0;y===f?(B<p?p=B:B>w&&(w=B),c=(h*c+G)/++h):(Y(),i.lineTo(G,B),f=y,h=0,p=w=B),M=B}Y()}function Bn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jh:Fh}function Wh(i){return i.stepped?jA:i.tension||i.cubicInterpolationMode==="monotone"?WA:ne}function Zh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),To(i,t.options),i.stroke(s)}function Uh(i,t,e,n){const{segments:s,options:o}=t,a=Bn(t);for(const r of s)To(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Kh=typeof Path2D=="function";function Xh(i,t,e,n){Kh&&!t.options.segment?Zh(i,t,e,n):Uh(i,t,e,n)}class Vt extends wt{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,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;TA(this._points,n,t,s,e),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=qA(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,a=Zs(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Wh(n);let A,c;for(A=0,c=a.length;A<c;++A){const{start:h,end:d}=a[A],g=o[h],f=o[d];if(g===f){r.push(g);continue}const p=Math.abs((s-g[e])/(f[e]-g[e])),w=l(g,f,p,n.stepped);w[e]=t[e],r.push(w)}return r.length===1?r[0]:r}pathSegment(t,e,n){return Bn(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=Bn(this);let a=this._loop;e=e||0,n=n||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+n-1});return!!a}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Xh(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}x(Vt,"id","line"),x(Vt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),x(Vt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),x(Vt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Oo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class ki extends wt{constructor(e){super();x(this,"parsed");x(this,"skip");x(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,n){return Oo(this,e,"x",n)}inYRange(e,n){return Oo(this,e,"y",n)}getCenterPoint(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const s=n&&e.borderWidth||0;return(n+s)*2}draw(e,n){const s=this.options;this.skip||s.radius<.1||!It(this,n,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,sn(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}x(ki,"id","point"),x(ki,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),x(ki,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ro(i,t){const{x:e,y:n,base:s,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,A,c,h;return i.horizontal?(h=a/2,r=Math.min(e,s),l=Math.max(e,s),A=n-h,c=n+h):(h=o/2,r=e-h,l=e+h,A=Math.min(n,s),c=Math.max(n,s)),{left:r,top:A,right:l,bottom:c}}function Ft(i,t,e,n){return i?0:J(t,e,n)}function Jh(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=Es(n);return{t:Ft(s.top,o.top,0,e),r:Ft(s.right,o.right,0,t),b:Ft(s.bottom,o.bottom,0,e),l:Ft(s.left,o.left,0,t)}}function qh(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=te(s),a=Math.min(t,e),r=i.borderSkipped,l=n||P(s);return{topLeft:Ft(!l||r.top||r.left,o.topLeft,0,a),topRight:Ft(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ft(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ft(!l||r.bottom||r.right,o.bottomRight,0,a)}}function _h(i){const t=Ro(i),e=t.right-t.left,n=t.bottom-t.top,s=Jh(i,e/2,n/2),o=qh(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Gn(i,t,e,n){const s=t===null,o=e===null,r=i&&!(s&&o)&&Ro(i,n);return r&&(s||vt(t,r.left,r.right))&&(o||vt(e,r.top,r.bottom))}function $h(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function td(i,t){i.rect(t.x,t.y,t.w,t.h)}function Yn(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,a=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+a,radius:i.radius}}class Qi extends wt{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:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:a}=_h(this),r=$h(a.radius)?Pe:td;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Yn(a,e,o)),t.clip(),r(t,Yn(o,-e,a)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),r(t,Yn(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return Gn(this,t,e,n)}inXRange(t,e){return Gn(this,t,null,e)}inYRange(t,e){return Gn(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}x(Qi,"id","bar"),x(Qi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),x(Qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ed=Object.freeze({__proto__:null,ArcElement:je,BarElement:Qi,LineElement:Vt,PointElement:ki});const xn=["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)"],No=xn.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ho(i){return xn[i%xn.length]}function Vo(i){return No[i%No.length]}function id(i,t){return i.borderColor=Ho(t),i.backgroundColor=Vo(t),++t}function nd(i,t){return i.backgroundColor=i.data.map(()=>Ho(t++)),t}function sd(i,t){return i.backgroundColor=i.data.map(()=>Vo(t++)),t}function od(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof se?t=nd(e,t):s instanceof Te?t=sd(e,t):s&&(t=id(e,t))}}function Fo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function ad(i){return i&&(i.borderColor||i.backgroundColor)}function rd(){return F.borderColor!=="rgba(0,0,0,0.1)"||F.backgroundColor!=="rgba(0,0,0,0.1)"}var ld={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,a=Fo(n)||ad(s)||o&&Fo(o)||rd();if(!e.forceOverride&&a)return;const r=od(i);n.forEach(r)}};function Ad(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const A=t+e-1;let c=t,h,d,g,f,p;for(a[l++]=i[c],h=0;h<o-2;h++){let w=0,M=0,D;const Y=Math.floor((h+1)*r)+1+t,G=Math.min(Math.floor((h+2)*r)+1,e)+t,B=G-Y;for(D=Y;D<G;D++)w+=i[D].x,M+=i[D].y;w/=B,M/=B;const y=Math.floor(h*r)+1+t,v=Math.min(Math.floor((h+1)*r)+1,e)+t,{x:C,y:I}=i[c];for(g=f=-1,D=y;D<v;D++)f=.5*Math.abs((C-w)*(i[D].y-I)-(C-i[D].x)*(M-I)),f>g&&(g=f,d=i[D],p=D);a[l++]=d,c=p}return a[l++]=i[A],a}function cd(i,t,e,n){let s=0,o=0,a,r,l,A,c,h,d,g,f,p;const w=[],M=t+e-1,D=i[t].x,G=i[M].x-D;for(a=t;a<t+e;++a){r=i[a],l=(r.x-D)/G*n,A=r.y;const B=l|0;if(B===c)A<f?(f=A,h=a):A>p&&(p=A,d=a),s=(o*s+r.x)/++o;else{const y=a-1;if(!z(h)&&!z(d)){const v=Math.min(h,d),C=Math.max(h,d);v!==g&&v!==y&&w.push({...i[v],x:s}),C!==g&&C!==y&&w.push({...i[C],x:s})}a>0&&y!==g&&w.push(i[y]),w.push(r),c=B,o=0,f=p=A,h=d=g=a}}return w}function jo(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Wo(i){i.data.datasets.forEach(t=>{jo(t)})}function hd(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:A}=o.getUserBounds();return l&&(n=J(Ct(t,o.axis,a).lo,0,e-1)),A?s=J(Ct(t,o.axis,r).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var dd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Wo(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=i.getDatasetMeta(o),A=a||s.data;if(Le([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const c=i.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||i.options.parsing)return;let{start:h,count:d}=hd(l,A);const g=e.threshold||4*n;if(d<=g){jo(s);return}z(a)&&(s._data=A,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let f;switch(e.algorithm){case"lttb":f=Ad(A,h,d,n,e);break;case"min-max":f=cd(A,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=f})},destroy(i){Wo(i)}};function gd(i,t,e){const n=i.segments,s=i.points,o=t.points,a=[];for(const r of n){let{start:l,end:A}=r;A=vn(l,A,s);const c=yn(e,s[l],s[A],r.loop);if(!t.segments){a.push({source:r,target:c,start:s[l],end:s[A]});continue}const h=Zs(t,c);for(const d of h){const g=yn(e,o[d.start],o[d.end],d.loop),f=Ws(r,s,g);for(const p of f)a.push({source:p,target:d,start:{[e]:Zo(c,g,"start",Math.max)},end:{[e]:Zo(c,g,"end",Math.min)}})}}return a}function yn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=At(s),o=At(o)),{property:i,start:s,end:o}}function ud(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=vn(a,r,s);const l=s[a],A=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:A.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:A.y}))}),o}function vn(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Zo(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Uo(i,t){let e=[],n=!1;return V(i)?(n=!0,e=i):e=ud(i,t),e.length?new Vt({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ko(i){return i&&i.fill!==!1}function fd(i,t,e){let s=i[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Z(s))return s;if(a=i[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function pd(i,t,e){const n=Md(i);if(P(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return Z(s)&&Math.floor(s)===s?wd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function wd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function md(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function bd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:P(i)?n=i.value:n=t.getBaseValue(),n}function Md(i){const t=i.options,e=t.fill;let n=E(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Dd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,a=n.points,r=Bd(t,e);r.push(Uo({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){const A=o[l];for(let c=A.start;c<=A.end;c++)Gd(s,a[c],r)}return new Vt({points:s,options:{}})}function Bd(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Gd(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Yd(o,t,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(i.push(l),!r)break}}i.push(...n)}function Yd(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,a=i.points;let r=!1,l=!1;for(let A=0;A<o.length;A++){const c=o[A],h=a[c.start][e],d=a[c.end][e];if(vt(s,h,d)){r=s===h,l=s===d;break}}return{first:r,last:l,point:n}}class Xo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:H},t.arc(s,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function xd(i){const{chart:t,fill:e,line:n}=i;if(Z(e))return yd(t,e);if(e==="stack")return Dd(i);if(e==="shape")return!0;const s=vd(i);return s instanceof Xo?s:Uo(s,n)}function yd(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function vd(i){return(i.scale||{}).getPointPositionForValue?Id(i):Cd(i)}function Cd(i){const{scale:t={},fill:e}=i,n=md(e,t);if(Z(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Id(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,a=bd(e,t,o),r=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,o);return new Xo({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Cn(i,t,e){const n=xd(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,A=r.backgroundColor,{above:c=A,below:h=A}=l||{};n&&s.points.length&&(hi(i,e),Ed(i,{line:s,target:n,above:c,below:h,area:e,scale:o,axis:a}),di(i))}function Ed(i,t){const{line:e,target:n,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&o!==s&&(Jo(i,n,a.top),qo(i,{line:e,target:n,color:s,scale:r,property:l}),i.restore(),i.save(),Jo(i,n,a.bottom)),qo(i,{line:e,target:n,color:o,scale:r,property:l}),i.restore()}function Jo(i,t,e){const{segments:n,points:s}=t;let o=!0,a=!1;i.beginPath();for(const r of n){const{start:l,end:A}=r,c=s[l],h=s[vn(l,A,s)];o?(i.moveTo(c.x,c.y),o=!1):(i.lineTo(c.x,e),i.lineTo(c.x,c.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(h.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function qo(i,t){const{line:e,target:n,property:s,color:o,scale:a}=t,r=gd(e,n,s);for(const{source:l,target:A,start:c,end:h}of r){const{style:{backgroundColor:d=o}={}}=l,g=n!==!0;i.save(),i.fillStyle=d,kd(i,a,g&&yn(s,c,h)),i.beginPath();const f=!!e.pathSegment(i,l);let p;if(g){f?i.closePath():_o(i,n,h,s);const w=!!n.pathSegment(i,A,{move:f,reverse:!0});p=f&&w,p||_o(i,n,c,s)}i.closePath(),i.fill(p?"evenodd":"nonzero"),i.restore()}}function kd(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,n,r-a,s-n),i.clip())}function _o(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Qd={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Vt&&(l={visible:i.isDatasetVisible(a),index:a,fill:pd(r,a,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=fd(s,a,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&Cn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;Ko(o)&&Cn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!Ko(n)||e.drawTime!=="beforeDatasetDraw"||Cn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $o=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Pd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ta extends wt{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,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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 e=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=X(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=$o(n,o);let A,c;e.font=s.string,this.isHorizontal()?(A=this.maxWidth,c=this._fitRows(a,o,r,l)+10):(c=this.maxHeight,A=this._fitCols(a,s,r,l)+10),this.width=Math.min(A,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],A=this.lineWidths=[0],c=s+r;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,g=-c;return this.legendItems.forEach((f,p)=>{const w=n+e/2+o.measureText(f.text).width;(p===0||A[A.length-1]+w+2*r>a)&&(h+=c,A[A.length-(p>0?0:1)]=0,g+=c,d++),l[p]={left:0,top:g,row:d,width:w,height:s},A[A.length-1]+=w+r}),h}_fitCols(t,e,n,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],A=this.columnSizes=[],c=a-t;let h=r,d=0,g=0,f=0,p=0;return this.legendItems.forEach((w,M)=>{const{itemWidth:D,itemHeight:Y}=Ld(n,e,o,w,s);M>0&&g+Y+2*r>c&&(h+=d+r,A.push({width:d,height:g}),f+=d+r,p++,d=g=0),l[M]={left:f,top:g,col:p,width:D,height:Y},d=Math.max(d,D),g+=Y+r}),h+=d,A.push({width:d,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,a=pe(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=$(n,this.left+s,this.right-this.lineWidths[r]);for(const A of e)r!==A.row&&(r=A.row,l=$(n,this.left+s,this.right-this.lineWidths[r])),A.top+=this.top+t+s,A.left=a.leftForLtr(a.x(l),A.width),l+=A.width+s}else{let r=0,l=$(n,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const A of e)A.col!==r&&(r=A.col,l=$(n,this.top+t+s,this.bottom-this.columnSizes[r].height)),A.top=l,A.left+=this.left+s,A.left=a.leftForLtr(a.x(A.left),A.width),l+=A.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;hi(t,this),this._draw(),di(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:a}=t,r=F.color,l=pe(t.rtl,this.left,this.width),A=X(a.font),{padding:c}=a,h=A.size,d=h/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=A.string;const{boxWidth:f,boxHeight:p,itemHeight:w}=$o(a,h),M=function(y,v,C){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;s.save();const I=E(C.lineWidth,1);if(s.fillStyle=E(C.fillStyle,r),s.lineCap=E(C.lineCap,"butt"),s.lineDashOffset=E(C.lineDashOffset,0),s.lineJoin=E(C.lineJoin,"miter"),s.lineWidth=I,s.strokeStyle=E(C.strokeStyle,r),s.setLineDash(E(C.lineDash,[])),a.usePointStyle){const k={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:I},Q=l.xPlus(y,f/2),L=v+d;Is(s,k,Q,L,a.pointStyleWidth&&f)}else{const k=v+Math.max((h-p)/2,0),Q=l.leftForLtr(y,f),L=te(C.borderRadius);s.beginPath(),Object.values(L).some(q=>q!==0)?Pe(s,{x:Q,y:k,w:f,h:p,radius:L}):s.rect(Q,k,f,p),s.fill(),I!==0&&s.stroke()}s.restore()},D=function(y,v,C){$t(s,C.text,y,v+w/2,A,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},Y=this.isHorizontal(),G=this._computeTitleHeight();Y?g={x:$(o,this.left+c,this.right-n[0]),y:this.top+c+G,line:0}:g={x:this.left+c,y:$(o,this.top+G+c,this.bottom-e[0].height),line:0},Hs(this.ctx,t.textDirection);const B=w+c;this.legendItems.forEach((y,v)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const C=s.measureText(y.text).width,I=l.textAlign(y.textAlign||(y.textAlign=a.textAlign)),k=f+d+C;let Q=g.x,L=g.y;l.setWidth(this.width),Y?v>0&&Q+k+c>this.right&&(L=g.y+=B,g.line++,Q=g.x=$(o,this.left+c,this.right-n[g.line])):v>0&&L+B>this.bottom&&(Q=g.x=Q+e[g.line].width+c,g.line++,L=g.y=$(o,this.top+G+c,this.bottom-e[g.line].height));const q=l.x(Q);if(M(q,L,y),Q=tA(I,Q+f+d,Y?Q+k:this.right,t.rtl),D(l.x(Q),L,y),Y)g.x+=k+c;else if(typeof y.text!="string"){const ct=A.lineHeight;g.y+=ea(y,ct)+c}else g.y+=B}),Vs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=X(e.font),s=tt(e.padding);if(!e.display)return;const o=pe(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=n.size/2,A=s.top+l;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+A,h=$(t.align,h,this.right-d);else{const f=this.columnSizes.reduce((p,w)=>Math.max(p,w.height),0);c=A+$(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}const g=$(r,h,h+d);a.textAlign=o.textAlign(_i(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=n.string,$t(a,e.text,g,c,n)}_computeTitleHeight(){const t=this.options.title,e=X(t.font),n=tt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],vt(t,s.left,s.left+s.width)&&vt(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Sd(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Pd(s,n);s&&!o&&R(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&R(e.onHover,[t,n,this],this)}else n&&R(e.onClick,[t,n,this],this)}}function Ld(i,t,e,n,s){const o=zd(n,i,t,e),a=Td(s,n,t.lineHeight);return{itemWidth:o,itemHeight:a}}function zd(i,t,e,n){let s=i.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+n.measureText(s).width}function Td(i,t,e){let n=i;return typeof t.text!="string"&&(n=ea(t,e)),n}function ea(i,t){const e=i.text?i.text.length:0;return t*e}function Sd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Od={id:"legend",_element:ta,start(i,t,e){const n=i.legend=new ta({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n)},stop(i){et.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;et.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const A=l.controller.getStyle(e?0:void 0),c=tt(A.borderWidth);return{text:t[l.index].label,fillStyle:A.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:A.borderCapStyle,lineDash:A.borderDash,lineDashOffset:A.borderDashOffset,lineJoin:A.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:A.borderColor,pointStyle:n||A.pointStyle,rotation:A.rotation,textAlign:s||A.textAlign,borderRadius:a&&(r||A.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class In extends wt{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,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=V(n.text)?n.text.length:1;this._padding=tt(n.padding);const o=s*X(n.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:e,left:n,bottom:s,right:o,options:a}=this,r=a.align;let l=0,A,c,h;return this.isHorizontal()?(c=$(r,n,o),h=e+t,A=o-n):(a.position==="left"?(c=n+t,h=$(r,s,e),l=N*-.5):(c=o-t,h=$(r,e,s),l=N*.5),A=s-e),{titleX:c,titleY:h,maxWidth:A,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=X(e.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:A}=this._drawArgs(o);$t(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:A,textAlign:_i(e.align),textBaseline:"middle",translation:[a,r]})}}function Rd(i,t){const e=new In({ctx:i.ctx,options:t,chart:i});et.configure(i,e,t),et.addBox(i,e),i.titleBlock=e}var Nd={id:"title",_element:In,start(i,t,e){Rd(i,e)},stop(i){const t=i.titleBlock;et.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;et.configure(i,n,e),n.options=e},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 Pi=new WeakMap;var Hd={id:"subtitle",start(i,t,e){const n=new In({ctx:i.ctx,options:e,chart:i});et.configure(i,n,e),et.addBox(i,n),Pi.set(i,n)},stop(i){et.removeBox(i,Pi.get(i)),Pi.delete(i)},beforeUpdate(i,t,e){const n=Pi.get(i);et.configure(i,n,e),n.options=e},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 We={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const A=l.getCenterPoint(),c=Ji(t,A);c<s&&(s=c,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function Bt(i,t){return t&&(V(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Qt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1856
1856
|
`)>-1?i.split(`
|
|
1857
|
-
`):i}function Vd(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ia(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=X(t.bodyFont),A=X(t.titleFont),c=X(t.footerFont),h=o.length,d=s.length,g=n.length,f=tt(t.padding);let p=f.height,w=0,M=n.reduce((G,B)=>G+B.before.length+B.lines.length+B.after.length,0);if(M+=i.beforeBody.length+i.afterBody.length,h&&(p+=h*A.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),M){const G=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=g*G+(M-g)*l.lineHeight+(M-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let D=0;const Y=function(G){w=Math.max(w,e.measureText(G).width+D)};return e.save(),e.font=A.string,T(i.title,Y),e.font=l.string,T(i.beforeBody.concat(i.afterBody),Y),D=t.displayColors?a+2+t.boxPadding:0,T(n,G=>{T(G.before,Y),T(G.lines,Y),T(G.after,Y)}),D=0,e.font=c.string,T(i.footer,Y),e.restore(),w+=f.width,{width:w,height:p}}function Fd(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function jd(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function Wd(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let A="center";return n==="center"?A=s<=(r+l)/2?"left":"right":s<=o/2?A="left":s>=a-o/2&&(A="right"),jd(A,i,t,e)&&(A="center"),A}function na(i,t,e){const n=e.yAlign||t.yAlign||Fd(i,e);return{xAlign:e.xAlign||t.xAlign||Wd(i,t,e,n),yAlign:n}}function Zd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Ud(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function sa(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,A=s+o,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:g}=$t(a);let f=Zd(t,r);const p=Ud(t,l,A);return l==="center"?r==="left"?f+=A:r==="right"&&(f-=A):r==="left"?f-=Math.max(c,d)+s:r==="right"&&(f+=Math.max(h,g)+s),{x:J(f,0,n.width-t.width),y:J(p,0,n.height-t.height)}}function Li(i,t,e){const n=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function oa(i){return Bt([],Qt(i))}function Kd(i,t,e){return Ht(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function aa(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ra={beforeTitle:yt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:yt,beforeBody:yt,beforeLabel:yt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:yt,afterBody:yt,beforeFooter:yt,footer:yt,afterFooter:yt};function at(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?ra[t].call(e,n):s}class En extends wt{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 e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Js(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Kd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=at(n,"beforeTitle",this,t),o=at(n,"title",this,t),a=at(n,"afterTitle",this,t);let r=[];return r=Bt(r,Qt(s)),r=Bt(r,Qt(o)),r=Bt(r,Qt(a)),r}getBeforeBody(t,e){return oa(at(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return T(t,o=>{const a={before:[],lines:[],after:[]},r=aa(n,o);Bt(a.before,Qt(at(r,"beforeLabel",this,o))),Bt(a.lines,at(r,"label",this,o)),Bt(a.after,Qt(at(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return oa(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=at(n,"beforeFooter",this,t),o=at(n,"footer",this,t),a=at(n,"afterFooter",this,t);let r=[];return r=Bt(r,Qt(s)),r=Bt(r,Qt(o)),r=Bt(r,Qt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,A;for(l=0,A=e.length;l<A;++l)r.push(Vd(this.chart,e[l]));return t.filter&&(r=r.filter((c,h,d)=>t.filter(c,h,d,n))),t.itemSort&&(r=r.sort((c,h)=>t.itemSort(c,h,n))),T(r,c=>{const h=aa(t.callbacks,c);s.push(at(h,"labelColor",this,c)),o.push(at(h,"labelPointStyle",this,c)),a.push(at(h,"labelTextColor",this,c))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=We[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=ia(this,n),A=Object.assign({},r,l),c=na(this.chart,n,A),h=sa(n,A,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:A,bottomLeft:c,bottomRight:h}=$t(r),{x:d,y:g}=t,{width:f,height:p}=e;let w,M,D,Y,G,B;return o==="center"?(G=g+p/2,s==="left"?(w=d,M=w-a,Y=G+a,B=G-a):(w=d+f,M=w+a,Y=G-a,B=G+a),D=w):(s==="left"?M=d+Math.max(l,c)+a:s==="right"?M=d+f-Math.max(A,h)-a:M=this.caretX,o==="top"?(Y=g,G=Y-a,w=M-a,D=M+a):(Y=g+p,G=Y+a,w=M+a,D=M-a),B=Y),{x1:w,x2:M,x3:D,y1:Y,y2:G,y3:B}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const A=pe(n.rtl,this.x,this.width);for(t.x=Li(this,n.titleAlign,n),e.textAlign=A.textAlign(n.titleAlign),e.textBaseline="middle",a=X(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],A.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,s,o){const a=this.labelColors[n],r=this.labelPointStyles[n],{boxHeight:l,boxWidth:A}=o,c=X(o.bodyFont),h=Li(this,"left",o),d=s.x(h),g=l<c.lineHeight?(c.lineHeight-l)/2:0,f=e.y+g;if(o.usePointStyle){const p={radius:Math.min(A,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},w=s.leftForLtr(d,A)+A/2,M=f+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,sn(t,p,w,M),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,sn(t,p,w,M)}else{t.lineWidth=P(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(d,A),w=s.leftForLtr(s.xPlus(d,1),A-2),M=$t(a.borderRadius);Object.values(M).some(D=>D!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Pe(t,{x:p,y:f,w:A,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pe(t,{x:w,y:f+1,w:A-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,f,A,l),t.strokeRect(p,f,A,l),t.fillStyle=a.backgroundColor,t.fillRect(w,f+1,A-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:A,boxPadding:c}=n,h=X(n.bodyFont);let d=h.lineHeight,g=0;const f=pe(n.rtl,this.x,this.width),p=function(C){e.fillText(C,f.x(t.x+g),t.y+d/2),t.y+=d+o},w=f.textAlign(a);let M,D,Y,G,B,y,v;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Li(this,w,n),e.fillStyle=n.bodyColor,T(this.beforeBody,p),g=r&&w!=="right"?a==="center"?A/2+c:A+2+c:0,G=0,y=s.length;G<y;++G){for(M=s[G],D=this.labelTextColors[G],e.fillStyle=D,T(M.before,p),Y=M.lines,r&&Y.length&&(this._drawColorBox(e,t,G,f,n),d=Math.max(h.lineHeight,l)),B=0,v=Y.length;B<v;++B)p(Y[B]),d=h.lineHeight;T(M.after,p)}g=0,d=h.lineHeight,T(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let a,r;if(o){const l=pe(n.rtl,this.x,this.width);for(t.x=Li(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=X(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:A,height:c}=n,{topLeft:h,topRight:d,bottomLeft:g,bottomRight:f}=$t(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+h,l),a==="top"&&this.drawCaret(t,e,n,s),e.lineTo(r+A-d,l),e.quadraticCurveTo(r+A,l,r+A,l+d),a==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(r+A,l+c-f),e.quadraticCurveTo(r+A,l+c,r+A-f,l+c),a==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(r+g,l+c),e.quadraticCurveTo(r,l+c,r,l+c-g),a==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(r,l+h),e.quadraticCurveTo(r,l,r+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=We[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ia(this,t),l=Object.assign({},a,this._size),A=na(e,t,l),c=sa(t,l,A,e);(s._to!==c.x||o._to!==c.y)&&(this.xAlign=A.xAlign,this.yAlign=A.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=tt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),Hs(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Vs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const A=this.chart.getDatasetMeta(r);if(!A)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:A.data[l],index:l}}),o=!oi(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!oi(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=We[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}x(En,"positioners",We);var Xd={id:"tooltip",_element:En,positioners:We,afterInit(i,t,e){e&&(i.tooltip=new En({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,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:(i,t)=>t.bodyFont.size,boxWidth:(i,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:ra},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Jd=Object.freeze({__proto__:null,Colors:ld,Decimation:dd,Filler:Qd,Legend:Od,SubTitle:Hd,Title:Nd,Tooltip:Xd});const qd=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function _d(i,t,e,n){const s=i.indexOf(t);if(s===-1)return qd(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const $d=(i,t)=>i===null?null:J(Math.round(i),0,t);function la(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class kn extends oe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:_d(n,t,E(e,t),this._addedLabels),$d(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return la.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 e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}x(kn,"id","category"),x(kn,"defaults",{ticks:{callback:la}});function tg(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:A,maxTicks:c,maxDigits:h,includeBounds:d}=i,g=o||1,f=c-1,{min:p,max:w}=t,M=!z(a),D=!z(r),Y=!z(A),G=(w-p)/(h+1);let B=ds((w-p)/f/g)*g,y,v,C,I;if(B<1e-14&&!M&&!D)return[{value:p},{value:w}];I=Math.ceil(w/B)-Math.floor(p/B),I>f&&(B=ds(I*B/f/g)*g),z(l)||(y=Math.pow(10,l),B=Math.ceil(B*y)/y),s==="ticks"?(v=Math.floor(p/B)*B,C=Math.ceil(w/B)*B):(v=p,C=w),M&&D&&o&&Ul((r-a)/o,B/1e3)?(I=Math.round(Math.min((r-a)/B,c)),B=(r-a)/I,v=a,C=r):Y?(v=M?a:v,C=D?r:C,I=A-1,B=(C-v)/I):(I=(C-v)/B,Ce(I,Math.round(I),B/1e3)?I=Math.round(I):I=Math.ceil(I));const k=Math.max(us(B),us(v));y=Math.pow(10,z(l)?k:l),v=Math.round(v*y)/y,C=Math.round(C*y)/y;let Q=0;for(M&&(d&&v!==a?(e.push({value:a}),v<a&&Q++,Ce(Math.round((v+Q*B)*y)/y,a,Aa(a,G,i))&&Q++):v<a&&Q++);Q<I;++Q){const L=Math.round((v+Q*B)*y)/y;if(D&&L>r)break;e.push({value:L})}return D&&d&&C!==r?e.length&&Ce(e[e.length-1].value,r,Aa(r,G,i))?e[e.length-1].value=r:e.push({value:r}):(!D||C===r)&&e.push({value:C}),e}function Aa(i,t,{horizontal:e,minRotation:n}){const s=ft(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class zi extends oe{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,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=Mt(s),A=Mt(o);l<0&&A<0?r(0):l>0&&A>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=tg(s,o);return t.bounds==="ticks"&&gs(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ke(t,this.chart.options.locale,this.options.ticks.format)}}class Qn extends zi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ft(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}x(Qn,"id","linear"),x(Qn,"defaults",{ticks:{callback:Ai.formatters.numeric}});const Ze=i=>Math.floor(Nt(i)),ae=(i,t)=>Math.pow(10,Ze(i)+t);function ca(i){return i/Math.pow(10,Ze(i))===1}function ha(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function eg(i,t){const e=t-i;let n=Ze(e);for(;ha(i,t,n)>10;)n++;for(;ha(i,t,n)<10;)n--;return Math.min(n,Ze(i))}function ig(i,{min:t,max:e}){t=lt(i.min,t);const n=[],s=Ze(t);let o=eg(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,A=Math.round((t-l)*a)/a,c=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((A-c)/Math.pow(10,o)),d=lt(i.min,Math.round((l+c+h*Math.pow(10,o))*a)/a);for(;d<e;)n.push({value:d,major:ca(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),d=Math.round((l+c+h*Math.pow(10,o))*a)/a;const g=lt(i.max,d);return n.push({value:g,major:ca(g),significand:h}),n}class Pn extends oe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=zi.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return Z(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===ae(this.min,0)?ae(this.min,-1):ae(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=r=>n=t?n:r,a=r=>s=e?s:r;n===s&&(n<=0?(o(1),a(10)):(o(ae(n,-1)),a(ae(s,1)))),n<=0&&o(ae(s,-1)),s<=0&&a(ae(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=ig(e,this);return t.bounds==="ticks"&&gs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":ke(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Nt(t),this._valueRange=Nt(this.max)-Nt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Nt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}x(Pn,"id","logarithmic"),x(Pn,"defaults",{ticks:{callback:Ai.formatters.logarithmic,major:{enabled:!0}}});function Ln(i){const t=i.ticks;if(t.display&&i.display){const e=tt(t.backdropPadding);return E(t.font&&t.font.size,F.font.size)+e.height}return 0}function ng(i,t,e){return e=V(e)?e:[e],{w:cA(i,t.string,e),h:e.length*t.lineHeight}}function da(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function sg(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?N/o:0;for(let l=0;l<o;l++){const A=a.setContext(i.getPointLabelContext(l));s[l]=A.padding;const c=i.getPointPosition(l,i.drawingArea+s[l],r),h=X(A.font),d=ng(i.ctx,h,i._pointLabels[l]);n[l]=d;const g=At(i.getIndexAngle(l)+r),f=Math.round(Xi(g)),p=da(f,c.x,d.w,0,180),w=da(f,c.y,d.h,90,270);og(e,t,g,p,w)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=lg(i,n,s)}function og(i,t,e,n,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;n.start<t.l?(r=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-r)):n.end>t.r&&(r=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function ag(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,n+s+a,o),A=Math.round(Xi(At(l.angle+U))),c=hg(l.y,r.h,A),h=Ag(A),d=cg(l.x,r.w,h);return{visible:!0,x:l.x,y:c,textAlign:h,left:d,top:c,right:d+r.w,bottom:c+r.h}}function rg(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(It({x:e,y:n},t)||It({x:e,y:o},t)||It({x:s,y:n},t)||It({x:s,y:o},t))}function lg(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Ln(o)/2,additionalAngle:a?N/s:0};let A;for(let c=0;c<s;c++){l.padding=e[c],l.size=t[c];const h=ag(i,c,l);n.push(h),r==="auto"&&(h.visible=rg(h,A),h.visible&&(A=h))}return n}function Ag(i){return i===0||i===180?"center":i<180?"left":"right"}function cg(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function hg(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function dg(i,t,e){const{left:n,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!z(r)){const l=$t(t.borderRadius),A=tt(t.backdropPadding);i.fillStyle=r;const c=n-A.left,h=s-A.top,d=o-n+A.width,g=a-s+A.height;Object.values(l).some(f=>f!==0)?(i.beginPath(),Pe(i,{x:c,y:h,w:d,h:g,radius:l}),i.fill()):i.fillRect(c,h,d,g)}}function gg(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=n.setContext(i.getPointLabelContext(s));dg(e,a,o);const r=X(a.font),{x:l,y:A,textAlign:c}=o;_t(e,i._pointLabels[s],l,A+r.lineHeight/2,r,{color:a.color,textAlign:c,textBaseline:"middle"})}}function ga(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,H);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=i.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function ug(i,t,e,n,s){const o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!n||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ga(i,e,a,n),o.closePath(),o.stroke(),o.restore())}function fg(i,t,e){return Ht(i,{label:e,index:t,type:"pointLabel"})}class Ue extends zi{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=tt(Ln(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ln(this.options))}generateTickLabels(t){zi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=R(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?sg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return At(t*e+ft(n))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return fg(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-U+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),ga(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,A;if(e.pointLabels.display&&gg(this,a),s.display&&this.ticks.forEach((c,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(h),g=s.setContext(d),f=o.setContext(d);ug(this,g,l,a,f)}}),n.display){for(t.save(),r=a-1;r>=0;r--){const c=n.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),A=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(A.x,A.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const A=n.setContext(this.getContext(l)),c=X(A.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),A.showLabelBackdrop){t.font=c.string,a=t.measureText(r.label).width,t.fillStyle=A.backdropColor;const h=tt(A.backdropPadding);t.fillRect(-a/2-h.left,-o-c.size/2-h.top,a+h.width,c.size+h.height)}_t(t,r.label,0,-o,c,{color:A.color,strokeColor:A.textStrokeColor,strokeWidth:A.textStrokeWidth})}),t.restore()}drawTitle(){}}x(Ue,"id","radialLinear"),x(Ue,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ai.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),x(Ue,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),x(Ue,"descriptors",{angleLines:{_fallback:"grid"}});const Ti={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}},rt=Object.keys(Ti);function ua(i,t){return i-t}function fa(i,t){if(z(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),Z(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ge(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function pa(i,t,e,n){const s=rt.length;for(let o=rt.indexOf(i);o<s-1;++o){const a=Ti[rt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=n)return rt[o]}return rt[s-1]}function pg(i,t,e,n,s){for(let o=rt.length-1;o>=rt.indexOf(e);o--){const a=rt[o];if(Ti[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return rt[e?rt.indexOf(e):0]}function wg(i){for(let t=rt.indexOf(i)+1,e=rt.length;t<e;++t)if(Ti[rt[t]].common)return rt[t]}function wa(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=qi(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function mg(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function ma(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,n.push({value:r,major:!1});return o===0||!e?n:mg(i,n,s,e)}class Ke extends oe{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,e={}){const n=t.time||(t.time={}),s=this._adapter=new yc._date(t.adapters.date);s.init(e),ye(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(A){!a&&!isNaN(A.min)&&(s=Math.min(s,A.min)),!r&&!isNaN(A.max)&&(o=Math.max(o,A.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Z(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=Z(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=ql(s,o,a);return this._unit=e.unit||(n.autoSkip?pa(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):pg(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:wg(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),ma(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=J(e,0,a),n=J(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||pa(o.minUnit,e,n,this._getLabelCapacity(e)),r=E(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,A=ge(l)||l===!0,c={};let h=e,d,g;if(A&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,A?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const f=s.ticks.source==="data"&&this.getDataTimestamps();for(d=h,g=0;d<n;d=+t.add(d,r,a),g++)wa(c,d,f);return(d===n||s.bounds==="ticks"||g===1)&&wa(c,d,f),Object.keys(c).sort(ua).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return R(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,A=this._majorUnit,c=l&&r[l],h=A&&r[A],d=n[e],g=A&&h&&d&&d.major;return this._adapter.format(t,s||(g?h:c))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:n*o+r*a,h:n*a+r*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,ma(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(fa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ms(t.sort(ua))}}x(Ke,"id","time"),x(Ke,"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 Si(i,t,e){let n=0,s=i.length-1,o,a,r,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Ct(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Ct(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const A=a-o;return A?r+(l-r)*(t-o)/A:r}class zn extends Ke{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Si(e,this.min),this._tableRange=Si(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,A,c;for(a=0,r=t.length;a<r;++a)A=t[a],A>=e&&A<=n&&s.push(A);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)c=s[a+1],l=s[a-1],A=s[a],Math.round((c+l)/2)!==A&&o.push({time:A,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Si(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Si(this._table,n*this._tableRange+this._minPos,!0)}}x(zn,"id","timeseries"),x(zn,"defaults",Ke.defaults);var bg=Object.freeze({__proto__:null,CategoryScale:kn,LinearScale:Qn,LogarithmicScale:Pn,RadialLinearScale:Ue,TimeScale:Ke,TimeSeriesScale:zn});const Mg=[xc,ed,Jd,bg];kt.register(...Mg);var Dg=Object.defineProperty,Bg=Object.getOwnPropertyDescriptor,Pt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Bg(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&Dg(t,e,s),s};b.GenusChart=class extends u.LitElement{constructor(){super(...arguments),this.chartTitle="",this.chartType="",this.chartLabels=[],this.chartDataSets=[],this.chartOptions={},this.isLoading=0,this.createChart=()=>{this._chart=new kt(this._chartCanvas,{type:this.chartType,data:{labels:[...this.chartLabels],datasets:[...this.chartDataSets]},options:{...this.chartOptions}})}}firstUpdated(){this.createChart()}updated(){this._chart.data.labels=[...this.chartLabels],this._chart.data.datasets=[...this.chartDataSets],this._chart.update()}render(){return this.isLoading?u.html`<div class='content-loader'></div>`:u.html`
|
|
1857
|
+
`):i}function Vd(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:i,label:a,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function ia(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=X(t.bodyFont),A=X(t.titleFont),c=X(t.footerFont),h=o.length,d=s.length,g=n.length,f=tt(t.padding);let p=f.height,w=0,M=n.reduce((G,B)=>G+B.before.length+B.lines.length+B.after.length,0);if(M+=i.beforeBody.length+i.afterBody.length,h&&(p+=h*A.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),M){const G=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=g*G+(M-g)*l.lineHeight+(M-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let D=0;const Y=function(G){w=Math.max(w,e.measureText(G).width+D)};return e.save(),e.font=A.string,T(i.title,Y),e.font=l.string,T(i.beforeBody.concat(i.afterBody),Y),D=t.displayColors?a+2+t.boxPadding:0,T(n,G=>{T(G.before,Y),T(G.lines,Y),T(G.after,Y)}),D=0,e.font=c.string,T(i.footer,Y),e.restore(),w+=f.width,{width:w,height:p}}function Fd(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function jd(i,t,e,n){const{x:s,width:o}=n,a=e.caretSize+e.caretPadding;if(i==="left"&&s+o+a>t.width||i==="right"&&s-o-a<0)return!0}function Wd(i,t,e,n){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let A="center";return n==="center"?A=s<=(r+l)/2?"left":"right":s<=o/2?A="left":s>=a-o/2&&(A="right"),jd(A,i,t,e)&&(A="center"),A}function na(i,t,e){const n=e.yAlign||t.yAlign||Fd(i,e);return{xAlign:e.xAlign||t.xAlign||Wd(i,t,e,n),yAlign:n}}function Zd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Ud(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function sa(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,A=s+o,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:g}=te(a);let f=Zd(t,r);const p=Ud(t,l,A);return l==="center"?r==="left"?f+=A:r==="right"&&(f-=A):r==="left"?f-=Math.max(c,d)+s:r==="right"&&(f+=Math.max(h,g)+s),{x:J(f,0,n.width-t.width),y:J(p,0,n.height-t.height)}}function Li(i,t,e){const n=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function oa(i){return Bt([],Qt(i))}function Kd(i,t,e){return Ht(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function aa(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const ra={beforeTitle:yt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:yt,beforeBody:yt,beforeLabel:yt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:yt,afterBody:yt,beforeFooter:yt,footer:yt,afterFooter:yt};function at(i,t,e,n){const s=i[t].call(e,n);return typeof s>"u"?ra[t].call(e,n):s}class En extends wt{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 e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Js(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Kd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=at(n,"beforeTitle",this,t),o=at(n,"title",this,t),a=at(n,"afterTitle",this,t);let r=[];return r=Bt(r,Qt(s)),r=Bt(r,Qt(o)),r=Bt(r,Qt(a)),r}getBeforeBody(t,e){return oa(at(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return T(t,o=>{const a={before:[],lines:[],after:[]},r=aa(n,o);Bt(a.before,Qt(at(r,"beforeLabel",this,o))),Bt(a.lines,at(r,"label",this,o)),Bt(a.after,Qt(at(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return oa(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=at(n,"beforeFooter",this,t),o=at(n,"footer",this,t),a=at(n,"afterFooter",this,t);let r=[];return r=Bt(r,Qt(s)),r=Bt(r,Qt(o)),r=Bt(r,Qt(a)),r}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],a=[];let r=[],l,A;for(l=0,A=e.length;l<A;++l)r.push(Vd(this.chart,e[l]));return t.filter&&(r=r.filter((c,h,d)=>t.filter(c,h,d,n))),t.itemSort&&(r=r.sort((c,h)=>t.itemSort(c,h,n))),T(r,c=>{const h=aa(t.callbacks,c);s.push(at(h,"labelColor",this,c)),o.push(at(h,"labelPointStyle",this,c)),a.push(at(h,"labelTextColor",this,c))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=We[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const l=this._size=ia(this,n),A=Object.assign({},r,l),c=na(this.chart,n,A),h=sa(n,A,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=n,{topLeft:l,topRight:A,bottomLeft:c,bottomRight:h}=te(r),{x:d,y:g}=t,{width:f,height:p}=e;let w,M,D,Y,G,B;return o==="center"?(G=g+p/2,s==="left"?(w=d,M=w-a,Y=G+a,B=G-a):(w=d+f,M=w+a,Y=G-a,B=G+a),D=w):(s==="left"?M=d+Math.max(l,c)+a:s==="right"?M=d+f-Math.max(A,h)-a:M=this.caretX,o==="top"?(Y=g,G=Y-a,w=M-a,D=M+a):(Y=g+p,G=Y+a,w=M+a,D=M-a),B=Y),{x1:w,x2:M,x3:D,y1:Y,y2:G,y3:B}}drawTitle(t,e,n){const s=this.title,o=s.length;let a,r,l;if(o){const A=pe(n.rtl,this.x,this.width);for(t.x=Li(this,n.titleAlign,n),e.textAlign=A.textAlign(n.titleAlign),e.textBaseline="middle",a=X(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],A.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,s,o){const a=this.labelColors[n],r=this.labelPointStyles[n],{boxHeight:l,boxWidth:A}=o,c=X(o.bodyFont),h=Li(this,"left",o),d=s.x(h),g=l<c.lineHeight?(c.lineHeight-l)/2:0,f=e.y+g;if(o.usePointStyle){const p={radius:Math.min(A,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},w=s.leftForLtr(d,A)+A/2,M=f+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,sn(t,p,w,M),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,sn(t,p,w,M)}else{t.lineWidth=P(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(d,A),w=s.leftForLtr(s.xPlus(d,1),A-2),M=te(a.borderRadius);Object.values(M).some(D=>D!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Pe(t,{x:p,y:f,w:A,h:l,radius:M}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pe(t,{x:w,y:f+1,w:A-2,h:l-2,radius:M}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,f,A,l),t.strokeRect(p,f,A,l),t.fillStyle=a.backgroundColor,t.fillRect(w,f+1,A-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:A,boxPadding:c}=n,h=X(n.bodyFont);let d=h.lineHeight,g=0;const f=pe(n.rtl,this.x,this.width),p=function(C){e.fillText(C,f.x(t.x+g),t.y+d/2),t.y+=d+o},w=f.textAlign(a);let M,D,Y,G,B,y,v;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Li(this,w,n),e.fillStyle=n.bodyColor,T(this.beforeBody,p),g=r&&w!=="right"?a==="center"?A/2+c:A+2+c:0,G=0,y=s.length;G<y;++G){for(M=s[G],D=this.labelTextColors[G],e.fillStyle=D,T(M.before,p),Y=M.lines,r&&Y.length&&(this._drawColorBox(e,t,G,f,n),d=Math.max(h.lineHeight,l)),B=0,v=Y.length;B<v;++B)p(Y[B]),d=h.lineHeight;T(M.after,p)}g=0,d=h.lineHeight,T(this.afterBody,p),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let a,r;if(o){const l=pe(n.rtl,this.x,this.width);for(t.x=Li(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=X(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:A,height:c}=n,{topLeft:h,topRight:d,bottomLeft:g,bottomRight:f}=te(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+h,l),a==="top"&&this.drawCaret(t,e,n,s),e.lineTo(r+A-d,l),e.quadraticCurveTo(r+A,l,r+A,l+d),a==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(r+A,l+c-f),e.quadraticCurveTo(r+A,l+c,r+A-f,l+c),a==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(r+g,l+c),e.quadraticCurveTo(r,l+c,r,l+c-g),a==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(r,l+h),e.quadraticCurveTo(r,l,r+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const a=We[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ia(this,t),l=Object.assign({},a,this._size),A=na(e,t,l),c=sa(t,l,A,e);(s._to!==c.x||o._to!==c.y)&&(this.xAlign=A.xAlign,this.yAlign=A.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=tt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),Hs(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Vs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:r,index:l})=>{const A=this.chart.getDatasetMeta(r);if(!A)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:A.data[l],index:l}}),o=!oi(n,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,n),r=this._positionChanged(a,t),l=e||!oi(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,a=We[o.position].call(this,t,e);return a!==!1&&(n!==a.x||s!==a.y)}}x(En,"positioners",We);var Xd={id:"tooltip",_element:En,positioners:We,afterInit(i,t,e){e&&(i.tooltip=new En({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,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:(i,t)=>t.bodyFont.size,boxWidth:(i,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:ra},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Jd=Object.freeze({__proto__:null,Colors:ld,Decimation:dd,Filler:Qd,Legend:Od,SubTitle:Hd,Title:Nd,Tooltip:Xd});const qd=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function _d(i,t,e,n){const s=i.indexOf(t);if(s===-1)return qd(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const $d=(i,t)=>i===null?null:J(Math.round(i),0,t);function la(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class kn extends ae{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:_d(n,t,E(e,t),this._addedLabels),$d(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return la.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 e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}x(kn,"id","category"),x(kn,"defaults",{ticks:{callback:la}});function tg(i,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:A,maxTicks:c,maxDigits:h,includeBounds:d}=i,g=o||1,f=c-1,{min:p,max:w}=t,M=!z(a),D=!z(r),Y=!z(A),G=(w-p)/(h+1);let B=ds((w-p)/f/g)*g,y,v,C,I;if(B<1e-14&&!M&&!D)return[{value:p},{value:w}];I=Math.ceil(w/B)-Math.floor(p/B),I>f&&(B=ds(I*B/f/g)*g),z(l)||(y=Math.pow(10,l),B=Math.ceil(B*y)/y),s==="ticks"?(v=Math.floor(p/B)*B,C=Math.ceil(w/B)*B):(v=p,C=w),M&&D&&o&&Ul((r-a)/o,B/1e3)?(I=Math.round(Math.min((r-a)/B,c)),B=(r-a)/I,v=a,C=r):Y?(v=M?a:v,C=D?r:C,I=A-1,B=(C-v)/I):(I=(C-v)/B,Ce(I,Math.round(I),B/1e3)?I=Math.round(I):I=Math.ceil(I));const k=Math.max(us(B),us(v));y=Math.pow(10,z(l)?k:l),v=Math.round(v*y)/y,C=Math.round(C*y)/y;let Q=0;for(M&&(d&&v!==a?(e.push({value:a}),v<a&&Q++,Ce(Math.round((v+Q*B)*y)/y,a,Aa(a,G,i))&&Q++):v<a&&Q++);Q<I;++Q){const L=Math.round((v+Q*B)*y)/y;if(D&&L>r)break;e.push({value:L})}return D&&d&&C!==r?e.length&&Ce(e[e.length-1].value,r,Aa(r,G,i))?e[e.length-1].value=r:e.push({value:r}):(!D||C===r)&&e.push({value:C}),e}function Aa(i,t,{horizontal:e,minRotation:n}){const s=ft(n),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class zi extends ae{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,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=n?o:l;if(t){const l=Mt(s),A=Mt(o);l<0&&A<0?r(0):l>0&&A>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=tg(s,o);return t.bounds==="ticks"&&gs(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ke(t,this.chart.options.locale,this.options.ticks.format)}}class Qn extends zi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=ft(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}x(Qn,"id","linear"),x(Qn,"defaults",{ticks:{callback:Ai.formatters.numeric}});const Ze=i=>Math.floor(Nt(i)),re=(i,t)=>Math.pow(10,Ze(i)+t);function ca(i){return i/Math.pow(10,Ze(i))===1}function ha(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function eg(i,t){const e=t-i;let n=Ze(e);for(;ha(i,t,n)>10;)n++;for(;ha(i,t,n)<10;)n--;return Math.min(n,Ze(i))}function ig(i,{min:t,max:e}){t=lt(i.min,t);const n=[],s=Ze(t);let o=eg(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,A=Math.round((t-l)*a)/a,c=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((A-c)/Math.pow(10,o)),d=lt(i.min,Math.round((l+c+h*Math.pow(10,o))*a)/a);for(;d<e;)n.push({value:d,major:ca(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),d=Math.round((l+c+h*Math.pow(10,o))*a)/a;const g=lt(i.max,d);return n.push({value:g,major:ca(g),significand:h}),n}class Pn extends ae{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=zi.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return Z(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===re(this.min,0)?re(this.min,-1):re(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=r=>n=t?n:r,a=r=>s=e?s:r;n===s&&(n<=0?(o(1),a(10)):(o(re(n,-1)),a(re(s,1)))),n<=0&&o(re(s,-1)),s<=0&&a(re(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=ig(e,this);return t.bounds==="ticks"&&gs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":ke(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Nt(t),this._valueRange=Nt(this.max)-Nt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Nt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}x(Pn,"id","logarithmic"),x(Pn,"defaults",{ticks:{callback:Ai.formatters.logarithmic,major:{enabled:!0}}});function Ln(i){const t=i.ticks;if(t.display&&i.display){const e=tt(t.backdropPadding);return E(t.font&&t.font.size,F.font.size)+e.height}return 0}function ng(i,t,e){return e=V(e)?e:[e],{w:cA(i,t.string,e),h:e.length*t.lineHeight}}function da(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function sg(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?N/o:0;for(let l=0;l<o;l++){const A=a.setContext(i.getPointLabelContext(l));s[l]=A.padding;const c=i.getPointPosition(l,i.drawingArea+s[l],r),h=X(A.font),d=ng(i.ctx,h,i._pointLabels[l]);n[l]=d;const g=At(i.getIndexAngle(l)+r),f=Math.round(Xi(g)),p=da(f,c.x,d.w,0,180),w=da(f,c.y,d.h,90,270);og(e,t,g,p,w)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=lg(i,n,s)}function og(i,t,e,n,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;n.start<t.l?(r=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-r)):n.end>t.r&&(r=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function ag(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,n+s+a,o),A=Math.round(Xi(At(l.angle+U))),c=hg(l.y,r.h,A),h=Ag(A),d=cg(l.x,r.w,h);return{visible:!0,x:l.x,y:c,textAlign:h,left:d,top:c,right:d+r.w,bottom:c+r.h}}function rg(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(It({x:e,y:n},t)||It({x:e,y:o},t)||It({x:s,y:n},t)||It({x:s,y:o},t))}function lg(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Ln(o)/2,additionalAngle:a?N/s:0};let A;for(let c=0;c<s;c++){l.padding=e[c],l.size=t[c];const h=ag(i,c,l);n.push(h),r==="auto"&&(h.visible=rg(h,A),h.visible&&(A=h))}return n}function Ag(i){return i===0||i===180?"center":i<180?"left":"right"}function cg(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function hg(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function dg(i,t,e){const{left:n,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!z(r)){const l=te(t.borderRadius),A=tt(t.backdropPadding);i.fillStyle=r;const c=n-A.left,h=s-A.top,d=o-n+A.width,g=a-s+A.height;Object.values(l).some(f=>f!==0)?(i.beginPath(),Pe(i,{x:c,y:h,w:d,h:g,radius:l}),i.fill()):i.fillRect(c,h,d,g)}}function gg(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const a=n.setContext(i.getPointLabelContext(s));dg(e,a,o);const r=X(a.font),{x:l,y:A,textAlign:c}=o;$t(e,i._pointLabels[s],l,A+r.lineHeight/2,r,{color:a.color,textAlign:c,textBaseline:"middle"})}}function ga(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,H);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=i.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function ug(i,t,e,n,s){const o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!n||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ga(i,e,a,n),o.closePath(),o.stroke(),o.restore())}function fg(i,t,e){return Ht(i,{label:e,index:t,type:"pointLabel"})}class Ue extends zi{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=tt(Ln(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ln(this.options))}generateTickLabels(t){zi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=R(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?sg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return At(t*e+ft(n))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return fg(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-U+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),ga(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,A;if(e.pointLabels.display&&gg(this,a),s.display&&this.ticks.forEach((c,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(h),g=s.setContext(d),f=o.setContext(d);ug(this,g,l,a,f)}}),n.display){for(t.save(),r=a-1;r>=0;r--){const c=n.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),A=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(A.x,A.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const A=n.setContext(this.getContext(l)),c=X(A.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),A.showLabelBackdrop){t.font=c.string,a=t.measureText(r.label).width,t.fillStyle=A.backdropColor;const h=tt(A.backdropPadding);t.fillRect(-a/2-h.left,-o-c.size/2-h.top,a+h.width,c.size+h.height)}$t(t,r.label,0,-o,c,{color:A.color,strokeColor:A.textStrokeColor,strokeWidth:A.textStrokeWidth})}),t.restore()}drawTitle(){}}x(Ue,"id","radialLinear"),x(Ue,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ai.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),x(Ue,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),x(Ue,"descriptors",{angleLines:{_fallback:"grid"}});const Ti={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}},rt=Object.keys(Ti);function ua(i,t){return i-t}function fa(i,t){if(z(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let a=t;return typeof n=="function"&&(a=n(a)),Z(a)||(a=typeof n=="string"?e.parse(a,n):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ge(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function pa(i,t,e,n){const s=rt.length;for(let o=rt.indexOf(i);o<s-1;++o){const a=Ti[rt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=n)return rt[o]}return rt[s-1]}function pg(i,t,e,n,s){for(let o=rt.length-1;o>=rt.indexOf(e);o--){const a=rt[o];if(Ti[a].common&&i._adapter.diff(s,n,a)>=t-1)return a}return rt[e?rt.indexOf(e):0]}function wg(i){for(let t=rt.indexOf(i)+1,e=rt.length;t<e;++t)if(Ti[rt[t]].common)return rt[t]}function wa(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=qi(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function mg(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=e[r],l>=0&&(t[l].major=!0);return t}function ma(i,t,e){const n=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,n.push({value:r,major:!1});return o===0||!e?n:mg(i,n,s,e)}class Ke extends ae{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,e={}){const n=t.time||(t.time={}),s=this._adapter=new yc._date(t.adapters.date);s.init(e),ye(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(A){!a&&!isNaN(A.min)&&(s=Math.min(s,A.min)),!r&&!isNaN(A.max)&&(o=Math.max(o,A.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Z(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=Z(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=ql(s,o,a);return this._unit=e.unit||(n.autoSkip?pa(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):pg(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:wg(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),ma(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=J(e,0,a),n=J(n,0,a),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||pa(o.minUnit,e,n,this._getLabelCapacity(e)),r=E(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,A=ge(l)||l===!0,c={};let h=e,d,g;if(A&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,A?"day":a),t.diff(n,e,a)>1e5*r)throw new Error(e+" and "+n+" are too far apart with stepSize of "+r+" "+a);const f=s.ticks.source==="data"&&this.getDataTimestamps();for(d=h,g=0;d<n;d=+t.add(d,r,a),g++)wa(c,d,f);return(d===n||s.bounds==="ticks"||g===1)&&wa(c,d,f),Object.keys(c).sort(ua).map(p=>+p)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,n,s){const o=this.options,a=o.ticks.callback;if(a)return R(a,[t,e,n],this);const r=o.time.displayFormats,l=this._unit,A=this._majorUnit,c=l&&r[l],h=A&&r[A],d=n[e],g=A&&h&&d&&d.major;return this._adapter.format(t,s||(g?h:c))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:n*o+r*a,h:n*a+r*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,ma(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(fa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ms(t.sort(ua))}}x(Ke,"id","time"),x(Ke,"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 Si(i,t,e){let n=0,s=i.length-1,o,a,r,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=Ct(i,"pos",t)),{pos:o,time:r}=i[n],{pos:a,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=Ct(i,"time",t)),{time:o,pos:r}=i[n],{time:a,pos:l}=i[s]);const A=a-o;return A?r+(l-r)*(t-o)/A:r}class zn extends Ke{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Si(e,this.min),this._tableRange=Si(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let a,r,l,A,c;for(a=0,r=t.length;a<r;++a)A=t[a],A>=e&&A<=n&&s.push(A);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)c=s[a+1],l=s[a-1],A=s[a],Math.round((c+l)/2)!==A&&o.push({time:A,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(e)||n.length===1)&&n.push(e),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Si(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Si(this._table,n*this._tableRange+this._minPos,!0)}}x(zn,"id","timeseries"),x(zn,"defaults",Ke.defaults);var bg=Object.freeze({__proto__:null,CategoryScale:kn,LinearScale:Qn,LogarithmicScale:Pn,RadialLinearScale:Ue,TimeScale:Ke,TimeSeriesScale:zn});const Mg=[xc,ed,Jd,bg];kt.register(...Mg);var Dg=Object.defineProperty,Bg=Object.getOwnPropertyDescriptor,Pt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Bg(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&Dg(t,e,s),s};b.GenusChart=class extends u.LitElement{constructor(){super(...arguments),this.chartTitle="",this.chartType="",this.chartLabels=[],this.chartDataSets=[],this.chartOptions={},this.isLoading=0,this.createChart=()=>{this._chart=new kt(this._chartCanvas,{type:this.chartType,data:{labels:[...this.chartLabels],datasets:[...this.chartDataSets]},options:{...this.chartOptions}})}}firstUpdated(){this.createChart()}updated(){this._chart.data.labels=[...this.chartLabels],this._chart.data.datasets=[...this.chartDataSets],this._chart.update()}render(){return this.isLoading?u.html`<div class='content-loader'></div>`:u.html`
|
|
1858
1858
|
<div class='chart'>
|
|
1859
1859
|
<div class='chart__head'>
|
|
1860
1860
|
<h4 class='chart__title'>${this.chartTitle}</h4>
|
|
@@ -2974,7 +2974,7 @@
|
|
|
2974
2974
|
justify-content: center;
|
|
2975
2975
|
margin-top: var(--navigation-margin-top, 0.625rem);
|
|
2976
2976
|
}
|
|
2977
|
-
`;var Gu=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,
|
|
2977
|
+
`;var Gu=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,Zt=(i,t,e,n)=>{for(var s=n>1?void 0:n?Yu(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&Gu(t,e,s),s};b.GenusSlider=class extends u.LitElement{constructor(){super(...arguments),this.autoplay=!1,this.autoplayInterval=5e3,this._currentSlide=0,this._slideCount=0,this.autoplayTimer=null,this.startX=null,this.moveX=null,this.handleTouchStart=t=>{this.startX=t.touches[0].pageX},this.handleTouchMove=t=>{this.moveX=t.touches[0].pageX},this.handleTouchEnd=()=>{this.startX!==null&&this.moveX!==null&&(this.startX-this.moveX>50?this.nextSlide():this.moveX-this.startX>50&&this.previousSlide()),this.startX=null,this.moveX=null},this.handleScroll=()=>{const t=this._sliderContainer.scrollLeft,e=this._sliderContainer.offsetWidth;this._currentSlide=Math.round(t/e),this.requestUpdate()}}firstUpdated(){this.updateSlideCount(),this.addEventListeners(),this.autoplay&&this.startAutoplay()}updateSlideCount(){const t=this._slotElement.assignedNodes({flatten:!0});this._slideCount=t.filter(e=>e.nodeType===Node.ELEMENT_NODE).length,this.requestUpdate()}addEventListeners(){this.addEventListener("touchstart",this.handleTouchStart),this.addEventListener("touchmove",this.handleTouchMove),this.addEventListener("touchend",this.handleTouchEnd),this._sliderContainer.addEventListener("scroll",this.handleScroll)}goToSlide(t){this._currentSlide=t,this._sliderContent.style.transform=`translateX(-${this._currentSlide*100}%)`}nextSlide(){this._currentSlide=(this._currentSlide+1)%this._slideCount,this.updateSlider()}previousSlide(){this._currentSlide=(this._currentSlide-1+this._slideCount)%this._slideCount,this.updateSlider()}updateSlider(){this._sliderContainer.scrollTo({left:this._currentSlide*this._sliderContainer.offsetWidth,behavior:"smooth"}),this.requestUpdate()}startAutoplay(){this.autoplayTimer=window.setInterval(()=>{this.nextSlide()},this.autoplayInterval)}stopAutoplay(){this.autoplayTimer&&(clearInterval(this.autoplayTimer),this.autoplayTimer=null)}disconnectedCallback(){super.disconnectedCallback(),this.stopAutoplay(),this.removeEventListener("touchstart",this.handleTouchStart),this.removeEventListener("touchmove",this.handleTouchMove),this.removeEventListener("touchend",this.handleTouchEnd),this._sliderContainer.removeEventListener("scroll",this.handleScroll)}render(){return u.html`
|
|
2978
2978
|
<div class="slider-container">
|
|
2979
2979
|
<div class="slider-content">
|
|
2980
2980
|
<slot @slotchange=${this.updateSlideCount}></slot>
|
|
@@ -2985,7 +2985,7 @@
|
|
|
2985
2985
|
<div class="nav-button ${e===this._currentSlide?"active":""}" @click="${()=>this.goToSlide(e)}"></div>
|
|
2986
2986
|
`)}
|
|
2987
2987
|
</div>
|
|
2988
|
-
`}},b.GenusSlider.styles=[Mu,Du,Bu],
|
|
2988
|
+
`}},b.GenusSlider.styles=[Mu,Du,Bu],Zt([m.property({type:Boolean,attribute:"auto-play"})],b.GenusSlider.prototype,"autoplay",2),Zt([m.property({type:Number,attribute:"auto-play-interval"})],b.GenusSlider.prototype,"autoplayInterval",2),Zt([m.state()],b.GenusSlider.prototype,"_currentSlide",2),Zt([m.state()],b.GenusSlider.prototype,"_slideCount",2),Zt([m.query("slot")],b.GenusSlider.prototype,"_slotElement",2),Zt([m.query(".slider-container")],b.GenusSlider.prototype,"_sliderContainer",2),Zt([m.query(".slider-content")],b.GenusSlider.prototype,"_sliderContent",2),b.GenusSlider=Zt([m.customElement("genus-slider")],b.GenusSlider),(()=>{let i=`
|
|
2989
2989
|
@font-face
|
|
2990
2990
|
{
|
|
2991
2991
|
font-family: 'Sofia Pro Regular';
|