PageSourceSearch

https://life.goodder.co/assets/js/9144.b27beb8b.js

js goodder.co collected 2026-10-07 19:07:03 UTC 250,297 bytes, 22 lines download raw bytes

vendor: 13,589 bytes, lines 1-15
1"use strict";(self["webpackChunkgoodderlife"]=self["webpackChunkgoodderlife"]||[]).push([[9144],{1014:function(t,e,i){
2/*!
3 * @kurkle/color v0.3.4
4 * https://github.com/kurkle/color#readme
5 * (c) 2024 Jukka Kurkela
6 * Released under the MIT License
7 */
8function n(t){return t+.5|0}i.d(e,{$:function(){return Ye},A:function(){return Jt},B:function(){return Gt},C:function(){return He},D:function(){return Wt},E:function(){return ai},F:function(){return ot},G:function(){return Zi},H:function(){return Ct},I:function(){return Wi},J:function(){return nn},K:function(){return en},L:function(){return oe},M:function(){return ji},N:function(){return Vt},O:function(){return tt},P:function(){return kt},Q:function(){return st},R:function(){return ci},S:function(){return Xt},T:function(){return wt},U:function(){return zt},V:function(){return Be},W:function(){return Qt},X:function(){return Ne},Y:function(){return $e},Z:function(){return Ge},_:function(){return ne},a:function(){return li},a0:function(){return ri},a1:function(){return re},a2:function(){return le},a3:function(){return Oe},a4:function(){return ht},a5:function(){return xt},a6:function(){return Ae},a7:function(){return yt},a8:function(){return ui},a9:function(){return di},aA:function(){return hn},aB:function(){return ce},aC:function(){return dn},aD:function(){return We},aE:function(){return Ht},aF:function(){return Q},aG:function(){return Ft},aH:function(){return Lt},aI:function(){return Bt},aJ:function(){return Tt},aK:function(){return jt},aL:function(){return Pe},aM:function(){return Ot},aN:function(){return Fe},aO:function(){return Zt},aP:function(){return Kt},aa:function(){return fi},ab:function(){return dt},ac:function(){return q},ad:function(){return ae},ae:function(){return tn},af:function(){return ze},ag:function(){return _t},ah:function(){return at},ai:function(){return vt},aj:function(){return qt},ak:function(){return ni},al:function(){return zi},am:function(){return yn},an:function(){return mn},ao:function(){return on},ap:function(){return an},aq:function(){return sn},ar:function(){return Ue},as:function(){return Xe},at:function(){return je},au:function(){return Je},av:function(){return si},aw:function(){return oi},ax:function(){return gn},ay:function(){return Yt},az:function(){return cn},b:function(){return G},c:function(){return xe},d:function(){return Ie},e:function(){return ge},f:function(){return mt},g:function(){return Z},h:function(){return bt},i:function(){return J},j:function(){return hi},k:function(){return K},l:function(){return ee},m:function(){return it},n:function(){return nt},o:function(){return Se},p:function(){return Ut},q:function(){return he},r:function(){return se},s:function(){return At},t:function(){return Nt},u:function(){return ie},v:function(){return et},w:function(){return de},x:function(){return Rt},y:function(){return Oi},z:function(){return Ki}});const s=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return s(n(2.55*t),0,255)}function a(t){return s(n(255*t),0,255)}function r(t){return s(n(t/2.55)/100,0,1)}function l(t){return s(n(100*t),0,100)}const c={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},h=[..."0123456789ABCDEF"],d=t=>h[15&t],u=t=>h[(240&t)>>4]+h[15&t],f=t=>(240&t)>>4===(15&t),p=t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a);function g(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*c[t[1]],g:255&17*c[t[2]],b:255&17*c[t[3]],a:5===i?17*c[t[4]]:255}:7!==i&&9!==i||(e={r:c[t[1]]<<4|c[t[2]],g:c[t[3]]<<4|c[t[4]],b:c[t[5]]<<4|c[t[6]],a:9===i?c[t[7]]<<4|c[t[8]]:255})),e}const m=(t,e)=>t<255?e(t):"";function x(t){var e=p(t)?d:u;return t?"#"+e(t.r)+e(t.g)+e(t.b)+m(t.a,e):void 0}const b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function _(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function v(t,e,i){const n=y(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function k(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}function w(t){const e=255,i=t.r/e,n=t.g/e,s=t.b/e,o=Math.max(i,n,s),a=Math.min(i,n,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=k(i,n,s,h,o),l=60*l+.5),[0|l,c||0,r]}function M(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(a)}function S(t,e,i){return M(y,t,e,i)}function D(t,e,i){return M(v,t,e,i)}function C(t,e,i){return M(_,t,e,i)}function P(t){return(t%360+360)%360}function E(t){const e=b.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?o(+e[5]):a(+e[5]));const s=P(+e[2]),r=+e[3]/100,l=+e[4]/100;return i="hwb"===e[1]?D(s,r,l):"hsv"===e[1]?C(s,r,l):S(s,r,l),{r:i[0],g:i[1],b:i[2],a:n}}function O(t,e){var i=w(t);i[0]=P(i[0]+e),i=S(i),t.r=i[0],t.g=i[1],t.b=i[2]}function A(t){if(!t)return;const e=w(t),i=e[0],n=l(e[1]),s=l(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${r(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}const T={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"},L={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function V(){const t={},e=Object.keys(L),i=Object.keys(T);let n,s,o,a,r;for(n=0;n<e.length;n++){for(a=r=e[n],s=0;s<i.length;s++)o=i[s],r=r.replace(o,T[o]);o=parseInt(L[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}let I;function R(t){I||(I=V(),I.transparent=[0,0,0,0]);const e=I[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const B=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function F(t){const e=B.exec(t);let i,n,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):s(255*t,0,255)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?o(i):s(i,0,255)),n=255&(e[4]?o(n):s(n,0,255)),a=255&(e[6]?o(a):s(a,0,255)),{r:i,g:n,b:a,a:r}}}function N(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const z=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,j=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function W(t,e,i){const n=j(r(t.r)),s=j(r(t.g)),o=j(r(t.b));return{r:a(z(n+i*(j(r(e.r))-n))),g:a(z(s+i*(j(r(e.g))-s))),b:a(z(o+i*(j(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}function H(t,e,i){if(t){let n=w(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=S(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function $(t,e){return t?Object.assign(e||{},t):t}function Y(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=a(t[3]))):(e=$(t,{r:0,g:0,b:0,a:1}),e.a=a(e.a)),e}function U(t){return"r"===t.charAt(0)?F(t):E(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let i;"object"===e?i=Y(t):"string"===e&&(i=g(t)||R(t)||U(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=Y(t)}rgbString(){return this._valid?N(this._rgb):void 0}hexString(){return this._valid?x(this._rgb):void 0}hslString(){return this._valid?A(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,a=2*o-1,r=i.a-n.a,l=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=W(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=n(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 H(this._rgb,2,t),this}darken(t){return H(this._rgb,2,-t),this}saturate(t){return H(this._rgb,1,t),this}desaturate(t){return H(this._rgb,1,-t),this}rotate(t){return O(this._rgb,t),this}}
9/*!
10 * Chart.js v4.4.8
11 * https://www.chartjs.org
12 * (c) 2025 Chart.js Contributors
13 * Released under the MIT License
14 */
15function Q(){}const q=(()=>{let t=0;return()=>t++})();function K(t){return null===t||void 0===t}function G(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 J(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Z(t){return("number"===typeof t||t instanceof Number)&&isFinite(+t)}function tt(t,e){return Z(t)?t:e}function et(t,e){return"undefined"===typeof t?e:t}const it=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,nt=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function st(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function ot(t,e,i,n){let s,o,a;if(G(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(J(t))for(a=Object.keys(t),o=a.length,s=0;s<o;s++)e.call(i,t[a[s]],a[s])}function at(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function rt(t){if(G(t))return t.map(rt);if(J(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=rt(t[i[s]]);return e}return t}function lt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ct(t,e,i,n){if(!lt(t))return;const s=e[t],o=i[t];J(s)&&J(o)?ht(s,o,n):e[t]=rt(o)}function ht(t,e,i){const n=G(e)?e:[e],s=n.length;if(!J(t))return t;i=i||{};const o=i.merger||ct;let a;for(let r=0;r<s;++r){if(a=n[r],!J(a))continue;const e=Object.keys(a);for(let n=0,s=e.length;n<s;++n)o(e[n],t,a,i)}return t}function dt(t,e){return ht(t,e,{merger:ut})}function ut(t,e,i){if(!lt(t))return;const n=e[t],s=i[t];J(n)&&J(s)?dt(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=rt(s))}const ft={"":t=>t,x:t=>t.x,y:t=>t.y};function pt(t){const e=t.split("."),i=[];let n="";for(const s of e)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function gt(t){const e=pt(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}function mt(t,e){const i=ft[e]||(ft[e]=gt(e));return i(t)}function xt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const bt=t=>"undefined"!==typeof t,yt=t=>"function"===typeof t,_t=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function vt(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const kt=Math.PI,wt=2*kt,Mt=wt+kt,St=Number.POSITIVE_INFINITY,Dt=kt/180,Ct=kt/2,Pt=kt/4,Et=2*kt/3,Ot=Math.log10,At=Math.sign;function Tt(t,e,i){return Math.abs(t-e)<i}function Lt(t){const e=Math.round(t);t=Tt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Ot(t))),n=t/i,s=n<=1?1:n<=2?2:n<=5?5:10;return s*i}function Vt(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n===0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function It(t){return"symbol"===typeof t||"object"===typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Rt(t){return!It(t)&&!isNaN(parseFloat(t))&&isFinite(t)}
vendor: 4,174 bytes, line 15
15function Bt(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function Ft(t,e,i){let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Nt(t){return t*(kt/180)}function zt(t){return t*(180/kt)}function jt(t){if(!Z(t))return;let e=1,i=0;while(Math.round(t*e)/e!==t)e*=10,i++;return i}function Wt(t,e){const i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*kt&&(o+=wt),{angle:o,distance:s}}function Ht(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $t(t,e){return(t-e+Mt)%wt-kt}function Yt(t){return(t%wt+wt)%wt}function Ut(t,e,i,n){const s=Yt(t),o=Yt(e),a=Yt(i),r=Yt(o-s),l=Yt(a-s),c=Yt(s-o),h=Yt(s-a);return s===o||s===a||n&&o===a||r>l&&c<h}function Xt(t,e,i){return Math.max(e,Math.min(i,t))}function Qt(t){return Xt(t,-32768,32767)}function qt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Kt(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;while(s-o>1)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const Gt=(t,e,i,n)=>Kt(t,i,n?n=>{const s=t[n][e];return s<i||s===i&&t[n+1][e]===i}:n=>t[n][e]<i),Jt=(t,e,i)=>Kt(t,i,(n=>t[n][e]>=i));function Zt(t,e,i){let n=0,s=t.length;while(n<s&&t[n]<e)n++;while(s>n&&t[s-1]>i)s--;return n>0||s<t.length?t.slice(n,s):t}const te=["push","pop","shift","splice","unshift"];function ee(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),te.forEach((e=>{const i="_onData"+xt(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const s=n.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[i]&&t[i](...e)})),s}})})))}function ie(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(te.forEach((e=>{delete t[e]})),delete t._chartjs)}function ne(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const se=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function oe(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,se.call(window,(()=>{n=!1,t.apply(e,i)})))}}function ae(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}const re=t=>"start"===t?"left":"end"===t?"right":"center",le=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,ce=(t,e,i,n)=>{const s=n?"left":"right";return t===s?i:"center"===t?(e+i)/2:e};function he(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:a,vScale:r,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(s=Math.min(Gt(l,h,d).lo,i?n:Gt(e,h,a.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex((t=>!K(t[r.axis])));s-=Math.max(0,t)}s=Xt(s,0,n-1)}if(p){let t=Math.max(Gt(l,a.axis,u,!0).hi+1,i?0:Gt(e,h,a.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex((t=>!K(t[r.axis])));t+=Math.max(0,e)}o=Xt(t,s,n)-s}else o=n-s}return{start:s,count:o}}function de(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const ue=t=>0===t||1===t,fe=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wt/i),pe=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*wt/i)+1,ge={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(kt*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=>ue(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))
vendor: 4,811 bytes, line 15
15),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=>ue(t)?t:fe(t,.075,.3),easeOutElastic:t=>ue(t)?t:pe(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return ue(t)?t:t<.5?.5*fe(2*t,e,i):.5+.5*pe(2*t-1,e,i)},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-ge.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ge.easeInBounce(2*t):.5*ge.easeOutBounce(2*t-1)+.5};function me(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function xe(t){return me(t)?t:new X(t)}function be(t){return me(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const ye=["x","y","borderWidth","radius","tension"],_e=["color","borderColor","backgroundColor"];function ve(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:_e},numbers:{type:"number",properties:ye}}),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 ke(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const we=new Map;function Me(t,e){e=e||{};const i=t+JSON.stringify(e);let n=we.get(i);return n||(n=new Intl.NumberFormat(t,e),we.set(i,n)),n}function Se(t,e,i){return Me(e,i).format(t)}const De={values(t){return G(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=Ce(t,i)}const a=Ot(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),Se(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(Ot(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?De.numeric.call(this,t,e,i):""}};function Ce(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Pe={formatters:De};function Ee(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:Pe.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})}const Oe=Object.create(null),Ae=Object.create(null);function Te(t,e){if(!e)return t;const i=e.split(".");for(let n=0,s=i.length;n<s;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function Le(t,e,i){return"string"===typeof e?ht(Te(t,e),i):ht(Te(t,""),e)}class Ve{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={}
vendor: 4,754 bytes, line 15
15,this.hoverBackgroundColor=(t,e)=>be(e.backgroundColor),this.hoverBorderColor=(t,e)=>be(e.borderColor),this.hoverColor=(t,e)=>be(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 Le(this,t,e)}get(t){return Te(this,t)}describe(t,e){return Le(Ae,t,e)}override(t,e){return Le(Oe,t,e)}route(t,e,i,n){const s=Te(this,t),o=Te(this,i),a="_"+e;Object.defineProperties(s,{[a]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[n];return J(t)?Object.assign({},e,t):et(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Ie=new Ve({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ve,ke,Ee]);function Re(t){return!t||K(t.size)||K(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Be(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Fe(t,e,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,c,h,d,u;for(l=0;l<r;l++)if(d=i[l],void 0===d||null===d||G(d)){if(G(d))for(c=0,h=d.length;c<h;c++)u=d[c],void 0===u||null===u||G(u)||(a=Be(t,s,o,a,u))}else a=Be(t,s,o,a,d);t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return a}function Ne(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function ze(t,e){(e||t)&&(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function je(t,e,i,n){We(t,e,i,n,null)}function We(t,e,i,n,s){let o,a,r,l,c,h,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Dt;if(f&&"object"===typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:s?t.ellipse(i,n,s/2,g,0,0,wt):t.arc(i,n,g,0,wt),t.closePath();break;case"triangle":h=s?s/2:g,t.moveTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=Et,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=Et,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":c=.516*g,l=g-c,a=Math.cos(m+Pt)*l,d=Math.cos(m+Pt)*(s?s/2-c:l),r=Math.sin(m+Pt)*l,u=Math.sin(m+Pt)*(s?s/2-c:l),t.arc(i-d,n-r,c,m-kt,m-Ct),t.arc(i+u,n-a,c,m-Ct,m),t.arc(i+d,n+r,c,m,m+Ct),t.arc(i-u,n+a,c,m+Ct,m+kt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,t.rect(i-h,n-l,2*h,2*l);break}m+=Pt;case"rectRot":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+u,n-a),t.lineTo(i+d,n+r),t.lineTo(i-u,n+a),t.closePath();break;case"crossRot":m+=Pt;case"cross":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a),m+=Pt,d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-a,n-r),t.lineTo(i+a,n+r);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function He(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function $e(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ye(t){t.restore()}function Ue(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!==!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Xe(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Qe(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),K(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function qe(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),a=e-
15o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(a,h),t.lineTo(r,h),t.stroke()}}function Ke(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Ge(t,e,i,n,s,o={}){const a=G(e)?e:[e],r=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,Qe(t,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Ke(t,o.backdrop),r&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),K(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,i,n,o.maxWidth)),t.fillText(c,i,n,o.maxWidth),qe(t,i,n,c,o),n+=Number(s.lineHeight);t.restore()}function Je(t,e){const{x:i,y:n,w:s,h:o,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,1.5*kt,kt,!0),t.lineTo(i,n+o-a.bottomLeft),t.arc(i+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,kt,Ct,!0),t.lineTo(i+s-a.bottomRight,n+o),t.arc(i+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,Ct,0,!0),t.lineTo(i+s,n+a.topRight),t.arc(i+s-a.topRight,n+a.topRight,a.topRight,0,-Ct,!0),t.lineTo(i+a.topLeft,n)}const Ze=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ti=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ei(t,e){const i=(""+t).match(Ze);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100;break}return e*t}const ii=t=>+t||0;function ni(t,e){const i={},n=J(e),s=n?Object.keys(e):e,o=J(t)?n?i=>et(t[i],t[e[i]]):e=>t[e]:()=>t;for(const a of s)i[a]=ii(o(a));return i}function si(t){return ni(t,{top:"y",right:"x",bottom:"y",left:"x"})}function oi(t){return ni(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ai(t){const e=si(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ri(t,e){t=t||{},e=e||Ie.font;let i=et(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let n=et(t.style,e.style);n&&!(""+n).match(ti)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:et(t.family,e.family),lineHeight:ei(et(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:et(t.weight,e.weight),string:""};return s.string=Re(s),s}function li(t,e,i,n){let s,o,a,r=!0;for(s=0,o=t.length;s<o;++s)if(a=t[s],void 0!==a&&(void 0!==e&&"function"===typeof a&&(a=a(e),r=!1),void 0!==i&&G(a)&&(a=a[i%a.length],r=!1),void 0!==a))return n&&!r&&(n.cacheable=!1),a}function ci(t,e,i){const{min:n,max:s}=t,o=nt(e,(s-n)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(n,-Math.abs(o)),max:a(s,o)}}function hi(t,e){return Object.assign(Object.create(t),e)}function di(t,e=[""],i,n,s=()=>t[0]){const o=i||t;"undefined"===typeof n&&(n=Ci("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>di([i,...t],e,o,n)};return new Proxy(a,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,n){return mi(i,n,(()=>Di(n,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return Pi(t).includes(e)},ownKeys(t){return Pi(t)},set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function ui(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:fi(t,n),setContext:e=>ui(t,e,i,n),override:s=>ui(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return mi(t,e,(()=>xi(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,n){return t[i]=n,delete e[i],!0}})}function fi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:yt(i)?i:()=>i,isIndexable:yt(n)?n:()=>n}}const pi=(t,e)=>t?t+xt(e):e,gi=(t,e)=>J(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function mi(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function xi(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;let r=n[e];return yt(r)&&a.isScriptable(e)&&(r=bi(e,r,t,i)),G(r)&&r.length&&(r=yi(e,r,t,a.isIndexable)),gi(e,r)&&(r=ui(r,s,o&&o[e],a)),r}function bi(t,e,i,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||n);return r.delete(t),gi(t,l)&&(l=wi(s._scopes,s,t,l)),l}
15function yi(t,e,i,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=i;if("undefined"!==typeof o.index&&n(t))return e[o.index%e.length];if(J(e[0])){const i=e,n=s._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=wi(n,s,t,l);e.push(ui(i,o,a&&a[t],r))}}return e}function _i(t,e,i){return yt(t)?t(e,i):t}const vi=(t,e)=>!0===t?e:"string"===typeof t?mt(e,t):void 0;function ki(t,e,i,n,s){for(const o of e){const e=vi(i,o);if(e){t.add(e);const o=_i(e._fallback,i,s);if("undefined"!==typeof o&&o!==i&&o!==n)return o}else if(!1===e&&"undefined"!==typeof n&&i!==n)return null}return!1}function wi(t,e,i,n){const s=e._rootScopes,o=_i(e._fallback,i,n),a=[...t,...s],r=new Set;r.add(n);let l=Mi(r,a,i,o||i,n);return null!==l&&(("undefined"===typeof o||o===i||(l=Mi(r,a,o,l,n),null!==l))&&di(Array.from(r),[""],s,o,(()=>Si(e,i,n))))}function Mi(t,e,i,n,s){while(i)i=ki(t,e,i,n,s);return i}function Si(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return G(s)&&J(i)?i:s||{}}function Di(t,e,i,n){let s;for(const o of e)if(s=Ci(pi(o,t),i),"undefined"!==typeof s)return gi(t,s)?wi(i,n,t,s):s}function Ci(t,e){for(const i of e){if(!i)continue;const e=i[t];if("undefined"!==typeof e)return e}}function Pi(t){let e=t._keys;return e||(e=t._keys=Ei(t._scopes)),e}function Ei(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}function Oi(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+i,h=e[c],a[r]={r:s.parse(mt(h,o),c)};return a}const Ai=Number.EPSILON||1e-14,Ti=(t,e)=>e<t.length&&!t[e].skip&&t[e],Li=t=>"x"===t?"y":"x";function Vi(t,e,i,n){const s=t.skip?e:t,o=e,a=i.skip?e:i,r=Ht(o,s),l=Ht(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function Ii(t,e,i){const n=t.length;let s,o,a,r,l,c=Ti(t,0);for(let h=0;h<n-1;++h)l=c,c=Ti(t,h+1),l&&c&&(Tt(e[h],0,Ai)?i[h]=i[h+1]=0:(s=i[h]/e[h],o=i[h+1]/e[h],r=Math.pow(s,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[h]=s*a*e[h],i[h+1]=o*a*e[h])))}function Ri(t,e,i="x"){const n=Li(i),s=t.length;let o,a,r,l=Ti(t,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Ti(t,c+1),!r)continue;const s=r[i],h=r[n];a&&(o=(s-a[i])/3,r[`cp1${i}`]=s-o,r[`cp1${n}`]=h-o*e[c]),l&&(o=(l[i]-s)/3,r[`cp2${i}`]=s+o,r[`cp2${n}`]=h+o*e[c])}}function Bi(t,e="x"){const i=Li(e),n=t.length,s=Array(n).fill(0),o=Array(n);let a,r,l,c=Ti(t,0);for(a=0;a<n;++a)if(r=l,l=c,c=Ti(t,a+1),l){if(c){const t=c[e]-l[e];s[a]=0!==t?(c[i]-l[i])/t:0}o[a]=r?c?At(s[a-1])!==At(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Ii(t,s,o),Ri(t,o,e)}function Fi(t,e,i){return Math.max(Math.min(t,i),e)}function Ni(t,e){let i,n,s,o,a,r=He(t[0],e);for(i=0,n=t.length;i<n;++i)a=o,o=r,r=i<n-1&&He(t[i+1],e),o&&(s=t[i],a&&(s.cp1x=Fi(s.cp1x,e.left,e.right),s.cp1y=Fi(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Fi(s.cp2x,e.left,e.right),s.cp2y=Fi(s.cp2y,e.top,e.bottom)))}function zi(t,e,i,n,s){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Bi(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Vi(i,r,t[Math.min(o+1,a-(n?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&Ni(t,i)}function ji(){return"undefined"!==typeof window&&"undefined"!==typeof document}function Wi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Hi(t,e,i){let n;return"string"===typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const $i=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Yi(t,e){return $i(t).getPropertyValue(e)}const Ui=["top","right","bottom","left"];function Xi(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Ui[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Qi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function qi(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let a,r,l=!1;if(Qi(s,o,t.target))a=s,r=o;else{const t=e.getBoundingClientRect();a=n.clientX-t.left,r=n.clientY-t.top,l=!0}return{x:a,y:r,box:l}}function Ki(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=$i(i),o="border-box"===s.boxSizing,a=Xi(s,"padding"),r=Xi(s,"border","width"),{x:l,y:c,box:h}=qi(t,i),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:f,height:p}=e;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}function Gi(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&Wi(t);if(o){const t=o.getBoundingClientRect(),a=$i(o),r=Xi(a,"border","width"),l=Xi(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,n=Hi(a.maxWidth,o,"clientWidth"),s=Hi(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||St,maxHeight:s||St}}const Ji=t=>Math.round(10*t)/10;function Zi(t,e,i,n){const s=$i(t),o=Xi(s,"margin"),a=Hi(s.maxWidth,t,"clientWidth")||St,r=Hi(s.maxHeight,t,"clientHeight")||St,l=Gi(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xi(s,"border","width"),e=Xi(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ji(Math.min(c,a,l.maxWidth)),h=Ji(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Ji(c/2));const d=void 0!==e||void 0!==i;return d&&n&&l.height&&h>l.height&&(h=l.height,c=Ji(Math.floor(h*n))),{width:c,height:h}}function tn(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||a.height!==s||a.width!==o)&&(t.currentDevicePixelRatio=n,a.height=s,a.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const en=function(){let t=!1;
vendor: 4,097 bytes, line 15
15try{const e={get passive(){return t=!0,!1}};ji()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(e){}return t}();function nn(t,e){const i=Yi(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function sn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function on(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function an(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=sn(t,s,i),r=sn(s,o,i),l=sn(o,e,i),c=sn(a,r,i),h=sn(r,l,i);return sn(c,h,i)}const rn=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},ln=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function cn(t,e,i){return t?rn(e,i):ln()}function hn(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function dn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function un(t){return"angle"===t?{between:Ut,compare:$t,normalize:Yt}:{between:qt,compare:(t,e)=>t-e,normalize:t=>t}}function fn({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i===0,style:s}}function pn(t,e,i){const{property:n,start:s,end:o}=i,{between:a,normalize:r}=un(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;c<h;++c){if(!a(r(e[d%l][n]),s,o))break;d--,u--}d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}function gn(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,a=e.length,{compare:r,between:l,normalize:c}=un(n),{start:h,end:d,loop:u,style:f}=pn(t,e,i),p=[];let g,m,x,b=!1,y=null;const _=()=>l(s,x,g)&&0!==r(s,x),v=()=>0===r(o,g)||l(o,x,g),k=()=>b||_(),w=()=>!b||v();for(let M=h,S=h;M<=d;++M)m=e[M%a],m.skip||(g=c(m[n]),g!==x&&(b=l(g,s,o),null===y&&k()&&(y=0===r(g,s)?M:S),null!==y&&w()&&(p.push(fn({start:y,end:M,loop:u,count:a,style:f})),y=null),S=M,x=g));return null!==y&&p.push(fn({start:y,end:d,loop:u,count:a,style:f})),p}function mn(t,e){const i=[],n=t.segments;for(let s=0;s<n.length;s++){const o=gn(n[s],t.points,e);o.length&&i.push(...o)}return i}function xn(t,e,i,n){let s=0,o=e-1;if(i&&!n)while(s<e&&!t[s].skip)s++;while(s<e&&t[s].skip)s++;s%=e,i&&(o+=s);while(o>s&&t[o%e].skip)o--;return o%=e,{start:s,end:o}}function bn(t,e,i,n){const s=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(a-1)%s,loop:n}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%s,end:r%s,loop:n}),o}function yn(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:a,end:r}=xn(i,s,o,n);if(!0===n)return _n(t,[{start:a,end:r,loop:o}],i,e);const l=r<a?r+s:r,c=!!t._fullLoop&&0===a&&r===s-1;return _n(t,bn(i,a,l,c),i,e)}function _n(t,e,i,n){return n&&n.setContext&&i?vn(t,e,i,n):e}function vn(t,e,i,n){const s=t._chart.getContext(),o=kn(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,c=[];let h=o,d=e[0].start,u=d;function f(t,e,n,s){const o=r?-1:1;if(t!==e){t+=l;while(i[t%l].skip)t-=o;while(i[e%l].skip)e+=o;t%l!==e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const p of e){d=r?d:p.start;let t,e=i[d%l];for(u=d+1;u<=p.end;u++){const o=i[u%l];t=kn(n.setContext(hi(s,{type:"segment",p0:e,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),wn(t,h)&&f(d,u-1,p.loop,h),e=o,h=t}d<u-1&&f(d,u-1,p.loop,h)}return c}function kn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function wn(t,e){if(!e)return!1;const i=[],n=function(t,e){return me(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}}
vendor: 5,126 bytes, lines 15-21
15,2489:function(t,e,i){var n=i(6518),s=i(9565),o=i(9306),a=i(8551),r=i(1767),l=i(9462),c=i(6319),h=i(6395),d=l((function(){var t,e,i,n=this.iterator,o=this.predicate,r=this.next;while(1){if(t=a(s(r,n)),e=this.done=!!t.done,e)return;if(i=t.value,c(n,o,[i,this.counter++],!0))return i}}));n({target:"Iterator",proto:!0,real:!0,forced:h},{filter:function(t){return a(this),o(t),new d(r(this),{predicate:t})}})},6118:function(t,e,i){i.d(e,{$L:function(){return bo},A6:function(){return X},Bs:function(){return vi},C5:function(){return xo},Dk:function(){return Tt},E8:function(){return Ui},FE:function(){return ve},FN:function(){return Ri},G5:function(){return J},Hg:function(){return ee},Jb:function(){return Q},Jy:function(){return an},N3:function(){return pt},NT:function(){return n.d},No:function(){return Vi},Nx:function(){return ws},OJ:function(){return Ns},P$:function(){return Z},PP:function(){return Ps},Pz:function(){return et},QW:function(){return te},Qt:function(){return o},Qw:function(){return c},R_:function(){return n.aL},UA:function(){return po},UM:function(){return it},X5:function(){return l},YF:function(){return At},Yt:function(){return Xi},ZT:function(){return G},dN:function(){return Wn},gO:function(){return un},gu:function(){return Lt},h9:function(){return tt},hE:function(){return ts},ij:function(){return ot},iw:function(){return mo},ju:function(){return K},kc:function(){return Ts},m_:function(){return ks},n:function(){return A},pr:function(){return io},s$:function(){return Gn},t1:function(){return ui},tK:function(){return is},u5:function(){return Ce},yw:function(){return Zt}});var n=i(1014);
16/*!
17 * Chart.js v4.4.8
18 * https://www.chartjs.org
19 * (c) 2025 Chart.js Contributors
20 * Released under the MIT License
21 */class s{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach((n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=n.r.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,a=s.length-1,r=!1;for(;a>=0;--a)o=s[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(s[a]=s[s.length-1],s.pop());r&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}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 i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new s;const a="transparent",r={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=(0,n.c)(t||a),o=s.valid&&(0,n.c)(e||a);return o&&o.valid?o.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class l{constructor(t,e,i,s){const o=e[i];s=(0,n.a)([t.to,s,o,t.from]);const a=(0,n.a)([t.from,o,s]);this._active=!0,this._fn=t.fn||r[t.type||typeof a],this._easing=n.e[t.easing]||n.e.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=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,n.a)([t.to,e,s,t.from]),this._from=(0,n.a)([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,a=this._to;let r;if(this._active=s!==a&&(o||e<i),!this._active)return this._target[n]=a,void this._notify(!0);e<0?this._target[n]=s:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[n]=this._fn(s,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class c{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,n.i)(t))return;const e=Object.keys(n.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const o=t[s];if(!(0,n.i)(o))return;const a={};for(const t of e)a[t]=o[t];
21((0,n.b)(o.properties)&&o.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,a)}))}))}_animateOptions(t,e){const i=e.options,n=d(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&h(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const c=o[r];if("$"===c.charAt(0))continue;if("options"===c){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=s[c];const u=i.get(c);if(d){if(u&&d.active()){d.update(u,h,a);continue}d.cancel()}u&&u.duration?(s[c]=d=new l(u,t,c,h),n.push(d)):t[c]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function h(t,e){const i=[],n=Object.keys(e);for(let s=0;s<n.length;s++){const e=t[n[s]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}function d(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}function u(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function f(t,e,i){if(!1===i)return!1;const n=u(t,i),s=u(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function p(t){let e,i,s,o;return(0,n.i)(t)?(e=t.top,i=t.right,s=t.bottom,o=t.left):e=i=s=o=t,{top:e,right:i,bottom:s,left:o,disabled:!1===t}}function g(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function m(t,e,i,s={}){const o=t.keys,a="single"===s.mode;let r,l,c,h;if(null===e)return;let d=!1;for(r=0,l=o.length;r<l;++r){if(c=+o[r],c===i){if(d=!0,s.all)continue;break}h=t.values[c],(0,n.g)(h)&&(a||0===e||(0,n.s)(e)===(0,n.s)(h))&&(e+=h)}return d||s.all?e:0}function x(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[s]:h,[o]:t[h]};return r}function b(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function y(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function _(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function v(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function k(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function w(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=y(o,a,n),d=e.length;let u;for(let f=0;f<d;++f){const t=e[f],{[l]:i,[c]:o}=t,d=t._stacks||(t._stacks={});u=d[c]=v(s,h,i),u[r]=o,u._top=k(u,a,!0,n.type),u._bottom=k(u,a,!1,n.type);const p=u._visualValues||(u._visualValues={});p[r]=o}}function M(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function S(t,e){return(0,n.j)(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function D(t,e,i){return(0,n.j)(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function C(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const P=t=>"reset"===t||"none"===t,E=(t,e)=>e?t:Object.assign({},t),O=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:g(i,!0),values:null};class A{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=b(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&&C(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,o=e.xAxisID=(0,n.v)(i.xAxisID,M(t,"x")),a=e.yAxisID=(0,n.v)(i.yAxisID,M(t,"y")),r=e.rAxisID=(0,n.v)(i.rAxisID,M(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=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(c),e.vScale=this.getScaleForId(h)}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&&(0,n.u)(this._data,this),t._stacked&&C(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,n.i)(e)){const t=this._cachedMeta;this._data=x(e,t)}else if(i!==e){if(i){(0,n.u)(i,this);const t=this._cachedMeta;C(t),t._parsed=[]}
21e&&Object.isExtensible(e)&&(0,n.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,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=b(e.vScale,e),e.stack!==i.stack&&(n=!0,C(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(w(this,e._parsed),e._stacked=b(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l,c,h,d=0===t&&e===s.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=(0,n.b)(s[t])?this.parseArrayData(i,s,t,e):(0,n.i)(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const o=()=>null===c[r]||u&&c[r]<u[r];for(l=0;l<e;++l)i._parsed[l+t]=c=h[l],d&&(o()&&(d=!1),u=c);i._sorted=d}a&&w(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,a=s.axis,r=o.axis,l=s.getLabels(),c=s===o,h=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[a]:c||s.parse(l[f],f),[r]:o.parse(e[f],f)};return h}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,a=new Array(n);let r,l,c,h;for(r=0,l=n;r<l;++r)c=r+i,h=e[c],a[r]={x:s.parse(h[0],c),y:o.parse(h[1],c)};return a}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,d,u,f;for(h=0,d=s;h<d;++h)u=h+i,f=e[u],c[h]={x:o.parse((0,n.f)(f,r),u),y:a.parse((0,n.f)(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis],a={keys:g(n,!0),values:e._stacks[t.axis]._visualValues};return m(a,o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,o=m(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=O(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=_(r);let u,f;function p(){f=s[u];const e=f[r.axis];return!(0,n.g)(f[t.axis])||h>e||d<e}for(u=0;u<a;++u)if(!p()&&(this.updateRangeFromParsed(c,t,f,l),o))break;if(o)for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],(0,n.g)(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=p((0,n.v)(this.options.clip,f(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||n.length-a,l=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(t,s,a,r),c=a;c<a+r;++c){const e=n[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];s=e.$context||(e.$context=D(this.getContext(),t,e)),s.parsed=this.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=S(this.chart.getContext(),this.index)),s.dataset=n,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&(0,n.h)(i);if(r)return E(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(n.d.elements[t]),p=()=>this.getContext(i,s,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(E(g,l))),g}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,a=s[o];if(a)return a;let r;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);r=n.createResolver(o,this.getContext(t,i,e))}const l=new c(n,r&&r.animations);return r&&r._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||P(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){P(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!P(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);
vendor: 4,358 bytes, line 21
21this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,r,l]of this._syncList)this[a](r,l);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&r(n._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&C(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function T(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=(0,n._)(s.sort(((t,e)=>t-e)))}return t._cache.$bar}function L(t){const e=t.iScale,i=T(e,t.type);let s,o,a,r,l=e._length;const c=()=>{32767!==a&&-32768!==a&&((0,n.h)(r)&&(l=Math.min(l,Math.abs(a-r)||l)),r=a)};for(s=0,o=i.length;s<o;++s)a=e.getPixelForValue(i[s]),c();for(r=void 0,s=0,o=e.ticks.length;s<o;++s)a=e.getPixelForTick(s),c();return l}function V(t,e,i,s){const o=i.barThickness;let a,r;return(0,n.k)(o)?(a=e.min*i.categoryPercentage,r=i.barPercentage):(a=o*s,r=1),{chunk:a/s,ratio:r,start:e.pixels[t]-a/2}}function I(t,e,i,n){const s=e.pixels,o=s[t];let a=t>0?s[t-1]:null,r=t<s.length-1?s[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l,h=Math.abs(r-a)/2*l;return{chunk:h/n,ratio:i.barPercentage,start:c}}function R(t,e,i,n){const s=i.parse(t[0],n),o=i.parse(t[1],n),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function B(t,e,i,s){return(0,n.b)(t)?R(t,e,i,s):e[i.axis]=i.parse(t,s),e}function F(t,e,i,n){const s=t.iScale,o=t.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(B(u,d,o,c));return l}function N(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function z(t,e,i){return 0!==t?(0,n.s)(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function j(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:e,top:s,bottom:o}}function W(t,e,i,n){let s=e.borderSkipped;const o={};if(!s)return void(t.borderSkipped=o);if(!0===s)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:l,top:c,bottom:h}=j(t);"middle"===s&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=h:(o[H(h,a,r,l)]=!0,s=c)),o[H(s,a,r,l)]=!0,t.borderSkipped=o}function H(t,e,i,n){return n?(t=$(t,e,i),t=Y(t,i,e)):t=Y(t,e,i),t}function $(t,e,i){return t===e?i:t===i?e:t}function Y(t,e,i){return"start"===t?e:"end"===t?i:t}function U(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class X extends A{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};
21parsePrimitiveData(t,e,i,n){return F(t,e,i,n)}parseArrayData(t,e,i,n){return F(t,e,i,n)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c="x"===o.axis?r:l,h="x"===a.axis?r:l,d=[];let u,f,p,g;for(u=i,f=i+s;u<f;++u)g=e[u],p={},p[o.axis]=o.parse((0,n.f)(g,c),u),d.push(B((0,n.f)(g,h),p,a,u));return d}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,s=this.getParsed(t),o=s._custom,a=N(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(s[n.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:a}}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,i,s){const o="reset"===s,{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=o||(0,n.k)(e[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),g=(e._stacks||{})[r.axis],m={horizontal:c,base:i.base,enableBorderRadius:!g||N(e._custom)||a===g._top||a===g._bottom,x:c?i.head:p.center,y:c?p.center:i.head,height:c?p.size:Math.abs(i.size),width:c?Math.abs(i.size):p.size};u&&(m.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const x=m.options||t[f].options;W(m,x,g,a),U(m,x,h.ratio),this.updateElement(t[f],f,m,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[i.axis],c=t=>{const e=t._parsed.find((t=>t[i.axis]===l)),s=e&&e[t.vScale.axis];if((0,n.k)(s)||isNaN(s))return!0};for(const n of s)if((void 0===e||!c(n))&&((!1===o||-1===a.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&a.push(n.stack),n.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s<o;++s)n.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const a=t.barThickness,r=a||L(e);return{min:r,pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=N(c);let d,u,f=l[e.axis],p=0,g=i?this.applyStack(e,l,i):f;g!==f&&(p=g-f,g=f),h&&(f=c.barStart,g=c.barEnd-c.barStart,0!==f&&(0,n.s)(f)!==(0,n.s)(c.barEnd)&&(p=0),p+=f);const m=(0,n.k)(o)||h?p:o;let x=e.getPixelForValue(m);if(d=this.chart.getDataVisibility(t)?e.getPixelForValue(p+g):x,u=d-x,Math.abs(u)<a){u=z(u,e,r)*a,f===r&&(x-=u/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),o=Math.min(t,n),c=Math.max(t,n);x=Math.max(Math.min(x,c),o),d=x+u,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(d)-e.getValueForPixel(x))}if(x===e.getPixelForValue(r)){const t=(0,n.s)(u)*e.getLineWidthForValue(r)/2;x+=t,u-=t}return{size:u,base:x,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=(0,n.v)(s.maxBarThickness,1/0);let r,l;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,n="flex"===s.barThickness?I(t,e,s,i):V(t,e,s,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=n.start+n.chunk*c+n.chunk/2,l=Math.min(a,n.chunk*n.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.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,i=t.data,n=i.length;let s=0;for(;s<n;++s)null===this.getParsed(s)[e.axis]||i[s].hidden||i[s].draw(this._ctx)}}class Q extends A{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}
21parsePrimitiveData(t,e,i,n){const s=super.parsePrimitiveData(t,e,i,n);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+i).radius;return s}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let a=0;a<o.length;a++){const t=e[i+a];o[a]._custom=(0,n.v)(t[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let a=0;a<o.length;a++){const t=e[i+a];o[a]._custom=(0,n.v)(t&&t.r&&+t.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),r=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=a.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!s&&this.getParsed(d),u={},f=u[c]=s?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),p=u[h]=s?a.getBasePixel():a.getPixelForValue(i[h]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":n),s&&(u.options.radius=0)),this.updateElement(e,d,u,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return"active"!==e&&(s.radius=0),s.radius+=(0,n.v)(i&&i._custom,o),s}}function q(t,e,i){let s=1,o=1,a=0,r=0;if(e<n.T){const l=t,c=l+e,h=Math.cos(l),d=Math.sin(l),u=Math.cos(c),f=Math.sin(c),p=(t,e,s)=>(0,n.p)(t,l,c,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>(0,n.p)(t,l,c,!0)?-1:Math.min(e,e*i,s,s*i),m=p(0,h,u),x=p(n.H,d,f),b=g(n.P,h,u),y=g(n.P+n.H,d,f);s=(m-b)/2,o=(x-y)/2,a=-(m+b)/2,r=-(x+y)/2}return{ratioX:s,ratioY:o,offsetX:a,offsetY:r}}class K extends A{static id="doughnut";static 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"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,s)=>{const o=t.getDatasetMeta(0),a=o.controller.getStyle(s);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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 i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let o,a,r=t=>+i[t];if((0,n.i)(i[t])){const{key:t="value"}=this._parsing;r=e=>+(0,n.f)(i[e],t)}for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return(0,n.t)(this.options.rotation-90)}_getCircumference(){return(0,n.t)(this.options.circumference)}_getRotationExtents(){let t=n.T,e=-n.T;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,s=n._getRotation(),o=n._getCircumference();t=Math.min(t,s),e=Math.max(e,s+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min((0,n.m)(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:p,offsetY:g}=q(d,h,l),m=(i.width-a)/u,x=(i.height-a)/f,b=Math.max(Math.min(m,x)/2,0),y=(0,n.n)(this.options.radius,b),_=Math.max(y*l,0),v=(y-_)/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=g*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/n.T)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,a=o.chartArea,r=o.options,l=r.animation,c=(a.left+a.right)/2,h=(a.top+a.bottom)/2,d=s&&l.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,n);let m,x=this._getRotation();for(m=0;m<e;++m)x+=this._circumference(m,s);for(m=e;m<e+i;++m){const e=this._circumference(m,s),i=t[m],o={x:c+this.offsetX,y:h+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:u};g&&(o.options=p||this.resolveDataElementOptions(m,i.active?"active":n)),x+=e,this.updateElement(i,m,o,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(s))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?n.T*(Math.abs(t)/e):0}
vendor: 10,020 bytes, line 21
21getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=(0,n.o)(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,a,r;if(!t)for(n=0,s=i.data.datasets.length;n<s;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,a=o.controller;break}if(!t)return 0;for(n=0,s=t.length;n<s;++n)r=a.resolveDataElementOptions(n),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max((0,n.v)(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class G extends A{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=(0,n.q)(e,s,a);this._drawStart=r,this._drawCount=l,(0,n.w)(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=a.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=(0,n.x)(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===s,b=e+i,y=t.length;let _=e>0&&this.getParsed(e-1);for(let v=0;v<y;++v){const i=t[v],p=x?i:{};if(v<e||v>=b){p.skip=!0;continue}const y=this.getParsed(v),k=(0,n.k)(y[f]),w=p[u]=a.getPixelForValue(y[u],v),M=p[f]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,y,l):y[f],v);p.skip=isNaN(w)||isNaN(M)||k,p.stop=v>0&&Math.abs(y[u]-_[u])>m,g&&(p.parsed=y,p.raw=c.data[v]),d&&(p.options=h||this.resolveDataElementOptions(v,i.active?"active":s)),x||this.updateElement(i,v,p,s),_=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class J extends A{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,s)=>{const o=t.getDatasetMeta(0),a=o.controller.getStyle(s);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:n,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=(0,n.o)(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return n.y.bind(this)(t,e,i,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(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const o="reset"===s,a=this.chart,r=a.options,l=r.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*n.P;let f,p=u;const g=360/this.countVisibleElements();for(f=0;f<e;++f)p+=this._computeAngle(f,s,g);for(f=e;f<e+i;f++){const e=t[f];let i=p,n=p+this._computeAngle(f,s,g),r=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(this.getParsed(f).r):0;p=n,o&&(l.animateScale&&(r=0),l.animateRotate&&(i=n=u));const m={x:h,y:d,innerRadius:0,outerRadius:r,startAngle:i,endAngle:n,options:this.resolveDataElementOptions(f,e.active?"active":s)};this.updateElement(e,f,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?(0,n.t)(this.resolveDataElementOptions(t,e).angle||i):0}}class Z extends K{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class tt extends A{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return n.y.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":n),r=s.getPointPositionForValue(a,this.getParsed(a).r),l=o?s.xCenter:r.x,c=o?s.yCenter:r.y,h={x:l,y:c,angle:r.angle,skip:isNaN(l)||isNaN(c),options:i};this.updateElement(e,a,h,n)}}}class et extends A{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),r=s.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+r+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=(0,n.q)(e,i,s);if(this._drawStart=o,this._drawCount=a,(0,n.w)(e)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o="reset"===s,{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),u=this.includeOptions(s,d),f=a.axis,p=r.axis,{spanGaps:g,segment:m}=this.options,x=(0,n.x)(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===s;let y=e>0&&this.getParsed(e-1);for(let _=e;_<e+i;++_){const e=t[_],i=this.getParsed(_),h=b?e:{},g=(0,n.k)(i[p]),v=h[f]=a.getPixelForValue(i[f],_),k=h[p]=o||g?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,i,l):i[p],_);h.skip=isNaN(v)||isNaN(k)||g,h.stop=_>0&&Math.abs(i[f]-y[f])>x,m&&(h.parsed=i,h.raw=c.data[_]),u&&(h.options=d||this.resolveDataElementOptions(_,e.active?"active":s)),b||this.updateElement(e,_,h,s),y=i}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}var it=Object.freeze({__proto__:null,BarController:X,BubbleController:Q,DoughnutController:K,LineController:G,PieController:Z,PolarAreaController:J,RadarController:tt,ScatterController:et});function nt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class st{static override(t){Object.assign(st.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return nt()}parse(){return nt()}format(){return nt()}add(){return nt()}diff(){return nt()}startOf(){return nt()}endOf(){return nt()}}var ot={_date:st};function at(t,e,i,s){const{controller:o,data:a,_sorted:r}=t,l=o._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&"r"!==e&&r&&a.length){const r=l._reversePixels?n.A:n.B;
21if(!s){const s=r(a,e,i);if(c){const{vScale:e}=o._cachedMeta,{_parsed:i}=t,a=i.slice(0,s.lo+1).reverse().findIndex((t=>!(0,n.k)(t[e.axis])));s.lo-=Math.max(0,a);const r=i.slice(s.hi).findIndex((t=>!(0,n.k)(t[e.axis])));s.hi+=Math.max(0,r)}return s}if(o._sharedOptions){const t=a[0],n="function"===typeof t.getRange&&t.getRange(e);if(n){const t=r(a,e,i-n),s=r(a,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:a.length-1}}function rt(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,l=o.length;r<l;++r){const{index:t,data:i}=o[r],{lo:l,hi:c}=at(o[r],e,a,s);for(let e=l;e<=c;++e){const s=i[e];s.skip||n(s,t,e)}}}function lt(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function ct(t,e,i,s,o){const a=[];if(!o&&!t.isPointInArea(e))return a;const r=function(i,r,l){(o||(0,n.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&a.push({element:i,datasetIndex:r,index:l})};return rt(t,i,e,r,!0),a}function ht(t,e,i,s){let o=[];function a(t,i,a){const{startAngle:r,endAngle:l}=t.getProps(["startAngle","endAngle"],s),{angle:c}=(0,n.D)(t,{x:e.x,y:e.y});(0,n.p)(c,r,l)&&o.push({element:t,datasetIndex:i,index:a})}return rt(t,i,e,a),o}function dt(t,e,i,n,s,o){let a=[];const r=lt(i);let l=Number.POSITIVE_INFINITY;function c(i,c,h){const d=i.inRange(e.x,e.y,s);if(n&&!d)return;const u=i.getCenterPoint(s),f=!!o||t.isPointInArea(u);if(!f&&!d)return;const p=r(e,u);p<l?(a=[{element:i,datasetIndex:c,index:h}],l=p):p===l&&a.push({element:i,datasetIndex:c,index:h})}return rt(t,i,e,c),a}function ut(t,e,i,n,s,o){return o||t.isPointInArea(e)?"r"!==i||n?dt(t,e,i,n,s,o):ht(t,e,i,s):[]}function ft(t,e,i,n,s){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return rt(t,i,e,((t,n,l)=>{t[a]&&t[a](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),r=r||t.inRange(e.x,e.y,s))})),n&&!r?[]:o}var pt={evaluateInteractionItems:rt,modes:{index(t,e,i,s){const o=(0,n.z)(e,t),a=i.axis||"x",r=i.includeInvisible||!1,l=i.intersect?ct(t,o,a,s,r):ut(t,o,a,!1,s,r),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=l[0].index,i=t.data[e];i&&!i.skip&&c.push({element:i,datasetIndex:t.index,index:e})})),c):[]},dataset(t,e,i,s){const o=(0,n.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;let l=i.intersect?ct(t,o,a,s,r):ut(t,o,a,!1,s,r);if(l.length>0){const e=l[0].datasetIndex,i=t.getDatasetMeta(e).data;l=[];for(let t=0;t<i.length;++t)l.push({element:i[t],datasetIndex:e,index:t})}return l},point(t,e,i,s){const o=(0,n.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;return ct(t,o,a,s,r)},nearest(t,e,i,s){const o=(0,n.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;return ut(t,o,a,i.intersect,s,r)},x(t,e,i,s){const o=(0,n.z)(e,t);return ft(t,o,"x",i.intersect,s)},y(t,e,i,s){const o=(0,n.z)(e,t);return ft(t,o,"y",i.intersect,s)}}};const gt=["left","top","right","bottom"];function mt(t,e){return t.filter((t=>t.pos===e))}function xt(t,e){return t.filter((t=>-1===gt.indexOf(t.pos)&&t.box.axis===e))}function bt(t,e){return t.sort(((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight}))}function yt(t){const e=[];let i,n,s,o,a,r;for(i=0,n=(t||[]).length;i<n;++i)s=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=s),e.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return e}function _t(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!gt.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function vt(t,e){const i=_t(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*n:a&&e.availableWidth,r.height=s):(r.width=n,r.height=c?c*s:a&&e.availableHeight)}return i}function kt(t){const e=yt(t),i=bt(e.filter((t=>t.box.fullSize)),!0),n=bt(mt(e,"left"),!0),s=bt(mt(e,"right")),o=bt(mt(e,"top"),!0),a=bt(mt(e,"bottom")),r=xt(e,"x"),l=xt(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:mt(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function wt(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Mt(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function St(t,e,i,s){const{pos:o,box:a}=i,r=t.maxPadding;if(!(0,n.i)(o)){i.size&&(t[o]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[o]+=i.size}a.getPadding&&Mt(r,a.getPadding());const l=Math.max(0,e.outerWidth-wt(r,t,"left","right")),c=Math.max(0,e.outerHeight-wt(r,t,"top","bottom")),h=l!==t.w,d=c!==t.h;return t.w=l,t.h=c,i.horizontal?{same:h,other:d}:{same:d,other:h}}function Dt(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function Ct(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function Pt(t,e,i,n){const s=[];let o,a,r,l,c,h;for(o=0,a=t.length,c=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,Ct(r.horizontal,e));const{same:a,other:d}=St(e,i,r,n);c|=a&&s.length,h=h||d,l.fullSize||s.push(r)}return c&&Pt(s,e,i,n)||h}function Et(t,e,i,n,s){t.top=i,t.left=e,t.right=e+n,t.bottom=i+s,t.width=n,t.height=s}function Ot(t,e,i,s){const o=i.padding;let{x:a,y:r}=e;for(const l of t){const t=l.box,c=s[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/c.weight||1;if(l.horizontal){const s=e.w*h,a=c.size||t.height;(0,n.h)(c.start)&&(r=c.start),t.fullSize?Et(t,o.left,r,i.outerWidth-o.right-o.left,a):Et(t,e.left+c.placed,r,s,a),c.start=r,c.placed+=s,r=t.bottom}else{const s=e.h*h,r=c.size||t.width;(0,n.h)(c.start)&&(a=c.start),t.fullSize?Et(t,a,o.top,r,i.outerHeight-o.bottom-o.top):Et(t,a,e.top+c.placed,r,s),c.start=a,c.placed+=s,a=t.right}}e.x=a,e.y=r}
21var At={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const o=(0,n.E)(t.options.layout.padding),a=Math.max(e-o.width,0),r=Math.max(i-o.height,0),l=kt(t.boxes),c=l.vertical,h=l.horizontal;(0,n.F)(t.boxes,(t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const d=c.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),f=Object.assign({},o);Mt(f,(0,n.E)(s));const p=Object.assign({maxPadding:f,w:a,h:r,x:o.left,y:o.top},o),g=vt(c.concat(h),u);Pt(l.fullSize,p,u,g),Pt(c,p,u,g),Pt(h,p,u,g)&&Pt(c,p,u,g),Dt(p),Ot(l.leftAndTop,p,u,g),p.x+=p.w,p.y+=p.h,Ot(l.rightAndBottom,p,u,g),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,n.F)(l.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Tt{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Lt extends Tt{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vt="$chartjs",It={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rt=t=>null===t||""===t;function Bt(t,e){const i=t.style,s=t.getAttribute("height"),o=t.getAttribute("width");if(t[Vt]={initial:{height:s,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Rt(o)){const e=(0,n.J)(t,"width");void 0!==e&&(t.width=e)}if(Rt(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,n.J)(t,"height");void 0!==e&&(t.height=e)}return t}const Ft=!!n.K&&{passive:!0};function Nt(t,e,i){t&&t.addEventListener(e,i,Ft)}function zt(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,Ft)}function jt(t,e){const i=It[t.type]||t.type,{x:s,y:o}=(0,n.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==o?o:null}}function Wt(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Ht(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Wt(i.addedNodes,n),e=e&&!Wt(i.removedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}function $t(t,e,i){const n=t.canvas,s=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Wt(i.removedNodes,n),e=e&&!Wt(i.addedNodes,n);e&&i()}));return s.observe(document,{childList:!0,subtree:!0}),s}const Yt=new Map;let Ut=0;function Xt(){const t=window.devicePixelRatio;t!==Ut&&(Ut=t,Yt.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Qt(t,e){Yt.size||window.addEventListener("resize",Xt),Yt.set(t,e)}function qt(t){Yt.delete(t),Yt.size||window.removeEventListener("resize",Xt)}function Kt(t,e,i){const s=t.canvas,o=s&&(0,n.I)(s);if(!o)return;const a=(0,n.L)(((t,e)=>{const n=o.clientWidth;i(t,e),n<o.clientWidth&&i()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)}));return r.observe(o),Qt(t,a),r}function Gt(t,e,i){i&&i.disconnect(),"resize"===e&&qt(t)}function Jt(t,e,i){const s=t.canvas,o=(0,n.L)((e=>{null!==t.ctx&&i(jt(e,t))}),t);return Nt(s,e,o),o}class Zt extends Tt{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Bt(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Vt])return!1;const i=e[Vt].initial;["height","width"].forEach((t=>{const s=i[t];(0,n.k)(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};
21return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[Vt],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Ht,detach:$t,resize:Kt},o=s[e]||Jt;n[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;const s={attach:Gt,detach:Gt,resize:Gt},o=s[e]||zt;o(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return(0,n.G)(t,e,i,s)}isAttached(t){const e=t&&(0,n.I)(t);return!(!e||!e.isConnected)}}function te(t){return!(0,n.M)()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Lt:Zt}class ee{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,n.x)(this.x)&&(0,n.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function ie(t,e){const i=t.options.ticks,s=ne(t),o=Math.min(i.maxTicksLimit||s,s),a=i.major.enabled?oe(e):[],r=a.length,l=a[0],c=a[r-1],h=[];if(r>o)return ae(e,h,a,r/o),h;const d=se(a,e,o);if(r>0){let t,i;const s=r>1?Math.round((c-l)/(r-1)):null;for(re(e,h,d,(0,n.k)(s)?0:l-s,l),t=0,i=r-1;t<i;t++)re(e,h,d,a[t],a[t+1]);return re(e,h,d,c,(0,n.k)(s)?e.length:c+s),h}return re(e,h,d),h}function ne(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}function se(t,e,i){const s=le(t),o=e.length/i;if(!s)return Math.max(o,1);const a=(0,n.N)(s);for(let n=0,r=a.length-1;n<r;n++){const t=a[n];if(t>o)return t}return Math.max(o,1)}function oe(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}function ae(t,e,i,n){let s,o=0,a=i[0];for(n=Math.ceil(n),s=0;s<t.length;s++)s===a&&(e.push(t[s]),o++,a=i[o*n])}function re(t,e,i,s,o){const a=(0,n.v)(s,0),r=Math.min((0,n.v)(o,t.length),t.length);let l,c,h,d=0;i=Math.ceil(i),o&&(l=o-s,i=l/Math.floor(l/i)),h=a;while(h<0)d++,h=Math.round(a+d*i);for(c=Math.max(a,0);c<r;c++)c===h&&(e.push(t[c]),d++,h=Math.round(a+d*i))}function le(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}const ce=t=>"left"===t?"right":"right"===t?"left":t,he=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,de=(t,e)=>Math.min(e||t,t);function ue(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;o<s;o+=n)i.push(t[Math.floor(o)]);return i}function fe(t,e,i){const n=t.ticks.length,s=Math.min(e,n-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,c=t.getPixelForTick(s);if(!(i&&(l=1===n?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(s-1))/2,c+=s<e?l:-l,c<o-r||c>a+r)))return c}function pe(t,e){(0,n.F)(t,(t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s<n;++s)delete t.data[i[s]];i.splice(0,n)}}))}function ge(t){return t.drawTicks?t.tickLength:0}function me(t,e){if(!t.display)return 0;const i=(0,n.a0)(t.font,e),s=(0,n.E)(t.padding),o=(0,n.b)(t.text)?t.text.length:1;return o*i.lineHeight+s.height}function xe(t,e){return(0,n.j)(t,{scale:e,type:"scale"})}function be(t,e,i){return(0,n.j)(t,{tick:i,index:e,type:"tick"})}function ye(t,e,i){let s=(0,n.a1)(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=ce(s)),s}function _e(t,e,i,s){const{top:o,left:a,bottom:r,right:l,chart:c}=t,{chartArea:h,scales:d}=c;let u,f,p,g=0;const m=r-o,x=l-a;if(t.isHorizontal()){if(f=(0,n.a2)(s,a,l),(0,n.i)(i)){const t=Object.keys(i)[0],n=i[t];p=d[t].getPixelForValue(n)+m-e}else p="center"===i?(h.bottom+h.top)/2+m-e:he(t,i,e);u=l-a}else{if((0,n.i)(i)){const t=Object.keys(i)[0],n=i[t];f=d[t].getPixelForValue(n)-x+e}else f="center"===i?(h.left+h.right)/2-x+e:he(t,i,e);p=(0,n.a2)(s,r,o),g="left"===i?-n.H:n.H}return{titleX:f,titleY:p,maxWidth:u,rotation:g}}class ve extends ee{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:i,_suggestedMax:s}=this;return t=(0,n.O)(t,Number.POSITIVE_INFINITY),e=(0,n.O)(e,Number.NEGATIVE_INFINITY),i=(0,n.O)(i,Number.POSITIVE_INFINITY),s=(0,n.O)(s,Number.NEGATIVE_INFINITY),{min:(0,n.O)(t,i),max:(0,n.O)(e,s),minDefined:(0,n.g)(t),maxDefined:(0,n.g)(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:s};const r=this.getMatchingVisibleMetas();for(let n=0,l=r.length;n<l;++n)e=r[n].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),a||(s=Math.max(s,e.max));return i=a&&i>s?s:i,s=o&&i>s?i:s,{min:(0,n.O)(i,(0,n.O)(s,i)),max:(0,n.O)(s,(0,n.O)(i,s))}}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||[]}
21getLabelItems(t=this.chart.chartArea){const e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,n.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=(0,n.R)(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?ue(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=ie(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,n.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,n.Q)(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(){(0,n.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,n.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,n.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=(0,n.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,n.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,n.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=de(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a,r,l,c=s;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=(0,n.S)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),r=this.maxHeight-ge(t.grid)-e.padding-me(t.title,this.chart.options.font),l=Math.sqrt(d*d+u*u),c=(0,n.U)(Math.min(Math.asin((0,n.S)((h.highest.height+6)/a,-1,1)),Math.asin((0,n.S)(r/l,-1,1))-Math.asin((0,n.S)(u/l,-1,1)))),c=Math.max(s,Math.min(o,c))),this.labelRotation=c}afterCalculateLabelRotation(){(0,n.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,n.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=me(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=ge(o)+a):(t.height=this.maxHeight,t.width=ge(o)+a),i.display&&this.ticks.length){const{first:e,last:s,widest:o,highest:a}=this._getLabelSizes(),l=2*i.padding,c=(0,n.t)(this.labelRotation),h=Math.cos(c),d=Math.sin(c);if(r){const e=i.mirror?0:d*o.width+h*a.height;t.height=Math.min(this.maxHeight,t.height+e+l)}else{const e=i.mirror?0:h*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+l)}this._calculatePadding(e,s,d,h)}}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,i,n){const{ticks:{align:s,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;r?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}
21else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_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(){(0,n.Q)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)(0,n.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=ue(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/de(e,i));let c,h,d,u,f,p,g,m,x,b,y,_=0,v=0;for(c=0;c<e;c+=l){if(u=t[c].label,f=this._resolveTickFontOptions(c),s.font=p=f.string,g=o[p]=o[p]||{data:{},gc:[]},m=f.lineHeight,x=b=0,(0,n.k)(u)||(0,n.b)(u)){if((0,n.b)(u))for(h=0,d=u.length;h<d;++h)y=u[h],(0,n.k)(y)||(0,n.b)(y)||(x=(0,n.V)(s,g.data,g.gc,x,y),b+=m)}else x=(0,n.V)(s,g.data,g.gc,x,u),b=m;a.push(x),r.push(b),_=Math.max(x,_),v=Math.max(b,v)}pe(o,e);const k=a.indexOf(_),w=r.indexOf(v),M=t=>({width:a[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(w),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(0,n.W)(this._alignToPixels?(0,n.X)(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 i=e[t];return i.$context||(i.$context=be(this.getContext(),t,i))}return this.$context||(this.$context=xe(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=(0,n.t)(this.labelRotation),i=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*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks,d=h.length+(l?1:0),u=ge(o),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,x=function(t){return(0,n.X)(i,t,g)};let b,y,_,v,k,w,M,S,D,C,P,E;if("top"===a)b=x(this.bottom),w=this.bottom-u,S=b-m,C=x(t.top)+m,E=t.bottom;else if("bottom"===a)b=x(this.top),C=t.top,E=x(t.bottom)-m,w=b+m,S=this.top+u;else if("left"===a)b=x(this.right),k=this.right-u,M=b-m,D=x(t.left)+m,P=t.right;else if("right"===a)b=x(this.left),D=t.left,P=x(t.right)-m,k=b+m,M=this.left+u;else if("x"===e){if("center"===a)b=x((t.top+t.bottom)/2+.5);else if((0,n.i)(a)){const t=Object.keys(a)[0],e=a[t];b=x(this.chart.scales[t].getPixelForValue(e))}C=t.top,E=t.bottom,w=b+m,S=w+u}else if("y"===e){if("center"===a)b=x((t.left+t.right)/2);else if((0,n.i)(a)){const t=Object.keys(a)[0],e=a[t];b=x(this.chart.scales[t].getPixelForValue(e))}k=b-m,M=k-u,D=t.left,P=t.right}const O=(0,n.v)(s.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/O));for(y=0;y<d;y+=A){const t=this.getContext(y),e=o.setContext(t),s=r.setContext(t),a=e.lineWidth,h=e.color,d=s.dash||[],u=s.dashOffset,p=e.tickWidth,g=e.tickColor,m=e.tickBorderDash||[],x=e.tickBorderDashOffset;_=fe(this,y,l),void 0!==_&&(v=(0,n.X)(i,_,a),c?k=M=D=P=v:w=S=C=E=v,f.push({tx1:k,ty1:w,tx2:M,ty2:S,x1:D,y1:C,x2:P,y2:E,width:a,color:h,borderDash:d,borderDashOffset:u,tickWidth:p,tickColor:g,tickBorderDash:m,tickBorderDashOffset:x}))}return this._ticksLength=d,this._borderValue=b,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=ge(i.grid),f=u+h,p=d?-h:f,g=-(0,n.t)(this.labelRotation),m=[];let x,b,y,_,v,k,w,M,S,D,C,P,E="middle";if("top"===s)k=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===s)k=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===s)k=(t.top+t.bottom)/2+f;else if((0,n.i)(s)){const t=Object.keys(s)[0],e=s[t];k=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)v=(t.left+t.right)/2-f;else if((0,n.i)(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===l?E="top":"end"===l&&(E="bottom"));const O=this._getLabelSizes();for(x=0,b=r.length;x<b;++x){y=r[x],_=y.label;const t=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,S=this._resolveTickFontOptions(x),D=S.lineHeight,C=(0,n.b)(_)?_.length:1;const e=C/2,i=t.color,l=t.textStrokeColor,h=t.textStrokeWidth;let u,f=w;
21if(a?(v=M,"inner"===w&&(f=x===b-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),P="top"===s?"near"===c||0!==g?-C*D+D/2:"center"===c?-O.highest.height/2-e*D+D:-O.highest.height+D/2:"near"===c||0!==g?D/2:"center"===c?O.highest.height/2-e*D:O.highest.height-C*D,d&&(P*=-1),0===g||t.showLabelBackdrop||(v+=D/2*Math.sin(g))):(k=M,P=(1-C)*D/2),t.showLabelBackdrop){const e=(0,n.E)(t.backdropPadding),i=O.heights[x],s=O.widths[x];let o=P-e.top,a=0-e.left;switch(E){case"middle":o-=i/2;break;case"bottom":o-=i;break}switch(w){case"center":a-=s/2;break;case"right":a-=s;break;case"inner":x===b-1?a-=s:x>0&&(a-=s/2);break}u={left:a,top:o,width:s+e.width,height:i+e.height,color:t.backdropColor}}m.push({label:_,font:S,textOffset:P,options:{rotation:g,color:i,strokeColor:l,strokeWidth:h,textAlign:f,textBaseline:E,translation:[v,k],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options,i=-(0,n.t)(this.labelRotation);if(i)return"top"===t?"left":"right";let s="center";return"start"===e.align?s="left":"end"===e.align?s="right":"inner"===e.align&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,r=o.widest.width;let l,c;return"left"===e?n?(c=this.right+s,"near"===i?l="left":"center"===i?(l="center",c+=r/2):(l="right",c+=r)):(c=this.right-a,"near"===i?l="right":"center"===i?(l="center",c-=r/2):(l="left",c=this.left)):"right"===e?n?(c=this.left+s,"near"===i?l="right":"center"===i?(l="center",c-=r/2):(l="left",c-=r)):(c=this.left+a,"near"===i?l="left":"center"===i?(l="center",c+=r/2):(l="right",c=this.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}
21:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks,n=i.findIndex((e=>e.value===t));if(n>=0){const t=e.setContext(this.getContext(n));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s<o;++s){const t=n[s];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=(0,n.X)(t,this.left,a)-a/2,h=(0,n.X)(t,this.right,r)+r/2,d=u=l):(d=(0,n.X)(t,this.top,a)-a/2,u=(0,n.X)(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){const e=this.options.ticks;if(!e.display)return;const i=this.ctx,s=this._computeLabelArea();s&&(0,n.Y)(i,s);const o=this.getLabelItems(t);for(const a of o){const t=a.options,e=a.font,s=a.label,o=a.textOffset;(0,n.Z)(i,s,0,o,e,t)}s&&(0,n.$)(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=(0,n.a0)(i.font),a=(0,n.E)(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||(0,n.i)(e)?(l+=a.bottom,(0,n.b)(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=_e(this,l,e,r);(0,n.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:ye(r,e,s),textBaseline:"middle",translation:[c,h]})}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,i=(0,n.v)(t.grid&&t.grid.z,-1),s=(0,n.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ve.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s<o;++s){const o=e[s];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,n.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ke{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,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 i;Se(e)&&(i=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,we(t,a,i),this.override&&n.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in n.d[s]&&(delete n.d[s][i],this.override&&delete n.a3[i])}}function we(t,e,i){const s=(0,n.a4)(Object.create(null),[i?n.d.get(i):{},n.d.get(e),t.defaults]);n.d.set(e,s),t.defaultRoutes&&Me(e,t.defaultRoutes),t.descriptors&&n.d.describe(e,t.descriptors)}function Me(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),o=s.pop(),a=[t].concat(s).join("."),r=e[i].split("."),l=r.pop(),c=r.join(".");n.d.route(a,o,c,l)}))}function Se(t){return"id"in t&&"defaults"in t}class De{constructor(){this.controllers=new ke(A,"datasets",!0),this.elements=new ke(ee,"elements"),this.plugins=new ke(Object,"plugins"),this.scales=new ke(ve,"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")}
21removeControllers(...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,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):(0,n.F)(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const s=(0,n.a5)(t);(0,n.Q)(i["before"+s],[],i),e[t](i),(0,n.Q)(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var Ce=new De;class Pe{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const o of t){const t=o.plugin,a=t[i],r=[e,s,o.options];if(!1===(0,n.Q)(a,r,t)&&s.cancelable)return!1}return!0}invalidate(){(0,n.k)(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 i=t&&t.config,s=(0,n.v)(i.options&&i.options.plugins,{}),o=Ee(i);return!1!==s||e?Ae(t,o,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Ee(t){const e={},i=[],n=Object.keys(Ce.plugins.items);for(let o=0;o<n.length;o++)i.push(Ce.getPlugin(n[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const t=s[o];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}function Oe(t,e){return e||!1!==t?!0===t?{}:t:null}function Ae(t,{plugins:e,localIds:i},n,s){const o=[],a=t.getContext();for(const r of e){const e=r.id,l=Oe(n[e],s);null!==l&&o.push({plugin:r,options:Te(t.config,{plugin:r,local:i[e]},l,a)})}return o}function Te(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(n,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Le(t,e){const i=n.d.datasets[t]||{},s=(e.datasets||{})[t]||{};return s.indexAxis||e.indexAxis||i.indexAxis||"x"}function Ve(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function Ie(t,e){return t===e?"_index_":"_value_"}function Re(t){if("x"===t||"y"===t||"r"===t)return t}function Be(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Fe(t,...e){if(Re(t))return t;for(const i of e){const e=i.axis||Be(i.position)||t.length>1&&Re(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Ne(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function ze(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return Ne(t,"x",i[0])||Ne(t,"y",i[0])}return{}}function je(t,e){const i=n.a3[t.type]||{scales:{}},s=e.scales||{},o=Le(t.type,e),a=Object.create(null);return Object.keys(s).forEach((e=>{const r=s[e];if(!(0,n.i)(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=Fe(e,r,ze(e,t),n.d.scales[r.type]),c=Ie(l,o),h=i.scales||{};a[e]=(0,n.ab)(Object.create(null),[{axis:l},r,h[l],h[c]])})),t.data.datasets.forEach((i=>{const o=i.type||t.type,r=i.indexAxis||Le(o,e),l=n.a3[o]||{},c=l.scales||{};Object.keys(c).forEach((t=>{const e=Ve(t,r),o=i[e+"AxisID"]||e;a[o]=a[o]||Object.create(null),(0,n.ab)(a[o],[{axis:e},s[o],c[t]])}))}
21)),Object.keys(a).forEach((t=>{const e=a[t];(0,n.ab)(e,[n.d.scales[e.type],n.d.scale])})),a}function We(t){const e=t.options||(t.options={});e.plugins=(0,n.v)(e.plugins,{}),e.scales=je(t,e)}function He(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function $e(t){return t=t||{},t.data=He(t.data),We(t),t}const Ye=new Map,Ue=new Set;function Xe(t,e){let i=Ye.get(t);return i||(i=e(),Ye.set(t,i),Ue.add(i)),i}const Qe=(t,e,i)=>{const s=(0,n.f)(e,i);void 0!==s&&t.add(s)};class qe{constructor(t){this._config=$e(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=He(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(),We(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xe(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Xe(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Xe(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id,i=this.type;return Xe(`${i}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach((e=>{t&&(l.add(t),e.forEach((e=>Qe(l,t,e)))),e.forEach((t=>Qe(l,s,t))),e.forEach((t=>Qe(l,n.a3[o]||{},t))),e.forEach((t=>Qe(l,n.d,t))),e.forEach((t=>Qe(l,n.a6,t)))}));const c=Array.from(l);return 0===c.length&&c.push(Object.create(null)),Ue.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,n.a3[e]||{},n.d.datasets[e]||{},{type:e},n.d,n.a6]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Ke(this._resolverCache,t,s);let l=a;if(Je(a,e)){o.$shared=!1,i=(0,n.a7)(i)?i():i;const e=this.createResolver(t,i,r);l=(0,n.a8)(a,i,e)}for(const n of e)o[n]=l[n];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Ke(this._resolverCache,t,i);return(0,n.i)(e)?(0,n.a8)(o,e,void 0,s):o}}function Ke(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const o=i.join();let a=s.get(o);if(!a){const t=(0,n.a9)(e,i);a={resolver:t,subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(o,a)}return a}const Ge=t=>(0,n.i)(t)&&Object.getOwnPropertyNames(t).some((e=>(0,n.a7)(t[e])));function Je(t,e){const{isScriptable:i,isIndexable:s}=(0,n.aa)(t);for(const o of e){const e=i(o),a=s(o),r=(a||e)&&t[o];if(e&&((0,n.a7)(r)||Ge(r))||a&&(0,n.b)(r))return!0}return!1}var Ze="4.4.8";const ti=["top","bottom","left","right","chartArea"];function ei(t,e){return"top"===t||"bottom"===t||-1===ti.indexOf(t)&&"x"===e}function ii(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ni(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,n.Q)(i&&i.onComplete,[t],e)}function si(t){const e=t.chart,i=e.options.animation;(0,n.Q)(i&&i.onProgress,[t],e)}function oi(t){return(0,n.M)()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ai={},ri=t=>{const e=oi(t);return Object.values(ai).filter((t=>t.canvas===e)).pop()};function li(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}function ci(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}function hi(t,e,i){return t.options.clip?t[i]:e[i]}function di(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:hi(i,e,"left"),right:hi(i,e,"right"),top:hi(n,e,"top"),bottom:hi(n,e,"bottom")}:e}class ui{static defaults=n.d;static instances=ai;static overrides=n.a3;static registry=Ce;static version=Ze;static getChart=ri;static register(...t){Ce.add(...t),fi()}static unregister(...t){Ce.remove(...t),fi()}constructor(t,e){const i=this.config=new qe(e),s=oi(t),a=ri(s);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||te(s)),this.platform.updateConfig(i);const l=this.platform.acquireContext(s,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;this.id=(0,n.ac)(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Pe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,n.ad)((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],ai[this.id]=this,l&&c?(o.listen(this,"complete",ni),o.listen(this,"progress",si),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return(0,n.k)(t)?e&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ce}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,n.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,n.af)(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,n.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,n.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};(0,n.F)(e,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];e&&(o=o.concat(Object.keys(e).map((t=>{const i=e[t],n=Fe(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}})))),(0,n.F)(o,(e=>
21{const o=e.options,a=o.id,r=Fe(a,o),l=(0,n.v)(o.type,e.dtype);void 0!==o.position&&ei(o.position,r)===ei(e.dposition)||(o.position=e.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===l)c=i[a];else{const t=Ce.getScale(l);c=new t({id:a,type:l,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(o,t)})),(0,n.F)(s,((t,e)=>{t||delete i[e]})),(0,n.F)(i,(t=>{At.configure(this,t,t.options),At.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(ii("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let o=this.getDatasetMeta(i);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=s.indexAxis||Le(a,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=Ce.getController(a),{datasetElementType:s,dataElementType:r}=n.d.datasets[a];Object.assign(e,{dataElementType:Ce.getElement(r),datasetElementType:s&&Ce.getElement(s)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){(0,n.F)(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let n=0,c=this.data.datasets.length;n<c;n++){const{controller:t}=this.getDatasetMeta(n),e=!s&&-1===o.indexOf(t);t.buildOrUpdateElements(e),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||(0,n.F)(o,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ii("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,n.F)(this.scales,(t=>{At.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,n.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){const e="_removeElements"===i?-s:s;li(t,n,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let o=1;o<e;o++)if(!(0,n.ag)(s,i(o)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;At.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,n.F)(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,n.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),ni({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))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,i=[];let n,s;for(n=0,s=e.length;n<s;++n){const s=e[n];t&&!s.visible||i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))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,i=t._clip,s=!i.disabled,o=di(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&(0,n.Y)(e,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?this.width:o.right+i.r
21ight,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&(0,n.$)(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return(0,n.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=pt.modes[e];return"function"===typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={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},i.push(n)),n}getContext(){return this.$context||(this.$context=(0,n.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);(0,n.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update((e=>e.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(),o.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(),(0,n.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ai[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,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,n.F)(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,n.F)(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},(0,n.F)(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,a,r;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),s=!(0,n.ah)(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=s(e,t),a=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,i,a),l=(0,n.ai)(t),c=ci(t,this._lastEvent,i,l);i&&(this._lastEvent=null,(0,n.Q)(o.onHover,[t,r,this],this),l&&(0,n.Q)(o.onClick,[t,r,this],this));const h=!(0,n.ah)(r,s);
21return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function fi(){return(0,n.F)(ui.instances,(t=>t._plugins.invalidate()))}function pi(t,e,i){const{startAngle:s,pixelMargin:o,x:a,y:r,outerRadius:l,innerRadius:c}=e;let h=o/l;t.beginPath(),t.arc(a,r,l,s-h,i+h),c>o?(h=o/c,t.arc(a,r,c,i+h,s-h,!0)):t.arc(a,r,o,i+n.H,s-n.H),t.closePath(),t.clip()}function gi(t){return(0,n.ak)(t,["outerStart","outerEnd","innerStart","innerEnd"])}function mi(t,e,i,s){const o=gi(t.options.borderRadius),a=(i-e)/2,r=Math.min(a,s*e/2),l=t=>{const e=(i-Math.min(a,t))*s/2;return(0,n.S)(t,0,Math.min(a,e))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:(0,n.S)(o.innerStart,0,r),innerEnd:(0,n.S)(o.innerEnd,0,r)}}function xi(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function bi(t,e,i,s,o,a){const{x:r,y:l,startAngle:c,pixelMargin:h,innerRadius:d}=e,u=Math.max(e.outerRadius+s+i-h,0),f=d>0?d+s+i+h:0;let p=0;const g=o-c;if(s){const t=d>0?d-s:0,e=u>0?u-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;p=(g-n)/2}const m=Math.max(.001,g*u-i/n.P)/u,x=(g-m)/2,b=c+x+p,y=o-x-p,{outerStart:_,outerEnd:v,innerStart:k,innerEnd:w}=mi(e,f,u,y-b),M=u-_,S=u-v,D=b+_/M,C=y-v/S,P=f+k,E=f+w,O=b+k/P,A=y-w/E;if(t.beginPath(),a){const e=(D+C)/2;if(t.arc(r,l,u,D,e),t.arc(r,l,u,e,C),v>0){const e=xi(S,C,r,l);t.arc(e.x,e.y,v,C,y+n.H)}const i=xi(E,y,r,l);if(t.lineTo(i.x,i.y),w>0){const e=xi(E,A,r,l);t.arc(e.x,e.y,w,y+n.H,A+Math.PI)}const s=(y-w/f+(b+k/f))/2;if(t.arc(r,l,f,y-w/f,s,!0),t.arc(r,l,f,s,b+k/f,!0),k>0){const e=xi(P,O,r,l);t.arc(e.x,e.y,k,O+Math.PI,b-n.H)}const o=xi(M,b,r,l);if(t.lineTo(o.x,o.y),_>0){const e=xi(M,D,r,l);t.arc(e.x,e.y,_,b-n.H,D)}}else{t.moveTo(r,l);const e=Math.cos(D)*u+r,i=Math.sin(D)*u+l;t.lineTo(e,i);const n=Math.cos(C)*u+r,s=Math.sin(C)*u+l;t.lineTo(n,s)}t.closePath()}function yi(t,e,i,s,o){const{fullCircles:a,startAngle:r,circumference:l}=e;let c=e.endAngle;if(a){bi(t,e,i,s,c,o);for(let e=0;e<a;++e)t.fill();isNaN(l)||(c=r+(l%n.T||n.T))}return bi(t,e,i,s,c,o),t.fill(),c}function _i(t,e,i,s,o){const{fullCircles:a,startAngle:r,circumference:l,options:c}=e,{borderWidth:h,borderJoinStyle:d,borderDash:u,borderDashOffset:f}=c,p="inner"===c.borderAlign;if(!h)return;t.setLineDash(u||[]),t.lineDashOffset=f,p?(t.lineWidth=2*h,t.lineJoin=d||"round"):(t.lineWidth=h,t.lineJoin=d||"bevel");let g=e.endAngle;if(a){bi(t,e,i,s,g,o);for(let e=0;e<a;++e)t.stroke();isNaN(l)||(g=r+(l%n.T||n.T))}p&&pi(t,e,g),a||(bi(t,e,i,s,g,o),t.stroke())}class vi extends ee{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=(0,n.D)(s,{x:t,y:e}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=(0,n.v)(d,l-r),p=(0,n.p)(o,r,l)&&r!==l,g=f>=n.T||p,m=(0,n.aj)(a,c+u,h+u);return g&&m}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,c=(n+s)/2,h=(o+a+l+r)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>n.T?Math.floor(i/n.T):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(n.P,i||0)),c=s*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,yi(t,this,c,o,a),_i(t,this,c,o,a),t.restore(
21)}}function ki(t,e,i=e){t.lineCap=(0,n.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,n.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,n.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,n.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,n.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,n.v)(i.borderColor,e.borderColor)}function wi(t,e,i){t.lineTo(i.x,i.y)}function Mi(t){return t.stepped?n.ar:t.tension||"monotone"===t.cubicInterpolationMode?n.as:wi}function Si(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:a,end:r}=e,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function Di(t,e,i,n){const{points:s,options:o}=e,{count:a,start:r,loop:l,ilen:c}=Si(s,i,n),h=Mi(o);let d,u,f,{move:p=!0,reverse:g}=n||{};for(d=0;d<=c;++d)u=s[(r+(g?c-d:d))%a],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):h(t,f,u,g,o.stepped),f=u);return l&&(u=s[(r+(g?c:0))%a],h(t,f,u,g,o.stepped)),!!l}function Ci(t,e,i,n){const s=e.points,{count:o,start:a,ilen:r}=Si(s,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,f,p,g,m=0,x=0;const b=t=>(a+(c?r-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[b(0)],t.moveTo(d.x,d.y)),h=0;h<=r;++h){if(d=s[b(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>p&&(p=i),m=(x*m+e)/++x):(y(),t.lineTo(e,i),u=n,x=0,f=p=i),g=i}y()}function Pi(t){const e=t.options,i=e.borderDash&&e.borderDash.length,n=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return n?Ci:Di}function Ei(t){return t.stepped?n.ao:t.tension||"monotone"===t.cubicInterpolationMode?n.ap:n.aq}function Oi(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),ki(t,e.options),t.stroke(s)}function Ai(t,e,i,n){const{segments:s,options:o}=e,a=Pi(e);for(const r of s)ki(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}const Ti="function"===typeof Path2D;function Li(t,e,i,n){Ti&&!e.options.segment?Oi(t,e,i,n):Ai(t,e,i,n)}class Vi extends ee{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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 i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;(0,n.al)(this._points,i,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=(0,n.am)(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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,a=(0,n.an)(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Ei(i);let c,h;for(c=0,h=a.length;c<h;++c){const{start:n,end:h}=a[c],d=o[n],u=o[h];if(d===u){r.push(d);continue}const f=Math.abs((s-d[e])/(u[e]-d[e])),p=l(d,u,f,i.stepped);p[e]=t[e],r.push(p)}return 1===r.length?r[0]:r}pathSegment(t,e,i){const n=Pi(this);return n(t,this,e,i)}path(t,e,i){const n=this.segments,s=Pi(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)o&=s(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const s=this.options||{},o=this.points||[];o.length&&s.borderWidth&&(t.save(),Li(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ii(t,e,i,n){const s=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<s.radius+s.hitRadius}class Ri extends ee{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Ii(this,t,"x",e)}inYRange(t,e){return Ii(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return 2*(e+i)}draw(t,e){const i=this.options;this.skip||i.radius<.1||!(0,n.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,n.at)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Bi(t,e){const{x:i,y:n,base:s,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,c,h,d;return t.horizontal?(d=a/2,r=Math.min(i,s),l=Math.max(i,s),c=n-d,h=n+d):(d=o/2,r=i-d,l=i+d,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h}}function Fi(t,e,i,s){return t?0:(0,n.S)(e,i,s)}
21function Ni(t,e,i){const s=t.options.borderWidth,o=t.borderSkipped,a=(0,n.av)(s);return{t:Fi(o.top,a.top,0,i),r:Fi(o.right,a.right,0,e),b:Fi(o.bottom,a.bottom,0,i),l:Fi(o.left,a.left,0,e)}}function zi(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,a=(0,n.aw)(o),r=Math.min(e,i),l=t.borderSkipped,c=s||(0,n.i)(o);return{topLeft:Fi(!c||l.top||l.left,a.topLeft,0,r),topRight:Fi(!c||l.top||l.right,a.topRight,0,r),bottomLeft:Fi(!c||l.bottom||l.left,a.bottomLeft,0,r),bottomRight:Fi(!c||l.bottom||l.right,a.bottomRight,0,r)}}function ji(t){const e=Bi(t),i=e.right-e.left,n=e.bottom-e.top,s=Ni(t,i/2,n/2),o=zi(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:i-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 Wi(t,e,i,s){const o=null===e,a=null===i,r=o&&a,l=t&&!r&&Bi(t,s);return l&&(o||(0,n.aj)(e,l.left,l.right))&&(a||(0,n.aj)(i,l.top,l.bottom))}function Hi(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function $i(t,e){t.rect(e.x,e.y,e.w,e.h)}function Yi(t,e,i={}){const n=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,a=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+n,y:t.y+s,w:t.w+o,h:t.h+a,radius:t.radius}}class Ui extends ee{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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:i,backgroundColor:s}}=this,{inner:o,outer:a}=ji(this),r=Hi(a.radius)?n.au:$i;t.save(),a.w===o.w&&a.h===o.h||(t.beginPath(),r(t,Yi(a,e,o)),t.clip(),r(t,Yi(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Yi(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Wi(this,t,e,i)}inXRange(t,e){return Wi(this,t,null,e)}inYRange(t,e){return Wi(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+n)/2:e,y:s?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}var Xi=Object.freeze({__proto__:null,ArcElement:vi,BarElement:Ui,LineElement:Vi,PointElement:Ri});const Qi=["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)"],qi=Qi.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Ki(t){return Qi[t%Qi.length]}function Gi(t){return qi[t%qi.length]}function Ji(t,e){return t.borderColor=Ki(e),t.backgroundColor=Gi(e),++e}function Zi(t,e){return t.backgroundColor=t.data.map((()=>Ki(e++))),e}function tn(t,e){return t.backgroundColor=t.data.map((()=>Gi(e++))),e}function en(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof K?e=Zi(i,e):s instanceof J?e=tn(i,e):s&&(e=Ji(i,e))}}function nn(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function sn(t){return t&&(t.borderColor||t.backgroundColor)}function on(){return"rgba(0,0,0,0.1)"!==n.d.borderColor||"rgba(0,0,0,0.1)"!==n.d.backgroundColor}var an={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,a=nn(n)||sn(s)||o&&nn(o)||on();if(!i.forceOverride&&a)return;const r=en(t);n.forEach(r)}};function rn(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(a[l++]=t[g],h=0;h<o-2;h++){let n,s=0,o=0;const c=Math.floor((h+1)*r)+1+e,m=Math.min(Math.floor((h+2)*r)+1,i)+e,x=m-c;for(n=c;n<m;n++)s+=t[n].x,o+=t[n].y;s/=x,o/=x;const b=Math.floor(h*r)+1+e,y=Math.min(Math.floor((h+1)*r)+1,i)+e,{x:_,y:v}=t[g];for(u=f=-1,n=b;n<y;n++)f=.5*Math.abs((_-s)*(t[n].y-v)-(_-t[n].x)*(o-v)),f>u&&(u=f,d=t[n],p=n);a[l++]=d,g=p}return a[l++]=t[c],a}function ln(t,e,i,s){let o,a,r,l,c,h,d,u,f,p,g=0,m=0;const x=[],b=e+i-1,y=t[e].x,_=t[b].x,v=_-y;for(o=e;o<e+i;++o){a=t[o],r=(a.x-y)/v*s,l=a.y;const e=0|r;if(e===c)l<f?(f=l,h=o):l>p&&(p=l,d=o),g=(m*g+a.x)/++m;else{const i=o-1;if(!(0,n.k)(h)&&!(0,n.k)(d)){const e=Math.min(h,d),n=Math.max(h,d);e!==u&&e!==i&&x.push({...t[e],x:g}),n!==u&&n!==i&&x.push({...t[n],x:g})}o>0&&i!==u&&x.push(t[i]),x.push(a),c=e,m=0,f=p=l,h=d=u=o}}return x}function cn(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}
21function hn(t){t.data.datasets.forEach((t=>{cn(t)}))}function dn(t,e){const i=e.length;let s,o=0;const{iScale:a}=t,{min:r,max:l,minDefined:c,maxDefined:h}=a.getUserBounds();return c&&(o=(0,n.S)((0,n.B)(e,a.axis,r).lo,0,i-1)),s=h?(0,n.S)((0,n.B)(e,a.axis,l).hi+1,o,i)-o:i-o,{start:o,count:s}}var un={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void hn(t);const s=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,l=t.getDatasetMeta(o),c=a||e.data;if("y"===(0,n.a)([r,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const h=t.scales[l.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:d,count:u}=dn(l,c);const f=i.threshold||4*s;if(u<=f)return void cn(e);let p;switch((0,n.k)(a)&&(e._data=c,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":p=rn(c,d,u,s,i);break;case"min-max":p=ln(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=p}))},destroy(t){hn(t)}};function fn(t,e,i){const s=t.segments,o=t.points,a=e.points,r=[];for(const l of s){let{start:t,end:s}=l;s=mn(t,s,o);const c=pn(i,o[t],o[s],l.loop);if(!e.segments){r.push({source:l,target:c,start:o[t],end:o[s]});continue}const h=(0,n.an)(e,c);for(const e of h){const t=pn(i,a[e.start],a[e.end],e.loop),s=(0,n.ax)(l,o,t);for(const n of s)r.push({source:n,target:e,start:{[i]:xn(c,t,"start",Math.max)},end:{[i]:xn(c,t,"end",Math.min)}})}}return r}function pn(t,e,i,s){if(s)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,n.ay)(o),a=(0,n.ay)(a)),{property:t,start:o,end:a}}function gn(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=mn(t,e,s);const a=s[t],r=s[e];null!==n?(o.push({x:a.x,y:n}),o.push({x:r.x,y:n})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}function mn(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function xn(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function bn(t,e){let i=[],s=!1;return(0,n.b)(t)?(s=!0,i=t):i=gn(t,e),i.length?new Vi({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function yn(t){return t&&!1!==t.fill}function _n(t,e,i){const s=t[e];let o=s.fill;const a=[e];let r;if(!i)return o;while(!1!==o&&-1===a.indexOf(o)){if(!(0,n.g)(o))return o;if(r=t[o],!r)return!1;if(r.visible)return o;a.push(o),o=r.fill}return!1}function vn(t,e,i){const s=Sn(t);if((0,n.i)(s))return!isNaN(s.value)&&s;let o=parseFloat(s);return(0,n.g)(o)&&Math.floor(o)===o?kn(s[0],e,o,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function kn(t,e,i,n){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=n)&&i}function wn(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:(0,n.i)(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}function Mn(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:(0,n.i)(t)?t.value:e.getBaseValue(),s}function Sn(t){const e=t.options,i=e.fill;let s=(0,n.v)(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}function Dn(t){const{scale:e,index:i,line:n}=t,s=[],o=n.segments,a=n.points,r=Cn(e,i);r.push(bn({x:null,y:e.bottom},n));for(let l=0;l<o.length;l++){const t=o[l];for(let e=t.start;e<=t.end;e++)Pn(s,a[e],r)}return new Vi({points:s,options:{}})}function Cn(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const t=n[s];if(t.index===e)break;t.hidden||i.unshift(t.dataset)}return i}function Pn(t,e,i){const n=[];for(let s=0;s<i.length;s++){const o=i[s],{first:a,last:r,point:l}=En(o,e,"x");if(!(!l||a&&r))if(a)n.unshift(l);else if(t.push(l),!r)break}t.push(...n)}function En(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const o=s[i],a=t.segments,r=t.points;let l=!1,c=!1;for(let h=0;h<a.length;h++){const t=a[h],e=r[t.start][i],s=r[t.end][i];if((0,n.aj)(o,e,s)){l=o===e,c=o===s;break}}return{first:l,last:c,point:s}}class On{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:n.T},t.arc(s,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function An(t){const{chart:e,fill:i,line:s}=t;if((0,n.g)(i))return Tn(e,i);if("stack"===i)return Dn(t);if("shape"===i)return!0;const o=Ln(t);return o instanceof On?o:bn(o,s)}function Tn(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}function Ln(t){const e=t.scale||{};return e.getPointPositionForValue?In(t):Vn(t)}function Vn(t){const{scale:e={},fill:i}=t,s=wn(i,e);if((0,n.g)(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}function In(t){const{scale:e,fill:i}=t,n=e.options,s=e.getLabels().length,o=n.reverse?e.max:e.min,a=Mn(i,e,o),r=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,o);return new On({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(e.getPointPositionForValue(l,a));return r}function Rn(t,e,i){const s=An(e),{line:o,scale:a,axis:r}=e,l=o.options,c=l.fill,h=l.backgroundColor,{above:d=h,below:u=h}=c||{};s&&o.points.length&&((0,n.Y)(t,i),Bn(t,{line:o,target:s,above:d,below:u,area:i,scale:a,axis:r}),(0,n.$)(t))}function Bn(t,e){const{line:i,target:n,above:s,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==s&&(Fn(t,n,a.top),Nn(t,{line:i,target:n,color:s,scale:r,property:l}
vendor: 4,378 bytes, line 21
21),t.restore(),t.save(),Fn(t,n,a.bottom)),Nn(t,{line:i,target:n,color:o,scale:r,property:l}),t.restore()}function Fn(t,e,i){const{segments:n,points:s}=e;let o=!0,a=!1;t.beginPath();for(const r of n){const{start:n,end:l}=r,c=s[n],h=s[mn(n,l,s)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Nn(t,e){const{line:i,target:n,property:s,color:o,scale:a}=e,r=fn(i,n,s);for(const{source:l,target:c,start:h,end:d}of r){const{style:{backgroundColor:e=o}={}}=l,r=!0!==n;t.save(),t.fillStyle=e,zn(t,a,r&&pn(s,h,d)),t.beginPath();const u=!!i.pathSegment(t,l);let f;if(r){u?t.closePath():jn(t,n,d,s);const e=!!n.pathSegment(t,c,{move:u,reverse:!0});f=u&&e,f||jn(t,n,h,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function zn(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,n,r-a,s-n),t.clip())}function jn(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}var Wn={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<n;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Vi&&(l={visible:t.isDatasetVisible(a),index:a,fill:vn(r,a,n),chart:t,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&&!1!==l.fill&&(l.fill=_n(s,a,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let a=s.length-1;a>=0;--a){const e=s[a].$filler;e&&(e.line.updateControlPoints(o,e.axis),n&&e.fill&&Rn(t.ctx,e,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const e=n[s].$filler;yn(e)&&Rn(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;yn(n)&&"beforeDatasetDraw"===i.drawTime&&Rn(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hn=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}},$n=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Yn extends ee{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=(0,n.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=(0,n.a0)(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Hn(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+a;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach(((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),r[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+a})),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=a,d=0,u=0,f=0,p=0;
21return this.legendItems.forEach(((t,o)=>{const{itemWidth:g,itemHeight:m}=Un(i,e,s,t,n);o>0&&u+m+2*a>c&&(h+=d+a,l.push({width:d,height:u}),f+=d+a,p++,d=u=0),r[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+a})),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=(0,n.az)(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=(0,n.a2)(i,this.left+s,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=(0,n.a2)(i,this.left+s,this.right-this.lineWidths[o])),l.top+=this.top+t+s,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+s}else{let o=0,r=(0,n.a2)(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=(0,n.a2)(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+s,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,n.Y)(t,this),this._draw(),(0,n.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=n.d.color,l=(0,n.az)(t.rtl,this.left,this.width),c=(0,n.a0)(a.font),{padding:h}=a,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Hn(a,d),x=function(t,e,i){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const o=(0,n.v)(i.lineWidth,1);if(s.fillStyle=(0,n.v)(i.fillStyle,r),s.lineCap=(0,n.v)(i.lineCap,"butt"),s.lineDashOffset=(0,n.v)(i.lineDashOffset,0),s.lineJoin=(0,n.v)(i.lineJoin,"miter"),s.lineWidth=o,s.strokeStyle=(0,n.v)(i.strokeStyle,r),s.setLineDash((0,n.v)(i.lineDash,[])),a.usePointStyle){const r={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},c=l.xPlus(t,p/2),h=e+u;(0,n.aD)(s,r,c,h,a.pointStyleWidth&&p)}else{const a=e+Math.max((d-g)/2,0),r=l.leftForLtr(t,p),c=(0,n.aw)(i.borderRadius);s.beginPath(),Object.values(c).some((t=>0!==t))?(0,n.au)(s,{x:r,y:a,w:p,h:g,radius:c}):s.rect(r,a,p,g),s.fill(),0!==o&&s.stroke()}s.restore()},b=function(t,e,i){(0,n.Z)(s,i.text,t,e+m/2,c,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},y=this.isHorizontal(),_=this._computeTitleHeight();f=y?{x:(0,n.a2)(o,this.left+h,this.right-i[0]),y:this.top+h+_,line:0}:{x:this.left+h,y:(0,n.a2)(o,this.top+_+h,this.bottom-e[0].height),line:0},(0,n.aA)(this.ctx,t.textDirection);const v=m+h;this.legendItems.forEach(((r,d)=>{s.strokeStyle=r.fontColor,s.fillStyle=r.fontColor;const g=s.measureText(r.text).width,m=l.textAlign(r.textAlign||(r.textAlign=a.textAlign)),k=p+u+g;let w=f.x,M=f.y;l.setWidth(this.width),y?d>0&&w+k+h>this.right&&(M=f.y+=v,f.line++,w=f.x=(0,n.a2)(o,this.left+h,this.right-i[f.line])):d>0&&M+v>this.bottom&&(w=f.x=w+e[f.line].width+h,f.line++,M=f.y=(0,n.a2)(o,this.top+_+h,this.bottom-e[f.line].height));const S=l.x(w);if(x(S,M,r),w=(0,n.aB)(m,w+p+u,y?w+k:this.right,t.rtl),b(l.x(w),M,r),y)f.x+=k+h;else if("string"!==typeof r.text){const t=c.lineHeight;f.y+=qn(r,t)+h}else f.y+=v})),(0,n.aC)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,n.a0)(e.font),s=(0,n.E)(e.padding);if(!e.display)return;const o=(0,n.az)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=(0,n.a2)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=c+(0,n.a2)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=(0,n.a2)(r,d,d+u);a.textAlign=o.textAlign((0,n.a1)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,n.Z)(a,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=(0,n.a0)(t.font),i=(0,n.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if((0,n.aj)(t,this.left,this.right)&&(0,n.aj)(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],(0,n.aj)(t,s.left,s.left+s.width)&&(0,n.aj)(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!Kn(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const s=this._hoveredItem,o=$n(s,i);s&&!o&&(0,n.Q)(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&(0,n.Q)(e.onHover,[t,i,this],this)}else i&&(0,n.Q)(e.onClick,[t,i,this],this)}}
21function Un(t,e,i,n,s){const o=Xn(n,t,e,i),a=Qn(s,n,e.lineHeight);return{itemWidth:o,itemHeight:a}}function Xn(t,e,i,n){let s=t.text;return s&&"string"!==typeof s&&(s=s.reduce(((t,e)=>t.length>e.length?t:e))),e+i.size/2+n.measureText(s).width}function Qn(t,e,i){let n=t;return"string"!==typeof e.text&&(n=qn(e,i)),n}function qn(t,e){const i=t.text?t.text.length:0;return e*i}function Kn(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var Gn={id:"legend",_element:Yn,start(t,e,i){const n=t.legend=new Yn({ctx:t.ctx,options:i,chart:t});At.configure(t,n,i),At.addBox(t,n)},stop(t){At.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;At.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const c=t.controller.getStyle(i?0:void 0),h=(0,n.E)(c.borderWidth);return{text:e[t.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:r&&(l||c.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Jn extends ee{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 i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=(0,n.b)(i.text)?i.text.length:1;this._padding=(0,n.E)(i.padding);const o=s*(0,n.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l,c,h,d=0;return this.isHorizontal()?(c=(0,n.a2)(r,i,o),h=e+t,l=o-i):("left"===a.position?(c=i+t,h=(0,n.a2)(r,s,e),d=-.5*n.P):(c=o-t,h=(0,n.a2)(r,e,s),d=.5*n.P),l=s-e),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,n.a0)(e.font),s=i.lineHeight,o=s/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);(0,n.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:(0,n.a1)(e.align),textBaseline:"middle",translation:[a,r]})}}function Zn(t,e){const i=new Jn({ctx:t.ctx,options:e,chart:t});At.configure(t,i,e),At.addBox(t,i),t.titleBlock=i}var ts={id:"title",_element:Jn,start(t,e,i){Zn(t,i)},stop(t){const e=t.titleBlock;At.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;At.configure(t,n,i),n.options=i},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 es=new WeakMap;var is={id:"subtitle",start(t,e,i){const n=new Jn({ctx:t.ctx,options:i,chart:t});At.configure(t,n,i),At.addBox(t,n),es.set(t,n)},stop(t){At.removeBox(t,es.get(t)),es.delete(t)},beforeUpdate(t,e,i){const n=es.get(t);At.configure(t,n,i),n.options=i},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 ns={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n.add(t.x),s+=t.y,++o}}if(0===o||0===n.size)return!1;const a=[...n].reduce(((t,e)=>t+e))/n.size;return{x:a,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,s,o,a=e.x,r=e.y,l=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=(0,n.aE)(e,t);i<l&&(l=i,o=s)}}if(o){const t=o.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function ss(t,e){return e&&((0,n.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function os(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function as(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:t,label:a,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function rs(t,e){const i=t.chart.ctx,{body:s,footer:o,title:a}=t,{boxWidth:r,boxHeight:l}=e,c=(0,n.a0)(e.bodyFont),h=(0,n.a0)(e.titleFont),d=(0,n.a0)(e.footerFont),u=a.length,f=o.length,p=s.length,g=(0,n.E)(e.padding);let m=g.height,x=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){const t=e.dis
21playColors?Math.max(l,c.lineHeight):c.lineHeight;m+=p*t+(b-p)*c.lineHeight+(b-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let y=0;const _=function(t){x=Math.max(x,i.measureText(t).width+y)};return i.save(),i.font=h.string,(0,n.F)(t.title,_),i.font=c.string,(0,n.F)(t.beforeBody.concat(t.afterBody),_),y=e.displayColors?r+2+e.boxPadding:0,(0,n.F)(s,(t=>{(0,n.F)(t.before,_),(0,n.F)(t.lines,_),(0,n.F)(t.after,_)})),y=0,i.font=d.string,(0,n.F)(t.footer,_),i.restore(),x+=g.width,{width:x,height:m}}function ls(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}function cs(t,e,i,n){const{x:s,width:o}=n,a=i.caretSize+i.caretPadding;return"left"===t&&s+o+a>e.width||("right"===t&&s-o-a<0||void 0)}function hs(t,e,i,n){const{x:s,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let c="center";return"center"===n?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),cs(c,t,e,i)&&(c="center"),c}function ds(t,e,i){const n=i.yAlign||e.yAlign||ls(t,i);return{xAlign:i.xAlign||e.xAlign||hs(t,e,i,n),yAlign:n}}function us(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}function fs(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}function ps(t,e,i,s){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:l,yAlign:c}=i,h=o+a,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,n.aw)(r);let g=us(e,l);const m=fs(e,c,h);return"center"===c?"left"===l?g+=h:"right"===l&&(g-=h):"left"===l?g-=Math.max(d,f)+o:"right"===l&&(g+=Math.max(u,p)+o),{x:(0,n.S)(g,0,s.width-e.width),y:(0,n.S)(m,0,s.height-e.height)}}function gs(t,e,i){const s=(0,n.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function ms(t){return ss([],os(t))}function xs(t,e,i){return(0,n.j)(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function bs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const ys={beforeTitle:n.aF,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:n.aF,beforeBody:n.aF,beforeLabel:n.aF,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return(0,n.k)(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:n.aF,afterBody:n.aF,beforeFooter:n.aF,footer:n.aF,afterFooter:n.aF};function _s(t,e,i,n){const s=t[e].call(i,n);return"undefined"===typeof s?ys[e].call(i,n):s}class vs extends ee{static positioners=ns;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,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new c(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=xs(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=_s(i,"beforeTitle",this,t),s=_s(i,"title",this,t),o=_s(i,"afterTitle",this,t);let a=[];return a=ss(a,os(n)),a=ss(a,os(s)),a=ss(a,os(o)),a}getBeforeBody(t,e){return ms(_s(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return(0,n.F)(t,(t=>{const e={before:[],lines:[],after:[]},n=bs(i,t);ss(e.before,os(_s(n,"beforeLabel",this,t))),ss(e.lines,_s(n,"label",this,t)),ss(e.after,os(_s(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return ms(_s(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=_s(i,"beforeFooter",this,t),s=_s(i,"footer",this,t),o=_s(i,"afterFooter",this,t);let a=[];return a=ss(a,os(n)),a=ss(a,os(s)),a=ss(a,os(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r,l,c=[];for(r=0,l=e.length;r<l;++r)c.push(as(this.chart,e[r]));return t.filter&&(c=c.filter(((e,n,s)=>t.filter(e,n,s,i)))),t.itemSort&&(c=c.sort(((e,n)=>
21t.itemSort(e,n,i)))),(0,n.F)(c,(e=>{const i=bs(t.callbacks,e);s.push(_s(i,"labelColor",this,e)),o.push(_s(i,"labelPointStyle",this,e)),a.push(_s(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=ns[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=rs(this,i),a=Object.assign({},t,e),r=ds(this.chart,i,a),l=ps(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=(0,n.aw)(r),{x:u,y:f}=t,{width:p,height:g}=e;let m,x,b,y,_,v;return"center"===o?(_=f+g/2,"left"===s?(m=u,x=m-a,y=_+a,v=_-a):(m=u+p,x=m+a,y=_-a,v=_+a),b=m):(x="left"===s?u+Math.max(l,h)+a:"right"===s?u+p-Math.max(c,d)-a:this.caretX,"top"===o?(y=f,_=y-a,m=x-a,b=x+a):(y=f+g,_=y+a,m=x+a,b=x-a),v=y),{x1:m,x2:x,x3:b,y1:y,y2:_,y3:v}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=(0,n.az)(i.rtl,this.x,this.width);for(t.x=gs(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,n.a0)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=(0,n.a0)(o.bodyFont),d=gs(this,"left",o),u=s.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(u,c)+c/2,h=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,n.at)(t,e,i,h),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,(0,n.at)(t,e,i,h)}else{t.lineWidth=(0,n.i)(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 e=s.leftForLtr(u,c),i=s.leftForLtr(s.xPlus(u,1),c-2),r=(0,n.aw)(a.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,n.au)(t,{x:e,y:p,w:c,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,n.au)(t,{x:i,y:p+1,w:c-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,p,c,l),t.strokeRect(e,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(i,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=(0,n.a0)(i.bodyFont);let u=d.lineHeight,f=0;const p=(0,n.az)(i.rtl,this.x,this.width),g=function(i){e.fillText(i,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(a);let x,b,y,_,v,k,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=gs(this,m,i),e.fillStyle=i.bodyColor,(0,n.F)(this.beforeBody,g),f=r&&"right"!==m?"center"===a?c/2+h:c+2+h:0,_=0,k=s.length;_<k;++_){for(x=s[_],b=this.labelTextColors[_],e.fillStyle=b,(0,n.F)(x.before,g),y=x.lines,r&&y.length&&(this._drawColorBox(e,t,_,p,i),u=Math.max(d.lineHeight,l)),v=0,w=y.length;v<w;++v)g(y[v]),u=d.lineHeight;(0,n.F)(x.after,g)}f=0,u=d.lineHeight,(0,n.F)(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=(0,n.az)(i.rtl,this.x,this.width);for(t.x=gs(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,n.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;
vendor: 4,657 bytes, line 21
21++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,n.aw)(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,l),"top"===a&&this.drawCaret(t,e,i,s),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),"center"===a&&"right"===o&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+h-p),e.quadraticCurveTo(r+c,l+h,r+c-p,l+h),"bottom"===a&&this.drawCaret(t,e,i,s),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),"center"===a&&"left"===o&&this.drawCaret(t,e,i,s),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=ns[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=rs(this,t),a=Object.assign({},i,this._size),r=ds(e,t,a),l=ps(t,a,r,e);n._to===l.x&&s._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,n.E)(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=i,this.drawBackground(o,t,s,e),(0,n.aA)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,n.aC)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!(0,n.ah)(i,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!(0,n.ah)(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,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=ns[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var ks={id:"tooltip",_element:vs,positioners:ns,afterInit(t,e,i){i&&(t.tooltip=new vs({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:ys},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ws=Object.freeze({__proto__:null,Colors:an,Decimation:un,Filler
21:Wn,Legend:Gn,SubTitle:is,Title:ts,Tooltip:ks});const Ms=(t,e,i,n)=>("string"===typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function Ss(t,e,i,n){const s=t.indexOf(e);if(-1===s)return Ms(t,e,i,n);const o=t.lastIndexOf(e);return s!==o?i:s}const Ds=(t,e)=>null===t?null:(0,n.S)(Math.round(t),0,e);function Cs(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Ps extends ve{static id="category";static defaults={ticks:{callback:Cs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,n.k)(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Ss(i,t,(0,n.v)(e,t),this._addedLabels),Ds(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){return Cs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!==typeof t&&(t=this.parse(t)),null===t?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}}function Es(t,e){const i=[],s=1e-14,{bounds:o,step:a,min:r,max:l,precision:c,count:h,maxTicks:d,maxDigits:u,includeBounds:f}=t,p=a||1,g=d-1,{min:m,max:x}=e,b=!(0,n.k)(r),y=!(0,n.k)(l),_=!(0,n.k)(h),v=(x-m)/(u+1);let k,w,M,S,D=(0,n.aH)((x-m)/g/p)*p;if(D<s&&!b&&!y)return[{value:m},{value:x}];S=Math.ceil(x/D)-Math.floor(m/D),S>g&&(D=(0,n.aH)(S*D/g/p)*p),(0,n.k)(c)||(k=Math.pow(10,c),D=Math.ceil(D*k)/k),"ticks"===o?(w=Math.floor(m/D)*D,M=Math.ceil(x/D)*D):(w=m,M=x),b&&y&&a&&(0,n.aI)((l-r)/a,D/1e3)?(S=Math.round(Math.min((l-r)/D,d)),D=(l-r)/S,w=r,M=l):_?(w=b?r:w,M=y?l:M,S=h-1,D=(M-w)/S):(S=(M-w)/D,S=(0,n.aJ)(S,Math.round(S),D/1e3)?Math.round(S):Math.ceil(S));const C=Math.max((0,n.aK)(D),(0,n.aK)(w));k=Math.pow(10,(0,n.k)(c)?C:c),w=Math.round(w*k)/k,M=Math.round(M*k)/k;let P=0;for(b&&(f&&w!==r?(i.push({value:r}),w<r&&P++,(0,n.aJ)(Math.round((w+P*D)*k)/k,r,Os(r,v,t))&&P++):w<r&&P++);P<S;++P){const t=Math.round((w+P*D)*k)/k;if(y&&t>l)break;i.push({value:t})}return y&&f&&M!==l?i.length&&(0,n.aJ)(i[i.length-1].value,l,Os(l,v,t))?i[i.length-1].value=l:i.push({value:l}):y&&M!==l||i.push({value:M}),i}function Os(t,e,{horizontal:i,minRotation:s}){const o=(0,n.t)(s),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}class As extends ve{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(0,n.k)(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=t=>s=e?s:t,r=t=>o=i?o:t;if(t){const t=(0,n.s)(s),e=(0,n.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(s===o){let e=0===o?1:Math.abs(.05*o);r(o+e),t||a(s-e)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},o=this._range||this,a=Es(s,o);return"ticks"===t.bounds&&(0,n.aG)(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,n.o)(t,this.chart.options.locale,this.options.ticks.format)}}class Ts extends As{static id="linear";static defaults={ticks:{callback:n.aL.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,n.g)(t)?t:0,this.max=(0,n.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,n.t)(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Ls=t=>Math.floor((0,n.aM)(t)),Vs=(t,e)=>Math.pow(10,Ls(t)+e);function Is(t){const e=t/Math.pow(10,Ls(t));return 1===e}function Rs(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n),o=Math.ceil(e/n);return o-s}function Bs(t,e){const i=e-t;let n=Ls(i);while(Rs(t,e,n)>10)n++;
21while(Rs(t,e,n)<10)n--;return Math.min(n,Ls(t))}function Fs(t,{min:e,max:i}){e=(0,n.O)(t.min,e);const s=[],o=Ls(e);let a=Bs(e,i),r=a<0?Math.pow(10,Math.abs(a)):1;const l=Math.pow(10,a),c=o>a?Math.pow(10,o):0,h=Math.round((e-c)*r)/r,d=Math.floor((e-c)/l/10)*l*10;let u=Math.floor((h-d)/Math.pow(10,a)),f=(0,n.O)(t.min,Math.round((c+d+u*Math.pow(10,a))*r)/r);while(f<i)s.push({value:f,major:Is(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(a++,u=2,r=a>=0?1:r),f=Math.round((c+d+u*Math.pow(10,a))*r)/r;const p=(0,n.O)(t.max,f);return s.push({value:p,major:Is(p),significand:u}),s}class Ns extends ve{static id="logarithmic";static defaults={ticks:{callback:n.aL.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=As.prototype.parse.apply(this,[t,e]);if(0!==i)return(0,n.g)(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,n.g)(t)?Math.max(0,t):null,this.max=(0,n.g)(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!(0,n.g)(this._userMin)&&(this.min=t===Vs(this.min,0)?Vs(this.min,-1):Vs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Vs(i,-1)),o(Vs(n,1)))),i<=0&&s(Vs(n,-1)),n<=0&&o(Vs(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Fs(e,this);return"ticks"===t.bounds&&(0,n.aG)(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":(0,n.o)(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=(0,n.aM)(t),this._valueRange=(0,n.aM)(this.max)-(0,n.aM)(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:((0,n.aM)(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function zs(t){const e=t.ticks;if(e.display&&t.display){const t=(0,n.E)(e.backdropPadding);return(0,n.v)(e.font&&e.font.size,n.d.font.size)+t.height}return 0}function js(t,e,i){return i=(0,n.b)(i)?i:[i],{w:(0,n.aN)(t,e.string,i),h:i.length*e.lineHeight}}function Ws(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:t<n||t>s?{start:e-i,end:e}:{start:e,end:e+i}}function Hs(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],o=[],a=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?n.P/a:0;for(let c=0;c<a;c++){const a=r.setContext(t.getPointLabelContext(c));o[c]=a.padding;const h=t.getPointPosition(c,t.drawingArea+o[c],l),d=(0,n.a0)(a.font),u=js(t.ctx,d,t._pointLabels[c]);s[c]=u;const f=(0,n.ay)(t.getIndexAngle(c)+l),p=Math.round((0,n.U)(f)),g=Ws(p,h.x,u.w,0,180),m=Ws(p,h.y,u.h,90,270);$s(i,e,f,g,m)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=Xs(t,s,o)}function $s(t,e,i,n,s){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,l=0;n.start<e.l?(r=(e.l-n.start)/o,t.l=Math.min(t.l,e.l-r)):n.end>e.r&&(r=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),s.start<e.t?(l=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-l)):s.end>e.b&&(l=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function Ys(t,e,i){const s=t.drawingArea,{extra:o,additionalAngle:a,padding:r,size:l}=i,c=t.getPointPosition(e,s+o+r,a),h=Math.round((0,n.U)((0,n.ay)(c.angle+n.H))),d=Ks(c.y,l.h,h),u=Qs(h),f=qs(c.x,l.w,u);return{visible:!0,x:c.x,y:d,textAlign:u,left:f,top:d,right:f+l.w,bottom:d+l.h}}function Us(t,e){if(!e)return!0;const{left:i,top:s,right:o,bottom:a}=t,r=(0,n.C)({x:i,y:s},e)||(0,n.C)({x:i,y:a},e)||(0,n.C)({x:o,y:s},e)||(0,n.C)({x:o,y:a},e);return!r}function Xs(t,e,i){const s=[],o=t._pointLabels.length,a=t.options,{centerPointLabels:r,display:l}=a.pointLabels,c={extra:zs(a)/2,additionalAngle:r?n.P/o:0};let h;for(let n=0;n<o;n++){c.padding=i[n],c.size=e[n];const o=Ys(t,n,c);s.push(o),"auto"===l&&(o.visible=Us(o,h),o.visible&&(h=o))}return s}function Qs(t){return 0===t||180===t?"center":t<180?"left":"right"}function qs(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}
21function Ks(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Gs(t,e,i){const{left:s,top:o,right:a,bottom:r}=i,{backdropColor:l}=e;if(!(0,n.k)(l)){const i=(0,n.aw)(e.borderRadius),c=(0,n.E)(e.backdropPadding);t.fillStyle=l;const h=s-c.left,d=o-c.top,u=a-s+c.width,f=r-o+c.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),(0,n.au)(t,{x:h,y:d,w:u,h:f,radius:i}),t.fill()):t.fillRect(h,d,u,f)}}function Js(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let o=e-1;o>=0;o--){const e=t._pointLabelItems[o];if(!e.visible)continue;const a=s.setContext(t.getPointLabelContext(o));Gs(i,a,e);const r=(0,n.a0)(a.font),{x:l,y:c,textAlign:h}=e;(0,n.Z)(i,t._pointLabels[o],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Zs(t,e,i,s){const{ctx:o}=t;if(i)o.arc(t.xCenter,t.yCenter,e,0,n.T);else{let i=t.getPointPosition(0,e);o.moveTo(i.x,i.y);for(let n=1;n<s;n++)i=t.getPointPosition(n,e),o.lineTo(i.x,i.y)}}function to(t,e,i,n,s){const o=t.ctx,a=e.circular,{color:r,lineWidth:l}=e;!a&&!n||!r||!l||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Zs(t,i,a,n),o.closePath(),o.stroke(),o.restore())}function eo(t,e,i){return(0,n.j)(t,{label:i,index:e,type:"pointLabel"})}class io extends As{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:n.aL.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=(0,n.E)(zs(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=(0,n.g)(t)&&!isNaN(t)?t:0,this.max=(0,n.g)(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/zs(this.options))}generateTickLabels(t){As.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=(0,n.Q)(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Hs(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){const e=n.T/(this._pointLabels.length||1),i=this.options.startAngle||0;return(0,n.ay)(t*e+(0,n.t)(i))}getDistanceFromCenterForValue(t){if((0,n.k)(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((0,n.k)(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 i=e[t];return eo(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-n.H+i;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:i,right:n,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Zs(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore(
21)}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:s}=e,o=this._pointLabels.length;let a,r,l;if(e.pointLabels.display&&Js(this,o),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),a=n.setContext(i),l=s.setContext(i);to(this,a,r,o,l)}})),i.display){for(t.save(),a=o-1;a>=0;a--){const n=i.setContext(this.getPointLabelContext(a)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.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(((s,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const l=i.setContext(this.getContext(r)),c=(0,n.a0)(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[r].value),l.showLabelBackdrop){t.font=c.string,a=t.measureText(s.label).width,t.fillStyle=l.backdropColor;const e=(0,n.E)(l.backdropPadding);t.fillRect(-a/2-e.left,-o-c.size/2-e.top,a+e.width,c.size+e.height)}(0,n.Z)(t,s.label,0,-o,c,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})})),t.restore()}drawTitle(){}}const no={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}},so=Object.keys(no);function oo(t,e){return t-e}function ao(t,e){if((0,n.k)(e))return null;const i=t._adapter,{parser:s,round:o,isoWeekday:a}=t._parseOpts;let r=e;return"function"===typeof s&&(r=s(r)),(0,n.g)(r)||(r="string"===typeof s?i.parse(r,s):i.parse(r)),null===r?null:(o&&(r="week"!==o||!(0,n.x)(a)&&!0!==a?i.startOf(r,o):i.startOf(r,"isoWeek",a)),+r)}function ro(t,e,i,n){const s=so.length;for(let o=so.indexOf(t);o<s-1;++o){const t=no[so[o]],s=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(s*t.size))<=n)return so[o]}return so[s-1]}function lo(t,e,i,n,s){for(let o=so.length-1;o>=so.indexOf(i);o--){const i=so[o];if(no[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return so[i?so.indexOf(i):0]}function co(t){for(let e=so.indexOf(t)+1,i=so.length;e<i;++e)if(no[so[e]].common)return so[e]}function ho(t,e,i){if(i){if(i.length){const{lo:s,hi:o}=(0,n.aP)(i,e),a=i[s]>=e?i[s]:i[o];t[a]=!0}}else t[e]=!0}function uo(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),a=e[e.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=i[r],l>=0&&(e[l].major=!0);return e}function fo(t,e,i){const n=[],s={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],s[r]=a,n.push({value:r,major:!1});return 0!==o&&i?uo(t,n,s,i):n}class po extends ve{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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 i=t.time||(t.time={}),s=this._adapter=new ot._date(t.adapters.date);s.init(e),(0,n.ab)(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ao(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(t){a||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(o=Math.max(o,t.max))}a&&r||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),s=(0,n.g)(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=(0,n.g)(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+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,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=(0,n.aO)(s,o,a);return this._unit=e.unit||(i.autoSkip?ro(e.minUnit,this.min,this.max,this._getLabelCapacity(o)
vendor: 4,105 bytes, line 21
21):lo(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?co(this._unit):void 0,this.initOffsets(s),t.reverse&&r.reverse(),fo(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,s=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;s=(0,n.S)(s,0,a),o=(0,n.S)(o,0,a),this._offsets={start:s,end:o,factor:1/(s+1+o)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||ro(o.minUnit,e,i,this._getLabelCapacity(e)),r=(0,n.v)(s.ticks.stepSize,1),l="week"===a&&o.isoWeekday,c=(0,n.x)(l)||!0===l,h={};let d,u,f=e;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,r,a),u++)ho(h,d,p);return d!==i&&"ticks"!==s.bounds&&1!==u||ho(h,d,p),Object.keys(h).sort(oo).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options,n=i.time.displayFormats,s=this._unit,o=e||n[s];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const o=this.options,a=o.ticks.callback;if(a)return(0,n.Q)(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=(0,n.t)(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,fo(this,[t],this._majorUnit),n),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(ao(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return(0,n._)(t.sort(oo))}}function go(t,e,i){let s,o,a,r,l=0,c=t.length-1;i?(e>=t[l].pos&&e<=t[c].pos&&({lo:l,hi:c}=(0,n.B)(t,"pos",e)),({pos:s,time:a}=t[l]),({pos:o,time:r}=t[c])):(e>=t[l].time&&e<=t[c].time&&({lo:l,hi:c}=(0,n.B)(t,"time",e)),({time:s,pos:a}=t[l]),({time:o,pos:r}=t[c]));const h=o-s;return h?a+(r-a)*(e-s)/h:a}class mo extends po{static id="timeseries";static defaults=po.defaults;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=go(e,this.min),this._tableRange=go(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,a,r,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=n.length;o<a;
21++o)c=n[o+1],r=n[o-1],l=n[o],Math.round((c+r)/2)!==l&&s.push({time:l,pos:o/(a-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort(((t,e)=>t-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(go(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return go(this._table,i*this._tableRange+this._minPos,!0)}}var xo=Object.freeze({__proto__:null,CategoryScale:Ps,LinearScale:Ts,LogarithmicScale:Ns,RadialLinearScale:io,TimeScale:po,TimeSeriesScale:mo});const bo=[it,Xi,ws,xo]},6769:function(t,e,i){i.d(e,{Y:function(){return o}});i(8111),i(2489),i(7588),i(1701),i(9726);var n=i(4743),s=i.n(n);function o(){function t(t,e){let i=new XMLHttpRequest;i.onload=function(){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(i.response)},i.open("GET",t),i.responseType="blob",i.send()}function e(t){return void 0!==t?t.toLocaleString("zh-TW",{style:"currency",currency:"TWD",minimumFractionDigits:0,maximumFractionDigits:0}):"N/A"}function i(t,e){if(null==e||void 0==e||0==Object.keys(t).length)return"";const i=e.split(".");let n={...t};for(let s in i){if(void 0==n)break;n=n[i[s]]}return n}function n(t){t.scrollIntoView({behavior:"smooth",block:"start"})}function o(t,e){let n=e.filter((t=>"date"==t.type||"boolean"==t.type)),o=t.map((t=>{let e=JSON.parse(JSON.stringify(t));return n.forEach((t=>{if("date"==t.type){let n=i(e,t.field),o="YYYY-MM-DD HH:mm",a=n?s()(n).format(
21o):"";e[t.field]=a}else"boolean"==t.type&&(t.format?e[t.field]=e[t.field]?t.format.t:t.format.f:e[t.field]=e[t.field]?"是":"否")})),e}));return o}function a(t){t=t.trim();let e=t.match("^[A-Z][1289ABCD]\\d{8}$");if(!e)return!1;let i="ABCDEFGHJKLMNPQRSTUVXYWZIO",n=[1,9,8,7,6,5,4,3,2,1,1],s=String(i.indexOf(t[0])+10)+t.slice(1),o=0;for(let h=0;h<s.length;h++){let t=parseInt(s[h]),e=n[h];o+=t*e}let a=o%10==0,r=String(i.indexOf(t[0])+10)+String((i.indexOf(t[1])+10)%10)+t.slice(2),l=0;for(let h=0;h<r.length;h++){let t=parseInt(r[h]),e=n[h];l+=t*e}let c=l%10==0;return a||c}async function r(t){const e=t=>new Promise(((e,i)=>{const n=new FileReader;n.onload=t=>e(t.target.result),n.onerror=i,n.readAsDataURL(t)})),i=t=>new Promise(((e,i)=>{const n=new Image;n.src=t,n.onload=()=>{const t=document.createElement("canvas"),s=t.getContext("2d");t.width=n.width,t.height=n.height,s.fillStyle="white",s.fillRect(0,0,t.width,t.height),s.drawImage(n,0,0),t.toBlob((t=>{t?e(t):i("Failed to convert to Blob")}),"image/jpeg",1)},n.onerror=i})),n=await e(t),s=await i(n);return s}function l(t){return t.indexOf("openExternalBrowser")>=0?t:t.indexOf("?")>=0?`${t}&openExternalBrowser=1`:`${t}?openExternalBrowser=1`}return{convert2Base64:t,formatCurrency:e,nest2Flat:i,scrollTo:n,formatDataTableExport:o,verifyIdentityNo:a,convertPNGImage:r,externalBrowserUrl:l}}},9144:function(t,e,i){i.r(e),i.d(e,{default:function(){return Ce}});i(8111),i(2489);var n=i(9726);const s={class:"flex justify-content-center"},o={key:2,class:"text-500"},a={key:3,class:"text-500"},r={key:1,class:"text-500"},l={key:2,class:"text-500"},c={key:0},h={key:1,class:"text-500"},d={key:2,class:"text-500"};function u(t,e,i,u,f,p){const g=(0,n.resolveComponent)("Chart"),m=(0,n.resolveComponent)("ProgressSpinner"),x=(0,n.resolveComponent)("Card"),b=(0,n.resolveComponent)("DonateCard"),y=(0,n.resolveComponent)("TabPanel"),_=(0,n.resolveComponent)("Divider"),v=(0,n.resolveComponent)("TabView");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(v,{ref:"tabview1",activeIndex:u.tabActive,"onUpdate:activeIndex":e[0]||(e[0]=t=>u.tabActive=t),onTabClick:u.getOrders},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(y,{header:"單次奉獻"},{default:(0,n.withCtx)((()=>[u.filter.done.length>0?((0,n.openBlock)(),(0,n.createBlock)(x,{key:0,class:"mb-5"},{content:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",s,[u.isAsyncDone?((0,n.openBlock)(),(0,n.createBlock)(g,{key:0,class:"h-20rem justify-items-center",plugins:u.plugins,type:"pie",data:u.chartData,options:u.chartOptions},null,8,["plugins","data","options"])):((0,n.openBlock)(),(0,n.createBlock)(m,{key:1,style:{width:"20px",height:"20px"},strokeWidth:"5"}))])])),_:1})):(0,n.createCommentVNode)("",!0),u.filter.done.length>0&&u.isAsyncDone?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(u.filter.done,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:`o1-${e}`},[(0,n.createVNode)(b,{class:"mb-3",modelValue:u.filter.done[e],"onUpdate:modelValue":t=>u.filter.done[e]=t,layout:"done"},null,8,["modelValue","onUpdate:modelValue"])])))),128)):((0,n.openBlock)(),(0,n.createElementBlock)("div",o," 已完成的奉獻紀錄在這裡喔!")),u.isAsyncDone?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",a,"讀取中..."))])),_:1}),(0,n.createVNode)(y,{header:"待完成奉獻"},{default:(0,n.withCtx)((()=>[u.filter.continue.length>0&&u.isAsyncDone?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(u.filter.continue,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:`o2-${e}`},[(0,n.createVNode)(b,{class:"mb-3",modelValue:u.filter.continue[e],"onUpdate:modelValue":t=>u.filter.continue[e]=t,layout:"continue"},null,8,["modelValue","onUpdate:modelValue"])])))),128)):((0,n.openBlock)(),(0,n.createElementBlock)("div",r,"未完成的奉獻訂單會顯示在這裡!")),u.isAsyncDone?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",l,"讀取中..."))])),_:1}),(0,n.createVNode)(y,{header:"定期定額"},{default:(0,n.withCtx)((()=>[e[3]||(e[3]=(0,n.createElementVNode)("div",{class:"mb-4"},"每月1號進行扣款",-1)),u.filter.period_running.length+u.filter.period_ended.length>0&&u.isAsyncDone?((0,n.openBlock)(),(0,n.createElementBlock)("div",c,[(0,n.createVNode)(_,{class:"z-0",align:"center",pt:{content:{class:"bg-none"}}},{default:(0,n.withCtx)((()=>e[1]||(e[1]=[(0,n.createElementVNode)("div",{class:"text-500 text-sm"},"進行中",-1)]))),_:1}),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(u.filter.period_running,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:`o2-${e}`},[(0,n.createVNode)(b,{class:"mb-3",modelValue:u.filter.period_running[e],"onUpdate:modelValue":t=>u.filter.period_running[e]=t,layout:"period"},null,8,["modelValue","onUpdate:modelValue"])])))),128)),(0,n.createVNode)(_,{class:"z-0",align:"center",pt:{content:{class:"bg-none"}}},{default:(0,n.withCtx)((()=>e[2]||(e[2]=[(0,n.createElementVNode)("div",{class:"text-500 text-sm"},"已結束",-1)]))),_:1}),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(u.filter.period_ended,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:`o3-${e}`},[(0,n.createVNode)(b,{class:"mb-3",modelValue:u.filter.period_ended[e],"onUpdate:modelValue":t=>u.filter.period_ended[e]=t,layout:"period"},null,8,["modelValue","onUpdate:modelValue"])])))),128))])):((0,n.openBlock)(),(0,n.createElementBlock)("div",h,"進行中/已結束的定期定額會顯示在這裡!")),u.isAsyncDone?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",d,"讀取中..."))])),_:1})])),_:1},8,["activeIndex","onTabClick"])])}i(4114),i(7588),i(3080);const f={class:"grid"},p={class:"col-9 pr-0"},g={class:"text-xs text-500"},m={class:"mb-2 text-xs text-500"},x={class:"white-space-nowrap overflow-hidden text-overflow-ellipsis"},b={key:0,class:"text-500 text-sm"},y={key:0,class:"text-sm"},_={class:"w-full"},v={class:"flex align-items-center justify-content-between"},k={class:"text-right text-xl"},w={key:0,class:"text-sm"},M={key:0,class:"text-xs color-info"},S={key:1,class:"text-xs color-info"},D={class:"col-2 pl-0 flex align-items-center justify-content-center"},C={key:0},P={key:0},E={class:"text-600"},O={key:1},A={style:{cursor:"pointer"}},T={key:0,class:"pl-1"},L={key:1,class:"pl-1"},V={key:1,class:"color-success text-center"},I={key:2,class:"text-center"},R={class:"color-info"},B={class:"text-lg"}
21,F={key:1,class:"text-500"},N={class:"flex justify-content-between my-3"},z={class:"flex justify-content-between my-3"},j={class:"flex justify-content-between my-3"},W={class:"flex justify-content-between my-3"},H={class:"flex justify-content-between my-3"},$={class:"color-error"},Y={class:"font-bold"},U={class:"flex justify-content-between my-3"},X={class:"flex justify-content-between my-3"},Q={class:"flex justify-content-between mb-4"},q={class:"text-lg"};function K(t,e,i,s,o,a){const r=(0,n.resolveComponent)("Ahref"),l=(0,n.resolveComponent)("Button"),c=(0,n.resolveComponent)("Divider"),h=(0,n.resolveComponent)("Card"),d=(0,n.resolveComponent)("Dialog"),u=(0,n.resolveComponent)("PeriodPaymentDetail"),K=(0,n.resolveComponent)("DataView");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(h,{class:"donate-card shadow-2 border-round-sm",style:{"max-width":"450px"}},{content:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",f,[(0,n.createElementVNode)("div",p,[(0,n.createElementVNode)("div",g,"訂單 "+(0,n.toDisplayString)(s.order.order_code),1),(0,n.createElementVNode)("div",m,"建立於 "+(0,n.toDisplayString)(t.$moment(s.order.created_at).format("YYYY-MM-DD (dd) HH:mm")),1),(0,n.createElementVNode)("div",x,[(0,n.createVNode)(r,{href:`/organizer/donate/${s.order.company_brief.company_code}`,text:s.order.company_brief.display_company_name,color:"text-700"},null,8,["href","text"]),s.order.is_period?((0,n.openBlock)(),(0,n.createElementBlock)("div",b,[(0,n.createTextVNode)((0,n.toDisplayString)(s.order.details[0].name)+" ",1),"ended"==s.order.period_status?((0,n.openBlock)(),(0,n.createElementBlock)("span",y,",共 "+(0,n.toDisplayString)(s.formatCurrency(s.order.payment_total)),1)):(0,n.createCommentVNode)("",!0)])):(0,n.createCommentVNode)("",!0)]),(0,n.createElementVNode)("div",_,[(0,n.createElementVNode)("div",v,[(0,n.createElementVNode)("div",null,[s.order.is_period?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,class:"py-1 px-0 p-button-sm p-button-text",severity:"secondary",label:"扣款紀錄",onClick:e[0]||(e[0]=t=>s.peridPaymentDialog=!0),badge:"done"==s.order.payment_status?"":"!",badgeClass:"p-badge-danger"},null,8,["badge"])):((0,n.openBlock)(),(0,n.createBlock)(l,{key:1,class:"py-1 px-0 p-button-sm p-button-text",severity:"secondary",label:"查看明細",onClick:e[1]||(e[1]=t=>s.orderInfoDialog=!0)}))]),(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("div",k,[(0,n.createElementVNode)("div",null,[(0,n.createTextVNode)((0,n.toDisplayString)(s.formatCurrency(s.order.amount))+" ",1),s.order.is_period?((0,n.openBlock)(),(0,n.createElementBlock)("span",w,"/月")):(0,n.createCommentVNode)("",!0)]),s.order.is_period?((0,n.openBlock)(),(0,n.createElementBlock)("div",M,[e[7]||(e[7]=(0,n.createElementVNode)("div",null,"最後扣款日 ",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(t.$moment(s.order.last_payment.created_at).format("YYYY-MM-DD")),1)])):((0,n.openBlock)(),(0,n.createElementBlock)("div",S,(0,n.toDisplayString)(s.order.payment_status_text),1))])])])])]),(0,n.createVNode)(c,{class:"col-1 px-0 mx-0",layout:"vertical"}),(0,n.createElementVNode)("div",D,["continue"==i.layout?((0,n.openBlock)(),(0,n.createElementBlock)("div",C,[s.is_cancel_executed?((0,n.openBlock)(),(0,n.createElementBlock)("div",P,[(0,n.createElementVNode)("div",E,(0,n.toDisplayString)(s.order.order_status_text),1)])):((0,n.openBlock)(),(0,n.createElementBlock)("div",O,[(0,n.createElementVNode)("div",A,[s.isPaid?((0,n.openBlock)(),(0,n.createElementBlock)("div",T,[s.isWait?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"color-info",onClick:e[2]||(e[2]=t=>s.paymentInfoDialog=!0)},e[8]||(e[8]=[(0,n.createElementVNode)("div",null,"查看",-1),(0,n.createElementVNode)("div",null,"應繳",-1)]))):(0,n.createCommentVNode)("",!0)])):((0,n.openBlock)(),(0,n.createElementBlock)("div",L,[(0,n.createElementVNode)("div",{class:"text-primary",onClick:e[3]||(e[3]=(...t)=>s.gotoDetail&&s.gotoDetail(...t))},e[9]||(e[9]=[(0,n.createElementVNode)("div",null,"立即",-1),(0,n.createElementVNode)("div",null,"付款",-1)]))])),(0,n.createVNode)(l,{class:"p-button-outlined mt-2 p-button-secondary",size:"small",style:{padding:"0.3rem"},onClick:s.cancelDialog},{default:(0,n.withCtx)((()=>e[10]||(e[10]=[(0,n.createTextVNode)("取消 ")]))),_:1},8,["onClick"])])]))])):"done"==i.layout?((0,n.openBlock)(),(0,n.createElementBlock)("div",V,e[11]||(e[11]=[(0,n.createElementVNode)("i",{class:"pi pi-check"},null,-1),(0,n.createElementVNode)("div",null,"完成",-1),(0,n.createElementVNode)("div",null,"奉獻",-1)]))):"period"==i.layout?((0,n.openBlock)(),(0,n.createElementBlock)("div",I,[(0,n.createElementVNode)("div",R,[(0,n.createElementVNode)("div",B,(0,n.toDisplayString)(s.serial_no),1),e[12]||(e[12]=(0,n.createElementVNode)("div",{class:"text-sm"},"期數",-1))]),"ended"!=s.order.period_status?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,class:"p-button-outlined mt-2 p-button-secondary",size:"small",style:{padding:"0.3rem"},onClick:s.cancelPeriodDialog},{default:(0,n.withCtx)((()=>e[13]||(e[13]=[(0,n.createTextVNode)("終止")]))),_:1},8,["onClick"])):((0,n.openBlock)(),(0,n.createElementBlock)("div",F,"結束 "))])):(0,n.createCommentVNode)("",!0)])])])),_:1}),(0,n.createVNode)(d,{visible:s.paymentInfoDialog,"onUpdate:visible":e[4]||(e[4]=t=>s.paymentInfoDialog=t),style:{"max-width":"450px","min-width":"320px"},header:"付款資訊",modal:!0},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",N,[e[14]||(e[14]=(0,n.createElementVNode)("div",null,"交易代號",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.payment.TradeNo),1)]),(0,n.createVNode)(c),(0,n.createElementVNode)("div",z,[e[15]||(e[15]=(0,n.createElementVNode)("div",null,"付款方式",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.payment.PaymentType),1)]),(0,n.createVNode)(c),(0,n.createElementVNode)("div",j,[e[16]||(e[16]=(0,n.createElementVNode)("div",null,"金融機構代號",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.payment.BankCode),1)]),(0,n.createVNode)(c),(0,n.createElementVNode)("div",W,[e[17]||(e[17]=(0,n.createElementVNode)("div",null,"帳號/ç¹³è²
21»ä»£ç¢¼",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.payment.CodeNo),1)]),(0,n.createVNode)(c),(0,n.createElementVNode)("div",H,[e[18]||(e[18]=(0,n.createElementVNode)("div",null,"繳費截止日期",-1)),(0,n.createElementVNode)("div",$,(0,n.toDisplayString)(s.payment.ExpireDate)+" "+(0,n.toDisplayString)(s.payment.ExpireTime),1)]),(0,n.createVNode)(c)])),_:1},8,["visible"]),(0,n.createVNode)(d,{visible:s.orderInfoDialog,"onUpdate:visible":e[5]||(e[5]=t=>s.orderInfoDialog=t),style:{"max-width":"450px","min-width":"320px"},header:"訂單資訊",modal:!0,dismissableMask:!0},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",Y,(0,n.toDisplayString)(s.order.company_brief?.title),1),(0,n.createVNode)(c),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(s.order.details,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",U,[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(t.name),1),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.formatCurrency(t.amount)),1)])))),256)),(0,n.createVNode)(c),(0,n.createElementVNode)("div",X,[e[19]||(e[19]=(0,n.createElementVNode)("div",{class:"font-bold"},"總計",-1)),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(s.formatCurrency(s.order.amount)),1)])])),_:1},8,["visible"]),(0,n.createVNode)(d,{visible:s.peridPaymentDialog,"onUpdate:visible":e[6]||(e[6]=t=>s.peridPaymentDialog=t),style:{"max-width":"450px","min-width":"320px"},header:`扣款紀錄 ${s.order.order_code} `,modal:!0,dismissableMask:!0},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",Q,[e[20]||(e[20]=(0,n.createElementVNode)("span",null,"累計金額",-1)),(0,n.createElementVNode)("span",q,(0,n.toDisplayString)(s.formatCurrency(s.order.payment_total)),1)]),(0,n.createVNode)(K,{value:s.order.payments,paginator:"",rows:24,sortField:"created_at",sortOrder:-1},{list:(0,n.withCtx)((t=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(t.items,((t,e)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:`item-${e}`},[(0,n.createVNode)(u,{class:"w-full",payment:t},null,8,["payment"])])))),128))])),_:1},8,["value"])])),_:1},8,["visible","header"])])}var G=i(5220),J=(i(4743),i(1143)),Z=i(1259),tt=i(6769),et=i(3281);const it={class:"grid"},nt={class:"col-9 pr-0"},st={class:"text-xs text-500"},ot={class:"mb-2 text-xs text-500"},at={class:"text-lg"},rt={class:"col-2 pl-0 flex align-items-center justify-content-center"},lt={class:"text-center"},ct={class:"color-info"},ht={class:"text-lg"};function dt(t,e,i,s,o,a){const r=(0,n.resolveComponent)("Divider"),l=(0,n.resolveComponent)("Card");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(l,{class:"payment-detail-card shadow-2 border-round-sm mb-4 max-w-screen"},{content:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",it,[(0,n.createElementVNode)("div",nt,[(0,n.createElementVNode)("div",st,"扣款序號 "+(0,n.toDisplayString)(i.payment.MerchantOrderNo),1),(0,n.createElementVNode)("div",ot,"扣款日期 "+(0,n.toDisplayString)(t.$moment(i.payment.created_at).format("YYYY-MM-DD (dd) HH:mm")),1),(0,n.createElementVNode)("div",at,(0,n.toDisplayString)(s.formatCurrency(i.payment.Amt)),1),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["text-xs",`${s.conditoinColor(i.payment.Status)}`])},(0,n.toDisplayString)(i.payment.Message),3)]),(0,n.createVNode)(r,{class:"col-1 px-0 mx-0",layout:"vertical"}),(0,n.createElementVNode)("div",rt,[(0,n.createElementVNode)("div",lt,[(0,n.createElementVNode)("div",ct,[(0,n.createElementVNode)("div",ht,(0,n.toDisplayString)(i.payment.serial_no),1),e[0]||(e[0]=(0,n.createElementVNode)("div",{class:"text-sm"},"期數",-1))])])])])])),_:1})])}var ut={components:{},props:{payment:{type:Object,default(){return{}},required:!0}},setup(t,{emit:e}){const{getImageFolder:i}=(0,J.i)(),{openDialogBox:n,closeDialogBox:s}=(0,Z.g)(),o=((0,G.rd)(),(0,tt.Y)());function a(t){switch(t){case"SUCCESS":return"color-success";default:return"color-error"}}return{formatCurrency:o.formatCurrency,conditoinColor:a}}},ft=i(6262);const pt=(0,ft.A)(ut,[["render",dt],["__scopeId","data-v-7c356800"]]);var gt=pt,mt={components:{PeriodPaymentDetail:gt},props:{modelValue:{type:Object,default(){return{}},required:!0},layout:{type:String,default:"",required:!0}},setup(t,{emit:e}){const i=(0,n.computed)({get:()=>t.modelValue,set:t=>e("update:modelValue",t)}),{getImageFolder:s}=(0,J.i)(),{openDialogBox:o,closeDialogBox:a}=(0,Z.g)(),r=(0,G.rd)(),l=(0,tt.Y)(),c=(0,n.computed)((()=>{let t=["new","failed"];return t.indexOf(i.value.payment_status)<0})),h=(0,n.computed)((()=>"wait"==i.value.payment_status)),d=(0,n.computed)((()=>i.value.payments&&i.value.payments.length>0?i.value.payments[i.value.payments.length-1].serial_no:"N/A")),u=(0,et._)(),f=(0,n.ref)(!1);function p(){return new Promise(((t,e)=>{u.putApi(`donates/${i.value.id}/cancel`).then((e=>{e.status?(Object.assign(i.value,e.order),f.value=!0,t(!0)):7==e.code?o({show:!0,title:"不可取消",message:"此奉獻訂單已無法取消,請聯繫主辦單位。"}):o({show:!0,title:"取消失敗",message:`錯誤代碼:${e.code},訊息:${e.message}`,icon:"error",btnCancelShow:!1,btnConfirmText:"我知道了",btnConfirmEvent:()=>{}})}
21))}))}function g(){o({show:!0,title:"取消奉獻",message:"您確定要取消此筆尚未完成的奉獻嗎?",btnCancelShow:!0,btnConfirmText:"非常確定",btnConfirmEvent:async()=>{await p()}})}function m(){o({show:!0,title:"終止定期定額",message:`您確定要終止「${i.value.company_brief.company_name}  ${i.value.details[0].name}/ $${i.value.amount}」的定期定額嗎?(已扣款的期數不會退款)`,btnCancelShow:!0,btnConfirmText:"非常確定",btnConfirmEvent:async()=>{await x()}})}function x(){return new Promise(((t,e)=>{u.putApi(`donates/period/${i.value.id}/cancel`).then((e=>{e.status?(i.value=e.order,f.value=!0,t(!0)):7==e.code?o({show:!0,title:"不可取消",message:"此奉獻訂單已無法取消,請聯繫主辦單位。"}):o({show:!0,title:"取消失敗",message:`錯誤代碼:${e.code},訊息:${e.message}`,icon:"error",btnCancelShow:!1,btnConfirmText:"我知道了",btnConfirmEvent:()=>{}})}))}))}const b=(0,n.ref)(!1),y=(0,n.computed)((()=>Array.isArray(i.value.payments)&&i.value.payments.length>0?i.value.payments[i.value.payments.length-1]:{})),_=(0,n.ref)(!1);function v(){"continue"==t.layout&&(c.value||r.push({name:"donate/repay",params:{order_code:i.value.order_code}}))}const k=(0,n.ref)(!1);return{gotoDetail:v,cancelDialog:g,cancelPeriodDialog:m,getImageFolder:s,formatCurrency:l.formatCurrency,orderInfoDialog:_,serial_no:d,order:i,isPaid:c,isWait:h,paymentInfoDialog:b,payment:y,peridPaymentDialog:k,is_cancel_executed:f}}};const xt=(0,ft.A)(mt,[["render",K],["__scopeId","data-v-1deefaa6"]]);var bt=xt,yt=i(5678),_t=i(5993),vt={root:{position:"relative"}},kt={root:"p-chart"},wt=_t.A.extend({name:"chart",inlineStyles:vt,classes:kt}),Mt={name:"BaseChart",extends:yt.A,props:{type:String,data:null,options:null,plugins:null,width:{type:Number,default:300},height:{type:Number,default:150},canvasProps:{type:null,default:null}},style:wt,provide:function(){return{$parentInstance:this}}},St={name:"Chart",extends:Mt,inheritAttrs:!1,emits:["select","loaded"],chart:null,watch:{data:{handler:function(){this.reinit()},deep:!0},type:function(){this.reinit()},options:function(){this.reinit()}},mounted:function(){this.initChart()},beforeUnmount:function(){this.chart&&(this.chart.destroy(),this.chart=null)},methods:{initChart:function(){var t=this;i.e(7154).then(i.bind(i,7154)).then((function(e){t.chart&&(t.chart.destroy(),t.chart=null),e&&e["default"]&&(t.chart=new e["default"](t.$refs.canvas,{type:t.type,data:t.data,options:t.options,plugins:t.plugins})),t.$emit("loaded",t.chart)}))},getCanvas:function(){return this.$canvas},getChart:function(){return this.chart},getBase64Image:function(){return this.chart.toBase64Image()},refresh:function(){this.chart&&this.chart.update()},reinit:function(){this.initChart()},onCanvasClick:function(t){if(this.chart){var e=this.chart.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1),i=this.chart.getElementsAtEventForMode(t,"dataset",{intersect:!0},!1);e&&e[0]&&i&&this.$emit("select",{originalEvent:t,element:e[0],dataset:i})}},generateLegend:function(){if(this.chart)return this.chart.generateLegend()}}};function Dt(t){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(t)}function Ct(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(i),!0).forEach((function(e){Et(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ct(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Et(t,e,i){return e=Ot(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ot(t){var e=At(t,"string");return"symbol"==Dt(e)?e:String(e)}function At(t,e){if("object"!=Dt(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Tt=["width","height"];function Lt(t,e,i,s,o,a){return(0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[(0,n.createElementVNode)("canvas",(0,n.mergeProps)({ref:"canvas",width:t.width,height:t.height,onClick:e[0]||(e[0]=function(t){return a.onCanvasClick(t)})},Pt(Pt({},t.canvasProps),t.ptm("canvas"))),null,16,Tt)],16)}St.render=Lt;var Vt=i(1014),It=i(6118),Rt=function(){if("undefined"!==typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t)return(t.deviceXDPI||1)/(t.logicalXDPI||1)}return 1}(),Bt={toTextLines:function(t){var e,i=[];t=[].concat(t);while(t.length)e=t.pop(),"string"===typeof e?i.unshift.apply(i,e.split("\n")):Array.isArray(e)?t.push.apply(t,e):(0,Vt.k)(t)||i.unshift(""+e);return i}
21,textSize:function(t,e,i){var n,s=[].concat(e),o=s.length,a=t.font,r=0;for(t.font=i.string,n=0;n<o;++n)r=Math.max(t.measureText(s[n]).width,r);return t.font=a,{height:o*i.lineHeight,width:r}},bound:function(t,e,i){return Math.max(t,Math.min(e,i))},arrayDiff:function(t,e){var i,n,s,o,a=t.slice(),r=[];for(i=0,s=e.length;i<s;++i)o=e[i],n=a.indexOf(o),-1===n?r.push([o,1]):a.splice(n,1);for(i=0,s=a.length;i<s;++i)r.push([a[i],-1]);return r},rasterize:function(t){return Math.round(t*Rt)/Rt}};function Ft(t,e){var i=e.x,n=e.y;if(null===i)return{x:0,y:-1};if(null===n)return{x:1,y:0};var s=t.x-i,o=t.y-n,a=Math.sqrt(s*s+o*o);return{x:a?s/a:0,y:a?o/a:-1}}function Nt(t,e,i,n,s){switch(s){case"center":i=n=0;break;case"bottom":i=0,n=1;break;case"right":i=1,n=0;break;case"left":i=-1,n=0;break;case"top":i=0,n=-1;break;case"start":i=-i,n=-n;break;case"end":break;default:s*=Math.PI/180,i=Math.cos(s),n=Math.sin(s);break}return{x:t,y:e,vx:i,vy:n}}var zt=0,jt=1,Wt=2,Ht=4,$t=8;function Yt(t,e,i){var n=zt;return t<i.left?n|=jt:t>i.right&&(n|=Wt),e<i.top?n|=$t:e>i.bottom&&(n|=Ht),n}function Ut(t,e){var i,n,s,o=t.x0,a=t.y0,r=t.x1,l=t.y1,c=Yt(o,a,e),h=Yt(r,l,e);while(1){if(!(c|h)||c&h)break;i=c||h,i&$t?(n=o+(r-o)*(e.top-a)/(l-a),s=e.top):i&Ht?(n=o+(r-o)*(e.bottom-a)/(l-a),s=e.bottom):i&Wt?(s=a+(l-a)*(e.right-o)/(r-o),n=e.right):i&jt&&(s=a+(l-a)*(e.left-o)/(r-o),n=e.left),i===c?(o=n,a=s,c=Yt(o,a,e)):(r=n,l=s,h=Yt(r,l,e))}return{x0:o,x1:r,y0:a,y1:l}}function Xt(t,e){var i,n,s=e.anchor,o=t;return e.clamp&&(o=Ut(o,e.area)),"start"===s?(i=o.x0,n=o.y0):"end"===s?(i=o.x1,n=o.y1):(i=(o.x0+o.x1)/2,n=(o.y0+o.y1)/2),Nt(i,n,t.vx,t.vy,e.align)}var Qt={arc:function(t,e){var i=(t.startAngle+t.endAngle)/2,n=Math.cos(i),s=Math.sin(i),o=t.innerRadius,a=t.outerRadius;return Xt({x0:t.x+n*o,y0:t.y+s*o,x1:t.x+n*a,y1:t.y+s*a,vx:n,vy:s},e)},point:function(t,e){var i=Ft(t,e.origin),n=i.x*t.options.radius,s=i.y*t.options.radius;return Xt({x0:t.x-n,y0:t.y-s,x1:t.x+n,y1:t.y+s,vx:i.x,vy:i.y},e)},bar:function(t,e){var i=Ft(t,e.origin),n=t.x,s=t.y,o=0,a=0;return t.horizontal?(n=Math.min(t.x,t.base),o=Math.abs(t.base-t.x)):(s=Math.min(t.y,t.base),a=Math.abs(t.base-t.y)),Xt({x0:n,y0:s+a,x1:n+o,y1:s,vx:i.x,vy:i.y},e)},fallback:function(t,e){var i=Ft(t,e.origin);return Xt({x0:t.x,y0:t.y,x1:t.x+(t.width||0),y1:t.y+(t.height||0),vx:i.x,vy:i.y},e)}},qt=Bt.rasterize;function Kt(t){var e=t.borderWidth||0,i=t.padding,n=t.size.height,s=t.size.width,o=-s/2,a=-n/2;return{frame:{x:o-i.left-e,y:a-i.top-e,w:s+i.width+2*e,h:n+i.height+2*e},text:{x:o,y:a,w:s,h:n}}}function Gt(t,e){var i=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!i)return null;if(void 0!==i.xCenter&&void 0!==i.yCenter)return{x:i.xCenter,y:i.yCenter};var n=i.getBasePixel();return t.horizontal?{x:n,y:null}:{x:null,y:n}}function Jt(t){return t instanceof It.Bs?Qt.arc:t instanceof It.FN?Qt.point:t instanceof It.E8?Qt.bar:Qt.fallback}function Zt(t,e,i,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=e+r,c=i+r,h=e+n-r,d=i+s-r;t.moveTo(e,c),l<h&&c<d?(t.arc(l,c,r,-Math.PI,-a),t.arc(h,c,r,-a,0),t.arc(h,d,r,0,a),t.arc(l,d,r,a,Math.PI)):l<h?(t.moveTo(l,i),t.arc(h,c,r,-a,a),t.arc(l,c,r,a,Math.PI+a)):c<d?(t.arc(l,c,r,-Math.PI,0),t.arc(l,d,r,0,Math.PI)):t.arc(l,c,r,-Math.PI,Math.PI),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,s)}function te(t,e,i){var n=i.backgroundColor,s=i.borderColor,o=i.borderWidth;(n||s&&o)&&(t.beginPath(),Zt(t,qt(e.x)+o/2,qt(e.y)+o/2,qt(e.w)-o,qt(e.h)-o,i.borderRadius),t.closePath(),n&&(t.fillStyle=n,t.fill()),s&&o&&(t.strokeStyle=s,t.lineWidth=o,t.lineJoin="miter",t.stroke()))}function ee(t,e,i){var n=i.lineHeight,s=t.w,o=t.x,a=t.y+n/2;return"center"===e?o+=s/2:"end"!==e&&"right"!==e||(o+=s),{h:n,w:s,x:o,y:a}}function ie(t,e,i){var n=t.shadowBlur,s=i.stroked,o=qt(i.x),a=qt(i.y),r=qt(i.w);s&&t.strokeText(e,o,a,r),i.filled&&(n&&s&&(t.shadowBlur=0),t.fillText(e,o,a,r),n&&s&&(t.shadowBlur=n))}function ne(t,e,i,n){var s,o=n.textAlign,a=n.color,r=!!a,l=n.font,c=e.length,h=n.textStrokeColor,d=n.textStrokeWidth,u=h&&d;if(c&&(r||u))for(i=ee(i,o,l),t.font=l.string,t.textAlign=o,t.textBaseline="middle",t.shadowBlur=n.textShadowBlur,t.shadowColor=n.textShadowColor,r&&(t.fillStyle=a),u&&(t.lineJoin="round",t.lineWidth=d,t.strokeStyle=h),s=0,c=e.length;s<c;++s)ie(t,e[s],{stroked:u,filled:r,w:i.w,x:i.x,y:i.y+i.h*s})}
21var se=function(t,e,i,n){var s=this;s._config=t,s._index=n,s._model=null,s._rects=null,s._ctx=e,s._el=i};(0,Vt.a4)(se.prototype,{_modelize:function(t,e,i,n){var s=this,o=s._index,a=(0,Vt.a0)((0,Vt.a)([i.font,{}],n,o)),r=(0,Vt.a)([i.color,Vt.d.color],n,o);return{align:(0,Vt.a)([i.align,"center"],n,o),anchor:(0,Vt.a)([i.anchor,"center"],n,o),area:n.chart.chartArea,backgroundColor:(0,Vt.a)([i.backgroundColor,null],n,o),borderColor:(0,Vt.a)([i.borderColor,null],n,o),borderRadius:(0,Vt.a)([i.borderRadius,0],n,o),borderWidth:(0,Vt.a)([i.borderWidth,0],n,o),clamp:(0,Vt.a)([i.clamp,!1],n,o),clip:(0,Vt.a)([i.clip,!1],n,o),color:r,display:t,font:a,lines:e,offset:(0,Vt.a)([i.offset,4],n,o),opacity:(0,Vt.a)([i.opacity,1],n,o),origin:Gt(s._el,n),padding:(0,Vt.E)((0,Vt.a)([i.padding,4],n,o)),positioner:Jt(s._el),rotation:(0,Vt.a)([i.rotation,0],n,o)*(Math.PI/180),size:Bt.textSize(s._ctx,e,a),textAlign:(0,Vt.a)([i.textAlign,"start"],n,o),textShadowBlur:(0,Vt.a)([i.textShadowBlur,0],n,o),textShadowColor:(0,Vt.a)([i.textShadowColor,r],n,o),textStrokeColor:(0,Vt.a)([i.textStrokeColor,r],n,o),textStrokeWidth:(0,Vt.a)([i.textStrokeWidth,0],n,o)}},update:function(t){var e,i,n,s=this,o=null,a=null,r=s._index,l=s._config,c=(0,Vt.a)([l.display,!0],t,r);c&&(e=t.dataset.data[r],i=(0,Vt.v)((0,Vt.Q)(l.formatter,[e,t]),e),n=(0,Vt.k)(i)?[]:Bt.toTextLines(i),n.length&&(o=s._modelize(c,n,l,t),a=Kt(o))),s._model=o,s._rects=a},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(t,e){var i,n=this,s=t.ctx,o=n._model,a=n._rects;this.visible()&&(s.save(),o.clip&&(i=o.area,s.beginPath(),s.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),s.clip()),s.globalAlpha=Bt.bound(0,o.opacity,1),s.translate(qt(e.x),qt(e.y)),s.rotate(o.rotation),te(s,a.frame,o),ne(s,o.lines,a.text,o),s.restore())}});var oe=Number.MIN_SAFE_INTEGER||-9007199254740991,ae=Number.MAX_SAFE_INTEGER||9007199254740991;function re(t,e,i){var n=Math.cos(i),s=Math.sin(i),o=e.x,a=e.y;return{x:o+n*(t.x-o)-s*(t.y-a),y:a+s*(t.x-o)+n*(t.y-a)}}function le(t,e){var i,n,s,o,a,r=ae,l=oe,c=e.origin;for(i=0;i<t.length;++i)n=t[i],s=n.x-c.x,o=n.y-c.y,a=e.vx*s+e.vy*o,r=Math.min(r,a),l=Math.max(l,a);return{min:r,max:l}}function ce(t,e){var i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);return{vx:(e.x-t.x)/s,vy:(e.y-t.y)/s,origin:t,ln:s}}var he=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function de(t,e,i){var n=e.positioner(t,e),s=n.vx,o=n.vy;if(!s&&!o)return{x:n.x,y:n.y};var a=i.w,r=i.h,l=e.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(r/2*Math.sin(l)),h=Math.abs(a/2*Math.sin(l))+Math.abs(r/2*Math.cos(l)),d=1/Math.max(Math.abs(s),Math.abs(o));return c*=s*d,h*=o*d,c+=e.offset*s,h+=e.offset*o,{x:n.x+c,y:n.y+h}}function ue(t,e){var i,n,s,o;for(i=t.length-1;i>=0;--i)for(s=t[i].$layout,n=i-1;n>=0&&s._visible;--n)o=t[n].$layout,o._visible&&s._box.intersects(o._box)&&e(s,o);return t}function fe(t){var e,i,n,s,o,a,r;for(e=0,i=t.length;e<i;++e)n=t[e],s=n.$layout,s._visible&&(r=new Proxy(n._el,{get:(t,e)=>t.getProps([e],!0)[e]}),o=n.geometry(),a=de(r,n.model(),o),s._box.update(a,o,n.rotation()));return ue(t,(function(t,e){var i=t._hidable,n=e._hidable;i&&n||n?e._visible=!1:i&&(t._visible=!1)}))}(0,Vt.a4)(he.prototype,{center:function(){var t=this._rect;return{x:t.x+t.w/2,y:t.y+t.h/2}},update:function(t,e,i){this._rotation=i,this._rect={x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},contains:function(t){var e=this,i=1,n=e._rect;return t=re(t,e.center(),-e._rotation),!(t.x<n.x-i||t.y<n.y-i||t.x>n.x+n.w+2*i||t.y>n.y+n.h+2*i)},intersects:function(t){var e,i,n,s=this._points(),o=t._points(),a=[ce(s[0],s[1]),ce(s[0],s[3])];for(this._rotation!==t._rotation&&a.push(ce(o[0],o[1]),ce(o[0],o[3])),e=0;e<a.length;++e)if(i=le(s,a[e]),n=le(o,a[e]),i.max<n.min||n.max<i.min)return!1;return!0},_points:function(){var t=this,e=t._rect,i=t._rotation,n=t.center();return[re({x:e.x,y:e.y},n,i),re({x:e.x+e.w,y:e.y},n,i),re({x:e.x+e.w,y:e.y+e.h},n,i),re({x:e.x,y:e.y+e.h},n,i)]}});var pe={prepare:function(t){var e,i,n,s,o,a=[];for(e=0,n=t.length;e<n;++e)for(i=0,s=t[e].length;i<s;++i)o=t[e][i],a.push(o),o.$layout={_box:new he,_hidable:!1,_visible:!0,_set:e,_idx:o._index};return a.sort((function(t,e){var i=t.$layout,n=e.$layout;
21return i._idx===n._idx?n._set-i._set:n._idx-i._idx})),this.update(a),a},update:function(t){var e,i,n,s,o,a=!1;for(e=0,i=t.length;e<i;++e)n=t[e],s=n.model(),o=n.$layout,o._hidable=s&&"auto"===s.display,o._visible=n.visible(),a|=o._hidable;a&&fe(t)},lookup:function(t,e){var i,n;for(i=t.length-1;i>=0;--i)if(n=t[i].$layout,n&&n._visible&&n._box.contains(e))return t[i];return null},draw:function(t,e){var i,n,s,o,a,r;for(i=0,n=e.length;i<n;++i)s=e[i],o=s.$layout,o._visible&&(a=s.geometry(),r=de(s._el,s.model(),a),o._box.update(r,a,s.rotation()),s.draw(t,r))}},ge=function(t){if((0,Vt.k)(t))return null;var e,i,n,s=t;if((0,Vt.i)(t))if((0,Vt.k)(t.label))if((0,Vt.k)(t.r))for(s="",e=Object.keys(t),n=0,i=e.length;n<i;++n)s+=(0!==n?", ":"")+e[n]+": "+t[e[n]];else s=t.r;else s=t.label;return""+s},me={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:ge,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},xe="$datalabels",be="$default";function ye(t,e){var i,n,s=t.datalabels,o={},a=[];return!1===s?null:(!0===s&&(s={}),e=(0,Vt.a4)({},[e,s]),i=e.labels||{},n=Object.keys(i),delete e.labels,n.length?n.forEach((function(t){i[t]&&a.push((0,Vt.a4)({},[e,i[t],{_key:t}]))})):a.push(e),o=a.reduce((function(t,e){return(0,Vt.F)(e.listeners||{},(function(i,n){t[n]=t[n]||{},t[n][e._key||be]=i})),delete e.listeners,t}),{}),{labels:a,listeners:o})}function _e(t,e,i,n){if(e){var s,o=i.$context,a=i.$groups;e[a._set]&&(s=e[a._set][a._key],s&&!0===(0,Vt.Q)(s,[o,n])&&(t[xe]._dirty=!0,i.update(o)))}}function ve(t,e,i,n,s){var o,a;(i||n)&&(i?n?i!==n&&(a=o=!0):a=!0:o=!0,a&&_e(t,e.leave,i,s),o&&_e(t,e.enter,n,s))}function ke(t,e){var i,n,s=t[xe],o=s._listeners;if(o.enter||o.leave){if("mousemove"===e.type)n=pe.lookup(s._labels,e);else if("mouseout"!==e.type)return;i=s._hovered,s._hovered=n,ve(t,o,i,n,e)}}function we(t,e){var i=t[xe],n=i._listeners.click,s=n&&pe.lookup(i._labels,e);s&&_e(t,n,s,e)}var Me={id:"datalabels",defaults:me,beforeInit:function(t){t[xe]={_actives:[]}},beforeUpdate:function(t){var e=t[xe];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(t,e,i){var n,s,o,a,r,l,c,h,d=e.index,u=t[xe],f=u._datasets[d]=[],p=t.isDatasetVisible(d),g=t.data.datasets[d],m=ye(g,i),x=e.meta.data||[],b=t.ctx;for(b.save(),n=0,o=x.length;n<o;++n)if(c=x[n],c[xe]=[],p&&c&&t.getDataVisibility(n)&&!c.skip)for(s=0,a=m.labels.length;s<a;++s)r=m.labels[s],l=r._key,h=new se(r,b,c,n),h.$groups={_set:d,_key:l||be},h.$context={active:!1,chart:t,dataIndex:n,dataset:g,datasetIndex:d},h.update(h.$context),c[xe].push(h),f.push(h);b.restore(),(0,Vt.a4)(u._listeners,m.listeners,{merger:function(t,i,n){i[t]=i[t]||{},i[t][e.index]=n[t],u._listened=!0}})},afterUpdate:function(t){t[xe]._labels=pe.prepare(t[xe]._datasets)},afterDatasetsDraw:function(t){pe.draw(t,t[xe]._labels)},beforeEvent:function(t,e){if(t[xe]._listened){var i=e.event;switch(i.type){case"mousemove":case"mouseout":ke(t,i);break;case"click":we(t,i);break}}},afterEvent:function(t){var e,i,n,s,o,a,r,l=t[xe],c=l._actives,h=l._actives=t.getActiveElements(),d=Bt.arrayDiff(c,h);for(e=0,i=d.length;e<i;++e)if(o=d[e],o[1])for(r=o[0].element[xe]||[],n=0,s=r.length;n<s;++n)a=r[n],a.$context.active=1===o[1],a.update(a.$context);(l._dirty||d.length)&&(pe.update(l._labels),t.render()),delete l._dirty}},Se={components:{DonateCard:bt,Chart:St},setup(){const{isAsyncDone:t,asyncDone:e}=(0,Z.g)(),i=(0,n.ref)(0),s=(0,et._)(),o=(0,n.ref)([]),a=(0,n.reactive)({done:[],continue:[],period_running:[],period_ended:[]});function r(){if(e(!1),2==i.value)s.getApi("donates/periods").then((t=>{t.status&&(a.period_running=t.orders.filter((t=>"running"==t.period_status)),a.period_ended=t.orders.filter((t=>"ended"==t.period_status))),e(!0)}));else{let t="";0==i.value?t="done":1==i.value&&(t="continue"),s.getApi(`donates/limited/${t}`).then((t=>
21{t.status&&(0==i.value?a.done=t.orders:1==i.value&&(a.continue=t.orders)),e(!0)}))}}function l(t){i.value,r()}(0,n.onMounted)((()=>{r()}));const c=(0,n.ref)([Me]),h=(0,n.computed)((()=>{let t={};a.done.forEach((e=>{e.details.forEach((e=>{t[e.name]||(t[e.name]=0),t[e.name]+=e.amount}))}));let e=[],i=[];for(let n in t)e.push(n),i.push(t[n]);return{labels:e,datasets:[{data:i}]}})),d=(0,n.ref)({plugins:{legend:{labels:{usePointStyle:!0}},title:{display:!0,text:"奉獻項目統計"},datalabels:{color:"white"}}});return{isAsyncDone:t,tabActive:i,orders:o,filter:a,plugins:c,chartData:h,chartOptions:d,getOrders:r,refresh:l}}};const De=(0,ft.A)(Se,[["render",u],["__scopeId","data-v-2b7d01ea"]]);var Ce=De}}]);
22//# sourceMappingURL=9144.b27beb8b.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.