forked from mattiabasone/CanopyGUIEnhancer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcge.js
13 lines (13 loc) · 227 KB
/
cge.js
1
2
3
4
5
6
7
8
9
10
11
12
13
/*!
* Chart.js v3.3.0
* https://www.chartjs.org
* (c) 2021 Chart.js Contributors
* Released under the MIT License
*/
function intval(t){return t=Number(t),isNaN(t)?0:t}function jsonp(t,e){let n="jsonp_callback_"+Math.round(1e5*Math.random());window[n]=function(t){delete window[n],document.body.removeChild(i),e(t)};let i=document.createElement("script");i.src=t+(t.indexOf("?")>=0?"&":"?")+"callback="+n,document.body.appendChild(i)}function escapeHTML(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function highlightErrorsInText(t,e){var n=new RegExp("("+RegExp.quote(t)+")","gi");return e.replace(n,"<span class='cge-bad-power-level'>$1</span>")}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";const t="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function e(e,n,i){const o=i||(t=>Array.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=o(i),a||(a=!0,t.call(window,()=>{a=!1,e.apply(n,s)}))}}function n(t,e){let n;return function(){return e?(clearTimeout(n),n=setTimeout(t,e)):t(),e}}const i=t=>"start"===t?"left":"end"===t?"right":"center",o=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2,a=(t,e,n)=>"right"===t?n:"center"===t?(e+n)/2:e;var s=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const o=e.listeners[i],a=e.duration;o.forEach(i=>i({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(n-e.start,a)}))}_refresh(){const e=this;e._request||(e._running=!0,e._request=t.call(window,()=>{e._update(),e._request=null,e._running&&e._refresh()}))}_update(t=Date.now()){const e=this;let n=0;e._charts.forEach((i,o)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,l=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),l=!0):(a[r]=a[a.length-1],a.pop());l&&(o.draw(),e._notify(o,i,t,"progress")),a.length||(i.running=!1,e._notify(o,i,t,"complete"),i.initial=!1),n+=a.length}),e._lastDate=t,0===n&&(e._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};
/*!
* @kurkle/color v0.1.9
* https://github.com/kurkle/color#readme
* (c) 2020 Jukka Kurkela
* Released under the MIT License
*/const r={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},l="0123456789ABCDEF",c=t=>l[15&t],h=t=>l[(240&t)>>4]+l[15&t],d=t=>(240&t)>>4==(15&t);function u(t){return t+.5|0}const g=(t,e,n)=>Math.max(Math.min(t,n),e);function f(t){return g(u(2.55*t),0,255)}function p(t){return g(u(255*t),0,255)}function m(t){return g(u(t/2.55)/100,0,1)}function b(t){return g(u(100*t),0,100)}const x=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,y=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _(t,e,n){const i=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function v(t,e,n){const i=(i,o=(i+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function M(t,e,n){const i=_(t,1,.5);let o;for(e+n>1&&(o=1/(e+n),e*=o,n*=o),o=0;o<3;o++)i[o]*=1-e-n,i[o]+=e;return i}function S(t){const e=t.r/255,n=t.g/255,i=t.b/255,o=Math.max(e,n,i),a=Math.min(e,n,i),s=(o+a)/2;let r,l,c;return o!==a&&(c=o-a,l=s>.5?c/(2-o-a):c/(o+a),r=o===e?(n-i)/c+(n<i?6:0):o===n?(i-e)/c+2:(e-n)/c+4,r=60*r+.5),[0|r,l||0,s]}function C(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(p)}function k(t,e,n){return C(_,t,e,n)}function P(t){return(t%360+360)%360}const w={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"},T={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let E;function A(t,e,n){if(t){let i=S(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=k(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function I(t,e){return t?Object.assign(e||{},t):t}function D(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=p(t[3]))):(e=I(t,{r:0,g:0,b:0,a:1})).a=p(e.a),e}function O(t){return"r"===t.charAt(0)?function(t){const e=x.exec(t);let n,i,o,a=255;if(e){if(e[7]!==n){const t=+e[7];a=255&(e[8]?f(t):255*t)}return n=+e[1],i=+e[3],o=+e[5],n=255&(e[2]?f(n):n),i=255&(e[4]?f(i):i),o=255&(e[6]?f(o):o),{r:n,g:i,b:o,a:a}}}(t):function(t){const e=y.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?f(+e[5]):p(+e[5]));const o=P(+e[2]),a=+e[3]/100,s=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return C(M,t,e,n)}(o,a,s):"hsv"===e[1]?function(t,e,n){return C(v,t,e,n)}(o,a,s):k(o,a,s),{r:n[0],g:n[1],b:n[2],a:i}}(t)}class L{constructor(t){if(t instanceof L)return t;const e=typeof t;let n;var i,o,a;"object"===e?n=D(t):"string"===e&&(a=(i=t).length,"#"===i[0]&&(4===a||5===a?o={r:255&17*r[i[1]],g:255&17*r[i[2]],b:255&17*r[i[3]],a:5===a?17*r[i[4]]:255}:7!==a&&9!==a||(o={r:r[i[1]]<<4|r[i[2]],g:r[i[3]]<<4|r[i[4]],b:r[i[5]]<<4|r[i[6]],a:9===a?r[i[7]]<<4|r[i[8]]:255})),n=o||function(t){E||(E=function(){const t={},e=Object.keys(T),n=Object.keys(w);let i,o,a,s,r;for(i=0;i<e.length;i++){for(s=r=e[i],o=0;o<n.length;o++)a=n[o],r=r.replace(a,w[a]);a=parseInt(T[s],16),t[r]=[a>>16&255,a>>8&255,255&a]}return t}(),E.transparent=[0,0,0,0]);const e=E[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||O(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=I(this._rgb);return t&&(t.a=m(t.a)),t}set rgb(t){this._rgb=D(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${m(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?function(t){var e=function(t){return d(t.r)&&d(t.g)&&d(t.b)&&d(t.a)}(t)?c:h;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=S(t),n=e[0],i=b(e[1]),o=b(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${o}%, ${m(t.a)})`:`hsl(${n}, ${i}%, ${o}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const i=n.rgb,o=t.rgb;let a;const s=e===a?.5:e,r=2*s-1,l=i.a-o.a,c=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;a=1-c,i.r=255&c*i.r+a*o.r+.5,i.g=255&c*i.g+a*o.g+.5,i.b=255&c*i.b+a*o.b+.5,i.a=s*i.a+(1-s)*o.a,n.rgb=i}return n}clone(){return new L(this.rgb)}alpha(t){return this._rgb.a=p(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=u(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return A(this._rgb,2,t),this}darken(t){return A(this._rgb,2,-t),this}saturate(t){return A(this._rgb,1,t),this}desaturate(t){return A(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=S(t);n[0]=P(n[0]+e),n=k(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function R(t){return new L(t)}const N=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function F(t){return N(t)?t:R(t)}function B(t){return N(t)?t:R(t).saturate(.5).darken(.1).hexString()}function z(){}const V=function(){let t=0;return function(){return t++}}();function H(t){return null==t}function j(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function U(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const W=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function q(t,e){return W(t)?t:e}function $(t,e){return void 0===t?e:t}const Y=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,X=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function G(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function K(t,e,n,i){let o,a,s;if(j(t))if(a=t.length,i)for(o=a-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o<a;o++)e.call(n,t[o],o);else if(U(t))for(s=Object.keys(t),a=s.length,o=0;o<a;o++)e.call(n,t[s[o]],s[o])}function Z(t,e){let n,i,o,a;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(o=t[n],a=e[n],o.datasetIndex!==a.datasetIndex||o.index!==a.index)return!1;return!0}function J(t){if(j(t))return t.map(J);if(U(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let o=0;for(;o<i;++o)e[n[o]]=J(t[n[o]]);return e}return t}function Q(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function tt(t,e,n,i){if(!Q(t))return;const o=e[t],a=n[t];U(o)&&U(a)?et(o,a,i):e[t]=J(a)}function et(t,e,n){const i=j(e)?e:[e],o=i.length;if(!U(t))return t;const a=(n=n||{}).merger||tt;for(let s=0;s<o;++s){if(!U(e=i[s]))continue;const o=Object.keys(e);for(let i=0,s=o.length;i<s;++i)a(o[i],t,e,n)}return t}function nt(t,e){return et(t,e,{merger:it})}function it(t,e,n){if(!Q(t))return;const i=e[t],o=n[t];U(i)&&U(o)?nt(i,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=J(o))}function ot(t,e){const n=t.indexOf(".",e);return-1===n?t.length:n}function at(t,e){if(""===e)return t;let n=0,i=ot(e,n);for(;t&&i>n;)t=t[e.substr(n,i-n)],n=i+1,i=ot(e,n);return t}function st(t){return t.charAt(0).toUpperCase()+t.slice(1)}const rt=t=>void 0!==t,lt=t=>"function"==typeof t,ct=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},ht=Object.create(null),dt=Object.create(null);function ut(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function gt(t,e,n){return"string"==typeof e?et(ut(t,e),n):et(ut(t,""),e)}var ft=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>B(e.backgroundColor),this.hoverBorderColor=(t,e)=>B(e.borderColor),this.hoverColor=(t,e)=>B(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return gt(this,t,e)}get(t){return ut(this,t)}describe(t,e){return gt(dt,t,e)}override(t,e){return gt(ht,t,e)}route(t,e,n,i){const o=ut(this,t),a=ut(this,n),s="_"+e;Object.defineProperties(o,{[s]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[s],e=a[i];return U(t)?Object.assign({},e,t):$(t,e)},set(t){this[s]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const pt=Math.PI,mt=2*pt,bt=mt+pt,xt=Number.POSITIVE_INFINITY,yt=pt/180,_t=pt/2,vt=pt/4,Mt=2*pt/3,St=Math.log10,Ct=Math.sign;function kt(t){const e=Math.pow(10,Math.floor(St(t))),n=t/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Pt(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i==0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}function wt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Tt(t,e,n){return Math.abs(t-e)<n}function Et(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function At(t,e,n){let i,o,a;for(i=0,o=t.length;i<o;i++)a=t[i][n],isNaN(a)||(e.min=Math.min(e.min,a),e.max=Math.max(e.max,a))}function It(t){return t*(pt/180)}function Dt(t){return t*(180/pt)}function Ot(t){if(!W(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Lt(t,e){const n=e.x-t.x,i=e.y-t.y,o=Math.sqrt(n*n+i*i);let a=Math.atan2(i,n);return a<-.5*pt&&(a+=mt),{angle:a,distance:o}}function Rt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Nt(t,e){return(t-e+bt)%mt-pt}function Ft(t){return(t%mt+mt)%mt}function Bt(t,e,n,i){const o=Ft(t),a=Ft(e),s=Ft(n),r=Ft(a-o),l=Ft(s-o),c=Ft(o-a),h=Ft(o-s);return o===a||o===s||i&&a===s||r>l&&c<h}function zt(t,e,n){return Math.max(e,Math.min(n,t))}function Vt(t){return zt(t,-32768,32767)}function Ht(t){return!t||H(t.size)||H(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function jt(t,e,n,i,o){let a=e[o];return a||(a=e[o]=t.measureText(o).width,n.push(o)),a>i&&(i=a),i}function Ut(t,e,n,i){let o=(i=i||{}).data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(o=i.data={},a=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let s=0;const r=n.length;let l,c,h,d,u;for(l=0;l<r;l++)if(d=n[l],null!=d&&!0!==j(d))s=jt(t,o,a,s,d);else if(j(d))for(c=0,h=d.length;c<h;c++)u=d[c],null==u||j(u)||(s=jt(t,o,a,s,u));t.restore();const g=a.length/2;if(g>n.length){for(l=0;l<g;l++)delete o[a[l]];a.splice(0,g)}return s}function Wt(t,e,n){const i=t.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((e-o)*i)/i+o}function qt(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function $t(t,e,n,i){let o,a,s,r,l;const c=e.pointStyle,h=e.rotation,d=e.radius;let u=(h||0)*yt;if(c&&"object"==typeof c&&(o=c.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,i),t.rotate(u),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(n,i,d,0,mt),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(u)*d,i-Math.cos(u)*d),u+=Mt,t.lineTo(n+Math.sin(u)*d,i-Math.cos(u)*d),u+=Mt,t.lineTo(n+Math.sin(u)*d,i-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,a=Math.cos(u+vt)*r,s=Math.sin(u+vt)*r,t.arc(n-a,i-s,l,u-pt,u-_t),t.arc(n+s,i-a,l,u-_t,u),t.arc(n+a,i+s,l,u,u+_t),t.arc(n-s,i+a,l,u+_t,u+pt),t.closePath();break;case"rect":if(!h){r=Math.SQRT1_2*d,t.rect(n-r,i-r,2*r,2*r);break}u+=vt;case"rectRot":a=Math.cos(u)*d,s=Math.sin(u)*d,t.moveTo(n-a,i-s),t.lineTo(n+s,i-a),t.lineTo(n+a,i+s),t.lineTo(n-s,i+a),t.closePath();break;case"crossRot":u+=vt;case"cross":a=Math.cos(u)*d,s=Math.sin(u)*d,t.moveTo(n-a,i-s),t.lineTo(n+a,i+s),t.moveTo(n+s,i-a),t.lineTo(n-s,i+a);break;case"star":a=Math.cos(u)*d,s=Math.sin(u)*d,t.moveTo(n-a,i-s),t.lineTo(n+a,i+s),t.moveTo(n+s,i-a),t.lineTo(n-s,i+a),u+=vt,a=Math.cos(u)*d,s=Math.sin(u)*d,t.moveTo(n-a,i-s),t.lineTo(n+a,i+s),t.moveTo(n+s,i-a),t.lineTo(n-s,i+a);break;case"line":a=Math.cos(u)*d,s=Math.sin(u)*d,t.moveTo(n-a,i-s),t.lineTo(n+a,i+s);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(u)*d,i+Math.sin(u)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function Yt(t,e,n){return n=n||.5,t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Xt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Gt(t){t.restore()}function Kt(t,e,n,i,o){if(!e)return t.lineTo(n.x,n.y);if("middle"===o){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===o!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Zt(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Jt(t,e,n,i,o,a={}){const s=j(e)?e:[e],r=a.strokeWidth>0&&""!==a.strokeColor;let l,c;for(t.save(),a.translation&&t.translate(a.translation[0],a.translation[1]),H(a.rotation)||t.rotate(a.rotation),t.font=o.string,a.color&&(t.fillStyle=a.color),a.textAlign&&(t.textAlign=a.textAlign),a.textBaseline&&(t.textBaseline=a.textBaseline),l=0;l<s.length;++l){if(c=s[l],r&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),H(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(c,n,i,a.maxWidth)),t.fillText(c,n,i,a.maxWidth),a.strikethrough||a.underline){const e=t.measureText(c),o=n-e.actualBoundingBoxLeft,s=n+e.actualBoundingBoxRight,r=i-e.actualBoundingBoxAscent,l=i+e.actualBoundingBoxDescent,h=a.strikethrough?(r+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(o,h),t.lineTo(s,h),t.stroke()}i+=o.lineHeight}t.restore()}function Qt(t,e){const{x:n,y:i,w:o,h:a,radius:s}=e;t.arc(n+s.topLeft,i+s.topLeft,s.topLeft,-_t,pt,!0),t.lineTo(n,i+a-s.bottomLeft),t.arc(n+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,pt,_t,!0),t.lineTo(n+o-s.bottomRight,i+a),t.arc(n+o-s.bottomRight,i+a-s.bottomRight,s.bottomRight,_t,0,!0),t.lineTo(n+o,i+s.topRight),t.arc(n+o-s.topRight,i+s.topRight,s.topRight,0,-_t,!0),t.lineTo(n+s.topLeft,i)}function te(t,e,n){n=n||(n=>t[n]<e);let i,o=t.length-1,a=0;for(;o-a>1;)i=a+o>>1,n(i)?a=i:o=i;return{lo:a,hi:o}}const ee=(t,e,n)=>te(t,n,i=>t[i][e]<n),ne=(t,e,n)=>te(t,n,i=>t[i][e]>=n);function ie(t,e,n){let i=0,o=t.length;for(;i<o&&t[i]<e;)i++;for(;o>i&&t[o-1]>n;)o--;return i>0||o<t.length?t.slice(i,o):t}const oe=["push","pop","shift","splice","unshift"];function ae(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),oe.forEach(e=>{const n="_onData"+st(e),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const o=i.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[n]&&t[n](...e)}),o}})}))}function se(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,o=i.indexOf(e);-1!==o&&i.splice(o,1),i.length>0||(oe.forEach(e=>{delete t[e]}),delete t._chartjs)}function re(t){const e=new Set;let n,i;for(n=0,i=t.length;n<i;++n)e.add(t[n]);if(e.size===i)return t;const o=[];return e.forEach(t=>{o.push(t)}),o}function le(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ce(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const he=t=>window.getComputedStyle(t,null);function de(t,e){return he(t).getPropertyValue(e)}const ue=["top","right","bottom","left"];function ge(t,e,n){const i={};n=n?"-"+n:"";for(let o=0;o<4;o++){const a=ue[o];i[a]=parseFloat(t[e+"-"+a+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function fe(t,e){const{canvas:n,currentDevicePixelRatio:i}=e,o=he(n),a="border-box"===o.boxSizing,s=ge(o,"padding"),r=ge(o,"border","width"),{x:l,y:c,box:h}=function(t,e){const n=t.native||t,i=n.touches,o=i&&i.length?i[0]:n,{offsetX:a,offsetY:s}=o;let r,l,c=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(a,s,n.target))r=a,l=s;else{const t=e.getBoundingClientRect();r=o.clientX-t.left,l=o.clientY-t.top,c=!0}return{x:r,y:l,box:c}}(t,n),d=s.left+(h&&r.left),u=s.top+(h&&r.top);let{width:g,height:f}=e;return a&&(g-=s.width+r.width,f-=s.height+r.height),{x:Math.round((l-d)/g*n.width/i),y:Math.round((c-u)/f*n.height/i)}}const pe=t=>Math.round(10*t)/10;function me(t,e,n,i){const o=he(t),a=ge(o,"margin"),s=ce(o.maxWidth,t,"clientWidth")||xt,r=ce(o.maxHeight,t,"clientHeight")||xt,l=function(t,e,n){let i,o;if(void 0===e||void 0===n){const a=le(t);if(a){const t=a.getBoundingClientRect(),s=he(a),r=ge(s,"border","width"),l=ge(s,"padding");e=t.width-l.width-r.width,n=t.height-l.height-r.height,i=ce(s.maxWidth,a,"clientWidth"),o=ce(s.maxHeight,a,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||xt,maxHeight:o||xt}}(t,e,n);let{width:c,height:h}=l;if("content-box"===o.boxSizing){const t=ge(o,"border","width"),e=ge(o,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-a.width),h=Math.max(0,i?Math.floor(c/i):h-a.height),c=pe(Math.min(c,s,l.maxWidth)),h=pe(Math.min(h,r,l.maxHeight)),c&&!h&&(h=pe(c/2)),{width:c,height:h}}function be(t,e,n){const i=e||1,o=Math.floor(t.height*i),a=Math.floor(t.width*i);t.height=o/i,t.width=a/i;const s=t.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=t.height+"px",s.style.width=t.width+"px"),(t.currentDevicePixelRatio!==i||s.height!==o||s.width!==a)&&(t.currentDevicePixelRatio=i,s.height=o,s.width=a,t.ctx.setTransform(i,0,0,i,0,0),!0)}const xe=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function ye(t,e){const n=de(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function _e(t,e){return"native"in t?{x:t.x,y:t.y}:fe(t,e)}function ve(t,e,n,i){const{controller:o,data:a,_sorted:s}=t,r=o._cachedMeta.iScale;if(r&&e===r.axis&&s&&a.length){const t=r._reversePixels?ne:ee;if(!i)return t(a,e,n);if(o._sharedOptions){const i=a[0],o="function"==typeof i.getRange&&i.getRange(e);if(o){const i=t(a,e,n-o),s=t(a,e,n+o);return{lo:i.lo,hi:s.hi}}}}return{lo:0,hi:a.length-1}}function Me(t,e,n,i,o){const a=t.getSortedVisibleDatasetMetas(),s=n[e];for(let t=0,n=a.length;t<n;++t){const{index:n,data:r}=a[t],{lo:l,hi:c}=ve(a[t],e,s,o);for(let t=l;t<=c;++t){const e=r[t];e.skip||i(e,n,t)}}}function Se(t,e,n,i){const o=[];return Yt(e,t.chartArea,t._minPadding)?(Me(t,n,e,(function(t,n,a){t.inRange(e.x,e.y,i)&&o.push({element:t,datasetIndex:n,index:a})}),!0),o):o}function Ce(t,e,n,i,o){const a=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const o=e?Math.abs(t.x-i.x):0,a=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}(n);let s=Number.POSITIVE_INFINITY,r=[];return Yt(e,t.chartArea,t._minPadding)?(Me(t,n,e,(function(t,n,l){if(i&&!t.inRange(e.x,e.y,o))return;const c=t.getCenterPoint(o),h=a(e,c);h<s?(r=[{element:t,datasetIndex:n,index:l}],s=h):h===s&&r.push({element:t,datasetIndex:n,index:l})})),r):r}function ke(t,e,n,i){const o=_e(e,t),a=[],s=n.axis,r="x"===s?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,o,a;for(let t=0,s=n.length;t<s;++t){({index:i,data:o}=n[t]);for(let t=0,n=o.length;t<n;++t)a=o[t],a.skip||e(a,i,t)}}(t,(t,e,n)=>{t[r](o[s],i)&&a.push({element:t,datasetIndex:e,index:n}),t.inRange(o.x,o.y,i)&&(l=!0)}),n.intersect&&!l?[]:a}var Pe={modes:{index(t,e,n,i){const o=_e(e,t),a=n.axis||"x",s=n.intersect?Se(t,o,a,i):Ce(t,o,a,!1,i),r=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=s[0].index,n=t.data[e];n&&!n.skip&&r.push({element:n,datasetIndex:t.index,index:e})}),r):[]},dataset(t,e,n,i){const o=_e(e,t),a=n.axis||"xy";let s=n.intersect?Se(t,o,a,i):Ce(t,o,a,!1,i);if(s.length>0){const e=s[0].datasetIndex,n=t.getDatasetMeta(e).data;s=[];for(let t=0;t<n.length;++t)s.push({element:n[t],datasetIndex:e,index:t})}return s},point:(t,e,n,i)=>Se(t,_e(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>Ce(t,_e(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>(n.axis="x",ke(t,e,n,i)),y:(t,e,n,i)=>(n.axis="y",ke(t,e,n,i))}};const we=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Te=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ee(t,e){const n=(""+t).match(we);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function Ae(t,e){const n={},i=U(e),o=i?Object.keys(e):e,a=U(t)?i?n=>$(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of o)n[t]=+a(t)||0;return n}function Ie(t){return Ae(t,{top:"y",right:"x",bottom:"y",left:"x"})}function De(t){return Ae(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Oe(t){const e=Ie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Le(t,e){t=t||{},e=e||ft.font;let n=$(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=$(t.style,e.style);i&&!(""+i).match(Te)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const o={family:$(t.family,e.family),lineHeight:Ee($(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:$(t.weight,e.weight),string:""};return o.string=Ht(o),o}function Re(t,e,n,i){let o,a,s,r=!0;for(o=0,a=t.length;o<a;++o)if(s=t[o],void 0!==s&&(void 0!==e&&"function"==typeof s&&(s=s(e),r=!1),void 0!==n&&j(s)&&(s=s[n%s.length],r=!1),void 0!==s))return i&&!r&&(i.cacheable=!1),s}function Ne(t,e){const{min:n,max:i}=t;return{min:n-Math.abs(X(e,n)),max:i+X(e,i)}}const Fe=["left","top","right","bottom"];function Be(t,e){return t.filter(t=>t.pos===e)}function ze(t,e){return t.filter(t=>-1===Fe.indexOf(t.pos)&&t.box.axis===e)}function Ve(t,e){return t.sort((t,n)=>{const i=e?n:t,o=e?t:n;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function He(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function je(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 Ue(t,e,n){const i=n.box,o=t.maxPadding;U(n.pos)||(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?i.height:i.width,t[n.pos]+=n.size),i.getPadding&&je(o,i.getPadding());const a=Math.max(0,e.outerWidth-He(o,t,"left","right")),s=Math.max(0,e.outerHeight-He(o,t,"top","bottom")),r=a!==t.w,l=s!==t.h;return t.w=a,t.h=s,n.horizontal?{same:r,other:l}:{same:l,other:r}}function We(t,e){const n=e.maxPadding;return function(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{i[t]=Math.max(e[t],n[t])}),i}(t?["left","right"]:["top","bottom"])}function qe(t,e,n){const i=[];let o,a,s,r,l,c;for(o=0,a=t.length,l=0;o<a;++o){s=t[o],r=s.box,r.update(s.width||e.w,s.height||e.h,We(s.horizontal,e));const{same:a,other:h}=Ue(e,n,s);l|=a&&i.length,c=c||h,r.fullSize||i.push(s)}return l&&qe(i,e,n)||c}function $e(t,e,n){const i=n.padding;let o,a,s,r,l=e.x,c=e.y;for(o=0,a=t.length;o<a;++o)s=t[o],r=s.box,s.horizontal?(r.left=r.fullSize?i.left:e.left,r.right=r.fullSize?n.outerWidth-i.right:e.left+e.w,r.top=c,r.bottom=c+r.height,r.width=r.right-r.left,c=r.bottom):(r.left=l,r.right=l+r.width,r.top=r.fullSize?i.top:e.top,r.bottom=r.fullSize?n.outerHeight-i.right:e.top+e.h,r.height=r.bottom-r.top,l=r.right);e.x=l,e.y=c}ft.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var Ye={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 n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const o=Oe(t.options.layout.padding),a=Math.max(e-o.width,0),s=Math.max(n-o.height,0),r=function(t){const e=function(t){const e=[];let n,i,o;for(n=0,i=(t||[]).length;n<i;++n)o=t[n],e.push({index:n,box:o,pos:o.position,horizontal:o.isHorizontal(),weight:o.weight});return e}(t),n=Ve(e.filter(t=>t.box.fullSize),!0),i=Ve(Be(e,"left"),!0),o=Ve(Be(e,"right")),a=Ve(Be(e,"top"),!0),s=Ve(Be(e,"bottom")),r=ze(e,"x"),l=ze(e,"y");return{fullSize:n,leftAndTop:i.concat(a),rightAndBottom:o.concat(l).concat(s).concat(r),chartArea:Be(e,"chartArea"),vertical:i.concat(o).concat(l),horizontal:a.concat(s).concat(r)}}(t.boxes),l=r.vertical,c=r.horizontal;K(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:o,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/h,hBoxMaxHeight:s/2}),u=Object.assign({},o);je(u,Oe(i));const g=Object.assign({maxPadding:u,w:a,h:s,x:o.left,y:o.top},o);!function(t,e){let n,i,o;for(n=0,i=t.length;n<i;++n)o=t[n],o.horizontal?(o.width=o.box.fullSize&&e.availableWidth,o.height=e.hBoxMaxHeight):(o.width=e.vBoxMaxWidth,o.height=o.box.fullSize&&e.availableHeight)}(l.concat(c),d),qe(r.fullSize,g,d),qe(l,g,d),qe(c,g,d)&&qe(l,g,d),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(g),$e(r.leftAndTop,g,d),g.x+=g.w,g.y+=g.h,$e(r.rightAndBottom,g,d),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},K(r.chartArea,e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(g.w,g.h)})}};class Xe{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}}class Ge extends Xe{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const Ke={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ze=t=>null===t||""===t,Je=!!xe&&{passive:!0};function Qe(t,e,n){t.canvas.removeEventListener(e,n,Je)}function tn(t,e,n){const i=t.canvas,o=i&&le(i)||i,a=new MutationObserver(t=>{const e=le(o);t.forEach(t=>{for(let i=0;i<t.addedNodes.length;i++){const a=t.addedNodes[i];a!==o&&a!==e||n(t.target)}})});return a.observe(document,{childList:!0,subtree:!0}),a}function en(t,e,n){const i=t.canvas,o=i&&le(i);if(!o)return;const a=new MutationObserver(t=>{t.forEach(t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===i){n();break}})});return a.observe(o,{childList:!0}),a}const nn=new Map;let on=0;function an(){const t=window.devicePixelRatio;t!==on&&(on=t,nn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function sn(t,n,i){const o=t.canvas,a=o&&le(o);if(!a)return;const s=e((t,e)=>{const n=a.clientWidth;i(t,e),n<a.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||s(n,i)});return r.observe(a),function(t,e){nn.size||window.addEventListener("resize",an),nn.set(t,e)}(t,s),r}function rn(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){nn.delete(t),nn.size||window.removeEventListener("resize",an)}(t)}function ln(t,n,i){const o=t.canvas,a=e(e=>{null!==t.ctx&&i(function(t,e){const n=Ke[t.type]||t.type,{x:i,y:o}=fe(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==o?o:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,n){t.addEventListener(e,n,Je)}(o,n,a),a}class cn extends Xe{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),o=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ze(o)){const e=ye(t,"width");void 0!==e&&(t.width=e)}if(Ze(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ye(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const n=e.$chartjs.initial;["height","width"].forEach(t=>{const i=n[t];H(i)?e.removeAttribute(t):e.setAttribute(t,i)});const i=n.style||{};return Object.keys(i).forEach(t=>{e.style[t]=i[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),o={attach:tn,detach:en,resize:sn}[e]||ln;i[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:rn,detach:rn,resize:rn}[e]||Qe)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return me(t,e,n,i)}isAttached(t){const e=le(t);return!(!e||!le(e))}}var hn=Object.freeze({__proto__:null,BasePlatform:Xe,BasicPlatform:Ge,DomPlatform:cn});const dn=t=>0===t||1===t,un=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*mt/n),gn=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*mt/n)+1,fn={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*_t),easeOutSine:t=>Math.sin(t*_t),easeInOutSine:t=>-.5*(Math.cos(pt*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=>dn(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>dn(t)?t:un(t,.075,.3),easeOutElastic:t=>dn(t)?t:gn(t,.075,.3),easeInOutElastic(t){const e=.1125;return dn(t)?t:t<.5?.5*un(2*t,e,.45):.5+.5*gn(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-fn.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*fn.easeInBounce(2*t):.5*fn.easeOutBounce(2*t-1)+.5},pn="transparent",mn={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=F(t||pn),o=i.valid&&F(e||pn);return o&&o.valid?o.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class bn{constructor(t,e,n,i){const o=e[n];i=Re([t.to,i,o,t.from]);const a=Re([t.from,o,i]);this._active=!0,this._fn=t.fn||mn[t.type||typeof a],this._easing=fn[t.easing]||fn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){const i=this;if(i._active){i._notify(!1);const o=i._target[i._prop],a=n-i._start,s=i._duration-a;i._start=n,i._duration=Math.floor(Math.max(s,t.duration)),i._total+=a,i._loop=!!t.loop,i._to=Re([t.to,e,o,t.from]),i._from=Re([t.from,o,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,n=t-e._start,i=e._duration,o=e._prop,a=e._from,s=e._loop,r=e._to;let l;if(e._active=a!==r&&(s||n<i),!e._active)return e._target[o]=r,void e._notify(!0);n<0?e._target[o]=a:(l=n/i%2,l=s&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[o]=e._fn(a,r,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}ft.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const xn=Object.keys(ft.animation);ft.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ft.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ft.describe("animations",{_fallback:"animation"}),ft.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}}}});class yn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!U(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const i=t[n];if(!U(i))return;const o={};for(const t of xn)o[t]=i[t];(j(i.properties)&&i.properties||[n]).forEach(t=>{t!==n&&e.has(t)||e.set(t,o)})})}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!i)return[];const o=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const o=t[i[e]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();let r;for(r=a.length-1;r>=0;--r){const l=a[r];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let h=o[l];const d=n.get(l);if(h){if(d&&h.active()){h.update(d,c,s);continue}h.cancel()}d&&d.duration?(o[l]=h=new bn(d,t,l,c),i.push(h)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(s.add(this._chart,n),!0):void 0}}function _n(t,e){const n=t&&t.options||{},i=n.reverse,o=void 0===n.min?e:0,a=void 0===n.max?e:0;return{start:i?a:o,end:i?o:a}}function vn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let o,a;for(o=0,a=i.length;o<a;++o)n.push(i[o].index);return n}function Mn(t,e,n,i){const o=t.keys,a="single"===i.mode;let s,r,l,c;if(null!==e){for(s=0,r=o.length;s<r;++s){if(l=+o[s],l===n){if(i.all)continue;break}c=t.values[l],W(c)&&(a||0===e||Ct(e)===Ct(c))&&(e+=c)}return e}}function Sn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Cn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function kn(t,e,n){for(const i of e.getMatchingVisibleMetas("bar").reverse()){const e=t[i.index];if(n&&e>0||!n&&e<0)return i.index}return null}function Pn(t,e){const{chart:n,_cachedMeta:i}=t,o=n._stacks||(n._stacks={}),{iScale:a,vScale:s,index:r}=i,l=a.axis,c=s.axis,h=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(a,s,i),d=e.length;let u;for(let t=0;t<d;++t){const n=e[t],{[l]:i,[c]:a}=n;u=(n._stacks||(n._stacks={}))[c]=Cn(o,h,i),u[r]=a,u._top=kn(u,s,!0),u._bottom=kn(u,s,!1)}}function wn(t,e){const n=t.scales;return Object.keys(n).filter(t=>n[t].axis===e).shift()}function Tn(t,e){e=e||t._parsed;for(const n of e){const e=n._stacks;if(!e||void 0===e[t.vScale.id]||void 0===e[t.vScale.id][t.index])return;delete e[t.vScale.id][t.index]}}const En=t=>"reset"===t||"none"===t,An=(t,e)=>e?t:Object.assign({},t);class In{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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=Sn(e.vScale,e),t.addElements()}updateIndex(t){this.index!==t&&Tn(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,n=t._cachedMeta,i=t.getDataset(),o=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,a=n.xAxisID=$(i.xAxisID,wn(e,"x")),s=n.yAxisID=$(i.yAxisID,wn(e,"y")),r=n.rAxisID=$(i.rAxisID,wn(e,"r")),l=n.indexAxis,c=n.iAxisID=o(l,a,s,r),h=n.vAxisID=o(l,s,a,r);n.xScale=t.getScaleForId(a),n.yScale=t.getScaleForId(s),n.rScale=t.getScaleForId(r),n.iScale=t.getScaleForId(c),n.vScale=t.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&&se(this._data,this),t._stacked&&Tn(t)}_dataCheck(){const t=this,e=t.getDataset(),n=e.data||(e.data=[]),i=t._data;if(U(n))t._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,o,a;for(i=0,o=e.length;i<o;++i)a=e[i],n[i]={x:a,y:t[a]};return n}(n);else if(i!==n){if(i){se(i,t);const e=t._cachedMeta;Tn(e),e._parsed=[]}n&&Object.isExtensible(n)&&ae(n,t),t._syncList=[],t._data=n}}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,n=e._cachedMeta,i=e.getDataset();let o=!1;e._dataCheck();const a=n._stacked;n._stacked=Sn(n.vScale,n),n.stack!==i.stack&&(o=!0,Tn(n),n.stack=i.stack),e._resyncElements(t),(o||a!==n._stacked)&&Pn(e,n._parsed)}configure(){const t=this,e=t.chart.config,n=e.datasetScopeKeys(t._type),i=e.getOptionScopes(t.getDataset(),n,!0);t.options=e.createResolver(i,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const n=this,{_cachedMeta:i,_data:o}=n,{iScale:a,_stacked:s}=i,r=a.axis;let l,c,h,d=0===t&&e===o.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===n._parsing)i._parsed=o,i._sorted=!0,h=o;else{h=j(o[t])?n.parseArrayData(i,o,t,e):U(o[t])?n.parseObjectData(i,o,t,e):n.parsePrimitiveData(i,o,t,e);const a=()=>null===c[r]||u&&c[r]<u[r];for(l=0;l<e;++l)i._parsed[l+t]=c=h[l],d&&(a()&&(d=!1),u=c);i._sorted=d}s&&Pn(n,h)}parsePrimitiveData(t,e,n,i){const{iScale:o,vScale:a}=t,s=o.axis,r=a.axis,l=o.getLabels(),c=o===a,h=new Array(i);let d,u,g;for(d=0,u=i;d<u;++d)g=d+n,h[d]={[s]:c||o.parse(l[g],g),[r]:a.parse(e[g],g)};return h}parseArrayData(t,e,n,i){const{xScale:o,yScale:a}=t,s=new Array(i);let r,l,c,h;for(r=0,l=i;r<l;++r)c=r+n,h=e[c],s[r]={x:o.parse(h[0],c),y:a.parse(h[1],c)};return s}parseObjectData(t,e,n,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:r="y"}=this._parsing,l=new Array(i);let c,h,d,u;for(c=0,h=i;c<h;++c)d=c+n,u=e[d],l[c]={x:o.parse(at(u,s),d),y:a.parse(at(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,o=this._cachedMeta,a=e[t.axis];return Mn({keys:vn(i,!0),values:e._stacks[t.axis]},a,o.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const o=n[e.axis];let a=null===o?NaN:o;const s=i&&n._stacks[e.axis];i&&s&&(i.values=s,t.min=Math.min(t.min,a),t.max=Math.max(t.max,a),a=Mn(i,o,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const n=this,i=n._cachedMeta,o=i._parsed,a=i._sorted&&t===i.iScale,s=o.length,r=n._getOtherScale(t),l=e&&i._stacked&&{keys:vn(n.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=function(t){const{min:e,max:n,minDefined:i,maxDefined:o}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(r);let u,g,f,p;function m(){return f=o[u],g=f[t.axis],p=f[r.axis],!W(g)||h>p||d<p}for(u=0;u<s&&(m()||(n.updateRangeFromParsed(c,t,f,l),!a));++u);if(a)for(u=s-1;u>=0;--u)if(!m()){n.updateRangeFromParsed(c,t,f,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,o,a;for(i=0,o=e.length;i<o;++i)a=e[i][t.axis],W(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const e=this,n=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),n._clip=function(t){let e,n,i,o;return U(t)?(e=t.top,n=t.right,i=t.bottom,o=t.left):e=n=i=o=t,{top:e,right:n,bottom:i,left:o}}($(e.options.clip,function(t,e,n){if(!1===n)return!1;const i=_n(t,n),o=_n(e,n);return{top:o.end,right:i.end,bottom:o.start,left:i.start}}(n.xScale,n.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,n=t.chart,i=t._cachedMeta,o=i.data||[],a=n.chartArea,s=[],r=t._drawStart||0,l=t._drawCount||o.length-r;let c;for(i.dataset&&i.dataset.draw(e,a,r,l),c=r;c<r+l;++c){const t=o[c];t.active?s.push(t):t.draw(e,a)}for(c=0;c<s.length;++c)s[c].draw(e,a)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this,o=i.getDataset();let a;if(t>=0&&t<i._cachedMeta.data.length){const e=i._cachedMeta.data[t];a=e.$context||(e.$context=function(t,e,n){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(i.getContext(),t,e)),a.parsed=i.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t}else a=i.$context||(i.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(i.chart.getContext(),i.index)),a.dataset=o,a.index=a.datasetIndex=i.index;return a.active=!!e,a.mode=n,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i=this,o="active"===e,a=i._cachedDataOpts,s=t+"-"+e,r=a[s],l=i.enableOptionSharing&&rt(n);if(r)return An(r,l);const c=i.chart.config,h=c.datasetElementScopeKeys(i._type,t),d=o?[t+"Hover","hover",t,""]:[t,""],u=c.getOptionScopes(i.getDataset(),h),g=Object.keys(ft.elements[t]),f=c.resolveNamedOptions(u,g,()=>i.getContext(n,o),d);return f.$shared&&(f.$shared=l,a[s]=Object.freeze(An(f,l))),f}_resolveAnimations(t,e,n){const i=this,o=i.chart,a=i._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let l;if(!1!==o.options.animation){const o=i.chart.config,a=o.datasetAnimationScopeKeys(i._type,e),s=o.getOptionScopes(i.getDataset(),a);l=o.createResolver(s,i.getContext(t,n,e))}const c=new yn(o,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||En(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){En(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!En(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const o=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,n=e._data,i=e._cachedMeta.data;for(const[t,n,i]of e._syncList)e[t](n,i);e._syncList=[];const o=i.length,a=n.length,s=Math.min(a,o);a>o?e._insertElements(o,a-o,t):a<o&&e._removeElements(a,o-a),s&&e.parse(0,s)}_insertElements(t,e,n=!0){const i=this,o=i._cachedMeta,a=o.data,s=t+e;let r;const l=t=>{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(l(a),r=t;r<s;++r)a[r]=new i.dataElementType;i._parsing&&l(o._parsed),i.parse(t,e),n&&i.updateElements(a,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Tn(n,i)}n.data.splice(t,e)}_onDataPush(){const t=arguments.length;this._syncList.push(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._syncList.push(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._syncList.push(["_removeElements",0,1])}_onDataSplice(t,e){this._syncList.push(["_removeElements",t,e]),this._syncList.push(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._syncList.push(["_insertElements",0,arguments.length])}}In.defaults={},In.prototype.datasetElementType=null,In.prototype.dataElementType=null;class Dn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return wt(this.x)&&wt(this.y)}getProps(t,e){const n=this,i=this.$animations;if(!e||!i)return n;const o={};return t.forEach(t=>{o[t]=i[t]&&i[t].active()?i[t]._to:n[t]}),o}}Dn.defaults={},Dn.defaultRoutes=void 0;const On=new Map;function Ln(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=On.get(n);return i||(i=new Intl.NumberFormat(t,e),On.set(n,i)),i}(e,n).format(t)}const Rn={values:t=>j(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let o,a=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(o="scientific"),a=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}(t,n)}const s=St(Math.abs(a)),r=Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ln(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(St(t)));return 1===i||2===i||5===i?Rn.numeric.call(this,t,e,n):""}};var Nn={formatters:Rn};function Fn(t,e,n,i,o){const a=$(i,0),s=Math.min($(o,t.length),t.length);let r,l,c,h=0;for(n=Math.ceil(n),o&&(r=o-i,n=r/Math.floor(r/n)),c=a;c<0;)h++,c=Math.round(a+h*n);for(l=Math.max(a,0);l<s;l++)l===c&&(e.push(t[l]),h++,c=Math.round(a+h*n))}ft.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Nn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ft.route("scale.ticks","color","","color"),ft.route("scale.grid","color","","borderColor"),ft.route("scale.grid","borderColor","","borderColor"),ft.route("scale.title","color","","color"),ft.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ft.describe("scales",{_fallback:"scale"});const Bn=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function zn(t,e){const n=[],i=t.length/e,o=t.length;let a=0;for(;a<o;a+=i)n.push(t[Math.floor(a)]);return n}function Vn(t,e,n){const i=t.ticks.length,o=Math.min(e,i-1),a=t._startPixel,s=t._endPixel,r=1e-6;let l,c=t.getPixelForTick(o);if(!(n&&(l=1===i?Math.max(c-a,s-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,c+=o<e?l:-l,c<a-r||c>s+r)))return c}function Hn(t){return t.drawTicks?t.tickLength:0}function jn(t,e){if(!t.display)return 0;const n=Le(t.font,e),i=Oe(t.padding);return(j(t.text)?t.text.length:1)*n.lineHeight+i.height}function Un(t,e,n){let o=i(t);return(n&&"right"!==e||!n&&"right"===e)&&(o=(t=>"left"===t?"right":"right"===t?"left":t)(o)),o}class Wn extends Dn{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){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=q(t,Number.POSITIVE_INFINITY),e=q(e,Number.NEGATIVE_INFINITY),n=q(n,Number.POSITIVE_INFINITY),i=q(i,Number.NEGATIVE_INFINITY),{min:q(t,n),max:q(e,i),minDefined:W(t),maxDefined:W(e)}}getMinMax(t){const e=this;let n,{min:i,max:o,minDefined:a,maxDefined:s}=e.getUserBounds();if(a&&s)return{min:i,max:o};const r=e.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)n=r[l].controller.getMinMax(e,t),a||(i=Math.min(i,n.min)),s||(o=Math.max(o,n.max));return{min:q(i,q(o,i)),max:q(o,q(i,o))}}getPadding(){const t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){G(this.options.beforeUpdate,[this])}update(t,e,n){const i=this,o=i.options.ticks,a=o.sampleSize;i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),i.ticks=null,i._labelSizes=null,i._gridLineItems=null,i._labelItems=null,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i._maxLength=i.isHorizontal()?i.width+n.left+n.right:i.height+n.top+n.bottom,i._dataLimitsCached||(i.beforeDataLimits(),i.determineDataLimits(),i.afterDataLimits(),i._range=Ne(i,i.options.grace),i._dataLimitsCached=!0),i.beforeBuildTicks(),i.ticks=i.buildTicks()||[],i.afterBuildTicks();const s=a<i.ticks.length;i._convertTicksToLabels(s?zn(i.ticks,a):i.ticks),i.configure(),i.beforeCalculateLabelRotation(),i.calculateLabelRotation(),i.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(i.ticks=function(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),o=t._maxLength/n;return Math.floor(Math.min(i,o))}(t),o=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],a=o.length,s=o[0],r=o[a-1],l=[];if(a>i)return function(t,e,n,i){let o,a=0,s=n[0];for(i=Math.ceil(i),o=0;o<t.length;o++)o===s&&(e.push(t[o]),a++,s=n[a*i])}(e,l,o,a/i),l;const c=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),o=e.length/n;if(!i)return Math.max(o,1);const a=Pt(i);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>o)return e}return Math.max(o,1)}(o,e,i);if(a>0){let t,n;const i=a>1?Math.round((r-s)/(a-1)):null;for(Fn(e,l,c,H(i)?0:s-i,s),t=0,n=a-1;t<n;t++)Fn(e,l,c,o[t],o[t+1]);return Fn(e,l,c,r,H(i)?e.length:r+i),l}return Fn(e,l,c),l}(i,i.ticks),i._labelSizes=null),s&&i._convertTicksToLabels(i.ticks),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate()}configure(){const t=this;let e,n,i=t.options.reverse;t.isHorizontal()?(e=t.left,n=t.right):(e=t.top,n=t.bottom,i=!i),t._startPixel=e,t._endPixel=n,t._reversePixels=i,t._length=n-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){G(this.options.afterUpdate,[this])}beforeSetDimensions(){G(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){G(this.options.afterSetDimensions,[this])}_callHooks(t){const e=this;e.chart.notifyPlugins(t,e.getContext()),G(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){G(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,n=e.options.ticks;let i,o,a;for(i=0,o=t.length;i<o;i++)a=t[i],a.label=G(n.callback,[a.value,i,t],e);for(i=0;i<o;i++)H(t[i].label)&&(t.splice(i,1),o--,i--)}afterTickToLabelConversion(){G(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){G(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,n=e.ticks,i=t.ticks.length,o=n.minRotation||0,a=n.maxRotation;let s,r,l,c=o;if(!t._isVisible()||!n.display||o>=a||i<=1||!t.isHorizontal())return void(t.labelRotation=o);const h=t._getLabelSizes(),d=h.widest.width,u=h.highest.height,g=zt(t.chart.width-d,0,t.maxWidth);s=e.offset?t.maxWidth/i:g/(i-1),d+6>s&&(s=g/(i-(e.offset?.5:1)),r=t.maxHeight-Hn(e.grid)-n.padding-jn(e.title,t.chart.options.font),l=Math.sqrt(d*d+u*u),c=Dt(Math.min(Math.asin(Math.min((h.highest.height+6)/s,1)),Math.asin(Math.min(r/l,1))-Math.asin(u/l))),c=Math.max(o,Math.min(a,c))),t.labelRotation=c}afterCalculateLabelRotation(){G(this.options.afterCalculateLabelRotation,[this])}beforeFit(){G(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:n,options:{ticks:i,title:o,grid:a}}=t,s=t._isVisible(),r=t.isHorizontal();if(s){const s=jn(o,n.options.font);if(r?(e.width=t.maxWidth,e.height=Hn(a)+s):(e.height=t.maxHeight,e.width=Hn(a)+s),i.display&&t.ticks.length){const{first:n,last:o,widest:a,highest:s}=t._getLabelSizes(),l=2*i.padding,c=It(t.labelRotation),h=Math.cos(c),d=Math.sin(c);if(r){const n=i.mirror?0:d*a.width+h*s.height;e.height=Math.min(t.maxHeight,e.height+n+l)}else{const n=i.mirror?0:h*a.width+d*s.height;e.width=Math.min(t.maxWidth,e.width+n+l)}t._calculatePadding(n,o,d,h)}}t._handleMargins(),r?(t.width=t._length=n.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,n,i){const o=this,{ticks:{align:a,padding:s},position:r}=o.options,l=0!==o.labelRotation,c="top"!==r&&"x"===o.axis;if(o.isHorizontal()){const r=o.getPixelForTick(0)-o.left,h=o.right-o.getPixelForTick(o.ticks.length-1);let d=0,u=0;l?c?(d=i*t.width,u=n*e.height):(d=n*t.height,u=i*e.width):"start"===a?u=e.width:"end"===a?d=t.width:(d=t.width/2,u=e.width/2),o.paddingLeft=Math.max((d-r+s)*o.width/(o.width-r),0),o.paddingRight=Math.max((u-h+s)*o.width/(o.width-h),0)}else{let n=e.height/2,i=t.height/2;"start"===a?(n=0,i=t.height):"end"===a&&(n=e.height,i=0),o.paddingTop=n+s,o.paddingBottom=i+s}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){G(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){const e=this;e.beforeTickToLabelConversion(),e.generateTickLabels(t),e.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const n=t.options.ticks.sampleSize;let i=t.ticks;n<i.length&&(i=zn(i,n)),t._labelSizes=e=t._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,o=[],a=[];let s,r,l,c,h,d,u,g,f,p,m,b=0,x=0;for(s=0;s<e;++s){if(c=t[s].label,h=this._resolveTickFontOptions(s),n.font=d=h.string,u=i[d]=i[d]||{data:{},gc:[]},g=h.lineHeight,f=p=0,H(c)||j(c)){if(j(c))for(r=0,l=c.length;r<l;++r)m=c[r],H(m)||j(m)||(f=jt(n,u.data,u.gc,f,m),p+=g)}else f=jt(n,u.data,u.gc,f,c),p=g;o.push(f),a.push(p),b=Math.max(f,b),x=Math.max(p,x)}!function(t,e){K(t,t=>{const n=t.gc,i=n.length/2;let o;if(i>e){for(o=0;o<i;++o)delete t.data[n[o]];n.splice(0,i)}})}(i,e);const y=o.indexOf(b),_=a.indexOf(x),v=t=>({width:o[t]||0,height:a[t]||0});return{first:v(0),last:v(e-1),widest:v(y),highest:v(_),widths:o,heights:a}}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){const e=this;e._reversePixels&&(t=1-t);const n=e._startPixel+t*e._length;return Vt(e._alignToPixels?Wt(e.chart,n,0):n)}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,n=e.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=function(t,e,n){return Object.assign(Object.create(t),{tick:n,index:e,type:"tick"})}(e.getContext(),t,i))}return e.$context||(e.$context=(i=e.chart.getContext(),o=e,Object.assign(Object.create(i),{scale:o,type:"scale"})));var i,o}_tickSize(){const t=this,e=t.options.ticks,n=It(t.labelRotation),i=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),a=t._getLabelSizes(),s=e.autoSkipPadding||0,r=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return t.isHorizontal()?l*i>r*o?r/i:l/o:l*o<r*i?l/i:r/o}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,n=e.axis,i=e.chart,o=e.options,{grid:a,position:s}=o,r=a.offset,l=e.isHorizontal(),c=e.ticks.length+(r?1:0),h=Hn(a),d=[],u=a.setContext(e.getContext()),g=u.drawBorder?u.borderWidth:0,f=g/2,p=function(t){return Wt(i,t,g)};let m,b,x,y,_,v,M,S,C,k,P,w;if("top"===s)m=p(e.bottom),v=e.bottom-h,S=m-f,k=p(t.top)+f,w=t.bottom;else if("bottom"===s)m=p(e.top),k=t.top,w=p(t.bottom)-f,v=m+f,S=e.top+h;else if("left"===s)m=p(e.right),_=e.right-h,M=m-f,C=p(t.left)+f,P=t.right;else if("right"===s)m=p(e.left),C=t.left,P=p(t.right)-f,_=m+f,M=e.left+h;else if("x"===n){if("center"===s)m=p((t.top+t.bottom)/2+.5);else if(U(s)){const t=Object.keys(s)[0],n=s[t];m=p(e.chart.scales[t].getPixelForValue(n))}k=t.top,w=t.bottom,v=m+f,S=v+h}else if("y"===n){if("center"===s)m=p((t.left+t.right)/2);else if(U(s)){const t=Object.keys(s)[0],n=s[t];m=p(e.chart.scales[t].getPixelForValue(n))}_=m-f,M=_-h,C=t.left,P=t.right}for(b=0;b<c;++b){const t=a.setContext(e.getContext(b)),n=t.lineWidth,o=t.color,s=a.borderDash||[],c=t.borderDashOffset,h=t.tickWidth,u=t.tickColor,g=t.tickBorderDash||[],f=t.tickBorderDashOffset;x=Vn(e,b,r),void 0!==x&&(y=Wt(i,x,n),l?_=M=C=P=y:v=S=k=w=y,d.push({tx1:_,ty1:v,tx2:M,ty2:S,x1:C,y1:k,x2:P,y2:w,width:n,color:o,borderDash:s,borderDashOffset:c,tickWidth:h,tickColor:u,tickBorderDash:g,tickBorderDashOffset:f}))}return e._ticksLength=c,e._borderValue=m,d}_computeLabelItems(t){const e=this,n=e.axis,i=e.options,{position:o,ticks:a}=i,s=e.isHorizontal(),r=e.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=a,u=Hn(i.grid),g=u+h,f=d?-h:g,p=-It(e.labelRotation),m=[];let b,x,y,_,v,M,S,C,k,P,w,T,E="middle";if("top"===o)M=e.bottom-f,S=e._getXAxisLabelAlignment();else if("bottom"===o)M=e.top+f,S=e._getXAxisLabelAlignment();else if("left"===o){const t=e._getYAxisLabelAlignment(u);S=t.textAlign,v=t.x}else if("right"===o){const t=e._getYAxisLabelAlignment(u);S=t.textAlign,v=t.x}else if("x"===n){if("center"===o)M=(t.top+t.bottom)/2+g;else if(U(o)){const t=Object.keys(o)[0],n=o[t];M=e.chart.scales[t].getPixelForValue(n)+g}S=e._getXAxisLabelAlignment()}else if("y"===n){if("center"===o)v=(t.left+t.right)/2-g;else if(U(o)){const t=Object.keys(o)[0],n=o[t];v=e.chart.scales[t].getPixelForValue(n)}S=e._getYAxisLabelAlignment(u).textAlign}"y"===n&&("start"===l?E="top":"end"===l&&(E="bottom"));const A=e._getLabelSizes();for(b=0,x=r.length;b<x;++b){y=r[b],_=y.label;const t=a.setContext(e.getContext(b));C=e.getPixelForTick(b)+a.labelOffset,k=e._resolveTickFontOptions(b),P=k.lineHeight,w=j(_)?_.length:1;const n=w/2,i=t.color,l=t.textStrokeColor,h=t.textStrokeWidth;let u;if(s?(v=C,T="top"===o?"near"===c||0!==p?-w*P+P/2:"center"===c?-A.highest.height/2-n*P+P:-A.highest.height+P/2:"near"===c||0!==p?P/2:"center"===c?A.highest.height/2-n*P:A.highest.height-w*P,d&&(T*=-1)):(M=C,T=(1-w)*P/2),t.showLabelBackdrop){const e=Oe(t.backdropPadding),n=A.heights[b],i=A.widths[b];let o=M+T-e.top,a=v-e.left;switch(E){case"middle":o-=n/2;break;case"bottom":o-=n}switch(S){case"center":a-=i/2;break;case"right":a-=i}u={left:a,top:o,width:i+e.width,height:n+e.height,color:t.backdropColor}}m.push({rotation:p,label:_,font:k,color:i,strokeColor:l,strokeWidth:h,textOffset:T,textAlign:S,textBaseline:E,translation:[v,M],backdrop:u})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-It(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const e=this,{position:n,ticks:{crossAlign:i,mirror:o,padding:a}}=e.options,s=t+a,r=e._getLabelSizes().widest.width;let l,c;return"left"===n?o?(l="left",c=e.right+a):(c=e.right-s,"near"===i?l="right":"center"===i?(l="center",c-=r/2):(l="left",c=e.left)):"right"===n?o?(l="right",c=e.left+a):(c=e.left+s,"near"===i?l="left":"center"===i?(l="center",c+=r/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,n=t.options.position;return"left"===n||"right"===n?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===n||"bottom"===n?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,o,a),t.restore())}getLineWidthForValue(t){const e=this,n=e.options.grid;if(!e._isVisible()||!n.display)return 0;const i=e.ticks.findIndex(e=>e.value===t);return i>=0?n.setContext(e.getContext(i)).lineWidth:0}drawGrid(t){const e=this,n=e.options.grid,i=e.ctx,o=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let a,s;const r=(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(n.display)for(a=0,s=o.length;a<s;++a){const t=o[a];n.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&r({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 t=this,{chart:e,ctx:n,options:{grid:i}}=t,o=i.setContext(t.getContext()),a=i.drawBorder?o.borderWidth:0;if(!a)return;const s=i.setContext(t.getContext(0)).lineWidth,r=t._borderValue;let l,c,h,d;t.isHorizontal()?(l=Wt(e,t.left,a)-a/2,c=Wt(e,t.right,s)+s/2,h=d=r):(h=Wt(e,t.top,a)-a/2,d=Wt(e,t.bottom,s)+s/2,l=c=r),n.save(),n.lineWidth=o.borderWidth,n.strokeStyle=o.borderColor,n.beginPath(),n.moveTo(l,h),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(t){const e=this;if(!e.options.ticks.display)return;const n=e.ctx,i=e._computeLabelArea();i&&Xt(n,i);const o=e._labelItems||(e._labelItems=e._computeLabelItems(t));let a,s;for(a=0,s=o.length;a<s;++a){const t=o[a],e=t.font,i=t.label;t.backdrop&&(n.fillStyle=t.backdrop.color,n.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Jt(n,i,0,t.textOffset,e,t)}i&&Gt(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const a=Le(n.font),s=Oe(n.padding),r=n.align;let l=a.lineHeight/2;"bottom"===e?(l+=s.bottom,j(n.text)&&(l+=a.lineHeight*(n.text.length-1))):l+=s.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=function(t,e,n,i){const{top:a,left:s,bottom:r,right:l}=t;let c,h,d,u=0;return t.isHorizontal()?(h=o(i,s,l),d=Bn(t,n,e),c=l-s):(h=Bn(t,n,e),d=o(i,r,a),u="left"===n?-_t:_t),{titleX:h,titleY:d,maxWidth:c,rotation:u}}(this,l,e,r);Jt(t,n.text,0,0,a,{color:n.color,maxWidth:d,rotation:u,textAlign:Un(r,e,i),textBaseline:"middle",translation:[c,h]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.grid&&e.grid.z||0;return t._isVisible()&&t.draw===Wn.prototype.draw?[{z:i,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:i+1,draw(){t.drawBorder()}},{z:n,draw(e){t.drawLabels(e)}}]:[{z:n,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,n=e.chart.getSortedVisibleDatasetMetas(),i=e.axis+"AxisID",o=[];let a,s;for(a=0,s=n.length;a<s;++a){const s=n[a];s[i]!==e.id||t&&s.type!==t||o.push(s)}return o}_resolveTickFontOptions(t){return Le(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}function qn(t,e=[""],n=t,i,o=(()=>t[0])){rt(i)||(i=ni("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:o,override:o=>qn([o,...t],e,n,i)};return new Proxy(a,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>Kn(n,i,()=>function(t,e,n,i){let o;for(const a of e)if(o=ni(Xn(a,t),n),rt(o))return Gn(t,o)?ti(n,i,t,o):o}(i,e,t,n)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ii(t).includes(e),ownKeys:t=>ii(t),set:(t,e,n)=>((t._storage||(t._storage=o()))[e]=n,delete t[e],delete t._keys,!0)})}function $n(t,e,n,i){const o={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Yn(t,i),setContext:e=>$n(t,e,n,i),override:o=>$n(t.override(o),e,n,i)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Kn(t,e,()=>function(t,e,n){const{_proxy:i,_context:o,_subProxy:a,_descriptors:s}=t;let r=i[e];return lt(r)&&s.isScriptable(e)&&(r=function(t,e,n,i){const{_proxy:o,_context:a,_subProxy:s,_stack:r}=n;if(r.has(t))throw new Error("Recursion detected: "+[...r].join("->")+"->"+t);return r.add(t),e=e(a,s||i),r.delete(t),U(e)&&(e=ti(o._scopes,o,t,e)),e}(e,r,t,n)),j(r)&&r.length&&(r=function(t,e,n,i){const{_proxy:o,_context:a,_subProxy:s,_descriptors:r}=n;if(rt(a.index)&&i(t))e=e[a.index%e.length];else if(U(e[0])){const n=e,i=o._scopes.filter(t=>t!==n);e=[];for(const l of n){const n=ti(i,o,t,l);e.push($n(n,a,s&&s[t],r))}}return e}(e,r,t,s.isIndexable)),Gn(e,r)&&(r=$n(r,o,a&&a[e],s)),r}(t,e,n)),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function Yn(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:o=e.allKeys}=t;return{allKeys:o,scriptable:n,indexable:i,isScriptable:lt(n)?n:()=>n,isIndexable:lt(i)?i:()=>i}}const Xn=(t,e)=>t?t+st(e):e,Gn=(t,e)=>U(e)&&"adapters"!==t;function Kn(t,e,n){let i=t[e];return rt(i)||(i=n(),rt(i)&&(t[e]=i)),i}function Zn(t,e,n){return lt(t)?t(e,n):t}const Jn=(t,e)=>!0===t?e:"string"==typeof t?at(e,t):void 0;function Qn(t,e,n,i){for(const o of e){const e=Jn(n,o);if(e){t.add(e);const o=Zn(e._fallback,n,e);if(rt(o)&&o!==n&&o!==i)return o}else if(!1===e&&rt(i)&&n!==i)return null}return!1}function ti(t,e,n,i){const o=e._rootScopes,a=Zn(e._fallback,n,i),s=[...t,...o],r=new Set;r.add(i);let l=ei(r,s,n,a||n);return null!==l&&(!rt(a)||a===n||(l=ei(r,s,a,l),null!==l))&&qn([...r],[""],o,a,()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const o=i[e];return j(o)&&U(n)?n:o}(e,n,i))}function ei(t,e,n,i){for(;n;)n=Qn(t,e,n,i);return n}function ni(t,e){for(const n of e){if(!n)continue;const e=n[t];if(rt(e))return e}}function ii(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter(t=>!t.startsWith("_")))e.add(t);return[...e]}(t._scopes)),e}const oi=Number.EPSILON||1e-14,ai=(t,e)=>e<t.length&&!t[e].skip&&t[e],si=t=>"x"===t?"y":"x";function ri(t,e,n,i){const o=t.skip?e:t,a=e,s=n.skip?e:n,r=Rt(a,o),l=Rt(s,a);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=i*c,u=i*h;return{previous:{x:a.x-d*(s.x-o.x),y:a.y-d*(s.y-o.y)},next:{x:a.x+u*(s.x-o.x),y:a.y+u*(s.y-o.y)}}}function li(t,e="x"){const n=si(e),i=t.length,o=Array(i).fill(0),a=Array(i);let s,r,l,c=ai(t,0);for(s=0;s<i;++s)if(r=l,l=c,c=ai(t,s+1),l){if(c){const t=c[e]-l[e];o[s]=0!==t?(c[n]-l[n])/t:0}a[s]=r?c?Ct(o[s-1])!==Ct(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}!function(t,e,n){const i=t.length;let o,a,s,r,l,c=ai(t,0);for(let h=0;h<i-1;++h)l=c,c=ai(t,h+1),l&&c&&(Tt(e[h],0,oi)?n[h]=n[h+1]=0:(o=n[h]/e[h],a=n[h+1]/e[h],r=Math.pow(o,2)+Math.pow(a,2),r<=9||(s=3/Math.sqrt(r),n[h]=o*s*e[h],n[h+1]=a*s*e[h])))}(t,o,a),function(t,e,n="x"){const i=si(n),o=t.length;let a,s,r,l=ai(t,0);for(let c=0;c<o;++c){if(s=r,r=l,l=ai(t,c+1),!r)continue;const o=r[n],h=r[i];s&&(a=(o-s[n])/3,r["cp1"+n]=o-a,r["cp1"+i]=h-a*e[c]),l&&(a=(l[n]-o)/3,r["cp2"+n]=o+a,r["cp2"+i]=h+a*e[c])}}(t,a,e)}function ci(t,e,n){return Math.max(Math.min(t,n),e)}function hi(t,e,n,i,o){let a,s,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)li(t,o);else{let n=i?t[t.length-1]:t[0];for(a=0,s=t.length;a<s;++a)r=t[a],l=ri(n,r,t[Math.min(a+1,s-(i?0:1))%s],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,n=r}e.capBezierPoints&&function(t,e){let n,i,o,a,s,r=Yt(t[0],e);for(n=0,i=t.length;n<i;++n)s=a,a=r,r=n<i-1&&Yt(t[n+1],e),a&&(o=t[n],s&&(o.cp1x=ci(o.cp1x,e.left,e.right),o.cp1y=ci(o.cp1y,e.top,e.bottom)),r&&(o.cp2x=ci(o.cp2x,e.left,e.right),o.cp2y=ci(o.cp2y,e.top,e.bottom)))}(t,n)}function di(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function ui(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function gi(t,e,n,i){const o={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},s=di(t,o,n),r=di(o,a,n),l=di(a,e,n),c=di(s,r,n),h=di(r,l,n);return di(c,h,n)}function fi(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function pi(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function mi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function bi(t){return"angle"===t?{between:Bt,compare:Nt,normalize:Ft}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function xi({start:t,end:e,count:n,loop:i,style:o}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:o}}function yi(t,e,n){if(!n)return[t];const{property:i,start:o,end:a}=n,s=e.length,{compare:r,between:l,normalize:c}=bi(i),{start:h,end:d,loop:u,style:g}=function(t,e,n){const{property:i,start:o,end:a}=n,{between:s,normalize:r}=bi(i),l=e.length;let c,h,{start:d,end:u,loop:g}=t;if(g){for(d+=l,u+=l,c=0,h=l;c<h&&s(r(e[d%l][i]),o,a);++c)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:g,style:t.style}}(t,e,n),f=[];let p,m,b,x=!1,y=null;for(let t=h,n=h;t<=d;++t)m=e[t%s],m.skip||(p=c(m[i]),p!==b&&(x=l(p,o,a),null===y&&(x||l(o,b,p)&&0!==r(o,b))&&(y=0===r(p,o)?t:n),null!==y&&(!x||0===r(a,p)||l(a,b,p))&&(f.push(xi({start:y,end:t,loop:u,count:s,style:g})),y=null),n=t,b=p));return null!==y&&f.push(xi({start:y,end:d,loop:u,count:s,style:g})),f}function _i(t,e){const n=[],i=t.segments;for(let o=0;o<i.length;o++){const a=yi(i[o],t.points,e);a.length&&n.push(...a)}return n}function vi(t,e){const n=t.points,i=t.options.spanGaps,o=n.length;if(!o)return[];const a=!!t._loop,{start:s,end:r}=function(t,e,n,i){let o=0,a=e-1;if(n&&!i)for(;o<e&&!t[o].skip;)o++;for(;o<e&&t[o].skip;)o++;for(o%=e,n&&(a+=o);a>o&&t[a%e].skip;)a--;return a%=e,{start:o,end:a}}(n,o,a,i);return Mi(!0===i?[{start:s,end:r,loop:a}]:function(t,e,n,i){const o=t.length,a=[];let s,r=e,l=t[e];for(s=e+1;s<=n;++s){const n=t[s%o];n.skip||n.stop?l.skip||(i=!1,a.push({start:e%o,end:(s-1)%o,loop:i}),e=r=n.stop?s:null):(r=s,l.skip&&(e=s)),l=n}return null!==r&&a.push({start:e%o,end:r%o,loop:i}),a}(n,s,r<s?r+o:r,!!t._fullLoop&&0===s&&r===o-1),n,e)}function Mi(t,e,n){return n&&n.setContext&&e?function(t,e,n){const i=e.length,o=[];let a=t[0].start,s=a;for(const r of t){let t,l,c=e[a%i];for(s=a+1;s<=r.end;s++){const h=e[s%i];l=Si(n.setContext({type:"segment",p0:c,p1:h})),Ci(l,t)&&(o.push({start:a,end:s-1,loop:r.loop,style:t}),t=l,a=s-1),c=h,t=l}a<s-1&&(o.push({start:a,end:s-1,loop:r.loop,style:l}),a=s-1)}return o}(t,e,n):t}function Si(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ci(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var ki=Object.freeze({__proto__:null,easingEffects:fn,color:F,getHoverColor:B,noop:z,uid:V,isNullOrUndef:H,isArray:j,isObject:U,isFinite:W,finiteOrDefault:q,valueOrDefault:$,toPercentage:Y,toDimension:X,callback:G,each:K,_elementsEqual:Z,clone:J,_merger:tt,merge:et,mergeIf:nt,_mergerIf:it,_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')},resolveObjectKey:at,_capitalize:st,defined:rt,isFunction:lt,setsEqual:ct,toFontString:Ht,_measureText:jt,_longestText:Ut,_alignPixel:Wt,clearCanvas:qt,drawPoint:$t,_isPointInArea:Yt,clipArea:Xt,unclipArea:Gt,_steppedLineTo:Kt,_bezierCurveTo:Zt,renderText:Jt,addRoundedRectPath:Qt,_lookup:te,_lookupByKey:ee,_rlookupByKey:ne,_filterBetween:ie,listenArrayEvents:ae,unlistenArrayEvents:se,_arrayUnique:re,_createResolver:qn,_attachContext:$n,_descriptors:Yn,splineCurve:ri,splineCurveMonotone:li,_updateBezierControlPoints:hi,_getParentNode:le,getStyle:de,getRelativePosition:fe,getMaximumSize:me,retinaScale:be,supportsEventListenerOptions:xe,readUsedSize:ye,fontString:function(t,e,n){return e+" "+t+"px "+n},requestAnimFrame:t,throttled:e,debounce:n,_toLeftRightCenter:i,_alignStartEnd:o,_textX:a,_pointInLine:di,_steppedInterpolation:ui,_bezierInterpolation:gi,formatNumber:Ln,toLineHeight:Ee,_readValueToProps:Ae,toTRBL:Ie,toTRBLCorners:De,toPadding:Oe,toFont:Le,resolve:Re,_addGrace:Ne,PI:pt,TAU:mt,PITAU:bt,INFINITY:xt,RAD_PER_DEG:yt,HALF_PI:_t,QUARTER_PI:vt,TWO_THIRDS_PI:Mt,log10:St,sign:Ct,niceNum:kt,_factorize:Pt,isNumber:wt,almostEquals:Tt,almostWhole:Et,_setMinAndMaxByKey:At,toRadians:It,toDegrees:Dt,_decimalPlaces:Ot,getAngleFromPoint:Lt,distanceBetweenPoints:Rt,_angleDiff:Nt,_normalizeAngle:Ft,_angleBetween:Bt,_limitValue:zt,_int16Range:Vt,getRtlAdapter:fi,overrideTextDirection:pi,restoreTextDirection:mi,_boundSegment:yi,_boundSegments:_i,_computeSegments:vi});class Pi{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,n=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(n)&&(i=e.register(n));const o=e.items,a=t.id,s=e.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in o||(o[a]=t,function(t,e,n){const i=et(Object.create(null),[n?ft.get(n):{},ft.get(e),t.defaults]);ft.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),o=i.pop(),a=[t].concat(i).join("."),s=e[n].split("."),r=s.pop(),l=s.join(".");ft.route(a,o,l,r)})}(e,t.defaultRoutes),t.descriptors&&ft.describe(e,t.descriptors)}(t,s,i),e.override&&ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in ft[i]&&(delete ft[i][n],this.override&&delete ht[n])}}var wi=new class{constructor(){this.controllers=new Pi(In,"datasets",!0),this.elements=new Pi(Dn,"elements"),this.plugins=new Pi(Object,"plugins"),this.scales=new Pi(Wn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){const i=this;[...e].forEach(e=>{const o=n||i._getRegistryForType(e);n||o.isForType(e)||o===i.plugins&&e.id?i._exec(t,o,e):K(e,e=>{const o=n||i._getRegistryForType(e);i._exec(t,o,e)})})}_exec(t,e,n){const i=st(t);G(n["before"+i],[],n),e[t](n),G(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class Ti{constructor(){this._init=[]}notify(t,e,n,i){const o=this;"beforeInit"===e&&(o._init=o._createDescriptors(t,!0),o._notify(o._init,t,"install"));const a=i?o._descriptors(t).filter(i):o._descriptors(t),s=o._notify(a,t,e,n);return"destroy"===e&&(o._notify(a,t,"stop"),o._notify(o._init,t,"uninstall")),s}_notify(t,e,n,i){i=i||{};for(const o of t){const t=o.plugin;if(!1===G(t[n],[e,i,o.options],t)&&i.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=$(n.options&&n.options.plugins,{}),o=function(t){const e=[],n=Object.keys(wi.plugins.items);for(let t=0;t<n.length;t++)e.push(wi.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const o=[],a=t.getContext();for(let s=0;s<e.length;s++){const r=e[s],l=Ei(n[r.id],i);null!==l&&o.push({plugin:r,options:Ai(t.config,r,l,a)})}return o}(t,o,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function Ei(t,e){return e||!1!==t?!0===t?{}:t:null}function Ai(t,e,n,i){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(n,o);return t.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ii(t,e){const n=ft.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Di(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function Oi(t){const e=t.options||(t.options={});e.plugins=$(e.plugins,{}),e.scales=function(t,e){const n=ht[t.type]||{scales:{}},i=e.scales||{},o=Ii(t.type,e),a=Object.create(null),s=Object.create(null);return Object.keys(i).forEach(t=>{const e=i[t],r=Di(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(r,o),c=n.scales||{};a[r]=a[r]||t,s[t]=nt(Object.create(null),[{axis:r},e,c[r],c[l]])}),t.data.datasets.forEach(n=>{const o=n.type||t.type,r=n.indexAxis||Ii(o,e),l=(ht[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,r),o=n[e+"AxisID"]||a[e]||e;s[o]=s[o]||Object.create(null),nt(s[o],[{axis:e},i[o],l[t]])})}),Object.keys(s).forEach(t=>{const e=s[t];nt(e,[ft.scales[e.type],ft.scale])}),s}(t,e)}function Li(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ri=new Map,Ni=new Set;function Fi(t,e){let n=Ri.get(t);return n||(n=e(),Ri.set(t,n),Ni.add(n)),n}const Bi=(t,e,n)=>{const i=at(e,n);void 0!==i&&t.add(i)};class zi{constructor(t){this._config=function(t){return(t=t||{}).data=Li(t.data),Oi(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}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=Li(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(),Oi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fi(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Fi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Fi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Fi(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:o}=this,a=this._cachedScopes(t,n),s=a.get(e);if(s)return s;const r=new Set;e.forEach(e=>{t&&(r.add(t),e.forEach(e=>Bi(r,t,e))),e.forEach(t=>Bi(r,i,t)),e.forEach(t=>Bi(r,ht[o]||{},t)),e.forEach(t=>Bi(r,ft,t)),e.forEach(t=>Bi(r,dt,t))});const l=[...r];return Ni.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ht[e]||{},ft.datasets[e]||{},{type:e},ft,dt]}resolveNamedOptions(t,e,n,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=Vi(this._resolverCache,t,i);let r=a;(function(t,e){const{isScriptable:n,isIndexable:i}=Yn(t);for(const o of e)if(n(o)&<(t[o])||i(o)&&j(t[o]))return!0;return!1})(a,e)&&(o.$shared=!1,r=$n(a,n=lt(n)?n():n,this.createResolver(t,n,s)));for(const t of e)o[t]=r[t];return o}createResolver(t,e,n=[""],i){const{resolver:o}=Vi(this._resolverCache,t,n);return U(e)?$n(o,e,void 0,i):o}}function Vi(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const o=n.join();let a=i.get(o);return a||(a={resolver:qn(e,n),subPrefixes:n.filter(t=>!t.toLowerCase().includes("hover"))},i.set(o,a)),a}const Hi=["top","bottom","left","right","chartArea"];function ji(t,e){return"top"===t||"bottom"===t||-1===Hi.indexOf(t)&&"x"===e}function Ui(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Wi(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),G(n&&n.onComplete,[t],e)}function qi(t){const e=t.chart,n=e.options.animation;G(n&&n.onProgress,[t],e)}function $i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Yi(t){return $i()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Xi={},Gi=t=>{const e=Yi(t);return Object.values(Xi).filter(t=>t.canvas===e).pop()};class Ki{constructor(t,e){const i=this;this.config=e=new zi(e);const o=Yi(t),a=Gi(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const r=e.createResolver(e.chartOptionScopes(),i.getContext());this.platform=i._initializePlatform(o,e);const l=i.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;this.id=V(),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.scale=void 0,this._plugins=new Ti,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=n(()=>this.update("resize"),r.resizeDelay||0),Xi[i.id]=i,l&&c?(s.listen(i,"complete",Wi),s.listen(i,"progress",qi),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:o}=this;return H(t)?e&&o?o:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():be(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}_initializePlatform(t,e){return e.platform?new e.platform:!$i()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?new Ge:new cn}clear(){return qt(this.canvas,this.ctx),this}stop(){return s.stop(this),this}resize(t,e){s.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this,i=n.options,o=n.canvas,a=i.maintainAspectRatio&&n.aspectRatio,s=n.platform.getMaximumSize(o,t,e,a),r=i.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=s.width,n.height=s.height,n._aspectRatio=n.aspectRatio,be(n,r,!0)&&(n.notifyPlugins("resize",{size:s}),G(i.onResize,[n,s],n),n.attached&&n._doResize()&&n.render())}ensureScalesHaveIDs(){K(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this,e=t.options,n=e.scales,i=t.scales,o=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];n&&(a=a.concat(Object.keys(n).map(t=>{const e=n[t],i=Di(t,e),o="r"===i,a="x"===i;return{options:e,dposition:o?"chartArea":a?"bottom":"left",dtype:o?"radialLinear":a?"category":"linear"}}))),K(a,n=>{const a=n.options,s=a.id,r=Di(s,a),l=$(a.type,n.dtype);void 0!==a.position&&ji(a.position,r)===ji(n.dposition)||(a.position=n.dposition),o[s]=!0;let c=null;s in i&&i[s].type===l?c=i[s]:(c=new(wi.getScale(l))({id:s,type:l,ctx:t.ctx,chart:t}),i[c.id]=c),c.init(a,e)}),K(o,(t,e)=>{t||delete i[e]}),K(i,e=>{Ye.configure(t,e,e.options),Ye.addBox(t,e)})}_updateMetasetIndex(t,e){const n=this._metasets,i=t.index;i!==e&&(n[i]=n[e],n[e]=t,t.index=e)}_updateMetasets(){const t=this,e=t._metasets,n=t.data.datasets.length,i=e.length;if(i>n){for(let e=n;e<i;++e)t._destroyDatasetMeta(e);e.splice(n,i-n)}t._sortedMetasets=e.slice(0).sort(Ui("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:n}}=t;e.length>n.length&&delete t._stacks,e.forEach((e,i)=>{0===n.filter(t=>t===e._dataset).length&&t._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=this,e=[],n=t.data.datasets;let i,o;for(t._removeUnreferencedMetasets(),i=0,o=n.length;i<o;i++){const o=n[i];let a=t.getDatasetMeta(i);const s=o.type||t.config.type;if(a.type&&a.type!==s&&(t._destroyDatasetMeta(i),a=t.getDatasetMeta(i)),a.type=s,a.indexAxis=o.indexAxis||Ii(s,t.options),a.order=o.order||0,t._updateMetasetIndex(a,i),a.label=""+o.label,a.visible=t.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const n=wi.getController(s),{datasetElementType:o,dataElementType:r}=ft.datasets[s];Object.assign(n.prototype,{dataElementType:wi.getElement(r),datasetElementType:o&&wi.getElement(o)}),a.controller=new n(t,i),e.push(a.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;K(t.data.datasets,(e,n)=>{t.getDatasetMeta(n).controller.reset()},t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,n=e.config;n.update(),e._options=n.createResolver(n.chartOptionScopes(),e.getContext()),K(e.scales,t=>{Ye.removeBox(e,t)});const i=e._animationsDisabled=!e.options.animation;e.ensureScalesHaveIDs(),e.buildOrUpdateScales();const o=new Set(Object.keys(e._listeners)),a=new Set(e.options.events);if(ct(o,a)&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,n=e.data.datasets.length;t<n;t++){const{controller:n}=e.getDatasetMeta(t),o=!i&&-1===s.indexOf(n);n.buildOrUpdateElements(o),r=Math.max(+n.getMaxOverflow(),r)}e._minPadding=r,e._updateLayout(r),i||K(s,t=>{t.reset()}),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(Ui("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;Ye.update(e,e.width,e.height,t);const n=e.chartArea,i=n.width<=0||n.height<=0;e._layers=[],K(e.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))},e),e._layers.forEach((t,e)=>{t._idx=e}),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,n="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let i=0,o=e.data.datasets.length;i<o;++i)e._updateDataset(i,n?t({datasetIndex:i}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this,i=n.getDatasetMeta(t),o={meta:i,index:t,mode:e,cancelable:!0};!1!==n.notifyPlugins("beforeDatasetUpdate",o)&&(i.controller._update(e),o.cancelable=!1,n.notifyPlugins("afterDatasetUpdate",o))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(s.has(t)?t.attached&&!s.running(t)&&s.start(t):(t.draw(),Wi({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:n}=t._resizeBeforeDraw;t._resize(e,n),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const n=t._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(t.chartArea);for(t._drawDatasets();e<n.length;++e)n[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,o;for(i=0,o=e.length;i<o;++i){const o=e[i];t&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)t._drawDataset(e[n]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,n=e.ctx,i=t._clip,o=e.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",a)&&(Xt(n,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?e.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?e.height:o.bottom+i.bottom}),t.controller.draw(),Gt(n),a.cancelable=!1,e.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,n,i){const o=Pe.modes[e];return"function"==typeof o?o(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(t=>t&&t._dataset===e).pop();return i||(i=n[t]={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}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateDatasetVisibility(t,e){const n=this,i=e?"show":"hide",o=n.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);n.setDatasetVisibility(t,e),a.update(o,{visible:e}),n.update(e=>e.datasetIndex===t?i:void 0)}hide(t){this._updateDatasetVisibility(t,!1)}show(t){this._updateDatasetVisibility(t,!0)}_destroyDatasetMeta(t){const e=this,n=e._metasets&&e._metasets[t];n&&n.controller&&(n.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:n}=t;let i,o;for(t.stop(),s.remove(t),i=0,o=t.data.datasets.length;i<o;++i)t._destroyDatasetMeta(i);t.config.clearCache(),e&&(t.unbindEvents(),qt(e,n),t.platform.releaseContext(n),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete Xi[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,n=t.platform,i=function(e,n,i){e.offsetX=n,e.offsetY=i,t._eventHandler(e)};K(t.options.events,o=>((i,o)=>{n.addEventListener(t,i,o),e[i]=o})(o,i))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,n=t.platform,i=(i,o)=>{n.addEventListener(t,i,o),e[i]=o},o=(i,o)=>{e[i]&&(n.removeEventListener(t,i,o),delete e[i])},a=(e,n)=>{t.canvas&&t.resize(e,n)};let s;const r=()=>{o("attach",r),t.attached=!0,t.resize(),i("resize",a),i("detach",s)};s=()=>{t.attached=!1,o("resize",a),i("attach",r)},n.isAttached(t.canvas)?r():s()}unbindEvents(){const t=this;K(t._listeners,(e,n)=>{t.platform.removeEventListener(t,n,e)}),t._listeners={},K(t._responsiveListeners,(e,n)=>{t.platform.removeEventListener(t,n,e)}),t._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let o,a,s,r;for("dataset"===e&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,r=t.length;s<r;++s){a=t[s];const e=a&&this.getDatasetMeta(a.datasetIndex).controller;e&&e[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,n=e._active||[],i=t.map(({datasetIndex:t,index:n})=>{const i=e.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[n],index:n}});!Z(i,n)&&(e._active=i,e._updateHoverStyles(i,n))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this,o=i.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=n?t:a(t,e);s.length&&i.updateHoverStyle(s,o.mode,!1),r.length&&o.mode&&i.updateHoverStyle(r,o.mode,!0)}_eventHandler(t,e){const n=this,i={event:t,replay:e,cancelable:!0},o=e=>(e.options.events||this.options.events).includes(t.type);if(!1===n.notifyPlugins("beforeEvent",i,o))return;const a=n._handleEvent(t,e);return i.cancelable=!1,n.notifyPlugins("afterEvent",i,o),(a||i.changed)&&n.render(),n}_handleEvent(t,e){const n=this,{_active:i=[],options:o}=n,a=o.hover,s=e;let r=[],l=!1,c=null;return"mouseout"!==t.type&&(r=n.getElementsAtEventForMode(t,a.mode,a,s),c="click"===t.type?n._lastEvent:t),n._lastEvent=null,Yt(t,n.chartArea,n._minPadding)&&(G(o.onHover,[t,r,n],n),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||G(o.onClick,[t,r,n],n)),l=!Z(r,i),(l||e)&&(n._active=r,n._updateHoverStyles(r,i,e)),n._lastEvent=c,l}}const Zi=()=>K(Ki.instances,t=>t._plugins.invalidate());function Ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(Ki,{defaults:{enumerable:!0,value:ft},instances:{enumerable:!0,value:Xi},overrides:{enumerable:!0,value:ht},registry:{enumerable:!0,value:wi},version:{enumerable:!0,value:"3.3.0"},getChart:{enumerable:!0,value:Gi},register:{enumerable:!0,value:(...t)=>{wi.add(...t),Zi()}},unregister:{enumerable:!0,value:(...t)=>{wi.remove(...t),Zi()}}});class Qi{constructor(t){this.options=t||{}}formats(){return Ji()}parse(t,e){return Ji()}format(t,e){return Ji()}add(t,e,n){return Ji()}diff(t,e,n){return Ji()}startOf(t,e,n){return Ji()}endOf(t,e){return Ji()}}Qi.override=function(t){Object.assign(Qi.prototype,t)};var to={_date:Qi};function eo(t){const e=function(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let n=[];for(let i=0,o=e.length;i<o;i++)n=n.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=re(n.sort((t,e)=>t-e))}return t._cache.$bar}(t);let n,i,o,a,s=t._length;const r=()=>{32767!==o&&-32768!==o&&(rt(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,i=e.length;n<i;++n)o=t.getPixelForValue(e[n]),r();for(a=void 0,n=0,i=t.ticks.length;n<i;++n)o=t.getPixelForTick(n),r();return s}function no(t,e,n,i){return j(t)?function(t,e,n,i){const o=n.parse(t[0],i),a=n.parse(t[1],i),s=Math.min(o,a),r=Math.max(o,a);let l=s,c=r;Math.abs(s)>Math.abs(r)&&(l=r,c=s),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:o,end:a,min:s,max:r}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function io(t,e,n,i){const o=t.iScale,a=t.vScale,s=o.getLabels(),r=o===a,l=[];let c,h,d,u;for(c=n,h=n+i;c<h;++c)u=e[c],d={},d[o.axis]=r||o.parse(s[c],c),l.push(no(u,d,a,c));return l}function oo(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}class ao extends In{parsePrimitiveData(t,e,n,i){return io(t,e,n,i)}parseArrayData(t,e,n,i){return io(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:o,vScale:a}=t,{xAxisKey:s="x",yAxisKey:r="y"}=this._parsing,l="x"===o.axis?s:r,c="x"===a.axis?s:r,h=[];let d,u,g,f;for(d=n,u=n+i;d<u;++d)f=e[d],g={},g[o.axis]=o.parse(at(f,l),d),h.push(no(at(f,c),g,a,d));return h}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,o=this.getParsed(t),a=o._custom,s=oo(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:s}}initialize(){const t=this;t.enableOptionSharing=!0,super.initialize(),t._cachedMeta.stack=t.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const o=this,a="reset"===i,s=o._cachedMeta.vScale,r=s.getBasePixel(),l=s.isHorizontal(),c=o._getRuler(),h=o.resolveDataElementOptions(e,i),d=o.getSharedOptions(h),u=o.includeOptions(i,d);o.updateSharedOptions(d,i,h);for(let h=e;h<e+n;h++){const e=o.getParsed(h),n=a||H(e[s.axis])?{base:r,head:r}:o._calculateBarValuePixels(h),g=o._calculateBarIndexPixels(h,c),f=(e._stacks||{})[s.axis],p={horizontal:l,base:n.base,enableBorderRadius:!f||oo(e._custom)||o.index===f._top||o.index===f._bottom,x:l?n.head:g.center,y:l?g.center:n.head,height:l?g.size:void 0,width:l?void 0:g.size};u&&(p.options=d||o.resolveDataElementOptions(h,i)),o.updateElement(t[h],h,p,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),o=n.options.stacked,a=i.length,s=[];let r,l;for(r=0;r<a;++r){if(l=i[r],void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(H(t)||isNaN(t))continue}if((!1===o||-1===s.indexOf(l.stack)||void 0===o&&void 0===l.stack)&&s.push(l.stack),l.index===t)break}return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),o=void 0!==e?i.indexOf(e):-1;return-1===o?i.length-1:o}_getRuler(){const t=this,e=t.options,n=t._cachedMeta,i=n.iScale,o=[];let a,s;for(a=0,s=n.data.length;a<s;++a)o.push(i.getPixelForValue(t.getParsed(a)[i.axis],a));const r=e.barThickness;return{min:r||eo(i),pixels:o,start:i._startPixel,end:i._endPixel,stackCount:t._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const e=this,{vScale:n,_stacked:i}=e._cachedMeta,{base:o,minBarLength:a}=e.options,s=e.getParsed(t),r=s._custom,l=oo(r);let c,h,d=s[n.axis],u=0,g=i?e.applyStack(n,s,i):d;g!==d&&(u=g-d,g=d),l&&(d=r.barStart,g=r.barEnd-r.barStart,0!==d&&Ct(d)!==Ct(r.barEnd)&&(u=0),u+=d);const f=H(o)||l?u:o;let p=n.getPixelForValue(f);c=this.chart.getDataVisibility(t)?n.getPixelForValue(u+g):p,h=c-p,void 0!==a&&Math.abs(h)<a&&(h=h<0?-a:a,0===d&&(p-=h/2),c=p+h);const m=o||0;if(p===n.getPixelForValue(m)){const t=n.getLineWidthForValue(m)/2;h>0?(p+=t,h-=t):h<0&&(p-=t,h+=t)}return{size:h,base:p,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const n=this,i=e.scale,o=n.options,a=o.skipNull,s=$(o.maxBarThickness,1/0);let r,l;if(e.grouped){const i=a?n._getStackCount(t):e.stackCount,c="flex"===o.barThickness?function(t,e,n,i){const o=e.pixels,a=o[t];let s=t>0?o[t-1]:null,r=t<o.length-1?o[t+1]:null;const l=n.categoryPercentage;null===s&&(s=a-(null===r?e.end-e.start:r-a)),null===r&&(r=a+a-s);const c=a-(a-Math.min(s,r))/2*l;return{chunk:Math.abs(r-s)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,o,i):function(t,e,n,i){const o=n.barThickness;let a,s;return H(o)?(a=e.min*n.categoryPercentage,s=n.barPercentage):(a=o*i,s=1),{chunk:a/i,ratio:s,start:e.pixels[t]-a/2}}(t,e,o,i),h=n._getStackIndex(n.index,n._cachedMeta.stack,a?t:void 0);r=c.start+c.chunk*h+c.chunk/2,l=Math.min(s,c.chunk*c.ratio)}else r=i.getPixelForValue(n.getParsed(t)[i.axis],t),l=Math.min(s,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this,e=t.chart,n=t._cachedMeta,i=n.vScale,o=n.data,a=o.length;let s=0;for(Xt(e.ctx,e.chartArea);s<a;++s)null!==t.getParsed(s)[i.axis]&&o[s].draw(t._ctx);Gt(e.ctx)}}ao.id="bar",ao.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},ao.overrides={interaction:{mode:"index"},scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class so extends In{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,n,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:r="y"}=this._parsing,l=[];let c,h,d;for(c=n,h=n+i;c<h;++c)d=e[c],l.push({x:o.parse(at(d,s),c),y:a.parse(at(d,r),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size()/2,e[i]._custom);return n>0&&n}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,o=this.getParsed(t),a=n.getLabelForValue(o.x),s=i.getLabelForValue(o.y),r=o._custom;return{label:e.label,value:"("+a+", "+s+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const o=this,a="reset"===i,{iScale:s,vScale:r}=o._cachedMeta,l=o.resolveDataElementOptions(e,i),c=o.getSharedOptions(l),h=o.includeOptions(i,c),d=s.axis,u=r.axis;for(let l=e;l<e+n;l++){const e=t[l],n=!a&&o.getParsed(l),c={},g=c[d]=a?s.getPixelForDecimal(.5):s.getPixelForValue(n[d]),f=c[u]=a?r.getBasePixel():r.getPixelForValue(n[u]);c.skip=isNaN(g)||isNaN(f),h&&(c.options=o.resolveDataElementOptions(l,i),a&&(c.options.radius=0)),o.updateElement(e,l,c,i)}o.updateSharedOptions(c,i,l)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return"active"!==e&&(i.radius=0),i.radius+=$(n&&n._custom,o),i}}so.id="bubble",so.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},so.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class ro extends In{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;let o,a;for(o=t,a=t+e;o<a;++o)i._parsed[o]=+n[o]}_getRotation(){return It(this.options.rotation-90)}_getCircumference(){return It(this.options.circumference)}_getRotationExtents(){let t=mt,e=-mt;const n=this;for(let i=0;i<n.chart.data.datasets.length;++i)if(n.chart.isDatasetVisible(i)){const o=n.chart.getDatasetMeta(i).controller,a=o._getRotation(),s=o._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this,n=e.chart,{chartArea:i}=n,o=e._cachedMeta,a=o.data,s=e.getMaxBorderWidth()+e.getMaxOffset(a),r=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(Y(e.options.cutout,r),1),c=e._getRingWeight(e.index),{circumference:h,rotation:d}=e._getRotationExtents(),{ratioX:u,ratioY:g,offsetX:f,offsetY:p}=function(t,e,n){let i=1,o=1,a=0,s=0;if(e<mt){const r=t,l=r+e,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),g=(t,e,i)=>Bt(t,r,l,!0)?1:Math.max(e,e*n,i,i*n),f=(t,e,i)=>Bt(t,r,l,!0)?-1:Math.min(e,e*n,i,i*n),p=g(0,c,d),m=g(_t,h,u),b=f(pt,c,d),x=f(pt+_t,h,u);i=(p-b)/2,o=(m-x)/2,a=-(p+b)/2,s=-(m+x)/2}return{ratioX:i,ratioY:o,offsetX:a,offsetY:s}}(d,h,l),m=(i.width-s)/u,b=(i.height-s)/g,x=Math.max(Math.min(m,b)/2,0),y=X(e.options.radius,x),_=(y-Math.max(y*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=f*y,e.offsetY=p*y,o.total=e.calculateTotal(),e.outerRadius=y-_*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-_*c,0),e.updateElements(a,0,a.length,t)}_circumference(t,e){const n=this,i=n.options,o=n._cachedMeta,a=n._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===o._parsed[t]?0:n.calculateCircumference(o._parsed[t]*a/mt)}updateElements(t,e,n,i){const o=this,a="reset"===i,s=o.chart,r=s.chartArea,l=s.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=a&&l.animateScale,u=d?0:o.innerRadius,g=d?0:o.outerRadius,f=o.resolveDataElementOptions(e,i),p=o.getSharedOptions(f),m=o.includeOptions(i,p);let b,x=o._getRotation();for(b=0;b<e;++b)x+=o._circumference(b,a);for(b=e;b<e+n;++b){const e=o._circumference(b,a),n=t[b],s={x:c+o.offsetX,y:h+o.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:g,innerRadius:u};m&&(s.options=p||o.resolveDataElementOptions(b,i)),x+=e,o.updateElement(n,b,s,i)}o.updateSharedOptions(p,i,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const e=t._parsed[n];null!==e&&!isNaN(e)&&this.chart.getDataVisibility(n)&&(i+=Math.abs(e))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?mt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=Ln(e._parsed[t],n.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){const e=this;let n=0;const i=e.chart;let o,a,s,r,l;if(!t)for(o=0,a=i.data.datasets.length;o<a;++o)if(i.isDatasetVisible(o)){s=i.getDatasetMeta(o),t=s.data,r=s.controller,r!==e&&r.configure();break}if(!t)return 0;for(o=0,a=t.length;o<a;++o)l=r.resolveDataElementOptions(o),"inner"!==l.borderAlign&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max($(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ro.id="doughnut",ro.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",indexAxis:"r"},ro.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((e,n)=>{const i=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:!t.getDataVisibility(n),index:n}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return j(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class lo extends In{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,n=e._cachedMeta,{dataset:i,data:o=[],_dataset:a}=n,s=e.chart._animationsDisabled;let{start:r,count:l}=function(t,e,n){const i=e.length;let o=0,a=i;if(t._sorted){const{iScale:s,_parsed:r}=t,l=s.axis,{min:c,max:h,minDefined:d,maxDefined:u}=s.getUserBounds();d&&(o=zt(Math.min(ee(r,s.axis,c).lo,n?i:ee(e,l,s.getPixelForValue(c)).lo),0,i-1)),a=u?zt(Math.max(ee(r,s.axis,h).hi+1,n?0:ee(e,l,s.getPixelForValue(h)).hi+1),o,i)-o:i-o}return{start:o,count:a}}(n,o,s);e._drawStart=r,e._drawCount=l,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,o={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=o,!0;const a=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,o),a}(n)&&(r=0,l=o.length),i._decimated=!!a._decimated,i.points=o;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(i,void 0,{animated:!s,options:c},t),e.updateElements(o,r,l,t)}updateElements(t,e,n,i){const o=this,a="reset"===i,{iScale:s,vScale:r,_stacked:l}=o._cachedMeta,c=o.resolveDataElementOptions(e,i),h=o.getSharedOptions(c),d=o.includeOptions(i,h),u=s.axis,g=r.axis,f=o.options.spanGaps,p=wt(f)?f:Number.POSITIVE_INFINITY,m=o.chart._animationsDisabled||a||"none"===i;let b=e>0&&o.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=o.getParsed(c),f=m?e:{},x=H(n[g]),y=f[u]=s.getPixelForValue(n[u],c),_=f[g]=a||x?r.getBasePixel():r.getPixelForValue(l?o.applyStack(r,n,l):n[g],c);f.skip=isNaN(y)||isNaN(_)||x,f.stop=c>0&&n[u]-b[u]>p,f.parsed=n,d&&(f.options=h||o.resolveDataElementOptions(c,i)),m||o.updateElement(e,c,f,i),b=n}o.updateSharedOptions(h,i,c)}getMaxOverflow(){const t=this,e=t._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,o=e.data||[];if(!o.length)return i;const a=o[0].size(t.resolveDataElementOptions(0)),s=o[o.length-1].size(t.resolveDataElementOptions(o.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}lo.id="line",lo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},lo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class co extends In{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=Ln(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:o}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,n=e.chartArea,i=e.options,o=Math.min(n.right-n.left,n.bottom-n.top),a=Math.max(o/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=a-s*t.index,t.innerRadius=t.outerRadius-s}updateElements(t,e,n,i){const o=this,a="reset"===i,s=o.chart,r=o.getDataset(),l=s.options.animation,c=o._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*pt;let g,f=u;const p=360/o.countVisibleElements();for(g=0;g<e;++g)f+=o._computeAngle(g,i,p);for(g=e;g<e+n;g++){const e=t[g];let n=f,m=f+o._computeAngle(g,i,p),b=s.getDataVisibility(g)?c.getDistanceFromCenterForValue(r.data[g]):0;f=m,a&&(l.animateScale&&(b=0),l.animateRotate&&(n=m=u));const x={x:h,y:d,innerRadius:0,outerRadius:b,startAngle:n,endAngle:m,options:o.resolveDataElementOptions(g,i)};o.updateElement(e,g,x,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?It(this.resolveDataElementOptions(t,e).angle||n):0}}co.id="polarArea",co.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},co.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((e,n)=>{const i=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:!t.getDataVisibility(n),index:n}}):[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class ho extends ro{}ho.id="pie",ho.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class uo extends In{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this,n=e._cachedMeta,i=n.dataset,o=n.data||[],a=n.iScale.getLabels();if(i.points=o,"resize"!==t){const n=e.resolveDatasetElementOptions(t);e.options.showLine||(n.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===o.length,options:n};e.updateElement(i,void 0,s,t)}e.updateElements(o,0,o.length,t)}updateElements(t,e,n,i){const o=this,a=o.getDataset(),s=o._cachedMeta.rScale,r="reset"===i;for(let l=e;l<e+n;l++){const e=t[l],n=o.resolveDataElementOptions(l,i),c=s.getPointPositionForValue(l,a.data[l]),h=r?s.xCenter:c.x,d=r?s.yCenter:c.y,u={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:n};o.updateElement(e,l,u,i)}}}uo.id="radar",uo.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},uo.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class go extends lo{}go.id="scatter",go.defaults={showLine:!1,fill:!1},go.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var fo=Object.freeze({__proto__:null,BarController:ao,BubbleController:so,DoughnutController:ro,LineController:lo,PolarAreaController:co,PieController:ho,RadarController:uo,ScatterController:go});function po(t,e){const{startAngle:n,endAngle:i,pixelMargin:o,x:a,y:s,outerRadius:r,innerRadius:l}=e;let c=o/r;t.beginPath(),t.arc(a,s,r,n-c,i+c),l>o?(c=o/l,t.arc(a,s,l,i+c,n-c,!0)):t.arc(a,s,o,i+_t,n-_t),t.closePath(),t.clip()}function mo(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function bo(t,e,n){const{x:i,y:o,startAngle:a,endAngle:s,pixelMargin:r,innerRadius:l}=e,c=Math.max(e.outerRadius+n-r,0),h=l>0?l+n+r:0,d=s-a,u=(d-Math.max(.001,d*c-n/pt)/c)/2,g=a+u,f=s-u,{outerStart:p,outerEnd:m,innerStart:b,innerEnd:x}=function(t,e,n,i){const o=Ae(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),a=(n-e)/2,s=Math.min(a,i*e/2),r=t=>{const e=(n-Math.min(a,t))*i/2;return zt(t,0,Math.min(a,e))};return{outerStart:r(o.outerStart),outerEnd:r(o.outerEnd),innerStart:zt(o.innerStart,0,s),innerEnd:zt(o.innerEnd,0,s)}}(e,h,c,f-g),y=c-p,_=c-m,v=g+p/y,M=f-m/_,S=h+b,C=h+x,k=g+b/S,P=f-x/C;if(t.beginPath(),t.arc(i,o,c,v,M),m>0){const e=mo(_,M,i,o);t.arc(e.x,e.y,m,M,f+_t)}const w=mo(C,f,i,o);if(t.lineTo(w.x,w.y),x>0){const e=mo(C,P,i,o);t.arc(e.x,e.y,x,f+_t,P+Math.PI)}if(t.arc(i,o,h,f-x/h,g+b/h,!0),b>0){const e=mo(S,k,i,o);t.arc(e.x,e.y,b,k+Math.PI,g-_t)}const T=mo(y,g,i,o);if(t.lineTo(T.x,T.y),p>0){const e=mo(y,v,i,o);t.arc(e.x,e.y,p,g-_t,v)}t.closePath()}class xo extends Dn{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,n){const i=this.getProps(["x","y"],n),{angle:o,distance:a}=Lt(i,{x:t,y:e}),{startAngle:s,endAngle:r,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n);return(h>=mt||Bt(o,s,r))&&a>=l&&a<=c}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),r=(i+o)/2,l=(a+s)/2;return{x:e+Math.cos(r)*l,y:n+Math.sin(r)*l}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,n=e.options,i=(n.offset||0)/2;if(e.pixelMargin="inner"===n.borderAlign?.33:0,e.fullCircles=Math.floor(e.circumference/mt),0===e.circumference||e.innerRadius<0||e.outerRadius<0)return;t.save();let o=0;if(i){o=i/2;const n=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(n)*o,Math.sin(n)*o),e.circumference>=pt&&(o=i)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,function(t,e,n){if(e.fullCircles){e.endAngle=e.startAngle+mt,bo(t,e,n);for(let n=0;n<e.fullCircles;++n)t.fill()}isNaN(e.circumference)||(e.endAngle=e.startAngle+e.circumference%mt),bo(t,e,n),t.fill()}(t,e,o),function(t,e,n){const{options:i}=e,o="inner"===i.borderAlign;i.borderWidth&&(o?(t.lineWidth=2*i.borderWidth,t.lineJoin="round"):(t.lineWidth=i.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:o,startAngle:a,endAngle:s,pixelMargin:r}=e,l=Math.max(e.outerRadius-r,0),c=e.innerRadius+r;let h;for(n&&(e.endAngle=e.startAngle+mt,po(t,e),e.endAngle=s,e.endAngle===e.startAngle&&(e.endAngle+=mt,e.fullCircles--)),t.beginPath(),t.arc(i,o,c,a+mt,a,!0),h=0;h<e.fullCircles;++h)t.stroke();for(t.beginPath(),t.arc(i,o,l,a,a+mt),h=0;h<e.fullCircles;++h)t.stroke()}(t,e,o),o&&po(t,e),bo(t,e,n),t.stroke())}(t,e,o),t.restore()}}function yo(t,e,n=e){t.lineCap=$(n.borderCapStyle,e.borderCapStyle),t.setLineDash($(n.borderDash,e.borderDash)),t.lineDashOffset=$(n.borderDashOffset,e.borderDashOffset),t.lineJoin=$(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=$(n.borderWidth,e.borderWidth),t.strokeStyle=$(n.borderColor,e.borderColor)}function _o(t,e,n){t.lineTo(n.x,n.y)}function vo(t,e,n={}){const i=t.length,{start:o=0,end:a=i-1}=n,{start:s,end:r}=e,l=Math.max(o,s),c=Math.min(a,r),h=o<s&&a<s||o>r&&a>r;return{count:i,start:l,loop:e.loop,ilen:c<l&&!h?i+c-l:c-l}}function Mo(t,e,n,i){const{points:o,options:a}=e,{count:s,start:r,loop:l,ilen:c}=vo(o,n,i),h=function(t){return t.stepped?Kt:t.tension||"monotone"===t.cubicInterpolationMode?Zt:_o}(a);let d,u,g,{move:f=!0,reverse:p}=i||{};for(d=0;d<=c;++d)u=o[(r+(p?c-d:d))%s],u.skip||(f?(t.moveTo(u.x,u.y),f=!1):h(t,g,u,p,a.stepped),g=u);return l&&(u=o[(r+(p?c:0))%s],h(t,g,u,p,a.stepped)),!!l}function So(t,e,n,i){const o=e.points,{count:a,start:s,ilen:r}=vo(o,n,i),{move:l=!0,reverse:c}=i||{};let h,d,u,g,f,p,m=0,b=0;const x=t=>(s+(c?r-t:t))%a,y=()=>{g!==f&&(t.lineTo(m,f),t.lineTo(m,g),t.lineTo(m,p))};for(l&&(d=o[x(0)],t.moveTo(d.x,d.y)),h=0;h<=r;++h){if(d=o[x(h)],d.skip)continue;const e=d.x,n=d.y,i=0|e;i===u?(n<g?g=n:n>f&&(f=n),m=(b*m+e)/++b):(y(),t.lineTo(e,n),u=i,b=0,g=f=n),p=n}y()}function Co(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?Mo:So}xo.id="arc",xo.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,angle:void 0},xo.defaultRoutes={backgroundColor:"backgroundColor"};const ko="function"==typeof Path2D;class Po extends Dn{constructor(t){super(),this.animated=!0,this.options=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,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this,i=n.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!n._pointsUpdated){const o=i.spanGaps?n._loop:n._fullLoop;hi(n._points,i,t,o,e),n._pointsUpdated=!0}}set points(t){const e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this,i=n.options,o=t[e],a=n.points,s=_i(n,{property:e,start:o,end:o});if(!s.length)return;const r=[],l=function(t){return t.stepped?ui:t.tension||"monotone"===t.cubicInterpolationMode?gi:di}(i);let c,h;for(c=0,h=s.length;c<h;++c){const{start:n,end:h}=s[c],d=a[n],u=a[h];if(d===u){r.push(d);continue}const g=l(d,u,Math.abs((o-d[e])/(u[e]-d[e])),i.stepped);g[e]=t[e],r.push(g)}return 1===r.length?r[0]:r}pathSegment(t,e,n){return Co(this)(t,this,e,n)}path(t,e,n){const i=this,o=i.segments,a=Co(i);let s=i._loop;e=e||0,n=n||i.points.length-e;for(const r of o)s&=a(t,i,r,{start:e,end:e+n-1});return!!s}draw(t,e,n,i){const o=this,a=o.options||{};(o.points||[]).length&&a.borderWidth&&(t.save(),function(t,e,n,i){ko&&1===e.segments.length?function(t,e,n,i){let o=e._path;o||(o=e._path=new Path2D,e.path(o,n,i)&&o.closePath()),yo(t,e.options),t.stroke(o)}(t,e,n,i):function(t,e,n,i){const{segments:o,options:a}=e,s=Co(e);for(const r of o)yo(t,a,r.style),t.beginPath(),s(t,e,r,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}(t,o,n,i),t.restore(),o.animated&&(o._pointsUpdated=!1,o._path=void 0))}}function wo(t,e,n,i){const o=t.options,{[n]:a}=t.getProps([n],i);return Math.abs(e-a)<o.radius+o.hitRadius}Po.id="line",Po.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Po.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Po.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class To extends Dn{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,n){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return wo(this,t,"x",e)}inYRange(t,e){return wo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t){const e=this,n=e.options;e.skip||n.radius<.1||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,$t(t,n,e.x,e.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Eo(t,e){const{x:n,y:i,base:o,width:a,height:s}=t.getProps(["x","y","base","width","height"],e);let r,l,c,h,d;return t.horizontal?(d=s/2,r=Math.min(n,o),l=Math.max(n,o),c=i-d,h=i+d):(d=a/2,r=n-d,l=n+d,c=Math.min(i,o),h=Math.max(i,o)),{left:r,top:c,right:l,bottom:h}}function Ao(t){let e=t.options.borderSkipped;const n={};return e?(e=t.horizontal?Io(e,"left","right",t.base>t.x):Io(e,"bottom","top",t.base<t.y),n[e]=!0,n):n}function Io(t,e,n,i){var o,a,s;return i?(s=n,t=Do(t=(o=t)===(a=e)?s:o===s?a:o,n,e)):t=Do(t,e,n),t}function Do(t,e,n){return"start"===t?e:"end"===t?n:t}function Oo(t,e,n,i){return t?0:Math.max(Math.min(e,i),n)}function Lo(t,e,n,i){const o=null===e,a=null===n,s=t&&!(o&&a)&&Eo(t,i);return s&&(o||e>=s.left&&e<=s.right)&&(a||n>=s.top&&n<=s.bottom)}function Ro(t,e){t.rect(e.x,e.y,e.w,e.h)}To.id="point",To.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},To.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class No extends Dn{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:n,outer:i}=function(t){const e=Eo(t),n=e.right-e.left,i=e.bottom-e.top,o=function(t,e,n){const i=t.options.borderWidth,o=Ao(t),a=Ie(i);return{t:Oo(o.top,a.top,0,n),r:Oo(o.right,a.right,0,e),b:Oo(o.bottom,a.bottom,0,n),l:Oo(o.left,a.left,0,e)}}(t,n/2,i/2),a=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,a=De(o),s=Math.min(e,n),r=Ao(t),l=i||U(o);return{topLeft:Oo(!l||r.top||r.left,a.topLeft,0,s),topRight:Oo(!l||r.top||r.right,a.topRight,0,s),bottomLeft:Oo(!l||r.bottom||r.left,a.bottomLeft,0,s),bottomRight:Oo(!l||r.bottom||r.right,a.bottomRight,0,s)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:a},inner:{x:e.left+o.l,y:e.top+o.t,w:n-o.l-o.r,h:i-o.t-o.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,a.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(o.b,o.r))}}}}(this),o=(a=i.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Qt:Ro;var a;t.save(),i.w===n.w&&i.h===n.h||(t.beginPath(),o(t,i),t.clip(),o(t,n),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),o(t,n),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,n){return Lo(this,t,e,n)}inXRange(t,e){return Lo(this,t,null,e)}inYRange(t,e){return Lo(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+i)/2:e,y:o?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}No.id="bar",No.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},No.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Fo=Object.freeze({__proto__:null,ArcElement:xo,LineElement:Po,PointElement:To,BarElement:No});function Bo(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function zo(t){t.data.datasets.forEach(t=>{Bo(t)})}var Vo={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void zo(t);const i=t.width;t.data.datasets.forEach((e,o)=>{const{_data:a,indexAxis:s}=e,r=t.getDatasetMeta(o),l=a||e.data;if("y"===Re([s,t.options.indexAxis]))return;if("line"!==r.type)return;const c=t.scales[r.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let h,{start:d,count:u}=function(t,e){const n=e.length;let i,o=0;const{iScale:a}=t,{min:s,max:r,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(o=zt(ee(e,a.axis,s).lo,0,n-1)),i=c?zt(ee(e,a.axis,r).hi+1,o,n)-o:n-o,{start:o,count:i}}(r,l);if(u<=4*i)Bo(e);else{switch(H(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":h=function(t,e,n,i,o){const a=o.samples||i;if(a>=n)return t.slice(e,e+n);const s=[],r=(n-2)/(a-2);let l=0;const c=e+n-1;let h,d,u,g,f,p=e;for(s[l++]=t[p],h=0;h<a-2;h++){let i,o=0,a=0;const c=Math.floor((h+1)*r)+1+e,m=Math.min(Math.floor((h+2)*r)+1,n)+e,b=m-c;for(i=c;i<m;i++)o+=t[i].x,a+=t[i].y;o/=b,a/=b;const x=Math.floor(h*r)+1+e,y=Math.floor((h+1)*r)+1+e,{x:_,y:v}=t[p];for(u=g=-1,i=x;i<y;i++)g=.5*Math.abs((_-o)*(t[i].y-v)-(_-t[i].x)*(a-v)),g>u&&(u=g,d=t[i],f=i);s[l++]=d,p=f}return s[l++]=t[c],s}(l,d,u,i,n);break;case"min-max":h=function(t,e,n,i){let o,a,s,r,l,c,h,d,u,g,f=0,p=0;const m=[],b=e+n-1,x=t[e].x,y=t[b].x-x;for(o=e;o<e+n;++o){a=t[o],s=(a.x-x)/y*i,r=a.y;const e=0|s;if(e===l)r<u?(u=r,c=o):r>g&&(g=r,h=o),f=(p*f+a.x)/++p;else{const n=o-1;if(!H(c)&&!H(h)){const e=Math.min(c,h),i=Math.max(c,h);e!==d&&e!==n&&m.push({...t[e],x:f}),i!==d&&i!==n&&m.push({...t[i],x:f})}o>0&&n!==d&&m.push(t[n]),m.push(a),l=e,p=0,u=g=r,c=h=d=o}}return m}(l,d,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=h}})},destroy(t){zo(t)}};function Ho(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=$(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(U(i))return!isNaN(i.value)&&i;let o=parseFloat(i);return W(o)&&Math.floor(o)===o?("-"!==i[0]&&"+"!==i[0]||(o=e+o),!(o===e||o<0||o>=n)&&o):["origin","start","end","stack"].indexOf(i)>=0&&i}class jo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:o,radius:a}=this;return e=e||{start:0,end:mt},t.arc(i,o,a,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,o=t.angle;return{x:e+Math.cos(o)*i,y:n+Math.sin(o)*i,angle:o}}}const Uo=t=>"line"===t.type&&!t.hidden;function Wo(t,e,n){const i=[];for(let o=0;o<n.length;o++){const a=n[o],{first:s,last:r,point:l}=qo(a,e,"x");if(!(!l||s&&r))if(s)i.unshift(l);else if(t.push(l),!r)break}t.push(...i)}function qo(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const o=i[n],a=t.segments,s=t.points;let r=!1,l=!1;for(let t=0;t<a.length;t++){const e=a[t],i=s[e.start][n],c=s[e.end][n];if(o>=i&&o<=c){r=o===i,l=o===c;break}}return{first:r,last:l,point:i}}function $o(t,e){let n=[],i=!1;return j(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},o=e.points,a=[];return e.segments.forEach(t=>{const e=o[t.start],s=o[t.end];null!==i?(a.push({x:e.x,y:i}),a.push({x:s.x,y:i})):null!==n&&(a.push({x:n,y:e.y}),a.push({x:n,y:s.y}))}),a}(t,e),n.length?new Po({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Yo(t,e,n){let i=t[e].fill;const o=[e];let a;if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!W(i))return i;if(a=t[i],!a)return!1;if(a.visible)return i;o.push(i),i=a.fill}return!1}function Xo(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Go(t,e,n,i){if(i)return;let o=e[t],a=n[t];return"angle"===t&&(o=Ft(o),a=Ft(a)),{property:t,start:o,end:a}}function Ko(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Zo(t,e,n){const{top:i,bottom:o}=e.chart.chartArea,{property:a,start:s,end:r}=n||{};"x"===a&&(t.beginPath(),t.rect(s,i,r-s,o-i),t.clip())}function Jo(t,e,n,i){const o=e.interpolate(n,i);o&&t.lineTo(o.x,o.y)}function Qo(t,e){const{line:n,target:i,property:o,color:a,scale:s}=e,r=function(t,e,n){const i=t.segments,o=t.points,a=e.points,s=[];for(const t of i){const i=Go(n,o[t.start],o[t.end],t.loop);if(!e.segments){s.push({source:t,target:i,start:o[t.start],end:o[t.end]});continue}const r=_i(e,i);for(const e of r){const r=Go(n,a[e.start],a[e.end],e.loop),l=yi(t,o,r);for(const t of l)s.push({source:t,target:e,start:{[n]:Ko(i,r,"start",Math.max)},end:{[n]:Ko(i,r,"end",Math.min)}})}}return s}(n,i,o);for(const{source:e,target:l,start:c,end:h}of r){const{style:{backgroundColor:r=a}={}}=e;t.save(),t.fillStyle=r,Zo(t,s,Go(o,c,h)),t.beginPath();const d=!!n.pathSegment(t,e);d?t.closePath():Jo(t,i,h,o);const u=!!i.pathSegment(t,l,{move:d,reverse:!0}),g=d&&u;g||Jo(t,i,c,o),t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function ta(t,e,n){const i=function(t){const{chart:e,fill:n,line:i}=t;if(W(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{chart:e,scale:n,index:i,line:o}=t,a=[],s=o.segments,r=o.points,l=function(t,e){const n=[],i=t.getSortedVisibleDatasetMetas();for(let t=0;t<i.length;t++){const o=i[t];if(o.index===e)break;Uo(o)&&n.unshift(o.dataset)}return n}(e,i);l.push($o({x:null,y:n.bottom},o));for(let t=0;t<s.length;t++){const e=s[t];for(let t=e.start;t<=e.end;t++)Wo(a,r[t],l)}return new Po({points:a,options:{}})}(t);const o=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,o=e.getLabels().length,a=[],s=i.reverse?e.max:e.min,r=i.reverse?e.min:e.max;let l,c,h;if(h="start"===n?s:"end"===n?r:U(n)?n.value:e.getBaseValue(),i.grid.circular)return c=e.getPointPositionForValue(0,s),new jo({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(h)});for(l=0;l<o;++l)a.push(e.getPointPositionForValue(l,h));return a}(t):function(t){const{scale:e={},fill:n}=t;let i,o=null;return"start"===n?o=e.bottom:"end"===n?o=e.top:U(n)?o=e.getPixelForValue(n.value):e.getBasePixel&&(o=e.getBasePixel()),W(o)?(i=e.isHorizontal(),{x:i?o:null,y:i?null:o}):null}(t)}(t);return o instanceof jo?o:$o(o,i)}(e),{line:o,scale:a,axis:s}=e,r=o.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:d=c}=l||{};i&&o.points.length&&(Xt(t,n),function(t,e){const{line:n,target:i,above:o,below:a,area:s,scale:r}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&a!==o&&(Xo(t,i,s.top),Qo(t,{line:n,target:i,color:o,scale:r,property:l}),t.restore(),t.save(),Xo(t,i,s.bottom)),Qo(t,{line:n,target:i,color:a,scale:r,property:l}),t.restore()}(t,{line:o,target:i,above:h,below:d,area:n,scale:a,axis:s}),Gt(t))}var ea={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,o=[];let a,s,r,l;for(s=0;s<i;++s)a=t.getDatasetMeta(s),r=a.dataset,l=null,r&&r.options&&r instanceof Po&&(l={visible:t.isDatasetVisible(s),index:s,fill:Ho(r,s,i),chart:t,axis:a.controller.options.indexAxis,scale:a.vScale,line:r}),a.$filler=l,o.push(l);for(s=0;s<i;++s)l=o[s],l&&!1!==l.fill&&(l.fill=Yo(o,s,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,o=t.getSortedVisibleDatasetMetas(),a=t.chartArea;for(let e=o.length-1;e>=0;--e){const n=o[e].$filler;n&&(n.line.updateControlPoints(a,n.axis),i&&ta(t.ctx,n,a))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&ta(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&ta(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const na=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class ia extends Dn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){const i=this;i.maxWidth=t,i.maxHeight=e,i._margins=n,i.setDimensions(),i.buildLabels(),i.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height)}buildLabels(){const t=this,e=t.options.labels||{};let n=G(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(n=>e.filter(n,t.chart.data))),e.sort&&(n=n.sort((n,i)=>e.sort(n,i,t.chart.data))),t.options.reverse&&n.reverse(),t.legendItems=n}fit(){const t=this,{options:e,ctx:n}=t;if(!e.display)return void(t.width=t.height=0);const i=e.labels,o=Le(i.font),a=o.size,s=t._computeTitleHeight(),{boxWidth:r,itemHeight:l}=na(i,a);let c,h;n.font=o.string,t.isHorizontal()?(c=t.maxWidth,h=t._fitRows(s,a,r,l)+10):(h=t.maxHeight,c=t._fitCols(s,a,r,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(h,e.maxHeight||t.maxHeight)}_fitRows(t,e,n,i){const o=this,{ctx:a,maxWidth:s,options:{labels:{padding:r}}}=o,l=o.legendHitBoxes=[],c=o.lineWidths=[0],h=i+r;let d=t;a.textAlign="left",a.textBaseline="middle";let u=-1,g=-h;return o.legendItems.forEach((t,o)=>{const f=n+e/2+a.measureText(t.text).width;(0===o||c[c.length-1]+f+2*r>s)&&(d+=h,c[c.length-(o>0?0:1)]=0,g+=h,u++),l[o]={left:0,top:g,row:u,width:f,height:i},c[c.length-1]+=f+r}),d}_fitCols(t,e,n,i){const o=this,{ctx:a,maxHeight:s,options:{labels:{padding:r}}}=o,l=o.legendHitBoxes=[],c=o.columnSizes=[],h=s-t;let d=r,u=0,g=0,f=0,p=0,m=0;return o.legendItems.forEach((t,o)=>{const s=n+e/2+a.measureText(t.text).width;o>0&&g+e+2*r>h&&(d+=u+r,c.push({width:u,height:g}),f+=u+r,m++,p=0,u=g=0),u=Math.max(u,s),g+=e+r,l[o]={left:f,top:p,col:m,width:s,height:i},p+=i+r}),d+=u,c.push({width:u,height:g}),d}adjustHitBoxes(){const t=this;if(!t.options.display)return;const e=t._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:a}}}=t;if(this.isHorizontal()){let s=0,r=o(i,t.left+a,t.right-t.lineWidths[s]);for(const l of n)s!==l.row&&(s=l.row,r=o(i,t.left+a,t.right-t.lineWidths[s])),l.top+=t.top+e+a,l.left=r,r+=l.width+a}else{let s=0,r=o(i,t.top+e+a,t.bottom-t.columnSizes[s].height);for(const l of n)l.col!==s&&(s=l.col,r=o(i,t.top+e+a,t.bottom-t.columnSizes[s].height)),l.top=r,l.left+=t.left+a,r+=l.height+a}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const t=this;if(t.options.display){const e=t.ctx;Xt(e,t),t._draw(),Gt(e)}}_draw(){const t=this,{options:e,columnSizes:n,lineWidths:i,ctx:s}=t,{align:r,labels:l}=e,c=ft.color,h=fi(e.rtl,t.left,t.width),d=Le(l.font),{color:u,padding:g}=l,f=d.size,p=f/2;let m;t.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:b,boxHeight:x,itemHeight:y}=na(l,f),_=t.isHorizontal(),v=this._computeTitleHeight();m=_?{x:o(r,t.left+g,t.right-i[0]),y:t.top+g+v,line:0}:{x:t.left+g,y:o(r,t.top+v+g,t.bottom-n[0].height),line:0},pi(t.ctx,e.textDirection);const M=y+g;t.legendItems.forEach((e,S)=>{s.strokeStyle=e.fontColor||u,s.fillStyle=e.fontColor||u;const C=s.measureText(e.text).width,k=h.textAlign(e.textAlign||(e.textAlign=l.textAlign)),P=b+f/2+C;let w=m.x,T=m.y;h.setWidth(t.width),_?S>0&&w+P+g>t.right&&(T=m.y+=M,m.line++,w=m.x=o(r,t.left+g,t.right-i[m.line])):S>0&&T+M>t.bottom&&(w=m.x=w+n[m.line].width+g,m.line++,T=m.y=o(r,t.top+v+g,t.bottom-n[m.line].height)),function(t,e,n){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();const i=$(n.lineWidth,1);if(s.fillStyle=$(n.fillStyle,c),s.lineCap=$(n.lineCap,"butt"),s.lineDashOffset=$(n.lineDashOffset,0),s.lineJoin=$(n.lineJoin,"miter"),s.lineWidth=i,s.strokeStyle=$(n.strokeStyle,c),s.setLineDash($(n.lineDash,[])),l.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},a=h.xPlus(t,b/2);$t(s,o,a,e+p)}else{const o=e+Math.max((f-x)/2,0),a=h.leftForLtr(t,b),r=De(n.borderRadius);s.beginPath(),Object.values(r).some(t=>0!==t)?Qt(s,{x:a,y:o,w:b,h:x,radius:r}):s.rect(a,o,b,x),s.fill(),0!==i&&s.stroke()}s.restore()}(h.x(w),T,e),w=a(k,w+b+p,t.right),function(t,e,n){Jt(s,n.text,t,e+y/2,d,{strikethrough:n.hidden,textAlign:n.textAlign})}(h.x(w),T,e),_?m.x+=P+g:m.y+=M}),mi(t.ctx,e.textDirection)}drawTitle(){const t=this,e=t.options,n=e.title,a=Le(n.font),s=Oe(n.padding);if(!n.display)return;const r=fi(e.rtl,t.left,t.width),l=t.ctx,c=n.position,h=a.size/2,d=s.top+h;let u,g=t.left,f=t.width;if(this.isHorizontal())f=Math.max(...t.lineWidths),u=t.top+d,g=o(e.align,g,t.right-f);else{const n=t.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);u=d+o(e.align,t.top,t.bottom-n-e.labels.padding-t._computeTitleHeight())}const p=o(c,g,g+f);l.textAlign=r.textAlign(i(c)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=a.string,Jt(l,n.text,p,u,a)}_computeTitleHeight(){const t=this.options.title,e=Le(t.font),n=Oe(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){const n=this;let i,o,a;if(t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom)for(a=n.legendHitBoxes,i=0;i<a.length;++i)if(o=a[i],t>=o.left&&t<=o.left+o.width&&e>=o.top&&e<=o.top+o.height)return n.legendItems[i];return null}handleEvent(t){const e=this,n=e.options;if(!function(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,n))return;const i=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const s=e._hoveredItem,r=(a=i,null!==(o=s)&&null!==a&&o.datasetIndex===a.datasetIndex&&o.index===a.index);s&&!r&&G(n.onLeave,[t,s,e],e),e._hoveredItem=i,i&&!r&&G(n.onHover,[t,i,e],e)}else i&&G(n.onClick,[t,i,e],e);var o,a}}var oa={id:"legend",_element:ia,start(t,e,n){const i=t.legend=new ia({ctx:t.ctx,options:n,chart:t});Ye.configure(t,i,n),Ye.addBox(t,i)},stop(t){Ye.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Ye.configure(t,i,n),i.options=n},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,n){const i=e.datasetIndex,o=n.chart;o.isDatasetVisible(i)?(o.hide(i),e.hidden=!0):(o.show(i),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:n,pointStyle:i,textAlign:o,color:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const s=t.controller.getStyle(n?0:void 0),r=Oe(s.borderWidth);return{text:e[t.index].label,fillStyle:s.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:s.borderColor,pointStyle:i||s.pointStyle,rotation:s.rotation,textAlign:o||s.textAlign,borderRadius:0,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 aa extends Dn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this,i=n.options;if(n.left=0,n.top=0,!i.display)return void(n.width=n.height=n.right=n.bottom=0);n.width=n.right=t,n.height=n.bottom=e;const o=j(i.text)?i.text.length:1;n._padding=Oe(i.padding);const a=o*Le(i.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=a:n.width=a}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:a,options:s}=this,r=s.align;let l,c,h,d=0;return this.isHorizontal()?(c=o(r,n,a),h=e+t,l=a-n):("left"===s.position?(c=n+t,h=o(r,i,e),d=-.5*pt):(c=a-t,h=o(r,e,i),d=.5*pt),l=i-e),{titleX:c,titleY:h,maxWidth:l,rotation:d}}draw(){const t=this,e=t.ctx,n=t.options;if(!n.display)return;const o=Le(n.font),a=o.lineHeight/2+t._padding.top,{titleX:s,titleY:r,maxWidth:l,rotation:c}=t._drawArgs(a);Jt(e,n.text,0,0,o,{color:n.color,maxWidth:l,rotation:c,textAlign:i(n.align),textBaseline:"middle",translation:[s,r]})}}var sa={id:"title",_element:aa,start(t,e,n){!function(t,e){const n=new aa({ctx:t.ctx,options:e,chart:t});Ye.configure(t,n,e),Ye.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Ye.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Ye.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ra={average(t){if(!t.length)return!1;let e,n,i=0,o=0,a=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,o+=t.y,++a}}return{x:i/a,y:o/a}},nearest(t,e){if(!t.length)return!1;let n,i,o,a=e.x,s=e.y,r=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=Rt(e,i.getCenterPoint());t<r&&(r=t,o=i)}}if(o){const t=o.tooltipPosition();a=t.x,s=t.y}return{x:a,y:s}}};function la(t,e){return e&&(j(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ca(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function ha(t,e){const{element:n,datasetIndex:i,index:o}=e,a=t.getDatasetMeta(i).controller,{label:s,value:r}=a.getLabelAndValue(o);return{chart:t,label:s,parsed:a.getParsed(o),raw:t.data.datasets[i].data[o],formattedValue:r,dataset:a.getDataset(),dataIndex:o,datasetIndex:i,element:n}}function da(t,e){const n=t._chart.ctx,{body:i,footer:o,title:a}=t,{boxWidth:s,boxHeight:r}=e,l=Le(e.bodyFont),c=Le(e.titleFont),h=Le(e.footerFont),d=a.length,u=o.length,g=i.length,f=Oe(e.padding);let p=f.height,m=0,b=i.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-g)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,n.measureText(t).width+x)};return n.save(),n.font=c.string,K(t.title,y),n.font=l.string,K(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?s+2:0,K(i,t=>{K(t.before,y),K(t.lines,y),K(t.after,y)}),x=0,n.font=h.string,K(t.footer,y),n.restore(),m+=f.width,{width:m,height:p}}function ua(t,e,n,i){const{x:o,width:a}=n,{width:s,chartArea:{left:r,right:l}}=t;let c="center";return"center"===i?c=o<=(r+l)/2?"left":"right":o<=a/2?c="left":o>=s-a/2&&(c="right"),function(t,e,n,i){const{x:o,width:a}=i,s=n.caretSize+n.caretPadding;return"left"===t&&o+a+s>e.width||"right"===t&&o-a-s<0||void 0}(c,t,e,n)&&(c="center"),c}function ga(t,e,n){const i=e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||ua(t,e,n,i),yAlign:i}}function fa(t,e,n,i){const{caretSize:o,caretPadding:a,cornerRadius:s}=t,{xAlign:r,yAlign:l}=n,c=o+a,h=s+a;let d=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,r);const u=function(t,e,n){let{y:i,height:o}=t;return"top"===e?i+=n:i-="bottom"===e?o+n:o/2,i}(e,l,c);return"center"===l?"left"===r?d+=c:"right"===r&&(d-=c):"left"===r?d-=h:"right"===r&&(d+=h),{x:zt(d,0,i.width-e.width),y:zt(u,0,i.height-e.height)}}function pa(t,e,n){const i=Oe(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function ma(t){return la([],ca(t))}function ba(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class xa extends Dn{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,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,e=t._cachedAnimations;if(e)return e;const n=t._chart,i=t.options.setContext(t.getContext()),o=i.enabled&&n.options.animation&&i.animations,a=new yn(t._chart,o);return o._cacheable&&(t._cachedAnimations=Object.freeze(a)),a}getContext(){const t=this;return t.$context||(t.$context=(e=t._chart.getContext(),n=t,i=t._tooltipItems,Object.assign(Object.create(e),{tooltip:n,tooltipItems:i,type:"tooltip"})));var e,n,i}getTitle(t,e){const n=this,{callbacks:i}=e,o=i.beforeTitle.apply(n,[t]),a=i.title.apply(n,[t]),s=i.afterTitle.apply(n,[t]);let r=[];return r=la(r,ca(o)),r=la(r,ca(a)),r=la(r,ca(s)),r}getBeforeBody(t,e){return ma(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const n=this,{callbacks:i}=e,o=[];return K(t,t=>{const e={before:[],lines:[],after:[]},a=ba(i,t);la(e.before,ca(a.beforeLabel.call(n,t))),la(e.lines,a.label.call(n,t)),la(e.after,ca(a.afterLabel.call(n,t))),o.push(e)}),o}getAfterBody(t,e){return ma(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const n=this,{callbacks:i}=e,o=i.beforeFooter.apply(n,[t]),a=i.footer.apply(n,[t]),s=i.afterFooter.apply(n,[t]);let r=[];return r=la(r,ca(o)),r=la(r,ca(a)),r=la(r,ca(s)),r}_createItems(t){const e=this,n=e._active,i=e._chart.data,o=[],a=[],s=[];let r,l,c=[];for(r=0,l=n.length;r<l;++r)c.push(ha(e._chart,n[r]));return t.filter&&(c=c.filter((e,n,o)=>t.filter(e,n,o,i))),t.itemSort&&(c=c.sort((e,n)=>t.itemSort(e,n,i))),K(c,n=>{const i=ba(t.callbacks,n);o.push(i.labelColor.call(e,n)),a.push(i.labelPointStyle.call(e,n)),s.push(i.labelTextColor.call(e,n))}),e.labelColors=o,e.labelPointStyles=a,e.labelTextColors=s,e.dataPoints=c,c}update(t,e){const n=this,i=n.options.setContext(n.getContext()),o=n._active;let a,s=[];if(o.length){const t=ra[i.position].call(n,o,n._eventPosition);s=n._createItems(i),n.title=n.getTitle(s,i),n.beforeBody=n.getBeforeBody(s,i),n.body=n.getBody(s,i),n.afterBody=n.getAfterBody(s,i),n.footer=n.getFooter(s,i);const e=n._size=da(n,i),r=Object.assign({},t,e),l=ga(n._chart,i,r),c=fa(i,r,l,n._chart);n.xAlign=l.xAlign,n.yAlign=l.yAlign,a={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==n.opacity&&(a={opacity:0});n._tooltipItems=s,n.$context=void 0,a&&n._resolveAnimations().update(n,a),t&&i.external&&i.external.call(n,{chart:n._chart,tooltip:n,replay:e})}drawCaret(t,e,n,i){const o=this.getCaretPosition(t,n,i);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:o}=this,{cornerRadius:a,caretSize:s}=n,{x:r,y:l}=t,{width:c,height:h}=e;let d,u,g,f,p,m;return"center"===o?(p=l+h/2,"left"===i?(d=r,u=d-s,f=p+s,m=p-s):(d=r+c,u=d+s,f=p-s,m=p+s),g=d):(u="left"===i?r+a+s:"right"===i?r+c-a-s:this.caretX,"top"===o?(f=l,p=f-s,d=u-s,g=u+s):(f=l+h,p=f+s,d=u+s,g=u-s),m=f),{x1:d,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,n){const i=this,o=i.title,a=o.length;let s,r,l;if(a){const c=fi(n.rtl,i.x,i.width);for(t.x=pa(i,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",s=Le(n.titleFont),r=n.titleSpacing,e.fillStyle=n.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r,l+1===a&&(t.y+=n.titleMarginBottom-r)}}_drawColorBox(t,e,n,i,o){const a=this,s=a.labelColors[n],r=a.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=Le(o.bodyFont),d=pa(a,"left",o),u=i.x(d),g=l<h.lineHeight?(h.lineHeight-l)/2:0,f=e.y+g;if(o.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},n=i.leftForLtr(u,c)+c/2,a=f+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,$t(t,e,n,a),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,$t(t,e,n,a)}else{t.lineWidth=s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=i.leftForLtr(u,c),n=i.leftForLtr(i.xPlus(u,1),c-2),a=De(s.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Qt(t,{x:e,y:f,w:c,h:l,radius:a}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Qt(t,{x:n,y:f+1,w:c-2,h:l-2,radius:a}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,f,c,l),t.strokeRect(e,f,c,l),t.fillStyle=s.backgroundColor,t.fillRect(n,f+1,c-2,l-2))}t.fillStyle=a.labelTextColors[n]}drawBody(t,e,n){const i=this,{body:o}=i,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:l,boxWidth:c}=n,h=Le(n.bodyFont);let d=h.lineHeight,u=0;const g=fi(n.rtl,i.x,i.width),f=function(n){e.fillText(n,g.x(t.x+u),t.y+d/2),t.y+=d+a},p=g.textAlign(s);let m,b,x,y,_,v,M;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=pa(i,p,n),e.fillStyle=n.bodyColor,K(i.beforeBody,f),u=r&&"right"!==p?"center"===s?c/2+1:c+2:0,y=0,v=o.length;y<v;++y){for(m=o[y],b=i.labelTextColors[y],e.fillStyle=b,K(m.before,f),x=m.lines,r&&x.length&&(i._drawColorBox(e,t,y,g,n),d=Math.max(h.lineHeight,l)),_=0,M=x.length;_<M;++_)f(x[_]),d=h.lineHeight;K(m.after,f)}u=0,d=h.lineHeight,K(i.afterBody,f),t.y-=a}drawFooter(t,e,n){const i=this,o=i.footer,a=o.length;let s,r;if(a){const l=fi(n.rtl,i.x,i.width);for(t.x=pa(i,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",s=Le(n.footerFont),e.fillStyle=n.footerColor,e.font=s.string,r=0;r<a;++r)e.fillText(o[r],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:o,yAlign:a}=this,{x:s,y:r}=t,{width:l,height:c}=n,h=i.cornerRadius;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(s+h,r),"top"===a&&this.drawCaret(t,e,n,i),e.lineTo(s+l-h,r),e.quadraticCurveTo(s+l,r,s+l,r+h),"center"===a&&"right"===o&&this.drawCaret(t,e,n,i),e.lineTo(s+l,r+c-h),e.quadraticCurveTo(s+l,r+c,s+l-h,r+c),"bottom"===a&&this.drawCaret(t,e,n,i),e.lineTo(s+h,r+c),e.quadraticCurveTo(s,r+c,s,r+c-h),"center"===a&&"left"===o&&this.drawCaret(t,e,n,i),e.lineTo(s,r+h),e.quadraticCurveTo(s,r,s+h,r),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,n=e._chart,i=e.$animations,o=i&&i.x,a=i&&i.y;if(o||a){const i=ra[t.position].call(e,e._active,e._eventPosition);if(!i)return;const s=e._size=da(e,t),r=Object.assign({},i,e._size),l=ga(n,t,r),c=fa(t,r,l,n);o._to===c.x&&a._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=s.width,e.height=s.height,e.caretX=i.x,e.caretY=i.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,n=e.options.setContext(e.getContext());let i=e.opacity;if(!i)return;e._updateAnimationTarget(n);const o={width:e.width,height:e.height},a={x:e.x,y:e.y};i=Math.abs(i)<.001?0:i;const s=Oe(n.padding),r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;n.enabled&&r&&(t.save(),t.globalAlpha=i,e.drawBackground(a,t,o,n),pi(t,n.textDirection),a.y+=s.top,e.drawTitle(a,t,n),e.drawBody(a,t,n),e.drawFooter(a,t,n),mi(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this,i=n._active,o=t.map(({datasetIndex:t,index:e})=>{const i=n._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!Z(i,o),s=n._positionChanged(o,e);(a||s)&&(n._active=o,n._eventPosition=e,n.update(!0))}handleEvent(t,e){const n=this,i=n.options,o=n._active||[];let a=!1,s=[];"mouseout"!==t.type&&(s=n._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&s.reverse());const r=n._positionChanged(s,t);return a=e||!Z(s,o)||r,a&&(n._active=s,(i.enabled||i.external)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0,e))),a}_positionChanged(t,e){const{caretX:n,caretY:i,options:o}=this,a=ra[o.position].call(this,t,e);return!1!==a&&(n!==a.x||i!==a.y)}}xa.positioners=ra;var ya={id:"tooltip",_element:xa,positioners:ra,afterInit(t,e,n){n&&(t.tooltip=new xa({_chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n)&&(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,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:{beforeTitle:z,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:z,beforeBody:z,beforeLabel:z,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 n=t.formattedValue;return H(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:z,afterBody:z,beforeFooter:z,footer:z,afterFooter:z}},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"]},_a=Object.freeze({__proto__:null,Decimation:Vo,Filler:ea,Legend:oa,Title:sa,Tooltip:ya});class va extends Wn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(H(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:zt(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n){const i=t.indexOf(e);return-1===i?((t,e,n)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:n)(t,e,n):i!==t.lastIndexOf(e)?n:i}(n,t,$(e,t)),n.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let{min:i,max:o}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(i=0),n||(o=t.getLabels().length-1)),t.min=i,t.max=o}buildTicks(){const t=this,e=t.min,n=t.max,i=t.options.offset,o=[];let a=t.getLabels();a=0===e&&n===a.length-1?a:a.slice(e,n+1),t._valueRange=Math.max(a.length-(i?0:1),1),t._startValue=t.min-(i?.5:0);for(let t=e;t<=n;t++)o.push({value:t});return o}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){const e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){return this.bottom}}function Ma(t,e,{horizontal:n,minRotation:i}){const o=It(i),a=(n?Math.sin(o):Math.cos(o))||.001,s=.75*e*(""+t).length;return Math.min(e/a,s)}va.id="category",va.defaults={ticks:{callback:va.prototype.getLabelForValue}};class Sa extends Wn{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 H(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:n,maxDefined:i}=t.getUserBounds();let{min:o,max:a}=t;const s=t=>o=n?o:t,r=t=>a=i?a:t;if(e){const t=Ct(o),e=Ct(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}o===a&&(r(a+1),e||s(o-1)),t.min=o,t.max=a}getTickLimit(){const t=this,e=t.options.ticks;let n,{maxTicksLimit:i,stepSize:o}=e;return o?n=Math.ceil(t.max/o)-Math.floor(t.min/o)+1:(n=t.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,n=e.ticks;let i=t.getTickLimit();i=Math.max(2,i);const o=function(t,e){const n=[],{step:i,min:o,max:a,precision:s,count:r,maxTicks:l,maxDigits:c,includeBounds:h}=t,d=i||1,u=l-1,{min:g,max:f}=e,p=!H(o),m=!H(a),b=!H(r),x=(f-g)/(c+1);let y,_,v,M,S=kt((f-g)/u/d)*d;if(S<1e-14&&!p&&!m)return[{value:g},{value:f}];M=Math.ceil(f/S)-Math.floor(g/S),M>u&&(S=kt(M*S/u/d)*d),H(s)||(y=Math.pow(10,s),S=Math.ceil(S*y)/y),_=Math.floor(g/S)*S,v=Math.ceil(f/S)*S,p&&m&&i&&Et((a-o)/i,S/1e3)?(M=Math.min((a-o)/S,l),S=(a-o)/M,_=o,v=a):b?(_=p?o:_,v=m?a:v,M=r-1,S=(v-_)/M):(M=(v-_)/S,M=Tt(M,Math.round(M),S/1e3)?Math.round(M):Math.ceil(M));const C=Math.max(Ot(S),Ot(_));y=Math.pow(10,H(s)?C:s),_=Math.round(_*y)/y,v=Math.round(v*y)/y;let k=0;for(p&&(h&&_!==o?(n.push({value:o}),_<o&&k++,Tt(Math.round((_+k*S)*y)/y,o,Ma(o,x,t))&&k++):_<o&&k++);k<M;++k)n.push({value:Math.round((_+k*S)*y)/y});return m&&h&&v!==a?Tt(n[n.length-1].value,a,Ma(a,x,t))?n[n.length-1].value=a:n.push({value:a}):m&&v!==a||n.push({value:v}),n}({maxTicks:i,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:n.minRotation||0,includeBounds:!1!==n.includeBounds},t._range||t);return"ticks"===e.bounds&&At(o,t,"value"),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),o}configure(){const t=this,e=t.ticks;let n=t.min,i=t.max;if(super.configure(),t.options.offset&&e.length){const t=(i-n)/Math.max(e.length-1,1)/2;n-=t,i+=t}t._startValue=n,t._endValue=i,t._valueRange=i-n}getLabelForValue(t){return Ln(t,this.chart.options.locale)}}class Ca extends Sa{determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=W(e)?e:0,t.max=W(n)?n:1,t.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),n=e?t.width:t.height,i=It(t.options.ticks.minRotation),o=(e?Math.sin(i):Math.cos(i))||.001,a=t._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,a.lineHeight/o))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function ka(t){return 1==t/Math.pow(10,Math.floor(St(t)))}Ca.id="linear",Ca.defaults={ticks:{callback:Nn.formatters.numeric}};class Pa extends Wn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Sa.prototype.parse.apply(this,[t,e]);if(0!==n)return W(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=W(e)?Math.max(0,e):null,t.max=W(n)?Math.max(0,n):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let i=t.min,o=t.max;const a=t=>i=e?i:t,s=t=>o=n?o:t,r=(t,e)=>Math.pow(10,Math.floor(St(t))+e);i===o&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(o,1)))),i<=0&&a(r(o,-1)),o<=0&&s(r(i,1)),t._zero&&t.min!==t._suggestedMin&&i===r(t.min,0)&&a(r(i,-1)),t.min=i,t.max=o}buildTicks(){const t=this,e=t.options,n=function(t,e){const n=Math.floor(St(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),o=[];let a=q(t.min,Math.pow(10,Math.floor(St(e.min)))),s=Math.floor(St(a)),r=Math.floor(a/Math.pow(10,s)),l=s<0?Math.pow(10,Math.abs(s)):1;do{o.push({value:a,major:ka(a)}),++r,10===r&&(r=1,++s,l=s>=0?1:l),a=Math.round(r*Math.pow(10,s)*l)/l}while(s<n||s===n&&r<i);const c=q(t.max,a);return o.push({value:c,major:ka(a)}),o}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&At(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}getLabelForValue(t){return void 0===t?"0":Ln(t,this.chart.options.locale)}configure(){const t=this,e=t.min;super.configure(),t._startValue=St(e),t._valueRange=St(t.max)-St(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(St(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,n=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+n*e._valueRange)}}function wa(t){const e=t.ticks;if(e.display&&t.display){const t=Oe(e.backdropPadding);return $(e.font&&e.font.size,ft.font.size)+t.height}return 0}function Ta(t,e,n,i,o){return t===i||t===o?{start:e-n/2,end:e+n/2}:t<i||t>o?{start:e-n,end:e}:{start:e,end:e+n}}function Ea(t){return 0===t||180===t?"center":t<180?"left":"right"}function Aa(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function Ia(t,e,n,i){const{ctx:o}=t;if(n)o.arc(t.xCenter,t.yCenter,e,0,mt);else{let n=t.getPointPosition(0,e);o.moveTo(n.x,n.y);for(let a=1;a<i;a++)n=t.getPointPosition(a,e),o.lineTo(n.x,n.y)}}function Da(t){return wt(t)?t:0}Pa.id="logarithmic",Pa.defaults={ticks:{callback:Nn.formatters.logarithmic,major:{enabled:!0}}};class Oa extends Sa{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=wa(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!1);t.min=W(e)&&!isNaN(e)?e:0,t.max=W(n)&&!isNaN(n)?n:0,t.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/wa(this.options))}generateTickLabels(t){const e=this;Sa.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map((t,n)=>{const i=G(e.options.pointLabels.callback,[t,n],e);return i||0===i?i:""})}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},n={};let i,o,a;const s=[],r=[],l=t.getLabels().length;for(i=0;i<l;i++){const l=t.options.pointLabels.setContext(t.getContext(i));r[i]=l.padding,a=t.getPointPosition(i,t.drawingArea+r[i]);const u=Le(l.font);t.ctx.font=u.string,c=t.ctx,h=u.lineHeight,o=j(d=t._pointLabels[i])?{w:Ut(c,c.font,d),h:d.length*h}:{w:c.measureText(d).width,h:h},s[i]=o;const g=t.getIndexAngle(i),f=Dt(g),p=Ta(f,a.x,o.w,0,180),m=Ta(f,a.y,o.h,90,270);p.start<e.l&&(e.l=p.start,n.l=g),p.end>e.r&&(e.r=p.end,n.r=g),m.start<e.t&&(e.t=m.start,n.t=g),m.end>e.b&&(e.b=m.end,n.b=g)}var c,h,d;t._setReductions(t.drawingArea,e,n),t._pointLabelItems=[];const u=t.options,g=wa(u),f=t.getDistanceFromCenterForValue(u.ticks.reverse?t.min:t.max);for(i=0;i<l;i++){const e=0===i?g/2:0,n=t.getPointPosition(i,f+e+r[i]),o=Dt(t.getIndexAngle(i)),a=s[i];Aa(o,a,n);const l=Ea(o);let c;c="left"===l?n.x:"center"===l?n.x-a.w/2:n.x-a.w;const h=c+a.w;t._pointLabelItems[i]={x:n.x,y:n.y,textAlign:l,left:c,top:n.y,right:h,bottom:n.y+a.h}}}(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,n){const i=this;let o=e.l/Math.sin(n.l),a=Math.max(e.r-i.width,0)/Math.sin(n.r),s=-e.t/Math.cos(n.t),r=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);o=Da(o),a=Da(a),s=Da(s),r=Da(r),i.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(o+a)/2),Math.floor(t-(s+r)/2))),i.setCenterPoint(o,a,s,r)}setCenterPoint(t,e,n,i){const o=this,a=o.width-e-o.drawingArea,s=t+o.drawingArea,r=n+o.drawingArea,l=o.height-o.paddingTop-i-o.drawingArea;o.xCenter=Math.floor((s+a)/2+o.left),o.yCenter=Math.floor((r+l)/2+o.top+o.paddingTop)}getIndexAngle(t){return Ft(t*(mt/this.getLabels().length)+It(this.options.startAngle||0))}getDistanceFromCenterForValue(t){const e=this;if(H(t))return NaN;const n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n}getValueForDistanceFromCenter(t){if(H(t))return NaN;const e=this,n=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-n:e.min+n}getPointPosition(t,e){const n=this,i=n.getIndexAngle(t)-_t;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:o}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:n}}=t.options;if(e){const i=t.ctx;i.save(),i.beginPath(),Ia(t,t.getDistanceFromCenterForValue(t._endValue),n,t.getLabels().length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const t=this,e=t.ctx,n=t.options,{angleLines:i,grid:o}=n,a=t.getLabels().length;let s,r,l;if(n.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let o=e-1;o>=0;o--){const e=i.setContext(t.getContext(o)),a=Le(e.font),{x:s,y:r,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[o],{backdropColor:g}=e;if(!H(g)){const t=Oe(e.backdropPadding);n.fillStyle=g,n.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}Jt(n,t._pointLabels[o],s,r+a.lineHeight/2,a,{color:e.color,textAlign:l,textBaseline:"middle"})}}(t,a),o.display&&t.ticks.forEach((e,n)=>{if(0!==n){r=t.getDistanceFromCenterForValue(e.value);const i=o.setContext(t.getContext(n-1));!function(t,e,n,i){const o=t.ctx,a=e.circular,{color:s,lineWidth:r}=e;!a&&!i||!s||!r||n<0||(o.save(),o.strokeStyle=s,o.lineWidth=r,o.setLineDash(e.borderDash),o.lineDashOffset=e.borderDashOffset,o.beginPath(),Ia(t,n,a,i),o.closePath(),o.stroke(),o.restore())}(t,i,r,a)}}),i.display){for(e.save(),s=t.getLabels().length-1;s>=0;s--){const o=i.setContext(t.getContext(s)),{color:a,lineWidth:c}=o;c&&a&&(e.lineWidth=c,e.strokeStyle=a,e.setLineDash(o.borderDash),e.lineDashOffset=o.borderDashOffset,r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),l=t.getPointPosition(s,r),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,n=t.options,i=n.ticks;if(!i.display)return;const o=t.getIndexAngle(0);let a,s;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((o,r)=>{if(0===r&&!n.reverse)return;const l=i.setContext(t.getContext(r)),c=Le(l.font);if(a=t.getDistanceFromCenterForValue(t.ticks[r].value),l.showLabelBackdrop){s=e.measureText(o.label).width,e.fillStyle=l.backdropColor;const t=Oe(l.backdropPadding);e.fillRect(-s/2-t.left,-a-c.size/2-t.top,s+t.width,c.size+t.height)}Jt(e,o.label,0,-a,c,{color:l.color})}),e.restore()}drawTitle(){}}Oa.id="radialLinear",Oa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Nn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},Oa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Oa.descriptors={angleLines:{_fallback:"grid"}};const La={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}},Ra=Object.keys(La);function Na(t,e){return t-e}function Fa(t,e){if(H(e))return null;const n=t._adapter,{parser:i,round:o,isoWeekday:a}=t._parseOpts;let s=e;return"function"==typeof i&&(s=i(s)),W(s)||(s="string"==typeof i?n.parse(s,i):n.parse(s)),null===s?null:(o&&(s="week"!==o||!wt(a)&&!0!==a?n.startOf(s,o):n.startOf(s,"isoWeek",a)),+s)}function Ba(t,e,n,i){const o=Ra.length;for(let a=Ra.indexOf(t);a<o-1;++a){const t=La[Ra[a]],o=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(o*t.size))<=i)return Ra[a]}return Ra[o-1]}function za(t,e,n){if(n){if(n.length){const{lo:i,hi:o}=te(n,e);t[n[i]>=e?n[i]:n[o]]=!0}}else t[e]=!0}function Va(t,e,n){const i=[],o={},a=e.length;let s,r;for(s=0;s<a;++s)r=e[s],o[r]=s,i.push({value:r,major:!1});return 0!==a&&n?function(t,e,n,i){const o=t._adapter,a=+o.startOf(e[0].value,i),s=e[e.length-1].value;let r,l;for(r=a;r<=s;r=+o.add(r,1,i))l=n[r],l>=0&&(e[l].major=!0);return e}(t,i,o,n):i}class Ha extends Wn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new to._date(t.adapters.date);nt(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,n=t._adapter,i=e.time.unit||"day";let{min:o,max:a,minDefined:s,maxDefined:r}=t.getUserBounds();function l(t){s||isNaN(t.min)||(o=Math.min(o,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),o=W(o)&&!isNaN(o)?o:+n.startOf(Date.now(),i),a=W(a)&&!isNaN(a)?a:+n.endOf(Date.now(),i)+1,t.min=Math.min(o,a-1),t.max=Math.max(o+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this,e=t.options,n=e.time,i=e.ticks,o="labels"===i.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&o.length&&(t.min=t._userMin||o[0],t.max=t._userMax||o[o.length-1]);const a=t.min,s=ie(o,a,t.max);return t._unit=n.unit||(i.autoSkip?Ba(n.minUnit,t.min,t.max,t._getLabelCapacity(a)):function(t,e,n,i,o){for(let a=Ra.length-1;a>=Ra.indexOf(n);a--){const n=Ra[a];if(La[n].common&&t._adapter.diff(o,i,n)>=e-1)return n}return Ra[n?Ra.indexOf(n):0]}(t,s.length,n.minUnit,t.min,t.max)),t._majorUnit=i.major.enabled&&"year"!==t._unit?function(t){for(let e=Ra.indexOf(t)+1,n=Ra.length;e<n;++e)if(La[Ra[e]].common)return Ra[e]}(t._unit):void 0,t.initOffsets(o),e.reverse&&s.reverse(),Va(t,s,t._majorUnit)}initOffsets(t){const e=this;let n,i,o=0,a=0;e.options.offset&&t.length&&(n=e.getDecimalForValue(t[0]),o=1===t.length?1-n:(e.getDecimalForValue(t[1])-n)/2,i=e.getDecimalForValue(t[t.length-1]),a=1===t.length?i:(i-e.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;o=zt(o,0,s),a=zt(a,0,s),e._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const t=this,e=t._adapter,n=t.min,i=t.max,o=t.options,a=o.time,s=a.unit||Ba(a.minUnit,n,i,t._getLabelCapacity(n)),r=$(a.stepSize,1),l="week"===s&&a.isoWeekday,c=wt(l)||!0===l,h={};let d,u,g=n;if(c&&(g=+e.startOf(g,"isoWeek",l)),g=+e.startOf(g,c?"day":s),e.diff(i,n,s)>1e5*r)throw new Error(n+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===o.ticks.source&&t.getDataTimestamps();for(d=g,u=0;d<i;d=+e.add(d,r,s),u++)za(h,d,f);return d!==i&&"ticks"!==o.bounds&&1!==u||za(h,d,f),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const o=this,a=o.options,s=a.time.displayFormats,r=o._unit,l=o._majorUnit,c=r&&s[r],h=l&&s[l],d=n[e],u=l&&h&&d&&d.major,g=o._adapter.format(t,i||(u?h:c)),f=a.ticks.callback;return f?G(f,[g,e,n],o):g}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){const e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){const e=this,n=e._offsets,i=e.getDecimalForValue(t);return e.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return e.min+i*(e.max-e.min)}_getLabelSize(t){const e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,o=It(e.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(o),s=Math.sin(o),r=e._resolveTickFontOptions(0).size;return{w:i*a+r*s,h:i*s+r*a}}_getLabelCapacity(t){const e=this,n=e.options.time,i=n.displayFormats,o=i[n.unit]||i.millisecond,a=e._tickFormatFunction(t,0,Va(e,[t],e._majorUnit),o),s=e._getLabelSize(a),r=Math.floor(e.isHorizontal()?e.width/s.w:e.height/s.h)-1;return r>0?r:1}getDataTimestamps(){const t=this;let e,n,i=t._cache.data||[];if(i.length)return i;const o=t.getMatchingVisibleMetas();if(t._normalized&&o.length)return t._cache.data=o[0].controller.getAllParsedValues(t);for(e=0,n=o.length;e<n;++e)i=i.concat(o[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(i)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let n,i;if(e.length)return e;const o=t.getLabels();for(n=0,i=o.length;n<i;++n)e.push(Fa(t,o[n]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return re(t.sort(Na))}}function ja(t,e,n){let i,o,a,s;if(n)i=Math.floor(e),o=Math.ceil(e),a=t[i],s=t[o];else{const n=te(t,e);a=n.lo,s=n.hi,i=t[a],o=t[s]}const r=o-i;return r?a+(s-a)*(e-i)/r:a}Ha.id="time",Ha.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Ua extends Ha{constructor(t){super(t),this._table=[],this._maxIndex=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable();t._table=t.buildLookupTable(e),t._maxIndex=t._table.length-1,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:n}=this;if(!t.length)return[{time:e,pos:0},{time:n,pos:1}];const i=[e];let o,a,s;for(o=0,a=t.length;o<a;++o)s=t[o],s>e&&s<n&&i.push(s);return i.push(n),i}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const n=t.getDataTimestamps(),i=t.getLabelTimestamps();return e=n.length&&i.length?t.normalize(n.concat(i)):n.length?n:i,e=t._cache.all=e,e}getPixelForValue(t,e){const n=this,i=n._offsets,o=n._normalized&&n._maxIndex>0&&!H(e)?e/n._maxIndex:n.getDecimalForValue(t);return n.getPixelForDecimal((i.start+o)*i.factor)}getDecimalForValue(t){return ja(this._table,t)/this._maxIndex}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return ja(e._table,i*this._maxIndex,!0)}}Ua.id="timeseries",Ua.defaults=Ha.defaults;var Wa=Object.freeze({__proto__:null,CategoryScale:va,LinearScale:Ca,LogarithmicScale:Pa,RadialLinearScale:Oa,TimeScale:Ha,TimeSeriesScale:Ua});return Ki.register(fo,Wa,Fo,_a),Ki.helpers={...ki},Ki._adapters=to,Ki.Animation=bn,Ki.Animations=yn,Ki.animator=s,Ki.controllers=wi.controllers.items,Ki.DatasetController=In,Ki.Element=Dn,Ki.elements=Fo,Ki.Interaction=Pe,Ki.layouts=Ye,Ki.platforms=hn,Ki.Scale=Wn,Ki.Ticks=Nn,Object.assign(Ki,fo,Wa,Fo,_a,hn),Ki.Chart=Ki,"undefined"!=typeof window&&(window.Chart=Ki),Ki})),RegExp.quote=function(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")},Number.prototype.byte2Mbit=function(){return 8*this/1e6},Number.prototype.formatDataUsage=function(){let t;return this>=1e12?(t=Math.round(this/1099511627776),t+="TB"):this>=1e9?(t=Math.round(this/1073741824),t+="GB"):this>=1e6?(t=Math.round(this/1048576),t+="MB"):this>=1e3?(t=Math.round(this/1024),t+="kB"):t=Math.round(this)+"B",t},Number.prototype.round2=function(){return Math.round(100*this)/100},String.prototype.trimBlank=function(){return this.replace(/^\s+|\s+$/g,"")},String.prototype.isMAC=function(){return null!==this.match(/^(([0-9A-Fa-f]{2}[:-]?){5}([0-9A-Fa-f]{2}))$/)},String.prototype.isValidPubIP=function(){if(null!=this.match(/^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$/)){if(null==this.match(/((^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.))/))return!0}return!1},Number.prototype.leadingZero=function(){return("0"+this).slice(-2)},Date.prototype.leadingZero=function(){return("0"+this).slice(-2)},String.prototype.regexIndexOf=function(t,e){let n=this.substring(e||0).search(t);return n>=0?n+(e||0):n},String.prototype.regexLastIndexOf=function(t,e){t=t.global?t:new RegExp(t.source,"g"+(t.ignoreCase?"i":"")+(t.multiLine?"m":"")),void 0===e?e=this.length:e<0&&(e=0);let n=this.substring(0,e+1),i=-1,o=0;for(;null!=(result=t.exec(n));)i=result.index,t.lastIndex=++o;return i},Element.prototype.emptyElement=function(){for(;this.firstChild;)this.removeChild(this.firstChild)};const PLATFORM_MIMO_OFDM="MIMO_OFDM",PLATFORM_SISO_OFDM="SISO_OFDM",PLATFORM_FSK="FSK",CanopyEnhancer=function(){this.browser="chrome",this.refreshTime=0,this.lastRefresh=0,this.tooltipMACNode={},this.tooltipIPNode={},this.settings={cge_enabled:1,cge_custom_css:1,cge_ip_lookup:1,cge_mac_lookup:1,cge_ap_evaluation:1,cge_ap_throughput:1,cge_ap_data_vc:1,cge_rtt_type:"string",cge_rtt_graph_entries:10,cge_debug:0},this.intervalsTimeout=0,this.currentCatIndex=-1,this.currentPageIndex=-1,this.currentRadioMAC="000000000000",this.currentRadioModulation="MIMO_OFDM",this.isMedusa=!1,this.medusaObserver=null,this.mainTrafficBlockID=null,this.inTrafficID=null,this.outTrafficID=null,this.inUcastPktsID=null,this.outUcastPktsID=null,this.inNUcastPktsID=null,this.outNUcastPktsID=null,this.realTimeTrafficChart=null,this.trafficData={started:!1,prevInOctets:0,inTraffic:0,prevOutOctets:0,outTraffic:0,prevInUcastPkts:0,inUcastPps:0,prevOutUcastPkts:0,outUcastPps:0,prevInNUcastPkts:0,inNUcastPps:0,prevOutNUcastPkts:0,outNUcastPps:0},this.ethernetErrorsFields=["FecCb_ifmib_ifInErrors","FecCb_ifmib_ifOutErrors","FecCb_fec_crerrs","FecCb_fec_rcvfifonobufs","FecCb_fec_clserrs","FecCb_fec_rlerrs","FecCb_fec_unerrs","FecCb_fec_cslerrs","FecCb_fec_nocs","FecCb_fec_lgerrs","FecCb_fec_sherrs","FecCb_fec_excdef"],this.radioErrorsFields=["RfCb_ifmib_ifInDiscards","RfCb_ifmib_ifInErrors","RfCb_ifmib_ifInUnknownProtos","RfCb_ifmib_ifOutDiscards","RfCb_ifmib_ifOutErrors","SoundingStats_ResponsesSuppressed","SoundingStats_ErrorCount","SoundingStats_VersionMismatch"],this.apEvaluationBlock=document.getElementById("APEval"),this.APEvaluationObj=[],this.apSelectionMethod="",this.currentEvaluationEntry=-1,this.currentSessionStatus="",this.currentColorCode="",this.currentlyScanning="",this.APThroughputSM={},this.Sections=[],this.Sections[0]={name:"Home",pages:{1:"General Status",5:"Event Log",6:"Network Interfaces",7:"Layer 2 Neighbors",10:"DFS Status"}},this.Sections[1]={name:"Configuration"},this.Sections[2]={name:"Statistics",pages:{7:"Ethernet",9:"Radio",11:"Data VC",12:"Throughput",15:"NAT Stats",16:"NAT DHCP",20:"ARP"}},this.Sections[3]={name:"Tool",pages:{4:"AP Evaluation",6:"Alignment Tool"}},this.Sections[5]={name:"Logs",pages:{9:"NAT Table"}},this.Sections[6]={name:"Accounts"},this.Sections[8]={name:"PDA"},this.Sections[9]={name:"Copyright"},this.APEvaluationFields={MIMO_OFDM:["Index","Frequency","Channel Bandwidth","Cyclic Prefix","ESN","Region","Beacon Receive Power","Beacon Count","FECEn","Type","Multipoint Avail","Age","Lockout","RegFail","Range","MaxRange","TxBER","EBcast","Session Count","NoLUIDS","OutOfRange","AuthFail","EncryptFail","Rescan Req","SMLimitReached","NoVC's","VCRsv/430smFail","VCActFail","AP Gain","AP RcvT","SectorID","Color Code","BeaconVersion","SectorUserCount","SyncSrc","NumULSlots","NumDLSlots","NumULContSlots","WhiteSched","ICC","Authentication","SM PPPoE","Frame Period"],SISO_OFDM:["Index","Frequency","Channel Bandwidth","Cyclic Prefix","ESN","Region","Beacon Receive Power Level","Beacon Count","FECEn","Type","Multipoint Avail","Age","Lockout","RegFail","Range","MaxRange","TxBER","EBcast","Session Count","NoLUIDS","OutOfRange","AuthFail","EncryptFail","Rescan Req","SMLimitReached","NoVC's","VCRsv/430smFail","VCActFail","AP Gain","AP RcvT","SectorID","Color Code","BeaconVersion","SectorUserCount","SyncSrc","NumULSlots","NumDLSlots","NumULContSlots","WhiteSched","ICC","Authentication","SM PPPoE","Frame Period"],FSK:["Index","Frequency","ESN","Region","Jitter","Beacon Receive Power Level","Beacon Count","BRcvW","FECEn","Type","Multipoint Avail","Age","Lockout","RegFail","Range","MaxRange","TxBER","EBcast","Session Count","NoLUIDS","OutOfRange","AuthFail","EncryptFail","Rescan Req","SMLimitReached","NoVC's","VCRsvFail","VCActFail","AP Gain","AP RcvT:","FrameNumber","SectorID","Color Code","BeaconVersion","SectorUserCount","NumULHalfSlots","NumDLHalfSlots","NumULContSlots","WhiteSched","Authentication","SM PPPoE","Frame Period"]},this.eventLogErrorStrings=["FatalError()","Watchdog Reset","ADI Communication Failure","ADI forced reset has been invoked!"],this.soundingStatsFields=["VC","reference SF:","soundingState","soundingFault","mumimoVetoCount","channelDistortion","nullingSNR","cnResponseCountSM","cnResponseCountAP","missedTagCount"]};if(CanopyEnhancer.prototype.initialize=function(){if(this.browser=function(){let t=navigator.userAgent.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);return void 0===typeof t[1]?"chrome":t[1].toLowerCase()}(),this.getRadioMac(),"000000000000"!==this.currentRadioMAC){clearInterval(document.ajaxtimerid),this.loadSettings(),!0===this.debugMessages()&&console.log("Browser platform: "+this.browser);let t=document.getElementById("page").querySelector("h2");if(null!==t){let e=t.textContent,n=null,i=e.match(/.*(?:GHz|MHz)(?:\sAdjustable\sPower)?\s\-\s([a-zA-Z\-\s]+)\s\-\s([A-Fa-f0-9\-]{17})/);null!==i?(n=i[1],this.currentRadioModulation="FSK"):(i=e.match(/.*(?:GHz|MHz)\sSISO\sOFDM\s\-\s([a-zA-Z\-\s]+)\s\-\s([A-Fa-f0-9\-]{17})/),null!==i?(n=i[1],this.currentRadioModulation="SISO_OFDM"):(i=e.match(/.*(?:GHz|MHz)\s(MU\-)?MIMO(?:\sOFDM)?\s\-\s([a-zA-Z\-\s]+)(?:\s\-\s|\n)([A-Fa-f0-9\-]{17})/),i&&(n=i[2],i[1]&&(this.isMedusa=!0)))),null!==n?this.getDevType(n):this.currentRadioType="SM"}else!0===this.debugMessages()&&console.log("Title not found");!0===this.debugMessages()&&(console.log("Current radio Modulation: "+this.currentRadioModulation),console.log("Current radio Type: "+this.currentRadioType)),this.identifySection(),this.getRefreshTime();let e=document.createElement("strong");e.className="cge-color-blue-cambium",e.appendChild(document.createTextNode(this.getSiteNameTitle()+": ")),document.querySelector("#page > h1").insertBefore(e,document.querySelector("#page > h1").firstChild),!0===this.debugMessages()&&(console.log("CGE Enabled!"),console.log("Current radio MAC "+this.currentRadioMAC),console.log("Current Section Category: "+this.getCurrentCatName()+" ("+this.currentCatIndex+")"),console.log("Current Section Page: "+this.getCurrentPageName()+" ("+this.currentPageIndex+")")),this.enhancedCSS(),this.homePageRender(),this.realTimeTraffic(),this.betterEvaluation(),this.MacLookupPage(),this.NATTable(),this.APThroughput(),this.dataVC(),this.EventLog(),this.sessionStatus(),this.SetUpAJAX()}},CanopyEnhancer.prototype.getSiteNameTitle=function(){let t=document.getElementsByTagName("title")[0].textContent.match(/(.*)\s\-\s(?:[a-zA-Z0-9\s]+)\[(?:.*)\]/);return t?t[1]:""},CanopyEnhancer.prototype.getRefreshTime=function(){let t=document.getElementsByTagName("body")[0].getAttribute("onload"),e=t.match(/handleLoad\(([0-9]+)\,.*/);return e&&e[1]?(this.refreshTime=parseInt(e[1]),void(this.intervalsTimeout=1e3*this.refreshTime+1)):(e=t.match(/handleLoadMilli\(([0-9]+)\,.*/),e&&e[1]?(this.refreshTime=parseInt(e[1])/1e3,void(this.intervalsTimeout=1e3*this.refreshTime+1)):void(this.refreshTime=0))},CanopyEnhancer.prototype.getDevType=function(t){this.currentRadioType="Subscriber Module"===t?"SM":"Access Point"===t?"AP":"BH"},CanopyEnhancer.prototype.SetUpAJAX=function(){if(this.refreshTime>0){let e=this;function t(){void 0!==document.ajaxtimerid&&clearInterval(document.ajaxtimerid);let t=document.request;if(void 0===t||t.readyState>0&&t.readyState<4)return;let n=[],i=getElementsByClassName(document,"table","section");for(let t=0;t<i.length;t++)i[t].style.display&&"none"===i[t].style.display||(n=n.concat(getElementsByClassName(i[t],"span","var")));let o=location.search.substr(1);for(let t=0;t<n.length;t++)o+="&"+n[t].id+"="+GetVarRefreshOption(n[t].id);o+="&"+RebootClass+"= ",t.open("POST","query.cgi",!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send(o),t.onreadystatechange=function(){let t=document.request;if(4===t.readyState)if(200===t.status){if(t.responseXML){let g=t.responseXML.getElementsByTagName("var");for(let t=0;t<g.length;t++){let e=g[t].getAttribute("id");if(e.indexOf("PowerLevelOFDMMax")>=0&&(max_rssi=g[t].firstChild.nodeValue.substr(0,g[t].firstChild.nodeValue.indexOf(" "))),e.indexOf("PowerLevelOFDMCurrent")>=0){var n=g[t].firstChild.nodeValue.substr(0,g[t].firstChild.nodeValue.indexOf(" "));if(document.getElementsByTagName("title")[0].innerHTML.indexOf("Alignment Tool")>-1&&(d3,1)){var i=[],o=(new Date).getTime()/1e3;i[0]={CurrentTimeStamp:o,ReceivePower:n};var a={boardValue:i};DS.updateItem("rssi_chart",a),Number(n)>Number(max_rssi)?DS.getItem("rssi_chart").setMax(n):null==DS.getItem("rssi_chart").maxLine&&DS.getItem("rssi_chart").setMax(max_rssi);var s,r={value:"",options:clone(rssi_chart.data)};c=(s=DS.getItem("rssi_chart")).getVal(),(l=DataStorageItem.mapValue(c,s.getValues(rssi_chart)))?(l.options=jsExtend(r.options,l.options),r=l):r.value=c,r.validity=s.getValidity(),s=r;var l=rssi_chart.data.marg[rssi_chart.data.subtype]||rssi_chart.data.marg.line,c=s.value.chartData;if(this.opts=s,c[0]&&c[0].list.length>1){if(!initialised){var h=document.getElementById("SectionGraph"),d=document.createElement("div");d.id="diagram_max_rssi",d.class="diagram_wrapper",flat_d=$(d).flatGraph(),h.appendChild(flat_d[0]);h=document.getElementById("SectionGraph");var u=document.createElement("div");u.id="rssi_chart_wrap",u.style="min-height: 270px;",h.appendChild(u),rssi_chart.initialized=!1,rssi_chart.wrapperId="rssi_chart_wrap",rssi_chart.data.chart=window.SimpleChart(),rssi_chart.data.chart(rssi_chart.data.subtype,"#"+rssi_chart.wrapperId),rssi_chart.data.chart.margin(l).duration(0).xRule(!0).yRule(!0).background("#000").height(s.options.height-l.top-l.bottom).width($(document.getElementById("rssi_chart_wrap")).width()-l.left-l.right),"acs"!==rssi_chart.data.subtype?(rssi_chart.data.chart.data(c),void 0!==s.options.minMaxYValuesCoef&&rssi_chart.data.chart.minMaxYValuesCoef(s.options.minMaxYValuesCoef),void 0!==s.options.adjustTimeAutoScale&&rssi_chart.data.chart.adjustTimeAutoScale(s.options.adjustTimeAutoScale),void 0!==s.options.minimumYRange&&rssi_chart.data.chart.minimumYRange(s.options.minimumYRange),rssi_chart.data.chart.xScale("time")):rssi_chart.data.chart.xScale("ordinal"),rssi_chart.data.chart.yScale("linear"),initialised=1}c[0]&&("acs"===rssi_chart.data.subtype&&rssi_chart.data.chart.data(s.value.chartData),s.value.maxLine&&rssi_chart.data.chart.setMax(s.value.maxLine),rssi_chart.data.chart.generate())}initialised&&flat_d.flatGraph("setDiagramValue",n)}}if(e!==RebootClass){let n="";if(g[t].hasChildNodes()&&(n=g[t].firstChild.nodeValue),e=PerformRefreshOverride(e,n),e){let t=document.getElementById(e);if(t)if(t.emptyElement(),t.insertAdjacentHTML("afterbegin",n),document.createEvent){let e=document.createEvent("Event");e.initEvent("change",!0,!0),t.dispatchEvent(e)}else if(document.createEventObject){let e=document.createEventObject();t.fireEvent("onclick",e)}}}else{let e=getElementsByClassName(document,"span",RebootClass);for(let n=0;n<e.length;n++)if(g[t].hasChildNodes()&&g[t].firstChild.nodeValue)e[n].emptyElement(),e[n].insertAdjacentHTML("afterbegin",g[t].firstChild.nodeValue);else if(e[n].hasChildNodes())for(;e[n].lastChild;)e[n].removeChild(e[n].lastChild)}}e.isTrafficPage()&&e.updateTrafficData(t.responseXML.getElementById(e.inTrafficID).firstChild.nodeValue,t.responseXML.getElementById(e.outTrafficID).firstChild.nodeValue,t.responseXML.getElementById(e.inUcastPktsID).firstChild.nodeValue,t.responseXML.getElementById(e.outUcastPktsID).firstChild.nodeValue,t.responseXML.getElementById(e.inNUcastPktsID).firstChild.nodeValue,t.responseXML.getElementById(e.outNUcastPktsID).firstChild.nodeValue),e.homePageRender(),e.APThroughputCalc(),e.dataVCCalc(),e.sessionStatus(),e.lastRefresh=Date.now()}}else 401===t.status&&(clearInterval(document.cge_ajaxtimerid),document.rebootId||window.location.reload())}}t(),document.cge_ajaxtimerid=setInterval(t,1e3*this.refreshTime)}},CanopyEnhancer.prototype.getRadioMac=function(){let t=document.getElementsByTagName("link")[0].getAttribute("href").match(/\_canopy\.css\?mac_esn\=([A-Fa-f0-9]{12})/);this.currentRadioMAC=null!==t?t[1].toUpperCase():"000000000000"},CanopyEnhancer.prototype.loadSettings=function(){let t=this;try{let e=JSON.parse(document.CGESettings);for(let n in e)e.hasOwnProperty(n)&&(t.settings[n]=e[n])}catch(t){console.error(t)}},CanopyEnhancer.prototype.debugMessages=function(){return 1===this.settings.cge_debug},CanopyEnhancer.prototype.enhancedCSS=function(){if(1===this.settings.cge_custom_css){let t=document.querySelectorAll('input[type="submit"]');for(let e=0;e<t.length;e++)t[e].className="btn btn-sm btn-cambium";document.getElementById("loginbutton")&&(document.getElementById("loginbutton").className="btn btn-sm btn-default")}},CanopyEnhancer.prototype.identifySection=function(){let t=window.location.href.match(/catindex\=([0-9]+).*pageindex\=([0-9]+)/);null!=t&&t[1]&&t[2]?(this.currentCatIndex=Number(t[1]),this.currentPageIndex=Number(t[2])):(this.currentCatIndex=0,this.currentPageIndex=1)},CanopyEnhancer.prototype.getCurrentCatName=function(){return this.Sections[this.currentCatIndex]?this.Sections[this.currentCatIndex].name:"Unknown"},CanopyEnhancer.prototype.getCurrentPageName=function(){return this.Sections[this.currentCatIndex]?void 0!==this.Sections[this.currentCatIndex].pages?this.Sections[this.currentCatIndex].pages[this.currentPageIndex]:0:"Unknown"},CanopyEnhancer.prototype.getSignalPowerClass=function(t){let e="bold ";return e+=t>-70?"cge-good-power-level":t<=-70&&t>-80?"cge-decent-power-level":"cge-bad-power-level",e},CanopyEnhancer.prototype.getSNRClass=function(t,e){let n="bold ";if(t=Number(t),(e=Number(e))>0&&t>0){let i=(t+e)/2;n+=i>24?"cge-good-power-level":i<=24&&i>12?"cge-decent-power-level":"cge-bad-power-level"}else n+="cge-bad-power-level";return n},CanopyEnhancer.prototype.getAdaptRateClass=function(t,e){switch(t=Number(t),e){case"MIMO-A":case"SISO":if(1===t)return"cge-poorlink-text";if(2===t)return"cge-avglink-text";if(3===t)return"cge-betterlink-text";if(4===t)return"cge-bestlink-text";break;case"MIMO-B":if(t<=2)return"cge-poorlink-text";if(t<=4)return"cge-avglink-text";if(t<=6)return"cge-betterlink-text";if(t=8)return"cge-bestlink-text"}return""},CanopyEnhancer.prototype.ishomePage=function(){return 0===this.currentCatIndex&&1===this.currentPageIndex},CanopyEnhancer.prototype.homePageRender=function(){if(this.ishomePage()){let n;n=null!==document.getElementById("LinkStatus")?document.getElementById("LinkStatus"):document.getElementById("LinkStatusMain");let i=n.textContent;if("100Base-TX Full Duplex"!==i&&"1000Base-T Full Duplex"!==i){var t=document.createElement("span");t.className="cge-warning",t.appendChild(document.createTextNode(n.textContent)),n.emptyElement(),n.appendChild(t)}let o=document.getElementById("Distance");if(null!==o){let t=o.textContent.match(/(([0-9]{1,2})\.([0-9]{0,3}))\smiles/);if(null!==t){let e=1.60934*parseFloat(t[1]);o.appendChild(document.createTextNode(" - "+e.toFixed(3)+" kilometres"))}}if("MIMO_OFDM"===this.currentRadioModulation){let t,n=document.getElementById("PowerLevelOFDM");if(null!==n){var e=n.textContent;e=parseFloat(e.replace(" dBm","")),n.emptyElement(),t=document.createElement("span"),t.className=this.getSignalPowerClass(e),t.appendChild(document.createTextNode(e+" dBm")),n.appendChild(t)}let i=document.getElementById("SignalToNoiseRatioSM");if(null!==i){let e="",n=i.textContent,o=n.match(/([\d]+)\sV\s\/\s([\d]+)\sH\sdB/);o?e=this.getSNRClass(o[1],o[2]):(o=n.match(/([\d]+)\sdB\sMIMO\-(?:[A-B])/),o&&(e=this.getSNRClass(o[1],0))),""!==e&&(i.emptyElement(),t=document.createElement("span"),t.className=e,t.appendChild(document.createTextNode(n)),i.appendChild(t))}let o=document.getElementById("SesRate");if(o){let e=o.textContent.match(/VC\s{1,2}(?:[\d]{1,3})\sRate\s(?:\d)X\/(\d)X\s((?:MIMO|SISO)\-?(?:[A-B]))/i);e&&(o.emptyElement(),t=document.createElement("span"),t.className=this.getAdaptRateClass(e[1],e[2]),t.appendChild(document.createTextNode(e[0])),o.appendChild(t))}}let a=document.getElementById("SectionSiteInfoStats");a.parentNode.insertBefore(a,document.getElementById("SectionDeviceInfo"))}},CanopyEnhancer.prototype.isEthernetStats=function(){return 2===this.currentCatIndex&&7===this.currentPageIndex},CanopyEnhancer.prototype.isRadioStats=function(){return 2===this.currentCatIndex&&9===this.currentPageIndex},CanopyEnhancer.prototype.isTrafficPage=function(){return this.isEthernetStats()||this.isRadioStats()},CanopyEnhancer.prototype.realTimeTraffic=function(){if(this.isTrafficPage()){var t=this.Sections[this.currentCatIndex].pages[this.currentPageIndex];if(7===this.currentPageIndex?(this.mainTrafficBlockID=document.getElementById("SectionEthernet"),this.inTrafficID="FecCb_ifmib_ifInOctets",this.outTrafficID="FecCb_ifmib_ifOutOctets",this.inUcastPktsID="FecCb_ifmib_ifInUcastPkts",this.outUcastPktsID="FecCb_ifmib_ifOutUcastPkts",this.inNUcastPktsID="FecCb_ifmib_ifInNUcastPkts",this.outNUcastPktsID="FecCb_ifmib_ifOutNUcastPkts"):(this.mainTrafficBlockID=document.getElementById("SectionRFCBStat"),this.inTrafficID="RfCb_ifmib_ifInOctets",this.outTrafficID="RfCb_ifmib_ifOutOctets",this.inUcastPktsID="RfCb_ifmib_ifInUcastPkts",this.outUcastPktsID="RfCb_ifmib_ifOutUcastPkts",this.inNUcastPktsID="RfCb_ifmib_ifInNUcastPkts",this.outNUcastPktsID="RfCb_ifmib_ifOutNUcastPkts"),this.refreshTime>0){if("graph"===this.settings.cge_rtt_type){this.mainTrafficBlockID.insertAdjacentHTML("beforebegin",'<div class="section" id="SectionRTGTraffic"><h2 class="sectiontitle"><span class="sectiontitletext">'+t+' Real Time Traffic</span><span class="MenuBar" style="float: right;"><img class="MenuImg" src="_min.gif?mac_esn='+this.currentRadioMAC.toLocaleLowerCase()+'" style="cursor: pointer; margin-right: 5px;"></span></h2><div id="RTGWrapper"><canvas id="RTGChart" width="1280" height="270"></canvas><div id="RTGLegend"></div></div></div>');for(var e=new Date,n=4,i=[];n>=0;){var o=new Date(e-this.refreshTime*n*1e3),a=o.getHours().leadingZero()+":"+o.getMinutes().leadingZero()+":"+o.getSeconds().leadingZero();i.push(a),n--}let s;switch(this.settings.cge_theme){case"dark":s={trIn:{borderColor:"rgba(138, 118, 170, 1)"},trOut:{borderColor:"rgba(35, 216, 127, 1)"}};break;default:s={trIn:{borderColor:"rgba(88,88,88,1)"},trOut:{borderColor:"rgba(50,143,191,1)"}}}let r={labels:i,datasets:[{label:"Interface Traffic In",data:[0,0,0,0,0],fill:!1,borderColor:s.trIn.borderColor,tension:.4},{label:"Interface Traffic Out",data:[0,0,0,0,0],fill:!1,borderColor:s.trOut.borderColor,tension:.4}]},l={plugins:{legend:{display:!0,labels:{generateLabels:function(t){let{data:e}=t;return e.datasets.map(t=>{let e=t.data[t.data.length-1];return{text:`${t.label}: ${e} Mbps`,fillStyle:t.borderColor,strokeStyle:t.borderColor,index:n}})}}}}};this.realTimeTrafficChart=new Chart(document.getElementById("RTGChart"),{type:"line",data:r,options:l}),document.getElementById("RTGLegend").emptyElement()}else{let t=document.createElement("span");t.id="cge-CurrInTraffic-wrap",t.className="cge-real-time-throughput cge-color-blue-cambium",t.insertAdjacentHTML("afterbegin",' (<span id="cge-CurrInTraffic">0.00</span> Mbps)</span>'),document.getElementById(this.inTrafficID).parentNode.insertBefore(t,document.getElementById(this.inTrafficID).nextSibling),t=document.createElement("span"),t.id="cge-CurrOutTraffic-wrap",t.className="cge-real-time-throughput cge-color-blue-cambium",t.insertAdjacentHTML("afterbegin",' (<span id="cge-CurrOutTraffic">0.00</span> Mbps)'),document.getElementById(this.outTrafficID).parentNode.insertBefore(t,document.getElementById(this.outTrafficID).nextSibling)}let s=[this.inUcastPktsID,this.outUcastPktsID,this.inNUcastPktsID,this.outNUcastPktsID];for(let t=0;t<s.length;t++){let e=document.createElement("span");e.id="cge-CurrInTraffic-wrap",e.className="cge-real-time-throughput cge-color-blue-cambium",e.insertAdjacentHTML("afterbegin",' (<span id="cge-'+s[t]+'">0</span> pps)</span>'),document.getElementById(s[t]).parentNode.insertBefore(e,document.getElementById(s[t]).nextSibling)}}else this.mainTrafficBlockID.insertAdjacentHTML("beforebegin",'<div class="cge-error">Set Webpage Auto Update > 0 for real time throughput (Configuration => General)</div>');!0===this.isMedusa&&this.isRadioStats()&&this.renderSoundingStats(),this.highlightInterfaceErrors()}},CanopyEnhancer.prototype.calcPerSeconds=function(t,e){return(t-e)/this.refreshTime},CanopyEnhancer.prototype.updateTrafficData=function(t,e,n,i,o,a){if(t=parseInt(t),e=parseInt(e),n=parseInt(n),i=parseInt(i),o=parseInt(o),a=parseInt(a),this.trafficData.started){if(this.trafficData.inTraffic=this.calcPerSeconds(t,this.trafficData.prevInOctets).byte2Mbit().round2(),this.trafficData.outTraffic=this.calcPerSeconds(e,this.trafficData.prevOutOctets).byte2Mbit().round2(),this.trafficData.inUcastPps=Math.round(this.calcPerSeconds(n,this.trafficData.prevInUcastPkts)),this.trafficData.outUcastPps=Math.round(this.calcPerSeconds(i,this.trafficData.prevOutUcastPkts)),this.trafficData.inNUcastPps=Math.round(this.calcPerSeconds(o,this.trafficData.prevInNUcastPkts)),this.trafficData.outNUcastPps=Math.round(this.calcPerSeconds(a,this.trafficData.prevOutNUcastPkts)),this.trafficData.prevInOctets=t,this.trafficData.prevOutOctets=e,this.trafficData.prevInUcastPkts=n,this.trafficData.prevOutUcastPkts=i,this.trafficData.prevInNUcastPkts=o,this.trafficData.prevOutNUcastPkts=a,"graph"===this.settings.cge_rtt_type){let t=new Date,e=t.getHours().leadingZero()+":"+t.getMinutes().leadingZero()+":"+t.getSeconds().leadingZero(),n=[this.trafficData.inTraffic,this.trafficData.outTraffic];this.realTimeTrafficChart.data.labels.push(e),this.realTimeTrafficChart.data.datasets.forEach((t,e)=>{t.data.push(n[e])}),this.realTimeTrafficChart.update(),this.realTimeTrafficChart.data.datasets[0].data.length>this.settings.cge_rtt_graph_entries&&(this.realTimeTrafficChart.data.labels.shift(),this.realTimeTrafficChart.data.datasets.forEach(t=>{t.data.shift()}),this.realTimeTrafficChart.update())}else document.getElementById("cge-CurrInTraffic").textContent=this.trafficData.inTraffic.toString(),document.getElementById("cge-CurrOutTraffic").textContent=this.trafficData.outTraffic.toString();document.getElementById("cge-"+this.inUcastPktsID).textContent=this.trafficData.inUcastPps.toString(),document.getElementById("cge-"+this.outUcastPktsID).textContent=this.trafficData.outUcastPps.toString(),document.getElementById("cge-"+this.inNUcastPktsID).textContent=this.trafficData.inNUcastPps.toString(),document.getElementById("cge-"+this.outNUcastPktsID).textContent=this.trafficData.outNUcastPps.toString()}else this.trafficData.prevInOctets=t,this.trafficData.inTraffic=0,this.trafficData.prevOutOctets=e,this.trafficData.outTraffic=0,this.trafficData.prevInUcastPkts=n,this.trafficData.inUcastPps=0,this.trafficData.prevOutUcastPkts=i,this.trafficData.outUcastPps=0,this.trafficData.prevInNUcastPkts=o,this.trafficData.inNUcastPps=0,this.trafficData.prevOutNUcastPkts=a,this.trafficData.outNUcastPps=0,this.trafficData.started=!0;this.highlightInterfaceErrors()},CanopyEnhancer.prototype.highlightInterfaceErrors=function(){let t=[];if(this.isEthernetStats()?t=this.ethernetErrorsFields:this.isRadioStats()&&(t=this.radioErrorsFields),t.length>0)for(let e=0;e<t.length;e++){let n=document.getElementById(t[e]);n&&(Number(n.textContent)>0?(n.parentNode.parentNode.parentNode.classList.add("cge-error-text"),n.parentNode.parentNode.parentNode.classList.add("bold")):(n.parentNode.parentNode.parentNode.classList.remove("cge-error-text"),n.parentNode.parentNode.parentNode.classList.remove("bold")))}},CanopyEnhancer.prototype.replaceSoundingCommas=function(t){for(let e=0;e<this.soundingStatsFields.length;e++){let n=new RegExp(",\\s+"+RegExp.quote(this.soundingStatsFields[e]));t=t.replace(n,"|"+this.soundingStatsFields[e])}return t},CanopyEnhancer.prototype.removeSoundingHeaders=function(t){for(let e=0;e<this.soundingStatsFields.length;e++)t=t.replace(this.soundingStatsFields[e],"");return t},CanopyEnhancer.prototype.renderSoundingStats=function(){let t=this,e="",n=document.getElementById("SectionSoundingStatistics"),o=document.getElementById("SoundingStatsLog"),a=document.querySelector("#SectionSoundingStatistics table.section");if(o){this.medusaObserver=new MutationObserver((function(n){if(n&&n.length>0){let n=o.innerHTML,s=document.getElementById("cge-sounding-tbody");if(s)s.emptyElement();else{e+='<table class="table section">',e+="<thead>",e+="<tr>";for(let n=0;n<t.soundingStatsFields.length;n++)e+="<td>"+t.soundingStatsFields[n].replace(":","")+"</td>";e+="</thead>",e+="</tr>",e+='<tbody id="cge-sounding-tbody">',e+="</tbody>",e+="</table>",a.insertAdjacentHTML("beforebegin",e),s=document.getElementById("cge-sounding-tbody")}let r=n.split("<br>"),l="";for(i=0;i<r.length;i++){let n=t.replaceSoundingCommas(r[i]);n=t.removeSoundingHeaders(n);let o=n.split("|");if(o.length>1){e+="<tr>";for(let t=0;t<o.length;t++){let e=o[t].trim();switch(e=escapeHTML(e),t){case 1:e.match(/^([0-9]{1,4})\s\(VALID\)$/)||(e='<span class="cge-avglink-text">'+e+"</span>");break;case 2:"3 (TRACKING)"!==e&&(e='<span class="cge-avglink-text">'+e+"</span>");break;case 3:"0 (NONE)"!==e&&(e='<span class="cge-avglink-text">'+e+"</span>")}l+="<td>"+e+"</td>"}l+="</tr>"}}s.insertAdjacentHTML("afterbegin",l)}}));let s={attributes:!0,childList:!0,characterData:!0};this.medusaObserver.observe(o,s),n.style.position="relative",n.style.overflow="hidden",a.style.position="absolute",a.style.left="4000px"}},CanopyEnhancer.prototype.extractAPEvaluationData=function(){let t=this.apEvaluationBlock.innerHTML,e=this.APEvaluationFields[this.currentRadioModulation];t=t.replace(/<br\s*[\/]?>/gi," "),t=t.replace(/\ \;/gi," ");let n=t.split("*********************************************"),i=n[0].replace(/([\n]+)/g," ");i=i.replace(/([\s]+)/g," "),console.log(i);let o=i.match(/AP Selection Method used\:(.*)\sCurrent entry index\:/);if(o&&(this.apSelectionMethod=o[1]),o=i.match(/Current entry index\:\s([0-9]+)\sSession Status\:/),o&&(this.currentEvaluationEntry=o[1]),o=i.match(/Session Status\:\s([A-Z]+)\s\(/),o&&(this.currentSessionStatus=o[1]),"REGISTERED"===this.currentSessionStatus){let t=i.match(/\(via ([a-zA-Z]+) Color Code ([0-9]{1,3})\)/);t&&(this.currentColorCode=t[2]+" ("+t[1]+")")}!0===this.debugMessages()&&(console.log("AP Selection Method: "+this.apSelectionMethod),console.log("Current eval entry: "+this.currentEvaluationEntry),console.log("Session status: "+this.currentSessionStatus),console.log("Color Code: "+this.currentColorCode)),delete n[0];for(let t=1;t<n.length;t++){let i,o,a=t-1,s=n[t],r={};for(let a=0;a<e.length;a++){let l=a+1,c=RegExp.quote(e[a]);if(l<e.length){let t=RegExp.quote(e[l]);"Beacon Receive Power"===t&&"MIMO_OFDM"===this.currentRadioModulation&&(t+="(?:\\sLevel)?"),o="RegFail"===c?new RegExp(c+" ([0-9]+).*"+t+":"):"Beacon Receive Power"===c&&"MIMO_OFDM"===this.currentRadioModulation?new RegExp(c+"(?:\\sLevel)?:(.*)"+t):new RegExp(c+":(.*)"+t),i=s.match(o),i&&(r[c]=i[1].trimBlank())}else o=new RegExp(c+":(.*)ms"),i=s.match(o),i&&(r[c]=i[1].trimBlank()+" ms"),t+1===n.length&&"SCANNING"===this.currentSessionStatus&&(o=new RegExp(c+":(?:.*)?Currently Scanning:\\s(.*)"),i=s.match(o),i&&(this.currentlyScanning=i[1].trimBlank()))}this.APEvaluationObj[a]=r}return this.APEvaluationObj.length>0},CanopyEnhancer.prototype.renderBetterEvaluationTemplate=function(){let t=document.getElementById("betterEvaluation");void 0!==t&&null!=t||(t=document.createElement("div"),t.id="betterEvaluation",t.emptyElement(),this.apEvaluationBlock.parentNode.insertBefore(t,this.apEvaluationBlock.nextSibling));let e="";e+="<div class='betterEvaluationHead'> <b>AP Selection Method:</b> "+this.apSelectionMethod+" - ",e+=' <b>Current evaluation entry:</b> <a href="#cge-ap-eval-entry-'+this.currentEvaluationEntry+'">'+this.currentEvaluationEntry+"</a> - ",e+=" <b>Session status:</b> "+this.currentSessionStatus,"SCANNING"===this.currentSessionStatus&&(e+=" - <b>Currently Scanning:</b> "+this.currentlyScanning),"REGISTERED"===this.currentSessionStatus&&""!==this.currentColorCode&&(e+=" - <b>Color Code</b>: "+this.currentColorCode),e+="</div><hr /><br />";for(let t=0;t<this.APEvaluationObj.length;t++){let n=this.APEvaluationObj[t],i=Number(n.Index);delete n.Index;let o=!0,a=0;e+='<div class="cge-ap-evaluation-entry-title">',e+='<a name="cge-ap-eval-entry-'+i+'"></a>Entry: '+i,i==this.currentEvaluationEntry&&(e+=" - Current AP"),e+="</div>",e+='<table class="table table-responsive table-striped table-condensed table-bordered cge-ap-evaluation-entry-table"><tbody>';for(let t in n)if(n.hasOwnProperty(t)){switch(a++,!0===o&&(e+="<tr>",o=!1),t){case"Beacon Receive Power":case"Beacon Receive Power Level":let i=n[t].match(/\-(([0-9]+)(\.([0-9]))?)/);if(i){let o=parseFloat(i[1]);o=-o;let a="bold ";a+=o>-70?"cge-good-power-level":o<=-70&&o>-80?"cge-decent-power-level":"cge-bad-power-level",e+="<td>"+t+': <span class="'+a+'">'+n[t]+"</span></td>"}else e+="<td>"+t+": "+n[t]+"</td>";break;case"ESN":case"Color Code":case"SectorUserCount":e+='<td class="cge-highlight-eval-entry">'+t+": "+n[t]+"</td>";break;default:e+="<td>"+t+": "+n[t]+"</td>"}a%6==0&&(e+="</tr>",o=!0)}!0===o&&(e+="</tr>"),e+="</table></tbody>"}t.emptyElement(),t.insertAdjacentHTML("afterbegin",e),this.apEvaluationBlock.style.display="none"},CanopyEnhancer.prototype.betterEvaluation=function(){if(null!==this.apEvaluationBlock&&this.settings.cge_ap_evaluation&&void 0!==this.APEvaluationFields[this.currentRadioModulation]&&this.extractAPEvaluationData())if(this.refreshTime>0){let t=this;t.renderBetterEvaluationTemplate(),setInterval((function(){t.extractAPEvaluationData(),t.renderBetterEvaluationTemplate()}),this.intervalsTimeout)}else this.renderBetterEvaluationTemplate()},CanopyEnhancer.prototype.MACLookUp=function(t){let e=this,n=t.getBoundingClientRect(),i=t.textContent.trimBlank();t.classList.add("cge-highlight"),i.isMAC()?jsonp("https://maclookup.info/api/jsonp/"+i,(function(t){if(void 0!==t.ok){let i;!0===e.debugMessages()&&console.log(t),!0===t.ok?(i="Company: "+t.data.company+"\n\n",i+="MAC Prefix: "+t.data.prefix+"\n\n",i+="Address: "+t.data.address+"\n\n",i+="Country Code: "+t.data.country_code):i="Error, no result",e.tooltipMACNode.emptyElement(),e.tooltipMACNode.appendChild(document.createTextNode(i)),e.tooltipMACNode.style.display="block";let o=e.tooltipMACNode.getBoundingClientRect();e.tooltipMACNode.style.top=n.top+document.scrollingElement.scrollTop-o.height-5+"px",e.tooltipMACNode.style.left=n.left+n.width/2-o.width/2+"px"}})):(e.tooltipMACNode.style.display="none",t.classList.remove("cge-highlight"))},CanopyEnhancer.prototype.addMACLookUpListener=function(t){t=void 0!==t?t:"body";let e=this;document.querySelector(t).addEventListener("mouseover",(function(t){e.MACLookUp(t.target)})),document.querySelector(t).addEventListener("mouseout",(function(t){t.target.classList.remove("cge-highlight"),e.tooltipMACNode.style.display="none"})),document.querySelector(t).addEventListener("click",(function(t){e.MACLookUp(t.target)}))},CanopyEnhancer.prototype.MACLookupTooltip=function(){this.tooltipMACNode=document.createElement("div"),this.tooltipMACNode.id="cge-mac-lookup-tooltip",this.tooltipMACNode.className="cge-tooltip",document.getElementsByTagName("body")[0].appendChild(this.tooltipMACNode)},CanopyEnhancer.prototype.MacLookupPage=function(){2===this.currentCatIndex&&[5,20,21,22,24].includes(this.currentPageIndex)&&1===this.settings.cge_mac_lookup&&(this.MACLookupTooltip(),this.addMACLookUpListener("#page"))},CanopyEnhancer.prototype.IPLookUp=function(t){let e=this,n=t.getBoundingClientRect(),i=t.textContent.trimBlank();if(t.classList.add("cge-highlight"),i.isValidPubIP()){var o=new XMLHttpRequest;o.open("GET","http://ipinfo.io/"+i+"/json",!0),o.onload=function(){var t;if(o.status>=200&&o.status<400){var i=JSON.parse(o.responseText);!0===e.debugMessages()&&console.log(i),"undefined"!==i.ip?(t="AS: "+i.org+"\n",t+="Country: "+i.country+"\n",t+="Region: "+i.region+"\n",t+="City: "+i.city+"\n",t+="Hostname: "+i.hostname):t="Error, no result"}else t="Error, no result";e.tooltipIPNode.emptyElement(),e.tooltipIPNode.appendChild(document.createTextNode(t)),e.tooltipIPNode.style.display="block";var a=e.tooltipIPNode.getBoundingClientRect();e.tooltipIPNode.style.top=n.top+document.body.scrollTop-a.height-5+"px",e.tooltipIPNode.style.left=n.left+n.width/2-a.width/2+"px"},o.onerror=function(){},o.send()}else t.classList.remove("cge-highlight"),e.tooltipIPNode.style.display="none"},CanopyEnhancer.prototype.addIPLookUpListener=function(t){t=void 0!==t?t:"body";let e=this;document.querySelector(t).addEventListener("mouseover",(function(t){e.IPLookUp(t.target)})),document.querySelector(t).addEventListener("mouseout",(function(t){t.target.classList.remove("cge-highlight"),e.tooltipIPNode.style.display="none"})),document.querySelector(t).addEventListener("click",(function(t){e.IPLookUp(t.target)}))},CanopyEnhancer.prototype.NATTable=function(){5===this.currentCatIndex&&9===this.currentPageIndex&&1===this.settings.cge_ip_lookup&&(this.tooltipIPNode=document.createElement("div"),this.tooltipIPNode.id="cge-ip-lookup-tooltip",this.tooltipIPNode.className="cge-tooltip",document.getElementsByTagName("body")[0].appendChild(this.tooltipIPNode),this.addIPLookUpListener("#page"))},CanopyEnhancer.prototype.isAPThroughputPage=function(){return 2===this.currentCatIndex&&12===this.currentPageIndex||null!==document.getElementById("SectionLUIDStats")},CanopyEnhancer.prototype.APThroughput=function(){this.isAPThroughputPage()&&1===this.settings.cge_ap_throughput&&(0===this.refreshTime?document.getElementById("SectionLUIDStats").insertAdjacentHTML("beforebegin",'<div class="cge-error">Set Webpage Auto Update > 0 for real time stats (Configuration => General)</div>'):this.APThroughputCalc())},CanopyEnhancer.prototype.APThroughputCalc=function(){if(this.isAPThroughputPage()){let t=document.getElementById("LuidOLtable"),e=t.querySelector("tbody").querySelectorAll("tr"),n=0,i=0;if(e.length>0){t.querySelector("thead tr:nth-child(1) th:nth-child(3)").setAttribute("colspan",14),t.querySelector("thead tr:nth-child(2) th:nth-child(1)").setAttribute("colspan",7),t.querySelector("thead tr:nth-child(2) th:nth-child(2)").setAttribute("colspan",7),t.querySelector("thead tr:nth-child(3) th:nth-child(1)").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">traffic (Mbps)</th>'),t.querySelector("thead tr:nth-child(3) th:nth-child(4)").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">data usage</th>'),t.querySelector("thead tr:nth-child(3) th:nth-child(8)").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">traffic (Mbps)</th>'),t.querySelector("thead tr:nth-child(3) th:nth-child(11)").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">data usage</th>');for(let t=0;t<e.length;t++){let o=parseInt(e[t].querySelector("td:nth-child(2)").textContent);if(o<255){let a,s,r,l,c=intval(e[t].querySelector("td:nth-child(3)").textContent),h=intval(e[t].querySelector("td:nth-child(8)").textContent),d=intval(e[t].querySelector("td:nth-child(4)").textContent),u=intval(e[t].querySelector("td:nth-child(9)").textContent);void 0!==this.APThroughputSM[o]?(a=this.calcPerSeconds(c,this.APThroughputSM[o].prevInOctets),this.APThroughputSM[o].prevInOctets=c,r=this.calcPerSeconds(d,this.APThroughputSM[o].prevInPackets),r=Math.round(r),this.APThroughputSM[o].prevInPackets=d,s=this.calcPerSeconds(h,this.APThroughputSM[o].prevOutOctets),this.APThroughputSM[o].prevOutOctets=h,l=this.calcPerSeconds(u,this.APThroughputSM[o].prevOutPackets),l=Math.round(l),this.APThroughputSM[o].prevOutPackets=u):(this.APThroughputSM[o]={prevInOctets:c,prevInPackets:d,prevOutOctets:h,prevOutPackets:u},a=0,s=0,r=0,l=0),n+=a,i+=s,a=a.byte2Mbit().toFixed(2),s=s.byte2Mbit().toFixed(2),e[t].querySelector("td:nth-child(3)").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+a+"</td>"),e[t].querySelector("td:nth-child(5)").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+r+" pps</b>"),e[t].querySelector("td:nth-child(6)").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+this.APThroughputSM[o].prevInOctets.formatDataUsage()+"</td>"),e[t].querySelector("td:nth-child(10)").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+s+"</td>"),e[t].querySelector("td:nth-child(12)").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+l+" pps</b>"),e[t].querySelector("td:nth-child(13)").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+this.APThroughputSM[o].prevOutOctets.formatDataUsage()+"</td>")}else e[t].querySelector("td:nth-child(3)").insertAdjacentHTML("afterend","<td></td>"),e[t].querySelector("td:nth-child(5)").insertAdjacentHTML("afterend","<td></td>"),e[t].querySelector("td:nth-child(10)").insertAdjacentHTML("afterend","<td></td>"),e[t].querySelector("td:nth-child(12)").insertAdjacentHTML("afterend","<td></td>")}}}},CanopyEnhancer.prototype.isDataVCPage=function(){return 2===this.currentCatIndex&&11===this.currentPageIndex},CanopyEnhancer.prototype.dataVC=function(){this.isDataVCPage()&&1===this.settings.cge_ap_data_vc&&(0===this.refreshTime?document.getElementById("SectionDnlkStatsHW").insertAdjacentHTML("beforebegin",'<div class="cge-error">Set Webpage Auto Update > 0 for real time stats (Configuration => General)</div>'):this.dataVCCalc())},CanopyEnhancer.prototype.dataVCCalc=function(){if(this.isDataVCPage()&&1===this.settings.cge_ap_data_vc){let e,n=document.getElementById("datavctable"),i=n.querySelector("tbody").querySelectorAll("tr"),o=0,a=0,s=null===document.getElementById("datavctablefragmodulation");switch(this.currentRadioModulation){case"FSK":e={header:{colspanIn:"7",colspanOut:"7",inMbpsAfter:"1",inDataUsageAfter:"4",outMbpsAfter:"8",outDataUsageAfter:"11"},low:{currInOctets:"4",currInUPackets:"5",currInNuPackets:"6",currOutOctets:"9",currOutUPackets:"10",currOutNuPackets:"11"},high:{currInOctets:"3",currInUPackets:"4",currInNuPackets:"5",currOutOctets:"8",currOutUPackets:"9",currOutNuPackets:"10"}};break;default:e=s?{header:{colspanIn:"11",colspanOut:"7",inMbpsAfter:"1",inDataUsageAfter:"4",outMbpsAfter:"12",outDataUsageAfter:"15"},low:{currInOctets:"4",currInUPackets:"5",currInNuPackets:"6",currOutOctets:"13",currOutUPackets:"14",currOutNuPackets:"15"},high:{currInOctets:"3",currInUPackets:"4",currInNuPackets:"5",currOutOctets:"8",currOutUPackets:"9",currOutNuPackets:"10"}}:{header:{colspanIn:"7",colspanOut:"7",inMbpsAfter:"1",inDataUsageAfter:"4",outMbpsAfter:"8",outDataUsageAfter:"11"},low:{currInOctets:"4",currInUPackets:"5",currInNuPackets:"6",currOutOctets:"9",currOutUPackets:"10",currOutNuPackets:"11"},high:{currInOctets:"3",currInUPackets:"4",currInNuPackets:"5",currOutOctets:"8",currOutUPackets:"9",currOutNuPackets:"10"}}}if(i.length>0){n.querySelector("thead tr:nth-child(1) th:nth-child(4)").setAttribute("colspan",e.header.colspanIn),n.querySelector("thead tr:nth-child(1) th:nth-child(5)").setAttribute("colspan",e.header.colspanOut),n.querySelector("thead tr:nth-child(2) th:nth-child("+e.header.inMbpsAfter+")").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">traffic (Mbps)</th>'),n.querySelector("thead tr:nth-child(2) th:nth-child("+e.header.inDataUsageAfter+")").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">data usage</th>'),n.querySelector("thead tr:nth-child(2) th:nth-child("+e.header.outMbpsAfter+")").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">traffic (Mbps)</th>'),n.querySelector("thead tr:nth-child(2) th:nth-child("+e.header.outDataUsageAfter+")").insertAdjacentHTML("afterend",'<th class="table-sortable:numeric table-sortable" title="Click to sort">data usage</th>');for(var t=0;t<i.length;t++){let n,s,r,l=i[t].querySelector("td:nth-child(1)").innerHTML;if(null!==l.match(/\s\-\sLUID\:/)?(3===i[t].querySelector("td:nth-child(1)").textContent.length?(n=intval(i[t].querySelector("td:nth-child(1)").textContent),r="high"):(n=intval(i[t].querySelector("td:nth-child(2)").textContent),l=l.replace(/\s\-\sLUID\:/,"<br />LUID:"),i[t].querySelector("td:nth-child(1)").emptyElement(),i[t].querySelector("td:nth-child(1)").insertAdjacentHTML("afterbegin",l),i[t].querySelector("td:nth-child(1)").style.minWidth="200px",i[t].querySelector("td:nth-child(1)").style.textAlign="left",r="low"),s=n):(s=i[t].querySelector("td:nth-child(2)").textContent+"_"+i[t].querySelector("td:nth-child(3)").textContent,n=intval(i[t].querySelector("td:nth-child(2)").textContent),r="low"),n<=255){let n,l,c,h,d,u,g=intval(i[t].querySelector("td:nth-child("+e[r].currInOctets+")").textContent),f=intval(i[t].querySelector("td:nth-child("+e[r].currOutOctets+")").textContent),p=intval(i[t].querySelector("td:nth-child("+e[r].currInUPackets+")").textContent),m=intval(i[t].querySelector("td:nth-child("+e[r].currInNuPackets+")").textContent),b=intval(i[t].querySelector("td:nth-child("+e[r].currOutUPackets+")").textContent),x=intval(i[t].querySelector("td:nth-child("+e[r].currOutNuPackets+")").textContent);void 0!==this.APThroughputSM[s]?(n=this.calcPerSeconds(g,this.APThroughputSM[s].prevInOctets),this.APThroughputSM[s].prevInOctets=g,c=this.calcPerSeconds(p,this.APThroughputSM[s].prevInUPackets),c=Math.round(c),this.APThroughputSM[s].prevInUPackets=p,h=this.calcPerSeconds(m,this.APThroughputSM[s].prevInNuPackets),h=Math.round(h),this.APThroughputSM[s].prevInNuPackets=m,l=this.calcPerSeconds(f,this.APThroughputSM[s].prevOutOctets),this.APThroughputSM[s].prevOutOctets=f,d=this.calcPerSeconds(b,this.APThroughputSM[s].prevOutUPackets),d=Math.round(d),this.APThroughputSM[s].prevOutUPackets=b,u=this.calcPerSeconds(x,this.APThroughputSM[s].prevOutNuPackets),u=Math.round(u),this.APThroughputSM[s].prevOutNuPackets=x):(this.APThroughputSM[s]={prevInOctets:g,prevInUPackets:p,prevInNuPackets:m,prevOutOctets:f,prevOutUPackets:b,prevOutNuPackets:x},n=0,l=0,c=0,h=0,d=0,u=0),o+=n,a+=l,n=n.byte2Mbit().toFixed(2),l=l.byte2Mbit().toFixed(2),i[t].querySelector("td:nth-child("+e[r].currOutNuPackets+")").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+this.APThroughputSM[s].prevOutOctets.formatDataUsage()+"</td>"),i[t].querySelector("td:nth-child("+e[r].currOutNuPackets+")").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+u+" pps</b>"),i[t].querySelector("td:nth-child("+e[r].currOutUPackets+")").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+d+" pps</b>"),i[t].querySelector("td:nth-child("+e[r].currOutOctets+")").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+l+"</td>"),i[t].querySelector("td:nth-child("+e[r].currInNuPackets+")").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+this.APThroughputSM[s].prevInOctets.formatDataUsage()+"</td>"),i[t].querySelector("td:nth-child("+e[r].currInNuPackets+")").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+h+" pps</b>"),i[t].querySelector("td:nth-child("+e[r].currInUPackets+")").insertAdjacentHTML("beforeend",'<br /><b class="cge-color-blue-cambium">'+c+" pps</b>"),i[t].querySelector("td:nth-child("+e[r].currInOctets+")").insertAdjacentHTML("afterend",'<td class="cge-highlight">'+n+"</td>")}else i[t].querySelector("td:nth-child("+e[r].currOutNuPackets+")").insertAdjacentHTML("afterend","<td></td>"),i[t].querySelector("td:nth-child("+e[r].currOutOctets+")").insertAdjacentHTML("afterend","<td></td>"),i[t].querySelector("td:nth-child("+e[r].currInNuPackets+")").insertAdjacentHTML("afterend","<td></td>"),i[t].querySelector("td:nth-child("+e[r].currInOctets+")").insertAdjacentHTML("afterend","<td></td>")}}}},CanopyEnhancer.prototype.EventLog=function(){if(0===this.currentCatIndex&&5===this.currentPageIndex&&("MIMO_OFDM"===this.currentRadioModulation||"FSK"===this.currentRadioModulation)||0===this.currentCatIndex&&4===this.currentPageIndex&&"SISO_OFDM"===this.currentRadioModulation){let e,n,i,o,a,s,r=document.getElementById("SysLoga"),l=r.innerHTML,c=l.match(/\*System Startup\*/gim),h=document.createElement("div");if(h.id="cge-event-log-wrapper",c){let r=l.split("******System Startup******");e=document.createElement("div"),e.className="cge-event-log-divider",n=document.createElement("table"),n.className="table table-striped table-responsive table-condensed",i=document.createElement("tbody");for(let l=0;l<r.length;l++){s=r[l].split("<br>");for(let t=0;t<s.length;t++)""!==s[t]&&" "!==s[t]&&(o=document.createElement("tr"),a=document.createElement("td"),s[t]=s[t].replace("<br />","<br />"),this.eventLogErrorStrings.forEach((function(e,n){s[t]=highlightErrorsInText(e,s[t])})),a.insertAdjacentHTML("afterbegin",s[t]),o.appendChild(a),i.appendChild(o));if(n.appendChild(i),e.appendChild(n),h.appendChild(e),l<r.length-1){e=document.createElement("div"),e.className="cge-event-log-divider",n=document.createElement("table"),n.className="table table-striped table-responsive table-condensed",i=document.createElement("tbody");var t=document.createElement("h4");t.className="cge-block-title",t.appendChild(document.createTextNode("******System Startup******")),e.appendChild(t)}}}else if(l.length>0){e=document.createElement("div"),e.className="cge-event-log-divider",n=document.createElement("table"),n.className="table table-striped table-responsive table-condensed",i=document.createElement("tbody"),s=l.split("<br>");for(let t=0;t<s.length;t++)""!==s[t]&&" "!==s[t]&&(o=document.createElement("tr"),a=document.createElement("td"),s[t]=s[t].replace("<br />","<br />"),this.eventLogErrorStrings.forEach((function(e,n){s[t]=highlightErrorsInText(e,s[t])})),a.insertAdjacentHTML("afterbegin",s[t]),o.appendChild(a),i.appendChild(o));n.appendChild(i),e.appendChild(n),h.appendChild(e)}r.emptyElement(),r.appendChild(h)}},CanopyEnhancer.prototype.isSessionStatusPage=function(){return 0===this.currentCatIndex&&2===this.currentPageIndex},CanopyEnhancer.prototype.sessionStatus=function(){if(this.isSessionStatusPage()){let t,e,n=document.querySelectorAll("#luidlisttable_3 tr td:nth-child(3)");for(let i=0;i<n.length;i++){let o=n[i].innerHTML.match(/VC\s{1,2}(?:[\d]{1,3})\sRate\s(?:\d)X\/(\d)X\s((?:MIMO|SISO)\-?(?:[A-B]))/gim);if(o){e=document.createDocumentFragment();for(let n=0;n<o.length;n++){n>0&&e.appendChild(document.createElement("br"));let i=o[n].match(/VC\s{1,2}(?:[\d]{1,3})\sRate\s(?:\d)X\/(\d)X\s((?:MIMO|SISO)\-?(?:[A-B]))/i),a=intval(i[1]);t=document.createElement("span"),t.className=this.getAdaptRateClass(a,i[2]),t.appendChild(document.createTextNode(i[0])),e.appendChild(t)}n[i].emptyElement(),n[i].appendChild(e)}}}},void 0===DataVCStatOnload)function DataVCStatOnload(){}var CGE=new CanopyEnhancer;CGE.initialize();