itowns
Version:
A JS/WebGL framework for 3D geospatial data visualization
2 lines • 214 kB
JavaScript
/*! For license information please see debug.umd.js.LICENSE.txt */
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("debug",[],e):"object"==typeof exports?exports.debug=e():t.debug=e()}(self,(()=>(self.webpackChunkitowns_repository=self.webpackChunkitowns_repository||[]).push([[40],{38171:(t,e,i)=>{i.r(e),i.d(e,{Debug:()=>Ms,GeometryDebug:()=>Ps,GuiTools:()=>ga,PointCloudDebug:()=>As,create3dTilesDebugUI:()=>Ns,createOGC3DTilesDebugUI:()=>ao,createTileDebugUI:()=>Bs});var n=i(24922),s=i(80353),o=i(86847);function a(t){return t+.5|0}const r=(t,e,i)=>Math.max(Math.min(t,i),e);function l(t){return r(a(2.55*t),0,255)}function h(t){return r(a(255*t),0,255)}function c(t){return r(a(t/2.55)/100,0,1)}function d(t){return r(a(100*t),0,100)}const u={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},p=[..."0123456789ABCDEF"],f=t=>p[15&t],g=t=>p[(240&t)>>4]+p[15&t],m=t=>(240&t)>>4==(15&t);const _=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function x(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function y(t,e,i){const n=b(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function v(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),a=(s+o)/2;let r,l,h;return s!==o&&(h=s-o,l=a>.5?h/(2-s-o):h/(s+o),r=function(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}(e,i,n,h,s),r=60*r+.5),[0|r,l||0,a]}function w(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(h)}function C(t,e,i){return w(b,t,e,i)}function k(t){return(t%360+360)%360}const M={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"},S={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;const D=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,A=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,O=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function L(t,e,i){if(t){let n=v(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=C(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function T(t,e){return t?Object.assign(e||{},t):t}function R(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=h(t[3]))):(e=T(t,{r:0,g:0,b:0,a:1})).a=h(e.a),e}function P(t){return"r"===t.charAt(0)?function(t){const e=D.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?l(t):r(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?l(i):r(i,0,255)),n=255&(e[4]?l(n):r(n,0,255)),s=255&(e[6]?l(s):r(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):function(t){const e=_.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?l(+e[5]):h(+e[5]));const s=k(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return w(y,t,e,i)}(s,o,a):"hsv"===e[1]?function(t,e,i){return w(x,t,e,i)}(s,o,a):C(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class I{constructor(t){if(t instanceof I)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=R(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*u[n[1]],g:255&17*u[n[2]],b:255&17*u[n[3]],a:5===o?17*u[n[4]]:255}:7!==o&&9!==o||(s={r:u[n[1]]<<4|u[n[2]],g:u[n[3]]<<4|u[n[4]],b:u[n[5]]<<4|u[n[6]],a:9===o?u[n[7]]<<4|u[n[8]]:255})),i=s||function(t){E||(E=function(){const t={},e=Object.keys(S),i=Object.keys(M);let n,s,o,a,r;for(n=0;n<e.length;n++){for(a=r=e[n],s=0;s<i.length;s++)o=i[s],r=r.replace(o,M[o]);o=parseInt(S[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}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)||P(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=T(this._rgb);return t&&(t.a=c(t.a)),t}set rgb(t){this._rgb=R(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${c(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>m(t.r)&&m(t.g)&&m(t.b)&&m(t.a))(t)?f:g,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=v(t),i=e[0],n=d(e[1]),s=d(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${c(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,a=2*o-1,r=i.a-n.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=O(c(t.r)),s=O(c(t.g)),o=O(c(t.b));return{r:h(A(n+i*(O(c(e.r))-n))),g:h(A(s+i*(O(c(e.g))-s))),b:h(A(o+i*(O(c(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new I(this.rgb)}alpha(t){return this._rgb.a=h(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=a(.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 L(this._rgb,2,t),this}darken(t){return L(this._rgb,2,-t),this}saturate(t){return L(this._rgb,1,t),this}desaturate(t){return L(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=v(t);i[0]=k(i[0]+e),i=C(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}const z=(()=>{let t=0;return()=>t++})();function B(t){return null==t}function F(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function N(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function V(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function H(t,e){return V(t)?t:e}function j(t,e){return void 0===t?e:t}function U(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function W(t,e,i,n){let s,o,a;if(F(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(N(t))for(a=Object.keys(t),o=a.length,s=0;s<o;s++)e.call(i,t[a[s]],a[s])}function G(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function $(t){if(F(t))return t.map($);if(N(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=$(t[i[s]]);return e}return t}function Y(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function q(t,e,i,n){if(!Y(t))return;const s=e[t],o=i[t];N(s)&&N(o)?X(s,o,n):e[t]=$(o)}function X(t,e,i){const n=F(e)?e:[e],s=n.length;if(!N(t))return t;const o=(i=i||{}).merger||q;let a;for(let e=0;e<s;++e){if(a=n[e],!N(a))continue;const s=Object.keys(a);for(let e=0,n=s.length;e<n;++e)o(s[e],t,a,i)}return t}function K(t,e){return X(t,e,{merger:Q})}function Q(t,e,i){if(!Y(t))return;const n=e[t],s=i[t];N(n)&&N(s)?K(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=$(s))}const J={"":t=>t,x:t=>t.x,y:t=>t.y};function Z(t,e){const i=J[e]||(J[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function tt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const et=t=>void 0!==t,it=t=>"function"==typeof t,nt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},st=Math.PI,ot=2*st,at=ot+st,rt=Number.POSITIVE_INFINITY,lt=st/180,ht=st/2,ct=st/4,dt=2*st/3,ut=Math.log10,pt=Math.sign;function ft(t,e,i){return Math.abs(t-e)<i}function gt(t){const e=Math.round(t);t=ft(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(ut(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function mt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function _t(t){return t*(st/180)}function bt(t){if(!V(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function xt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yt(t,e){return(t-e+at)%ot-st}function vt(t){return(t%ot+ot)%ot}function wt(t,e,i,n){const s=vt(t),o=vt(e),a=vt(i),r=vt(o-s),l=vt(a-s),h=vt(s-o),c=vt(s-a);return s===o||s===a||n&&o===a||r>l&&h<c}function Ct(t,e,i){return Math.max(e,Math.min(i,t))}function kt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Mt(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;for(;s-o>1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const St=(t,e,i,n)=>Mt(t,i,n?n=>{const s=t[n][e];return s<i||s===i&&t[n+1][e]===i}:n=>t[n][e]<i),Et=(t,e,i)=>Mt(t,i,(n=>t[n][e]>=i)),Dt=["push","pop","shift","splice","unshift"];function At(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(Dt.forEach((e=>{delete t[e]})),delete t._chartjs)}const Ot="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Lt(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Ot.call(window,(()=>{n=!1,t.apply(e,i)})))}}const Tt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const Rt=t=>0===t||1===t,Pt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*ot/i),It=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*ot/i)+1,zt={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*ht),easeOutSine:t=>Math.sin(t*ht),easeInOutSine:t=>-.5*(Math.cos(st*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=>Rt(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=>Rt(t)?t:Pt(t,.075,.3),easeOutElastic:t=>Rt(t)?t:It(t,.075,.3),easeInOutElastic(t){const e=.1125;return Rt(t)?t:t<.5?.5*Pt(2*t,e,.45):.5+.5*It(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-zt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*zt.easeInBounce(2*t):.5*zt.easeOutBounce(2*t-1)+.5};function Bt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Ft(t){return Bt(t)?t:new I(t)}function Nt(t){return Bt(t)?t:new I(t).saturate(.5).darken(.1).hexString()}const Vt=["x","y","borderWidth","radius","tension"],Ht=["color","borderColor","backgroundColor"],jt=new Map;function Ut(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=jt.get(i);return n||(n=new Intl.NumberFormat(t,e),jt.set(i,n)),n}(e,i).format(t)}const Wt={values:t=>F(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=ut(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ut(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ut(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Wt.numeric.call(this,t,e,i):""}};var Gt={formatters:Wt};const $t=Object.create(null),Yt=Object.create(null);function qt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function Xt(t,e,i){return"string"==typeof e?X(qt(t,e),i):X(qt(t,""),e)}class Kt{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Nt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Nt(e.borderColor),this.hoverColor=(t,e)=>Nt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xt(this,t,e)}get(t){return qt(this,t)}describe(t,e){return Xt(Yt,t,e)}override(t,e){return Xt($t,t,e)}route(t,e,i,n){const s=qt(this,t),o=qt(this,i),a="_"+e;Object.defineProperties(s,{[a]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[n];return N(t)?Object.assign({},e,t):j(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Qt=new Kt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ht},numbers:{type:"number",properties:Vt}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Gt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Jt(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Zt(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function te(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function ee(t,e,i,n){!function(t,e,i,n,s){let o,a,r,l,h,c,d,u;const p=e.pointStyle,f=e.rotation,g=e.radius;let m=(f||0)*lt;if(p&&"object"==typeof p&&(o=p.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),p){default:s?t.ellipse(i,n,s/2,g,0,0,ot):t.arc(i,n,g,0,ot),t.closePath();break;case"triangle":c=s?s/2:g,t.moveTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=dt,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=dt,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,a=Math.cos(m+ct)*l,d=Math.cos(m+ct)*(s?s/2-h:l),r=Math.sin(m+ct)*l,u=Math.sin(m+ct)*(s?s/2-h:l),t.arc(i-d,n-r,h,m-st,m-ht),t.arc(i+u,n-a,h,m-ht,m),t.arc(i+d,n+r,h,m,m+ht),t.arc(i-u,n+a,h,m+ht,m+st),t.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*g,c=s?s/2:l,t.rect(i-c,n-l,2*c,2*l);break}m+=ct;case"rectRot":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+u,n-a),t.lineTo(i+d,n+r),t.lineTo(i-u,n+a),t.closePath();break;case"crossRot":m+=ct;case"cross":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a),m+=ct,d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-r),t.lineTo(i+d,n+r),t.moveTo(i+u,n-a),t.lineTo(i-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-a,n-r),t.lineTo(i+a,n+r);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}(t,e,i,n,null)}function ie(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function ne(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function se(t){t.restore()}function oe(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function ae(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function re(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=s.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function le(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function he(t,e,i,n,s,o={}){const a=F(e)?e:[e],r=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),B(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)h=a[l],o.backdrop&&le(t,o.backdrop),r&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),B(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,n,o.maxWidth)),t.fillText(h,i,n,o.maxWidth),re(t,i,n,h,o),n+=Number(s.lineHeight);t.restore()}function ce(t,e){const{x:i,y:n,w:s,h:o,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,1.5*st,st,!0),t.lineTo(i,n+o-a.bottomLeft),t.arc(i+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,st,ht,!0),t.lineTo(i+s-a.bottomRight,n+o),t.arc(i+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,ht,0,!0),t.lineTo(i+s,n+a.topRight),t.arc(i+s-a.topRight,n+a.topRight,a.topRight,0,-ht,!0),t.lineTo(i+a.topLeft,n)}const de=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ue=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function pe(t,e){const i=(""+t).match(de);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function fe(t,e){const i={},n=N(e),s=n?Object.keys(e):e,o=N(t)?n?i=>j(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+o(t)||0;return i}function ge(t){return fe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function me(t){const e=ge(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _e(t,e){t=t||{},e=e||Qt.font;let i=j(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=j(t.style,e.style);n&&!(""+n).match(ue)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:j(t.family,e.family),lineHeight:pe(j(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:j(t.weight,e.weight),string:""};return s.string=function(t){return!t||B(t.size)||B(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function be(t,e,i,n){let s,o,a,r=!0;for(s=0,o=t.length;s<o;++s)if(a=t[s],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),r=!1),void 0!==i&&F(a)&&(a=a[i%a.length],r=!1),void 0!==a))return n&&!r&&(n.cacheable=!1),a}function xe(t,e){return Object.assign(Object.create(t),e)}function ye(t,e=[""],i,n,s=()=>t[0]){const o=i||t;void 0===n&&(n=Le("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>ye([i,...t],e,o,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Me(i,n,(()=>function(t,e,i,n){let s;for(const o of e)if(s=Le(Ce(o,t),i),void 0!==s)return ke(t,s)?Ae(i,n,t,s):s}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Te(t).includes(e),ownKeys:t=>Te(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function ve(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:we(t,n),setContext:e=>ve(t,e,i,n),override:s=>ve(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Me(t,e,(()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;let r=n[e];return it(r)&&a.isScriptable(e)&&(r=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||n);return r.delete(t),ke(t,l)&&(l=Ae(s._scopes,s,t,l)),l}(e,r,t,i)),F(r)&&r.length&&(r=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(N(e[0])){const i=e,n=s._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Ae(n,s,t,l);e.push(ve(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable)),ke(e,r)&&(r=ve(r,s,o&&o[e],a)),r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function we(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:it(i)?i:()=>i,isIndexable:it(n)?n:()=>n}}const Ce=(t,e)=>t?t+tt(e):e,ke=(t,e)=>N(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Me(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Se(t,e,i){return it(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?Z(e,t):void 0;function De(t,e,i,n,s){for(const o of e){const e=Ee(i,o);if(e){t.add(e);const o=Se(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Ae(t,e,i,n){const s=e._rootScopes,o=Se(e._fallback,i,n),a=[...t,...s],r=new Set;r.add(n);let l=Oe(r,a,i,o||i,n);return null!==l&&(void 0===o||o===i||(l=Oe(r,a,o,l,n),null!==l))&&ye(Array.from(r),[""],s,o,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return F(s)&&N(i)?i:s||{}}(e,i,n)))}function Oe(t,e,i,n,s){for(;i;)i=De(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Te(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Re=Number.EPSILON||1e-14,Pe=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ie=t=>"x"===t?"y":"x";function ze(t,e,i,n){const s=t.skip?e:t,o=e,a=i.skip?e:i,r=xt(o,s),l=xt(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=n*h,u=n*c;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function Be(t,e,i){return Math.max(Math.min(t,i),e)}function Fe(t,e,i,n,s){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),o=Array(n);let a,r,l,h=Pe(t,0);for(a=0;a<n;++a)if(r=l,l=h,h=Pe(t,a+1),l){if(h){const t=h[e]-l[e];s[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?pt(s[a-1])!==pt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}!function(t,e,i){const n=t.length;let s,o,a,r,l,h=Pe(t,0);for(let c=0;c<n-1;++c)l=h,h=Pe(t,c+1),l&&h&&(ft(e[c],0,Re)?i[c]=i[c+1]=0:(s=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(s,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=s*a*e[c],i[c+1]=o*a*e[c])))}(t,s,o),function(t,e,i="x"){const n=Ie(i),s=t.length;let o,a,r,l=Pe(t,0);for(let h=0;h<s;++h){if(a=r,r=l,l=Pe(t,h+1),!r)continue;const s=r[i],c=r[n];a&&(o=(s-a[i])/3,r[`cp1${i}`]=s-o,r[`cp1${n}`]=c-o*e[h]),l&&(o=(l[i]-s)/3,r[`cp2${i}`]=s+o,r[`cp2${n}`]=c+o*e[h])}}(t,o,e)}(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=ze(i,r,t[Math.min(o+1,a-(n?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,n,s,o,a,r=ie(t[0],e);for(i=0,n=t.length;i<n;++i)a=o,o=r,r=i<n-1&&ie(t[i+1],e),o&&(s=t[i],a&&(s.cp1x=Be(s.cp1x,e.left,e.right),s.cp1y=Be(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Be(s.cp2x,e.left,e.right),s.cp2y=Be(s.cp2y,e.top,e.bottom)))}(t,i)}function Ne(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ve(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function He(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const je=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Ue=["top","right","bottom","left"];function We(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Ue[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ge(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=je(i),o="border-box"===s.boxSizing,a=We(s,"padding"),r=We(s,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let a,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))a=s,r=o;else{const t=e.getBoundingClientRect();a=n.clientX-t.left,r=n.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:p,height:f}=e;return o&&(p-=a.width+r.width,f-=a.height+r.height),{x:Math.round((l-d)/p*i.width/n),y:Math.round((h-u)/f*i.height/n)}}const $e=t=>Math.round(10*t)/10;function Ye(t,e,i){const n=e||1,s=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||a.height!==s||a.width!==o)&&(t.currentDevicePixelRatio=n,a.height=s,a.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const qe=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Ne()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Xe(t,e){const i=function(t,e){return je(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ke(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Qe(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Je(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Ke(t,s,i),r=Ke(s,o,i),l=Ke(o,e,i),h=Ke(a,r,i),c=Ke(r,l,i);return Ke(h,c,i)}function Ze(t){return"angle"===t?{between:wt,compare:yt,normalize:vt}:{between:kt,compare:(t,e)=>t-e,normalize:t=>t}}function ti({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ei(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Ze(n),{start:c,end:d,loop:u,style:p}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:a,normalize:r}=Ze(n),l=e.length;let h,c,{start:d,end:u,loop:p}=t;if(p){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][n]),s,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:p,style:t.style}}(t,e,i),f=[];let g,m,_,b=!1,x=null;for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(g=h(m[n]),g!==_&&(b=l(g,s,o),null===x&&(b||l(s,_,g)&&0!==r(s,_))&&(x=0===r(g,s)?t:i),null!==x&&(!b||0===r(o,g)||l(o,_,g))&&(f.push(ti({start:x,end:t,loop:u,count:a,style:p})),x=null),i=t,_=g));return null!==x&&f.push(ti({start:x,end:d,loop:u,count:a,style:p})),f}function ii(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ni(t,e){if(!e)return!1;const i=[],n=function(t,e){return Bt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}class si{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach((n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Ot.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,a=s.length-1,r=!1;for(;a>=0;--a)o=s[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(s[a]=s[s.length-1],s.pop());r&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var oi=new si;const ai="transparent",ri={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Ft(t||ai),s=n.valid&&Ft(e||ai);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class li{constructor(t,e,i,n){const s=e[i];n=be([t.to,n,s,t.from]);const o=be([t.from,s,n]);this._active=!0,this._fn=t.fn||ri[t.type||typeof o],this._easing=zt[t.easing]||zt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=be([t.to,e,n,t.from]),this._from=be([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,a=this._to;let r;if(this._active=s!==a&&(o||e<i),!this._active)return this._target[n]=a,void this._notify(!0);e<0?this._target[n]=s:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[n]=this._fn(s,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class hi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!N(t))return;const e=Object.keys(Qt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const s=t[n];if(!N(s))return;const o={};for(const t of e)o[t]=s[t];(F(s.properties)&&s.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const s=t[n[e]];s&&s.active()&&i.push(s.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=s[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(s[l]=c=new li(d,t,l,h),n.push(c)):t[l]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(oi.add(this._chart,i),!0):void 0}}function ci(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function di(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function ui(t,e,i,n={}){const s=t.keys,o="single"===n.mode;let a,r,l,h;if(null===e)return;let c=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===i){if(c=!0,n.all)continue;break}h=t.values[l],V(h)&&(o||0===e||pt(e)===pt(h))&&(e+=h)}return c||n.all?e:0}function pi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function fi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function gi(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function mi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,n),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=fi(s,c,o),u[r]=d,u._top=gi(u,a,!0,n.type),u._bottom=gi(u,a,!1,n.type),(u._visualValues||(u._visualValues={}))[r]=d}}function _i(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function bi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const xi=t=>"reset"===t||"none"===t,yi=(t,e)=>e?t:Object.assign({},t);class vi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=pi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&bi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=j(i.xAxisID,_i(t,"x")),o=e.yAxisID=j(i.yAxisID,_i(t,"y")),a=e.rAxisID=j(i.rAxisID,_i(t,"r")),r=e.indexAxis,l=e.iAxisID=n(r,s,o,a),h=e.vAxisID=n(r,o,s,a);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&At(this._data,this),t._stacked&&bi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(N(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l<h;++l)c=a[l],r[l]={[s]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){At(i,this);const t=this._cachedMeta;bi(t),t._parsed=[]}e&&Object.isExtensible(e)&&((n=e)._chartjs?n._chartjs.listeners.push(this):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Dt.forEach((t=>{const e="_onData"+tt(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),s}})})))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=pi(e.vScale,e),e.stack!==i.stack&&(n=!0,bi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(mi(this,e._parsed),e._stacked=pi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,a=s.axis;let r,l,h,c=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=F(n[t])?this.parseArrayData(i,n,t,e):N(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[a]||d&&l[a]<d[a];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(s()&&(c=!1),d=l);i._sorted=c}o&&mi(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,a=s.axis,r=o.axis,l=s.getLabels(),h=s===o,c=new Array(n);let d,u,p;for(d=0,u=n;d<u;++d)p=d+i,c[d]={[a]:h||s.parse(l[p],p),[r]:o.parse(e[p],p)};return c}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,a=new Array(n);let r,l,h,c;for(r=0,l=n;r<l;++r)h=r+i,c=e[h],a[r]={x:s.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(n);let h,c,d,u;for(h=0,c=n;h<c;++h)d=h+i,u=e[d],l[h]={x:s.parse(Z(u,a),d),y:o.parse(Z(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis];return ui({keys:di(n,!0),values:e._stacks[t.axis]._visualValues},o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,o=ui(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,s=i._sorted&&t===i.iScale,o=n.length,a=this._getOtherScale(t),r=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:di(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(a);let d,u;function p(){u=n[d];const e=u[a.axis];return!V(u[t.axis])||h>e||c<e}for(d=0;d<o&&(p()||(this.updateRangeFromParsed(l,t,u,r),!s));++d);if(s)for(d=o-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n<s;++n)o=e[n][t.axis],V(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,s;return N(t)?(e=t.top,i=t.right,n=t.bottom,s=t.left):e=i=n=s=t,{top:e,right:i,bottom:n,left:s,disabled:!1===t}}(j(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=ci(t,i),s=ci(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||n.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,a,r),h=a;h<a+r;++h){const e=n[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,s))}for(h=0;h<o.length;++h)o[h].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];s=e.$context||(e.$context=function(t,e,i){return xe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),s.parsed=this.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=function(t,e){return xe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),s.dataset=n,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,s=this._cachedDataOpts,o=t+"-"+e,a=s[o],r=this.enableOptionSharing&&et(i);if(a)return yi(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(Qt.elements[t]),p=l.resolveNamedOptions(d,u,(()=>this.getContext(i,n,e)),c);return p.$shared&&(p.$shared=r,s[o]=Object.freeze(yi(p,r))),p}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,a=s[o];if(a)return a;let r;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);r=n.createResolver(o,this.getContext(t,i,e))}const l=new hi(n,r&&r.animations);return r&&r._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||xi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){xi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!xi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&r(n._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&bi(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function wi(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,s=i.length;e<s;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=function(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,s,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(et(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(n=0,s=i.length;n<s;+