@opendatasoft/visualizations
Version:
Opendatasoft's components to easily build dashboards and visualizations.
19 lines • 1.49 MB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("punycode")):"function"==typeof define&&define.amd?define(["exports","punycode"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).opendatasoft=t.opendatasoft||{},t.opendatasoft.visualizations={}),t.require$$8)}(this,(function(t,e){"use strict";function n(t,e,n){return e=h(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}(t,i()?Reflect.construct(e,[],h(t).constructor):e.apply(t,n))}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/()}function m(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function _(t){return t+.5|0}const v=(t,e,n)=>Math.max(Math.min(t,n),e);function x(t){return v(_(2.55*t),0,255)}function b(t){return v(_(255*t),0,255)}function w(t){return v(_(t/2.55)/100,0,1)}function k(t){return v(_(100*t),0,100)}const S={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},M=[..."0123456789ABCDEF"],C=t=>M[15&t],T=t=>M[(240&t)>>4]+M[15&t],A=t=>(240&t)>>4==(15&t);function E(t){var e=(t=>A(t.r)&&A(t.g)&&A(t.b)&&A(t.a))(t)?C:T;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const I=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function D(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function P(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function z(t,e,n){const i=D(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function L(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),s=(r+o)/2;let a,l,c;return r!==o&&(c=r-o,l=s>.5?c/(2-r-o):c/(r+o),a=function(t,e,n,i,r){return t===r?(e-n)/i+(e<n?6:0):e===r?(n-t)/i+2:(t-e)/i+4}(e,n,i,c,r),a=60*a+.5),[0|a,l||0,s]}function O(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(b)}function R(t,e,n){return O(D,t,e,n)}function F(t){return(t%360+360)%360}function $(t){const e=I.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?x(+e[5]):b(+e[5]));const r=F(+e[2]),o=+e[3]/100,s=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return O(z,t,e,n)}(r,o,s):"hsv"===e[1]?function(t,e,n){return O(P,t,e,n)}(r,o,s):R(r,o,s),{r:n[0],g:n[1],b:n[2],a:i}}const B={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},N={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let V;function j(t){V||(V=function(){const t={},e=Object.keys(N),n=Object.keys(B);let i,r,o,s,a;for(i=0;i<e.length;i++){for(s=a=e[i],r=0;r<n.length;r++)o=n[r],a=a.replace(o,B[o]);o=parseInt(N[s],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),V.transparent=[0,0,0,0]);const e=V[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const q=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const U=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Z=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function W(t,e,n){if(t){let i=L(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=R(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function G(t,e){return t?Object.assign(e||{},t):t}function H(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=b(t[3]))):(e=G(t,{r:0,g:0,b:0,a:1})).a=b(e.a),e}function Y(t){return"r"===t.charAt(0)?function(t){const e=q.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=e[8]?x(t):v(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?x(n):v(n,0,255)),i=255&(e[4]?x(i):v(i,0,255)),r=255&(e[6]?x(r):v(r,0,255)),{r:n,g:i,b:r,a:o}}}(t):$(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=H(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*S[i[1]],g:255&17*S[i[2]],b:255&17*S[i[3]],a:5===o?17*S[i[4]]:255}:7!==o&&9!==o||(r={r:S[i[1]]<<4|S[i[2]],g:S[i[3]]<<4|S[i[4]],b:S[i[5]]<<4|S[i[6]],a:9===o?S[i[7]]<<4|S[i[8]]:255})),n=r||j(t)||Y(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=G(this._rgb);return t&&(t.a=w(t.a)),t}set rgb(t){this._rgb=H(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${w(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?E(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=L(t),n=e[0],i=k(e[1]),r=k(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${w(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const o=e===r?.5:e,s=2*o-1,a=n.a-i.a,l=((s*a==-1?s:(s+a)/(1+s*a))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=Z(w(t.r)),r=Z(w(t.g)),o=Z(w(t.b));return{r:b(U(i+n*(Z(w(e.r))-i))),g:b(U(r+n*(Z(w(e.g))-r))),b:b(U(o+n*(Z(w(e.b))-o))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=b(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=_(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return W(this._rgb,2,t),this}darken(t){return W(this._rgb,2,-t),this}saturate(t){return W(this._rgb,1,t),this}desaturate(t){return W(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=L(t);n[0]=F(n[0]+e),n=R(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}
/*!
* Chart.js v4.4.2
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function K(){}const J=(()=>{let t=0;return()=>t++})();function Q(t){return null==t}function tt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function et(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function nt(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function it(t,e){return nt(t)?t:e}function rt(t,e){return void 0===t?e:t}const ot=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function st(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function at(t,e,n,i){let r,o,s;if(tt(t))for(o=t.length,r=0;r<o;r++)e.call(n,t[r],r);else if(et(t))for(s=Object.keys(t),o=s.length,r=0;r<o;r++)e.call(n,t[s[r]],s[r])}function lt(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function ct(t){if(tt(t))return t.map(ct);if(et(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=ct(t[n[r]]);return e}return t}function ut(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ht(t,e,n,i){if(!ut(t))return;const r=e[t],o=n[t];et(r)&&et(o)?dt(r,o,i):e[t]=ct(o)}function dt(t,e,n){const i=tt(e)?e:[e],r=i.length;if(!et(t))return t;const o=(n=n||{}).merger||ht;let s;for(let e=0;e<r;++e){if(s=i[e],!et(s))continue;const r=Object.keys(s);for(let e=0,i=r.length;e<i;++e)o(r[e],t,s,n)}return t}function ft(t,e){return dt(t,e,{merger:pt})}function pt(t,e,n){if(!ut(t))return;const i=e[t],r=n[t];et(i)&&et(r)?ft(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ct(r))}const mt={"":t=>t,x:t=>t.x,y:t=>t.y};function gt(t,e){const n=mt[e]||(mt[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const t of e)i+=t,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function yt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const _t=t=>void 0!==t,vt=t=>"function"==typeof t,xt=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};const bt=Math.PI,wt=2*bt,kt=wt+bt,St=Number.POSITIVE_INFINITY,Mt=bt/180,Ct=bt/2,Tt=bt/4,At=2*bt/3,Et=Math.log10,It=Math.sign;function Dt(t,e,n){return Math.abs(t-e)<n}function Pt(t){const e=Math.round(t);t=Dt(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Et(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function zt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Lt(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Ot(t){return t*(bt/180)}function Rt(t){return t*(180/bt)}function Ft(t){if(!nt(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $t(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*bt&&(o+=wt),{angle:o,distance:r}}function Bt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Nt(t,e){return(t-e+kt)%wt-bt}function Vt(t){return(t%wt+wt)%wt}function jt(t,e,n,i){const r=Vt(t),o=Vt(e),s=Vt(n),a=Vt(o-r),l=Vt(s-r),c=Vt(r-o),u=Vt(r-s);return r===o||r===s||i&&o===s||a>l&&c<u}function qt(t,e,n){return Math.max(e,Math.min(n,t))}function Ut(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function Zt(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Wt=(t,e,n,i)=>Zt(t,n,i?i=>{const r=t[i][e];return r<n||r===n&&t[i+1][e]===n}:i=>t[i][e]<n),Gt=(t,e,n)=>Zt(t,n,(i=>t[i][e]>=n));const Ht=["push","pop","shift","splice","unshift"];function Yt(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(Ht.forEach((e=>{delete t[e]})),delete t._chartjs)}function Xt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Jt(t,e){let n=[],i=!1;return function(...r){n=r,i||(i=!0,Kt.call(window,(()=>{i=!1,t.apply(e,n)})))}}const Qt=t=>"start"===t?"left":"end"===t?"right":"center",te=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function ee(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:s,_parsed:a}=t,l=s.axis,{min:c,max:u,minDefined:h,maxDefined:d}=s.getUserBounds();h&&(r=qt(Math.min(Wt(a,l,c).lo,n?i:Wt(e,l,s.getPixelForValue(c)).lo),0,i-1)),o=d?qt(Math.max(Wt(a,s.axis,u,!0).hi+1,n?0:Wt(e,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:i-r}return{start:r,count:o}}function ne(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}const ie=t=>0===t||1===t,re=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wt/n),oe=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*wt/n)+1,se={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Ct),easeOutSine:t=>Math.sin(t*Ct),easeInOutSine:t=>-.5*(Math.cos(bt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ie(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ie(t)?t:re(t,.075,.3),easeOutElastic:t=>ie(t)?t:oe(t,.075,.3),easeInOutElastic(t){const e=.1125;return ie(t)?t:t<.5?.5*re(2*t,e,.45):.5+.5*oe(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-se.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*se.easeInBounce(2*t):.5*se.easeOutBounce(2*t-1)+.5};function ae(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function le(t){return ae(t)?t:new X(t)}function ce(t){return ae(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const ue=["x","y","borderWidth","radius","tension"],he=["color","borderColor","backgroundColor"];const de=new Map;function fe(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=de.get(n);return i||(i=new Intl.NumberFormat(t,e),de.set(n,i)),i}(e,n).format(t)}const pe={values:t=>tt(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const s=Et(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),fe(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(Et(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?pe.numeric.call(this,t,e,n):""}};var me={formatters:pe};const ge=Object.create(null),ye=Object.create(null);function _e(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function ve(t,e,n){return"string"==typeof e?dt(_e(t,e),n):dt(_e(t,""),e)}class xe{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=t=>t.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=(t,e)=>ce(e.backgroundColor),this.hoverBorderColor=(t,e)=>ce(e.borderColor),this.hoverColor=(t,e)=>ce(e.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 ve(this,t,e)}get(t){return _e(this,t)}describe(t,e){return ve(ye,t,e)}override(t,e){return ve(ge,t,e)}route(t,e,n,i){const r=_e(this,t),o=_e(this,n),s="_"+e;Object.defineProperties(r,{[s]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[s],e=o[i];return et(t)?Object.assign({},e,t):rt(t,e)},set(t){this[s]=t}}})}apply(t){t.forEach((t=>t(this)))}}var be=new xe({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:he},numbers:{type:"number",properties:ue}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(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:me.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function we(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function ke(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let s=0;const a=n.length;let l,c,u,h,d;for(l=0;l<a;l++)if(h=n[l],null==h||tt(h)){if(tt(h))for(c=0,u=h.length;c<u;c++)d=h[c],null==d||tt(d)||(s=we(t,r,o,s,d))}else s=we(t,r,o,s,h);t.restore();const f=o.length/2;if(f>n.length){for(l=0;l<f;l++)delete r[o[l]];o.splice(0,f)}return s}function Se(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Me(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Ce(t,e,n,i){Te(t,e,n,i,null)}function Te(t,e,n,i,r){let o,s,a,l,c,u,h,d;const f=e.pointStyle,p=e.rotation,m=e.radius;let g=(p||0)*Mt;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,i),t.rotate(g),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(m)||m<=0)){switch(t.beginPath(),f){default:r?t.ellipse(n,i,r/2,m,0,0,wt):t.arc(n,i,m,0,wt),t.closePath();break;case"triangle":u=r?r/2:m,t.moveTo(n+Math.sin(g)*u,i-Math.cos(g)*m),g+=At,t.lineTo(n+Math.sin(g)*u,i-Math.cos(g)*m),g+=At,t.lineTo(n+Math.sin(g)*u,i-Math.cos(g)*m),t.closePath();break;case"rectRounded":c=.516*m,l=m-c,s=Math.cos(g+Tt)*l,h=Math.cos(g+Tt)*(r?r/2-c:l),a=Math.sin(g+Tt)*l,d=Math.sin(g+Tt)*(r?r/2-c:l),t.arc(n-h,i-a,c,g-bt,g-Ct),t.arc(n+d,i-s,c,g-Ct,g),t.arc(n+h,i+a,c,g,g+Ct),t.arc(n-d,i+s,c,g+Ct,g+bt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,u=r?r/2:l,t.rect(n-u,i-l,2*u,2*l);break}g+=Tt;case"rectRot":h=Math.cos(g)*(r?r/2:m),s=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(n-h,i-a),t.lineTo(n+d,i-s),t.lineTo(n+h,i+a),t.lineTo(n-d,i+s),t.closePath();break;case"crossRot":g+=Tt;case"cross":h=Math.cos(g)*(r?r/2:m),s=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s);break;case"star":h=Math.cos(g)*(r?r/2:m),s=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s),g+=Tt,h=Math.cos(g)*(r?r/2:m),s=Math.cos(g)*m,a=Math.sin(g)*m,d=Math.sin(g)*(r?r/2:m),t.moveTo(n-h,i-a),t.lineTo(n+h,i+a),t.moveTo(n+d,i-s),t.lineTo(n-d,i+s);break;case"line":s=r?r/2:Math.cos(g)*m,a=Math.sin(g)*m,t.moveTo(n-s,i-a),t.lineTo(n+s,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(g)*(r?r/2:m),i+Math.sin(g)*m);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Ae(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Ee(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ie(t){t.restore()}function De(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Pe(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function ze(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),s=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function Le(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Oe(t,e,n,i,r,o={}){const s=tt(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Q(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&Le(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),Q(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,n,i,o.maxWidth)),t.fillText(c,n,i,o.maxWidth),ze(t,n,i,c,o),i+=Number(r.lineHeight);t.restore()}function Re(t,e){const{x:n,y:i,w:r,h:o,radius:s}=e;t.arc(n+s.topLeft,i+s.topLeft,s.topLeft,1.5*bt,bt,!0),t.lineTo(n,i+o-s.bottomLeft),t.arc(n+s.bottomLeft,i+o-s.bottomLeft,s.bottomLeft,bt,Ct,!0),t.lineTo(n+r-s.bottomRight,i+o),t.arc(n+r-s.bottomRight,i+o-s.bottomRight,s.bottomRight,Ct,0,!0),t.lineTo(n+r,i+s.topRight),t.arc(n+r-s.topRight,i+s.topRight,s.topRight,0,-Ct,!0),t.lineTo(n+s.topLeft,i)}const Fe=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,$e=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Be(t,e){const n=(""+t).match(Fe);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}const Ne=t=>+t||0;function Ve(t,e){const n={},i=et(e),r=i?Object.keys(e):e,o=et(t)?i?n=>rt(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=Ne(o(t));return n}function je(t){return Ve(t,{top:"y",right:"x",bottom:"y",left:"x"})}function qe(t){return Ve(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(t){const e=je(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ze(t,e){t=t||{},e=e||be.font;let n=rt(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=rt(t.style,e.style);i&&!(""+i).match($e)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:rt(t.family,e.family),lineHeight:Be(rt(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:rt(t.weight,e.weight),string:""};return r.string=function(t){return!t||Q(t.size)||Q(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function We(t,e,n,i){let r,o,s;for(r=0,o=t.length;r<o;++r)if(s=t[r],void 0!==s&&(void 0!==e&&"function"==typeof s&&(s=s(e)),void 0!==n&&tt(s)&&(s=s[n%s.length]),void 0!==s))return s}function Ge(t,e){return Object.assign(Object.create(t),e)}function He(t,e=[""],n,i,r=(()=>t[0])){const o=n||t;void 0===i&&(i=sn("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:r,override:n=>He([n,...t],e,o,i)};return new Proxy(s,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>Qe(n,i,(()=>function(t,e,n,i){let r;for(const o of e)if(r=sn(Ke(o,t),n),void 0!==r)return Je(t,r)?rn(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>an(t).includes(e),ownKeys:t=>an(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function Ye(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Xe(t,i),setContext:e=>Ye(t,e,n,i),override:r=>Ye(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Qe(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:s}=t;let a=i[e];vt(a)&&s.isScriptable(e)&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:s,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,s||i);a.delete(t),Je(t,l)&&(l=rn(r._scopes,r,t,l));return l}(e,a,t,n));tt(a)&&a.length&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:s,_descriptors:a}=n;if(void 0!==o.index&&i(t))return e[o.index%e.length];if(et(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=rn(i,r,t,l);e.push(Ye(n,o,s&&s[t],a))}}return e}(e,a,t,s.isIndexable));Je(e,a)&&(a=Ye(a,r,o&&o[e],s));return a}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function Xe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:vt(n)?n:()=>n,isIndexable:vt(i)?i:()=>i}}const Ke=(t,e)=>t?t+yt(e):e,Je=(t,e)=>et(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Qe(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function tn(t,e,n){return vt(t)?t(e,n):t}const en=(t,e)=>!0===t?e:"string"==typeof t?gt(e,t):void 0;function nn(t,e,n,i,r){for(const o of e){const e=en(n,o);if(e){t.add(e);const o=tn(e._fallback,n,r);if(void 0!==o&&o!==n&&o!==i)return o}else if(!1===e&&void 0!==i&&n!==i)return null}return!1}function rn(t,e,n,i){const r=e._rootScopes,o=tn(e._fallback,n,i),s=[...t,...r],a=new Set;a.add(i);let l=on(a,s,n,o||n,i);return null!==l&&((void 0===o||o===n||(l=on(a,s,o,l,i),null!==l))&&He(Array.from(a),[""],r,o,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];if(tt(r)&&et(n))return n;return r||{}}(e,n,i))))}function on(t,e,n,i,r){for(;n;)n=nn(t,e,n,i,r);return n}function sn(t,e){for(const n of e){if(!n)continue;const e=n[t];if(void 0!==e)return e}}function an(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function ln(t,e,n,i){const{iScale:r}=t,{key:o="r"}=this._parsing,s=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=e[c],s[a]={r:r.parse(gt(u,o),c)};return s}const cn=Number.EPSILON||1e-14,un=(t,e)=>e<t.length&&!t[e].skip&&t[e],hn=t=>"x"===t?"y":"x";function dn(t,e,n,i){const r=t.skip?e:t,o=e,s=n.skip?e:n,a=Bt(o,r),l=Bt(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,d=i*u;return{previous:{x:o.x-h*(s.x-r.x),y:o.y-h*(s.y-r.y)},next:{x:o.x+d*(s.x-r.x),y:o.y+d*(s.y-r.y)}}}function fn(t,e="x"){const n=hn(e),i=t.length,r=Array(i).fill(0),o=Array(i);let s,a,l,c=un(t,0);for(s=0;s<i;++s)if(a=l,l=c,c=un(t,s+1),l){if(c){const t=c[e]-l[e];r[s]=0!==t?(c[n]-l[n])/t:0}o[s]=a?c?It(r[s-1])!==It(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}!function(t,e,n){const i=t.length;let r,o,s,a,l,c=un(t,0);for(let u=0;u<i-1;++u)l=c,c=un(t,u+1),l&&c&&(Dt(e[u],0,cn)?n[u]=n[u+1]=0:(r=n[u]/e[u],o=n[u+1]/e[u],a=Math.pow(r,2)+Math.pow(o,2),a<=9||(s=3/Math.sqrt(a),n[u]=r*s*e[u],n[u+1]=o*s*e[u])))}(t,r,o),function(t,e,n="x"){const i=hn(n),r=t.length;let o,s,a,l=un(t,0);for(let c=0;c<r;++c){if(s=a,a=l,l=un(t,c+1),!a)continue;const r=a[n],u=a[i];s&&(o=(r-s[n])/3,a[`cp1${n}`]=r-o,a[`cp1${i}`]=u-o*e[c]),l&&(o=(l[n]-r)/3,a[`cp2${n}`]=r+o,a[`cp2${i}`]=u+o*e[c])}}(t,o,e)}function pn(t,e,n){return Math.max(Math.min(t,n),e)}function mn(t,e,n,i,r){let o,s,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)fn(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,s=t.length;o<s;++o)a=t[o],l=dn(n,a,t[Math.min(o+1,s-(i?0:1))%s],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,n=a}e.capBezierPoints&&function(t,e){let n,i,r,o,s,a=Ae(t[0],e);for(n=0,i=t.length;n<i;++n)s=o,o=a,a=n<i-1&&Ae(t[n+1],e),o&&(r=t[n],s&&(r.cp1x=pn(r.cp1x,e.left,e.right),r.cp1y=pn(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=pn(r.cp2x,e.left,e.right),r.cp2y=pn(r.cp2y,e.top,e.bottom)))}(t,n)}function gn(){return"undefined"!=typeof window&&"undefined"!=typeof document}function yn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function _n(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const vn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const xn=["top","right","bottom","left"];function bn(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=xn[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const wn=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function kn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=vn(n),o="border-box"===r.boxSizing,s=bn(r,"padding"),a=bn(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:o}=i;let s,a,l=!1;if(wn(r,o,t.target))s=r,a=o;else{const t=e.getBoundingClientRect();s=i.clientX-t.left,a=i.clientY-t.top,l=!0}return{x:s,y:a,box:l}}(t,n),h=s.left+(u&&a.left),d=s.top+(u&&a.top);let{width:f,height:p}=e;return o&&(f-=s.width+a.width,p-=s.height+a.height),{x:Math.round((l-h)/f*n.width/i),y:Math.round((c-d)/p*n.height/i)}}const Sn=t=>Math.round(10*t)/10;function Mn(t,e,n,i){const r=vn(t),o=bn(r,"margin"),s=_n(r.maxWidth,t,"clientWidth")||St,a=_n(r.maxHeight,t,"clientHeight")||St,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=yn(t);if(o){const t=o.getBoundingClientRect(),s=vn(o),a=bn(s,"border","width"),l=bn(s,"padding");e=t.width-l.width-a.width,n=t.height-l.height-a.height,i=_n(s.maxWidth,o,"clientWidth"),r=_n(s.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||St,maxHeight:r||St}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=bn(r,"border","width"),e=bn(r,"padding");c-=e.width+t.width,u-=e.height+t.height}c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Sn(Math.min(c,s,l.maxWidth)),u=Sn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Sn(c/2));return(void 0!==e||void 0!==n)&&i&&l.height&&u>l.height&&(u=l.height,c=Sn(Math.floor(u*i))),{width:c,height:u}}function Cn(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const s=t.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||s.height!==r||s.width!==o)&&(t.currentDevicePixelRatio=i,s.height=r,s.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const Tn=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};gn()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function An(t,e){const n=function(t,e){return vn(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function En(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function In(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function Dn(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},s=En(t,r,n),a=En(r,o,n),l=En(o,e,n),c=En(s,a,n),u=En(a,l,n);return En(c,u,n)}function Pn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function zn(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Ln(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function On(t){return"angle"===t?{between:jt,compare:Nt,normalize:Vt}:{between:Ut,compare:(t,e)=>t-e,normalize:t=>t}}function Rn({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function Fn(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,s=e.length,{compare:a,between:l,normalize:c}=On(i),{start:u,end:h,loop:d,style:f}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:s,normalize:a}=On(i),l=e.length;let c,u,{start:h,end:d,loop:f}=t;if(f){for(h+=l,d+=l,c=0,u=l;c<u&&s(a(e[h%l][i]),r,o);++c)h--,d--;h%=l,d%=l}return d<h&&(d+=l),{start:h,end:d,loop:f,style:t.style}}(t,e,n),p=[];let m,g,y,_=!1,v=null;const x=()=>_||l(r,y,m)&&0!==a(r,y),b=()=>!_||0===a(o,m)||l(o,y,m);for(let t=u,n=u;t<=h;++t)g=e[t%s],g.skip||(m=c(g[i]),m!==y&&(_=l(m,r,o),null===v&&x()&&(v=0===a(m,r)?t:n),null!==v&&b()&&(p.push(Rn({start:v,end:t,loop:d,count:s,style:f})),v=null),n=t,y=m));return null!==v&&p.push(Rn({start:v,end:h,loop:d,count:s,style:f})),p}function $n(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=Fn(i[r],t.points,e);o.length&&n.push(...o)}return n}function Bn(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),o=Nn(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,l=n.length,c=[];let u=o,h=e[0].start,d=h;function f(t,e,i,r){const o=a?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=o;for(;n[e%l].skip;)e+=o;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:i,style:r}),u=r,h=e%l)}}for(const t of e){h=a?h:t.start;let e,o=n[h%l];for(d=h+1;d<=t.end;d++){const a=n[d%l];e=Nn(i.setContext(Ge(r,{type:"segment",p0:o,p1:a,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:s}))),Vn(e,u)&&f(h,d-1,t.loop,u),o=a,u=e}h<d-1&&f(h,d-1,t.loop,u)}return c}(t,e,n,i):e}function Nn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Vn(t,e){if(!e)return!1;const n=[],i=function(t,e){return ae(e)?(n.includes(e)||n.push(e),n.indexOf(e)):e};return JSON.stringify(t,i)!==JSON.stringify(e,i)}
/*!
* Chart.js v4.4.2
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class jn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach((i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Kt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o,s=r.length-1,a=!1;for(;s>=0;--s)o=r[s],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),a=!0):(r[s]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(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(((t,e)=>Math.max(t,e._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 i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qn=new jn;const Un="transparent",Zn={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=le(t||Un),r=i.valid&&le(e||Un);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Wn{constructor(t,e,n,i){const r=e[n];i=We([t.to,i,r,t.from]);const o=We([t.from,r,i]);this._active=!0,this._fn=t.fn||Zn[t.type||typeof o],this._easing=se[t.easing]||se.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=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=We([t.to,e,i,t.from]),this._from=We([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,s=this._to;let a;if(this._active=r!==s&&(o||e<n),!this._active)return this._target[i]=s,void this._notify(!0);e<0?this._target[i]=r:(a=e/n%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(r,s,a))}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 t=0;t<n.length;t++)n[t][e]()}}class Gn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!et(t))return;const e=Object.keys(be.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const r=t[i];if(!et(r))return;const o={};for(const t of e)o[t]=r[t];(tt(r.properties)&&r.properties||[i]).forEach((t=>{t!==i&&n.has(t)||n.set(t,o)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const h=n.get(l);if(u){if(h&&u.active()){u.update(h,c,s);continue}u.cancel()}h&&h.duration?(r[l]=u=new Wn(h,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(qn.add(this._chart,n),!0):void 0}}function Hn(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function Yn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function Xn(t,e,n,i={}){const r=t.keys,o="single"===i.mode;let s,a,l,c;if(null!==e){for(s=0,a=r.length;s<a;++s){if(l=+r[s],l===n){if(i.all)continue;break}c=t.values[l],nt(c)&&(o||0===e||It(e)===It(c))&&(e+=c)}return e}}function Kn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Jn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Qn(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function ti(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=i,l=o.axis,c=s.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,s,i),h=e.length;let d;for(let t=0;t<h;++t){const n=e[t],{[l]:o,[c]:h}=n;d=(n._stacks||(n._stacks={}))[c]=Jn(r,u,o),d[a]=h,d._top=Qn(d,s,!0,i.type),d._bottom=Qn(d,s,!1,i.type);(d._visualValues||(d._visualValues={}))[a]=h}}function ei(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function ni(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n],void 0!==e[i]._visualValues&&void 0!==e[i]._visualValues[n]&&delete e[i]._visualValues[n]}}}const ii=t=>"reset"===t||"none"===t,ri=(t,e)=>e?t:Object.assign({},t);class oi{static defaults={};static datasetElementType=null;static dataElementType=null;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=Kn(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&&ni(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=rt(n.xAxisID,ei(t,"x")),o=e.yAxisID=rt(n.yAxisID,ei(t,"y")),s=e.rAxisID=rt(n.rAxisID,ei(t,"r")),a=e.indexAxis,l=e.iAxisID=i(a,r,o,s),c=e.vAxisID=i(a,o,r,s);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(l),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&&Yt(this._data,this),t._stacked&&ni(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(et(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i],n[i]={x:o,y:t[o]};return n}(e);else if(n!==e){if(n){Yt(n,this);const t=this._cachedMeta;ni(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(i=e)._chartjs?i._chartjs.listeners.push(r):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Ht.forEach((t=>{const e="_onData"+yt(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),r}})})))),this._syncList=[],this._data=e}var i,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=Kn(e.vScale,e),e.stack!==n.stack&&(i=!0,ni(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&ti(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.c