!function(){function t(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}System.register(["./antdv-legacy.ba9eaef5.js"],(function(e,i){"use strict";var n;return{setters:[t=>{n=t.c}],execute:function(){e({O:function(...t){const e=[0].concat(t);e.push(1);const i=e.length,n=Array(i).fill(0).map(((t,e)=>((t,e)=>Math.round(c(e)/(c(t)*c(e-t))))(e,i-1)));return t=>((...t)=>t.reduce(((t,e)=>t+e),0))(...n.map(((n,r)=>n*e[r]*(1-t)**(i-r-1)*t**r)))},S:async function(t){return new Promise((e=>setTimeout(e,t)))},a:function(t,e){if("sin"===t)return u(e,(t=>(Math.cosh(2*t)-1)/(f-1)));if("tan"===t){const t=t=>1*Math.tanh(3*t)/p;return u(e,(e=>1-t(1-e)),t)}if("sec"===t){const t=t=>1/Math.cosh(t);return u(e,(e=>1-2*(t(e*d)-.5)))}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")},j:function(){return t=>t}});var i=Object.defineProperty,r=(t,e,n)=>(((t,e,n)=>{e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let s=[];const o=t=>{for(const i of s)if("running"===i.status)try{for(const e of i.funcs)e(t-i.startTime)}catch(e){i.destroy(),console.error(e)}requestAnimationFrame(o)};requestAnimationFrame(o);class a{constructor(){r(this,"funcs",[]),r(this,"status","stop"),r(this,"startTime",0),this.status="running",s.push(this),requestAnimationFrame((t=>this.startTime=t))}add(t,e=!1){return e?this.funcs.unshift(t):this.funcs.push(t),this}remove(t){const e=this.funcs.findIndex((e=>e===t));if(-1===e)throw new ReferenceError("You are going to remove nonexistent ticker function.");return this.funcs.splice(e,1),this}clear(){this.funcs=[]}destroy(){this.clear(),this.stop()}stop(){this.status="stop",s=s.filter((t=>t!==this))}}class l{constructor(){r(this,"timing"),r(this,"relation","absolute"),r(this,"easeTime",0),r(this,"applying",{}),r(this,"ticker",new a),r(this,"value",{}),r(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every((t=>!0===t)))throw new ReferenceError("There is no animates to be waited.");await new Promise((t=>{const e=()=>{Object.values(this.applying).every((t=>!1===t))&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)}))}async n(t){const e=Object.values(this.applying).filter((t=>!0===t)).length;if(e{const n=()=>{i++,i===t&&(this.unlisten("end",n),e(`${t} animated.`))};this.listen("end",n)}))}async w(t){if(!1===this.applying[t])throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise((e=>{const i=()=>{!1===this.applying[t]&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)}))}listen(t,e){var i;null!=(i=this.listener)[t]||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex((t=>t===e));if(-1===i)throw new ReferenceError("You are trying to remove a nonexistent listener.");this.listener[t].splice(i,1)}hook(...t){const e=Object.entries(this.listener).filter((e=>t.includes(e[0])));for(const[i,n]of e)for(const t of n)t(this,i)}}function h(t){return null!=t}e("R",class extends l{constructor(){super(),r(this,"shakeTiming"),r(this,"path"),r(this,"multiTiming"),r(this,"value",{}),r(this,"size",1),r(this,"angle",0),r(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),r(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),r(this,"ox",0),r(this,"oy",0),r(this,"sx",0),r(this,"sy",0),r(this,"bindInfo",[]),this.timing=t=>t,this.shakeTiming=t=>t,this.multiTiming=t=>[t,t],this.path=t=>[t,t],this.applying={move:!1,scale:!1,rotate:!1,shake:!1},this.ticker.add((()=>{const{running:t}=this.listener;if(h(t))for(const e of t)e(this,"running")}))}get x(){return this.ox+this.sx}get y(){return this.oy+this.sy}mode(t,e=!1){return"number"==typeof t(0)?e?this.shakeTiming=t:this.timing=t:this.multiTiming=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}bind(...t){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=[],this}move(t,e){return this.applying.move&&this.end(!0,"move"),this.applySys("ox",t,"move"),this.applySys("oy",e,"move"),this}rotate(t){return this.applySys("angle",t,"rotate"),this}scale(t){return this.applySys("size",t,"resize"),this}shake(t,e){!0===this.applying.shake&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:n}=this,r=Date.now();this.hook("start","shakestart");const s=()=>{const o=Date.now()-r;o>i&&(this.ticker.remove(s),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const a=n(o/i);this.sx=a*t,this.sy=a*e};return this.ticker.add(s),this.animateFn.system.shake=s,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:n}=this,r=Date.now(),[s,o]=[this.x,this.y],[a,l]=(()=>{if("absolute"===i)return t(1);{const[e,i]=t(1);return[s+e,o+i]}})();this.hook("start","movestart");const h=()=>{const a=Date.now()-r;if(a>e)return void this.end(!0,"moveAs");const l=a/e,[h,c]=t(n(l));"absolute"===i?(this.ox=h,this.oy=c):(this.ox=s+h,this.oy=o+c)};return this.ticker.add(h,!0),this.animateFn.system.moveAs=h,this.targetValue.system.moveAs=[a,l],this}register(t,e){if("number"==typeof this.value[t])return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){!0===this.applying[t]&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const n=this.value[t],r=Date.now(),{timing:s,relation:o,easeTime:a}=this,l="absolute"===o?e-n:e;this.hook("start");const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!1,t);const i=s(e/a);this.value[t]=n+i*l};return this.ticker.add(h,i),this.animateFn.custom[t]=h,this.targetValue.custom[t]=l+n,this}applyMulti(t=!1){!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map((t=>this.value[t])),n=Date.now(),{multiTiming:r,relation:s,easeTime:o}=this,a=r(1);if(a.length!==i.length)throw new TypeError(`The number of binded animate attributes and timing function returns's length does not match. binded: ${e.length}, timing: ${a.length}`);this.hook("start");const l=()=>{const t=Date.now()-n;if(t>o)return void this.end(!1,"@@bind");const a=r(t/o);e.forEach(((t,e)=>{this.value[t]="absolute"===s?a[e]:i[e]+a[e]}))};return this.ticker.add(l,t),this.animateFn.custom["@@bind"]=l,this.targetValue.system["@@bind"]=a,this}applySys(t,e,i){"move"!==i&&!0===this.applying[i]&&this.end(!0,i),this.applying[i]=!0;const n=this[t],r=Date.now(),s=this.timing,o=this.relation,a=this.easeTime,l="absolute"===o?e-n:e;this.hook("start",`${i}start`);const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!0,i);const o=s(e/a);this[t]=n+l*o,"oy"!==t&&this.hook(i)};this.ticker.add(h,!0),"ox"===t?this.animateFn.system.move[0]=h:"oy"===t?this.animateFn.system.move[1]=h:this.animateFn.system[i]=h,"move"===i?("ox"===t&&(this.targetValue.system.move[0]=l+n),"oy"===t&&(this.targetValue.system.move[1]=l+n)):"shake"!==i&&(this.targetValue.system[i]=l+n)}error(t,e){throw"repeat"===e?new Error(`Cannot execute the same animation twice. Info: ${t}`):"reregister"===e?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(!0===t)if(this.applying[e]=!1,"move"===e?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):"moveAs"===e?this.ticker.remove(this.animateFn.system.moveAs):"@@bind"===e?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),"move"===e){const[t,e]=this.targetValue.system.move;this.ox=t,this.oy=e,this.hook("moveend","end")}else if("moveAs"===e){const[t,e]=this.targetValue.system.moveAs;this.ox=t,this.oy=e,this.hook("moveend","end")}else"rotate"===e?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):"resize"===e?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):"@@bind"===e?this.bindInfo.forEach(((t,e)=>{this.value[t]=this.targetValue.system["@@bind"][e]})):(this.sx=0,this.sy=0,this.hook("shakeend","end"));else this.applying[e]=!1,this.ticker.remove(this.animateFn.custom[e]),this.value[e]=this.targetValue.custom[e],this.hook("end")}});e("Y",class extends l{constructor(){super(),r(this,"now",{}),r(this,"target",{}),r(this,"transitionFn",{}),r(this,"value"),r(this,"handleSet",((t,e,i)=>(this.transition(e,i),!0))),r(this,"handleGet",((t,e)=>this.now[e])),this.timing=t=>t,this.value=new Proxy(this.target,{set:this.handleSet,get:this.handleGet})}mode(t){return this.timing=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}transition(t,e){if(e===this.target[t])return this;if(!h(this.now[t]))return this.now[t]=e,this;this.applying[t]&&this.end(t,!0),this.applying[t]=!0,this.hook("start");const i=Date.now(),n=this.easeTime,r=this.timing,s=this.now[t],o=e+("absolute"===this.relation?0:s),a=o-s;this.target[t]=o;const l=()=>{const e=Date.now()-i;e>=n&&this.end(t);const o=e/n;this.now[t]=r(o)*a+s,this.hook("running")};return this.transitionFn[t]=l,this.ticker.add(l),this}end(t,e=!1){if(!h(this.transitionFn[t]))throw new ReferenceError(`You are trying to end an ended transition: ${t}`);this.ticker.remove(this.transitionFn[t]),delete this.transitionFn[t],this.applying[t]=!1,this.hook("end"),e||(this.now[t]=this.target[t])}});const c=t=>{if(0===t)return 1;let e=t;for(;t>1;)e*=--t;return e},u=(t,e,i=(t=>1-e(1-t)))=>"in"===t?e:"out"===t?i:"in-out"===t?t=>t<.5?e(2*t)/2:.5+i(2*(t-.5))/2:t=>t<.5?i(2*t)/2:.5+e(2*(t-.5))/2,f=Math.cosh(2),d=Math.acosh(2),p=Math.tanh(3);var g=e("l",{exports:{}}); /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */ function m(t){return t+.5|0}!function(t,e){(function(){var i,r="Expected a function",s="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,l=32,h=64,c=128,u=256,f=1/0,d=9007199254740991,p=NaN,g=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",l],["partialRight",h],["rearg",u]],b="[object Arguments]",_="[object Array]",x="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",k="[object GeneratorFunction]",M="[object Map]",S="[object Number]",P="[object Object]",A="[object Promise]",D="[object RegExp]",O="[object Set]",C="[object String]",T="[object Symbol]",E="[object WeakMap]",L="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",z="[object Float64Array]",F="[object Int8Array]",j="[object Int16Array]",V="[object Int32Array]",B="[object Uint8Array]",W="[object Uint8ClampedArray]",N="[object Uint16Array]",H="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(q.source),Z=RegExp(X.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),st=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,kt="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Dt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Tt="["+kt+"]",Et="["+Ot+"]",Lt="["+Mt+"]",Rt="\\d+",It="["+St+"]",zt="["+Pt+"]",Ft="[^"+kt+Ot+Rt+St+Pt+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Vt="[^"+kt+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Wt="[\\ud800-\\udbff][\\udc00-\\udfff]",Nt="["+At+"]",Ht="\\u200d",$t="(?:"+zt+"|"+Ft+")",Ut="(?:"+Nt+"|"+Ft+")",Yt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+Lt+"|"+jt+")"+"?",Kt="["+Dt+"]?",Zt=Kt+Xt+("(?:"+Ht+"(?:"+[Vt,Bt,Wt].join("|")+")"+Kt+Xt+")*"),Gt="(?:"+[It,Bt,Wt].join("|")+")"+Zt,Jt="(?:"+[Vt+Lt+"?",Lt,Bt,Wt,Tt].join("|")+")",Qt=RegExp(Ct,"g"),te=RegExp(Lt,"g"),ee=RegExp(jt+"(?="+jt+")|"+Jt+Zt,"g"),ie=RegExp([Nt+"?"+zt+"+"+Yt+"(?="+[Et,Nt,"$"].join("|")+")",Ut+"+"+qt+"(?="+[Et,Nt+$t,"$"].join("|")+")",Nt+"?"+$t+"+"+Yt,Nt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Gt].join("|"),"g"),ne=RegExp("["+Ht+kt+Mt+Dt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[I]=ae[z]=ae[F]=ae[j]=ae[V]=ae[B]=ae[W]=ae[N]=ae[H]=!0,ae[b]=ae[_]=ae[L]=ae[x]=ae[R]=ae[v]=ae[y]=ae[w]=ae[M]=ae[S]=ae[P]=ae[D]=ae[O]=ae[C]=ae[E]=!1;var le={};le[b]=le[_]=le[L]=le[R]=le[x]=le[v]=le[I]=le[z]=le[F]=le[j]=le[V]=le[M]=le[S]=le[P]=le[D]=le[O]=le[C]=le[T]=le[B]=le[W]=le[N]=le[H]=!0,le[y]=le[w]=le[E]=!1;var he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,ue=parseInt,fe="object"==typeof n&&n&&n.Object===Object&&n,de="object"==typeof self&&self&&self.Object===Object&&self,pe=fe||de||Function("return this")(),ge=e&&!e.nodeType&&e,me=ge&&t&&!t.nodeType&&t,be=me&&me.exports===ge,_e=be&&fe.process,xe=function(){try{var t=me&&me.require&&me.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),ve=xe&&xe.isArrayBuffer,ye=xe&&xe.isDate,we=xe&&xe.isMap,ke=xe&&xe.isRegExp,Me=xe&&xe.isSet,Se=xe&&xe.isTypedArray;function Pe(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function Ae(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r-1}function Le(t,e,i){for(var n=-1,r=null==t?0:t.length;++n-1;);return i}function ii(t,e){for(var i=t.length;i--&&Ne(e,t[i],0)>-1;);return i}function ni(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}var ri=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),si=qe({"&":"&","<":"<",">":">",'"':""","'":"'"});function oi(t){return"\\"+he[t]}function ai(t){return ne.test(t)}function li(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function hi(t,e){return function(i){return t(e(i))}}function ci(t,e){for(var i=-1,n=t.length,r=0,s=[];++i",""":'"',"'":"'"});var bi=function t(e){var n=(e=null==e?pe:bi.defaults(pe.Object(),e,bi.pick(pe,se))).Array,ot=e.Date,kt=e.Error,Mt=e.Function,St=e.Math,Pt=e.Object,At=e.RegExp,Dt=e.String,Ot=e.TypeError,Ct=n.prototype,Tt=Mt.prototype,Et=Pt.prototype,Lt=e["__core-js_shared__"],Rt=Tt.toString,It=Et.hasOwnProperty,zt=0,Ft=function(){var t=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jt=Et.toString,Vt=Rt.call(Pt),Bt=pe._,Wt=At("^"+Rt.call(It).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=be?e.Buffer:i,Ht=e.Symbol,$t=e.Uint8Array,Ut=Nt?Nt.allocUnsafe:i,Yt=hi(Pt.getPrototypeOf,Pt),qt=Pt.create,Xt=Et.propertyIsEnumerable,Kt=Ct.splice,Zt=Ht?Ht.isConcatSpreadable:i,Gt=Ht?Ht.iterator:i,Jt=Ht?Ht.toStringTag:i,ee=function(){try{var t=fs(Pt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ne=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=ot&&ot.now!==pe.Date.now&&ot.now,fe=e.setTimeout!==pe.setTimeout&&e.setTimeout,de=St.ceil,ge=St.floor,me=Pt.getOwnPropertySymbols,_e=Nt?Nt.isBuffer:i,xe=e.isFinite,Ve=Ct.join,qe=hi(Pt.keys,Pt),_i=St.max,xi=St.min,vi=ot.now,yi=e.parseInt,wi=St.random,ki=Ct.reverse,Mi=fs(e,"DataView"),Si=fs(e,"Map"),Pi=fs(e,"Promise"),Ai=fs(e,"Set"),Di=fs(e,"WeakMap"),Oi=fs(Pt,"create"),Ci=Di&&new Di,Ti={},Ei=Vs(Mi),Li=Vs(Si),Ri=Vs(Pi),Ii=Vs(Ai),zi=Vs(Di),Fi=Ht?Ht.prototype:i,ji=Fi?Fi.valueOf:i,Vi=Fi?Fi.toString:i;function Bi(t){if(na(t)&&!Yo(t)&&!(t instanceof $i)){if(t instanceof Hi)return t;if(It.call(t,"__wrapped__"))return Bs(t)}return new Hi(t)}var Wi=function(){function t(){}return function(e){if(!ia(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function Ni(){}function Hi(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function $i(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Ui(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function hn(t,e,n,r,s,o){var a,l=1&e,h=2&e,c=4&e;if(n&&(a=s?n(t,r,s,o):n(t)),a!==i)return a;if(!ia(t))return t;var u=Yo(t);if(u){if(a=function(t){var e=t.length,i=new t.constructor(e);e&&"string"==typeof t[0]&&It.call(t,"index")&&(i.index=t.index,i.input=t.input);return i}(t),!l)return Cr(t,a)}else{var f=gs(t),d=f==w||f==k;if(Zo(t))return Mr(t,l);if(f==P||f==b||d&&!s){if(a=h||d?{}:bs(t),!l)return h?function(t,e){return Tr(t,ps(t),e)}(t,function(t,e){return t&&Tr(e,Ra(e),t)}(a,t)):function(t,e){return Tr(t,ds(t),e)}(t,sn(a,t))}else{if(!le[f])return s?t:{};a=function(t,e,i){var n=t.constructor;switch(e){case L:return Sr(t);case x:case v:return new n(+t);case R:return function(t,e){var i=e?Sr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case I:case z:case F:case j:case V:case B:case W:case N:case H:return Pr(t,i);case M:return new n;case S:case C:return new n(t);case D:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new n;case T:return r=t,ji?Pt(ji.call(r)):{}}var r}(t,f,l)}}o||(o=new Ki);var p=o.get(t);if(p)return p;o.set(t,a),la(t)?t.forEach((function(i){a.add(hn(i,e,n,i,t,o))})):ra(t)&&t.forEach((function(i,r){a.set(r,hn(i,e,n,r,t,o))}));var g=u?i:(c?h?ss:rs:h?Ra:La)(t);return De(g||t,(function(i,r){g&&(i=t[r=i]),en(a,r,hn(i,e,n,r,t,o))})),a}function cn(t,e,n){var r=n.length;if(null==t)return!r;for(t=Pt(t);r--;){var s=n[r],o=e[s],a=t[s];if(a===i&&!(s in t)||!o(a))return!1}return!0}function un(t,e,n){if("function"!=typeof t)throw new Ot(r);return Es((function(){t.apply(i,n)}),e)}function fn(t,e,i,n){var r=-1,s=Ee,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;i&&(e=Re(e,Je(i))),n?(s=Le,o=!1):e.length>=200&&(s=ti,o=!1,e=new Xi(e));t:for(;++r-1},Yi.prototype.set=function(t,e){var i=this.__data__,n=nn(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},qi.prototype.clear=function(){this.size=0,this.__data__={hash:new Ui,map:new(Si||Yi),string:new Ui}},qi.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},qi.prototype.get=function(t){return cs(this,t).get(t)},qi.prototype.has=function(t){return cs(this,t).has(t)},qi.prototype.set=function(t,e){var i=cs(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},Xi.prototype.add=Xi.prototype.push=function(t){return this.__data__.set(t,s),this},Xi.prototype.has=function(t){return this.__data__.has(t)},Ki.prototype.clear=function(){this.__data__=new Yi,this.size=0},Ki.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Ki.prototype.get=function(t){return this.__data__.get(t)},Ki.prototype.has=function(t){return this.__data__.has(t)},Ki.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Yi){var n=i.__data__;if(!Si||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new qi(n)}return i.set(t,e),this.size=i.size,this};var dn=Rr(yn),pn=Rr(wn,!0);function gn(t,e){var i=!0;return dn(t,(function(t,n,r){return i=!!e(t,n,r)})),i}function mn(t,e,n){for(var r=-1,s=t.length;++r0&&i(a)?e>1?_n(a,e-1,i,n,r):Ie(r,a):n||(r[r.length]=a)}return r}var xn=Ir(),vn=Ir(!0);function yn(t,e){return t&&xn(t,e,La)}function wn(t,e){return t&&vn(t,e,La)}function kn(t,e){return Te(e,(function(e){return Qo(t[e])}))}function Mn(t,e){for(var n=0,r=(e=vr(e,t)).length;null!=t&&ne}function Dn(t,e){return null!=t&&It.call(t,e)}function On(t,e){return null!=t&&e in Pt(t)}function Cn(t,e,r){for(var s=r?Le:Ee,o=t[0].length,a=t.length,l=a,h=n(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=Re(f,Je(e))),c=xi(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new Xi(l&&f):i}f=t[0];var d=-1,p=h[0];t:for(;++d=a?l:l*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Yn(t,e,i){for(var n=-1,r=e.length,s={};++n-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function Xn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var r=e[i];if(i==n||r!==s){var s=r;xs(r)?Kt.call(t,r,1):fr(t,r)}}return t}function Kn(t,e){return t+ge(wi()*(e-t+1))}function Zn(t,e){var i="";if(!t||e<1||e>d)return i;do{e%2&&(i+=t),(e=ge(e/2))&&(t+=t)}while(e);return i}function Gn(t,e){return Ls(As(t,e,sl),t+"")}function Jn(t){return Gi(Na(t))}function Qn(t,e){var i=Na(t);return zs(i,ln(e,0,i.length))}function tr(t,e,n,r){if(!ia(t))return t;for(var s=-1,o=(e=vr(e,t)).length,a=o-1,l=t;null!=l&&++ss?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var o=n(s);++r>>1,o=t[s];null!==o&&!ca(o)&&(i?o<=e:o=200){var h=e?null:Zr(t);if(h)return ui(h);o=!1,r=ti,l=new Xi}else l=e?[]:a;t:for(;++n=r?t:rr(t,e,n)}var kr=ne||function(t){return pe.clearTimeout(t)};function Mr(t,e){if(e)return t.slice();var i=t.length,n=Ut?Ut(i):new t.constructor(i);return t.copy(n),n}function Sr(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e}function Pr(t,e){var i=e?Sr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ar(t,e){if(t!==e){var n=t!==i,r=null===t,s=t==t,o=ca(t),a=e!==i,l=null===e,h=e==e,c=ca(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!n&&h||!s)return 1;if(!r&&!o&&!c&&t1?n[s-1]:i,a=s>2?n[2]:i;for(o=t.length>3&&"function"==typeof o?(s--,o):i,a&&vs(n[0],n[1],a)&&(o=s<3?i:o,s=1),e=Pt(e);++r-1?s[o?e[a]:a]:i}}function Br(t){return ns((function(e){var n=e.length,s=n,o=Hi.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new Ot(r);if(o&&!l&&"wrapper"==as(a))var l=new Hi([],!0)}for(s=l?s:n;++s1&&x.reverse(),d&&ul))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,p=2&n?new Xi:i;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return De(m,(function(i){var n="_."+i[0];e&i[1]&&!Ee(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(ht):[]}(n),i)))}function Is(t){var e=0,n=0;return function(){var r=vi(),s=16-(r-n);if(n=r,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function zs(t,e){var n=-1,r=t.length,s=r-1;for(e=e===i?r:e;++n1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,oo(t,n)}));function po(t){var e=Bi(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var mo=ns((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,s=function(e){return an(e,t)};return!(e>1||this.__actions__.length)&&r instanceof $i&&xs(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:go,args:[s],thisArg:i}),new Hi(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(s)}));var bo=Er((function(t,e,i){It.call(t,i)?++t[i]:on(t,i,1)}));var _o=Vr($s),xo=Vr(Us);function vo(t,e){return(Yo(t)?De:dn)(t,hs(e,3))}function yo(t,e){return(Yo(t)?Oe:pn)(t,hs(e,3))}var wo=Er((function(t,e,i){It.call(t,i)?t[i].push(e):on(t,i,[e])}));var ko=Gn((function(t,e,i){var r=-1,s="function"==typeof e,o=Xo(t)?n(t.length):[];return dn(t,(function(t){o[++r]=s?Pe(e,t,i):Tn(t,e,i)})),o})),Mo=Er((function(t,e,i){on(t,i,e)}));function So(t,e){return(Yo(t)?Re:Bn)(t,hs(e,3))}var Po=Er((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]}));var Ao=Gn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&vs(t,e[0],e[1])?e=[]:i>2&&vs(e[0],e[1],e[2])&&(e=[e[0]]),Un(t,_n(e,1),[])})),Do=he||function(){return pe.Date.now()};function Oo(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Jr(t,c,i,i,i,i,e)}function Co(t,e){var n;if("function"!=typeof e)throw new Ot(r);return t=ma(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var To=Gn((function(t,e,i){var n=1;if(i.length){var r=ci(i,ls(To));n|=l}return Jr(t,n,e,i,r)})),Eo=Gn((function(t,e,i){var n=3;if(i.length){var r=ci(i,ls(Eo));n|=l}return Jr(e,n,t,i,r)}));function Lo(t,e,n){var s,o,a,l,h,c,u=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Ot(r);function g(e){var n=s,r=o;return s=o=i,u=e,l=t.apply(r,n)}function m(t){return u=t,h=Es(_,e),f?g(t):l}function b(t){var n=t-c;return c===i||n>=e||n<0||d&&t-u>=a}function _(){var t=Do();if(b(t))return x(t);h=Es(_,function(t){var i=e-(t-c);return d?xi(i,a-(t-u)):i}(t))}function x(t){return h=i,p&&s?g(t):(s=o=i,l)}function v(){var t=Do(),n=b(t);if(s=arguments,o=this,c=t,n){if(h===i)return m(c);if(d)return kr(h),h=Es(_,e),g(c)}return h===i&&(h=Es(_,e)),l}return e=_a(e)||0,ia(n)&&(f=!!n.leading,a=(d="maxWait"in n)?_i(_a(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){h!==i&&kr(h),u=0,s=c=o=h=i},v.flush=function(){return h===i?l:x(Do())},v}var Ro=Gn((function(t,e){return un(t,1,e)})),Io=Gn((function(t,e,i){return un(t,_a(e)||0,i)}));function zo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(zo.Cache||qi),i}function Fo(t){if("function"!=typeof t)throw new Ot(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}zo.Cache=qi;var jo=yr((function(t,e){var i=(e=1==e.length&&Yo(e[0])?Re(e[0],Je(hs())):Re(_n(e,1),Je(hs()))).length;return Gn((function(n){for(var r=-1,s=xi(n.length,i);++r=e})),Uo=En(function(){return arguments}())?En:function(t){return na(t)&&It.call(t,"callee")&&!Xt.call(t,"callee")},Yo=n.isArray,qo=ve?Je(ve):function(t){return na(t)&&Pn(t)==L};function Xo(t){return null!=t&&ea(t.length)&&!Qo(t)}function Ko(t){return na(t)&&Xo(t)}var Zo=_e||_l,Go=ye?Je(ye):function(t){return na(t)&&Pn(t)==v};function Jo(t){if(!na(t))return!1;var e=Pn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qo(t){if(!ia(t))return!1;var e=Pn(t);return e==w||e==k||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ma(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ia(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=we?Je(we):function(t){return na(t)&&gs(t)==M};function sa(t){return"number"==typeof t||na(t)&&Pn(t)==S}function oa(t){if(!na(t)||Pn(t)!=P)return!1;var e=Yt(t);if(null===e)return!0;var i=It.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Rt.call(i)==Vt}var aa=ke?Je(ke):function(t){return na(t)&&Pn(t)==D};var la=Me?Je(Me):function(t){return na(t)&&gs(t)==O};function ha(t){return"string"==typeof t||!Yo(t)&&na(t)&&Pn(t)==C}function ca(t){return"symbol"==typeof t||na(t)&&Pn(t)==T}var ua=Se?Je(Se):function(t){return na(t)&&ea(t.length)&&!!ae[Pn(t)]};var fa=qr(Vn),da=qr((function(t,e){return t<=e}));function pa(t){if(!t)return[];if(Xo(t))return ha(t)?pi(t):Cr(t);if(Gt&&t[Gt])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Gt]());var e=gs(t);return(e==M?li:e==O?ui:Na)(t)}function ga(t){return t?(t=_a(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ma(t){var e=ga(t),i=e%1;return e==e?i?e-i:e:0}function ba(t){return t?ln(ma(t),0,g):0}function _a(t){if("number"==typeof t)return t;if(ca(t))return p;if(ia(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ia(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var i=mt.test(t);return i||_t.test(t)?ue(t.slice(2),i?2:8):gt.test(t)?p:+t}function xa(t){return Tr(t,Ra(t))}function va(t){return null==t?"":cr(t)}var ya=Lr((function(t,e){if(Ms(e)||Xo(e))Tr(e,La(e),t);else for(var i in e)It.call(e,i)&&en(t,i,e[i])})),wa=Lr((function(t,e){Tr(e,Ra(e),t)})),ka=Lr((function(t,e,i,n){Tr(e,Ra(e),t,n)})),Ma=Lr((function(t,e,i,n){Tr(e,La(e),t,n)})),Sa=ns(an);var Pa=Gn((function(t,e){t=Pt(t);var n=-1,r=e.length,s=r>2?e[2]:i;for(s&&vs(e[0],e[1],s)&&(r=1);++n1),e})),Tr(t,ss(t),i),n&&(i=hn(i,7,es));for(var r=e.length;r--;)fr(i,e[r]);return i}));var ja=ns((function(t,e){return null==t?{}:function(t,e){return Yn(t,e,(function(e,i){return Oa(t,i)}))}(t,e)}));function Va(t,e){if(null==t)return{};var i=Re(ss(t),(function(t){return[t]}));return e=hs(e),Yn(t,i,(function(t,i){return e(t,i[0])}))}var Ba=Gr(La),Wa=Gr(Ra);function Na(t){return null==t?[]:Qe(t,La(t))}var Ha=Fr((function(t,e,i){return e=e.toLowerCase(),t+(i?$a(e):e)}));function $a(t){return Ja(va(t).toLowerCase())}function Ua(t){return(t=va(t))&&t.replace(vt,ri).replace(te,"")}var Ya=Fr((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),qa=Fr((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),Xa=zr("toLowerCase");var Ka=Fr((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()}));var Za=Fr((function(t,e,i){return t+(i?" ":"")+Ja(e)}));var Ga=Fr((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Ja=zr("toUpperCase");function Qa(t,e,n){return t=va(t),(e=n?i:e)===i?function(t){return re.test(t)}(t)?function(t){return t.match(ie)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var tl=Gn((function(t,e){try{return Pe(t,i,e)}catch(n){return Jo(n)?n:new kt(n)}})),el=ns((function(t,e){return De(e,(function(e){e=js(e),on(t,e,To(t[e],t))})),t}));function il(t){return function(){return t}}var nl=Br(),rl=Br(!0);function sl(t){return t}function ol(t){return zn("function"==typeof t?t:hn(t,1))}var al=Gn((function(t,e){return function(i){return Tn(i,t,e)}})),ll=Gn((function(t,e){return function(i){return Tn(t,i,e)}}));function hl(t,e,i){var n=La(e),r=kn(e,n);null!=i||ia(e)&&(r.length||!n.length)||(i=e,e=t,t=this,r=kn(e,La(e)));var s=!(ia(i)&&"chain"in i&&!i.chain),o=Qo(t);return De(r,(function(i){var n=e[i];t[i]=n,o&&(t.prototype[i]=function(){var e=this.__chain__;if(s||e){var i=t(this.__wrapped__),r=i.__actions__=Cr(this.__actions__);return r.push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,Ie([this.value()],arguments))})})),t}function cl(){}var ul=$r(Re),fl=$r(Ce),dl=$r(je);function pl(t){return ys(t)?Ye(js(t)):function(t){return function(e){return Mn(e,t)}}(t)}var gl=Yr(),ml=Yr(!0);function bl(){return[]}function _l(){return!1}var xl=Hr((function(t,e){return t+e}),0),vl=Kr("ceil"),yl=Hr((function(t,e){return t/e}),1),wl=Kr("floor");var kl,Ml=Hr((function(t,e){return t*e}),1),Sl=Kr("round"),Pl=Hr((function(t,e){return t-e}),0);return Bi.after=function(t,e){if("function"!=typeof e)throw new Ot(r);return t=ma(t),function(){if(--t<1)return e.apply(this,arguments)}},Bi.ary=Oo,Bi.assign=ya,Bi.assignIn=wa,Bi.assignInWith=ka,Bi.assignWith=Ma,Bi.at=Sa,Bi.before=Co,Bi.bind=To,Bi.bindAll=el,Bi.bindKey=Eo,Bi.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Yo(t)?t:[t]},Bi.chain=po,Bi.chunk=function(t,e,r){e=(r?vs(t,e,r):e===i)?1:_i(ma(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=n(de(s/e));os?0:s+n),(r=r===i||r>s?s:ma(r))<0&&(r+=s),r=n>r?0:ba(r);n>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!aa(e))&&!(e=cr(e))&&ai(t)?wr(pi(t),0,n):t.split(e,n):[]},Bi.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:_i(ma(e),0),Gn((function(i){var n=i[e],r=wr(i,0,e);return n&&Ie(r,n),Pe(t,this,r)}))},Bi.tail=function(t){var e=null==t?0:t.length;return e?rr(t,1,e):[]},Bi.take=function(t,e,n){return t&&t.length?rr(t,0,(e=n||e===i?1:ma(e))<0?0:e):[]},Bi.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?rr(t,(e=r-(e=n||e===i?1:ma(e)))<0?0:e,r):[]},Bi.takeRightWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!1,!0):[]},Bi.takeWhile=function(t,e){return t&&t.length?pr(t,hs(e,3)):[]},Bi.tap=function(t,e){return e(t),t},Bi.throttle=function(t,e,i){var n=!0,s=!0;if("function"!=typeof t)throw new Ot(r);return ia(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),Lo(t,e,{leading:n,maxWait:e,trailing:s})},Bi.thru=go,Bi.toArray=pa,Bi.toPairs=Ba,Bi.toPairsIn=Wa,Bi.toPath=function(t){return Yo(t)?Re(t,js):ca(t)?[t]:Cr(Fs(va(t)))},Bi.toPlainObject=xa,Bi.transform=function(t,e,i){var n=Yo(t),r=n||Zo(t)||ua(t);if(e=hs(e,4),null==i){var s=t&&t.constructor;i=r?n?new s:[]:ia(t)&&Qo(s)?Wi(Yt(t)):{}}return(r?De:yn)(t,(function(t,n,r){return e(i,t,n,r)})),i},Bi.unary=function(t){return Oo(t,1)},Bi.union=io,Bi.unionBy=no,Bi.unionWith=ro,Bi.uniq=function(t){return t&&t.length?ur(t):[]},Bi.uniqBy=function(t,e){return t&&t.length?ur(t,hs(e,2)):[]},Bi.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?ur(t,i,e):[]},Bi.unset=function(t,e){return null==t||fr(t,e)},Bi.unzip=so,Bi.unzipWith=oo,Bi.update=function(t,e,i){return null==t?t:dr(t,e,xr(i))},Bi.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:dr(t,e,xr(n),r)},Bi.values=Na,Bi.valuesIn=function(t){return null==t?[]:Qe(t,Ra(t))},Bi.without=ao,Bi.words=Qa,Bi.wrap=function(t,e){return Vo(xr(e),t)},Bi.xor=lo,Bi.xorBy=ho,Bi.xorWith=co,Bi.zip=uo,Bi.zipObject=function(t,e){return br(t||[],e||[],en)},Bi.zipObjectDeep=function(t,e){return br(t||[],e||[],tr)},Bi.zipWith=fo,Bi.entries=Ba,Bi.entriesIn=Wa,Bi.extend=wa,Bi.extendWith=ka,hl(Bi,Bi),Bi.add=xl,Bi.attempt=tl,Bi.camelCase=Ha,Bi.capitalize=$a,Bi.ceil=vl,Bi.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=_a(n))==n?n:0),e!==i&&(e=(e=_a(e))==e?e:0),ln(_a(t),e,n)},Bi.clone=function(t){return hn(t,4)},Bi.cloneDeep=function(t){return hn(t,5)},Bi.cloneDeepWith=function(t,e){return hn(t,5,e="function"==typeof e?e:i)},Bi.cloneWith=function(t,e){return hn(t,4,e="function"==typeof e?e:i)},Bi.conformsTo=function(t,e){return null==e||cn(t,e,La(e))},Bi.deburr=Ua,Bi.defaultTo=function(t,e){return null==t||t!=t?e:t},Bi.divide=yl,Bi.endsWith=function(t,e,n){t=va(t),e=cr(e);var r=t.length,s=n=n===i?r:ln(ma(n),0,r);return(n-=e.length)>=0&&t.slice(n,s)==e},Bi.eq=No,Bi.escape=function(t){return(t=va(t))&&Z.test(t)?t.replace(X,si):t},Bi.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Bi.every=function(t,e,n){var r=Yo(t)?Ce:gn;return n&&vs(t,e,n)&&(e=i),r(t,hs(e,3))},Bi.find=_o,Bi.findIndex=$s,Bi.findKey=function(t,e){return Be(t,hs(e,3),yn)},Bi.findLast=xo,Bi.findLastIndex=Us,Bi.findLastKey=function(t,e){return Be(t,hs(e,3),wn)},Bi.floor=wl,Bi.forEach=vo,Bi.forEachRight=yo,Bi.forIn=function(t,e){return null==t?t:xn(t,hs(e,3),Ra)},Bi.forInRight=function(t,e){return null==t?t:vn(t,hs(e,3),Ra)},Bi.forOwn=function(t,e){return t&&yn(t,hs(e,3))},Bi.forOwnRight=function(t,e){return t&&wn(t,hs(e,3))},Bi.get=Da,Bi.gt=Ho,Bi.gte=$o,Bi.has=function(t,e){return null!=t&&ms(t,e,Dn)},Bi.hasIn=Oa,Bi.head=qs,Bi.identity=sl,Bi.includes=function(t,e,i,n){t=Xo(t)?t:Na(t),i=i&&!n?ma(i):0;var r=t.length;return i<0&&(i=_i(r+i,0)),ha(t)?i<=r&&t.indexOf(e,i)>-1:!!r&&Ne(t,e,i)>-1},Bi.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:ma(i);return r<0&&(r=_i(n+r,0)),Ne(t,e,r)},Bi.inRange=function(t,e,n){return e=ga(e),n===i?(n=e,e=0):n=ga(n),function(t,e,i){return t>=xi(e,i)&&t<_i(e,i)}(t=_a(t),e,n)},Bi.invoke=Ea,Bi.isArguments=Uo,Bi.isArray=Yo,Bi.isArrayBuffer=qo,Bi.isArrayLike=Xo,Bi.isArrayLikeObject=Ko,Bi.isBoolean=function(t){return!0===t||!1===t||na(t)&&Pn(t)==x},Bi.isBuffer=Zo,Bi.isDate=Go,Bi.isElement=function(t){return na(t)&&1===t.nodeType&&!oa(t)},Bi.isEmpty=function(t){if(null==t)return!0;if(Xo(t)&&(Yo(t)||"string"==typeof t||"function"==typeof t.splice||Zo(t)||ua(t)||Uo(t)))return!t.length;var e=gs(t);if(e==M||e==O)return!t.size;if(Ms(t))return!Fn(t).length;for(var i in t)if(It.call(t,i))return!1;return!0},Bi.isEqual=function(t,e){return Ln(t,e)},Bi.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Ln(t,e,i,n):!!r},Bi.isError=Jo,Bi.isFinite=function(t){return"number"==typeof t&&xe(t)},Bi.isFunction=Qo,Bi.isInteger=ta,Bi.isLength=ea,Bi.isMap=ra,Bi.isMatch=function(t,e){return t===e||Rn(t,e,us(e))},Bi.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Rn(t,e,us(e),n)},Bi.isNaN=function(t){return sa(t)&&t!=+t},Bi.isNative=function(t){if(ks(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return In(t)},Bi.isNil=function(t){return null==t},Bi.isNull=function(t){return null===t},Bi.isNumber=sa,Bi.isObject=ia,Bi.isObjectLike=na,Bi.isPlainObject=oa,Bi.isRegExp=aa,Bi.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=d},Bi.isSet=la,Bi.isString=ha,Bi.isSymbol=ca,Bi.isTypedArray=ua,Bi.isUndefined=function(t){return t===i},Bi.isWeakMap=function(t){return na(t)&&gs(t)==E},Bi.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==Pn(t)},Bi.join=function(t,e){return null==t?"":Ve.call(t,e)},Bi.kebabCase=Ya,Bi.last=Gs,Bi.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r;return n!==i&&(s=(s=ma(n))<0?_i(r+s,0):xi(s,r-1)),e==e?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(t,e,s):We(t,$e,s,!0)},Bi.lowerCase=qa,Bi.lowerFirst=Xa,Bi.lt=fa,Bi.lte=da,Bi.max=function(t){return t&&t.length?mn(t,sl,An):i},Bi.maxBy=function(t,e){return t&&t.length?mn(t,hs(e,2),An):i},Bi.mean=function(t){return Ue(t,sl)},Bi.meanBy=function(t,e){return Ue(t,hs(e,2))},Bi.min=function(t){return t&&t.length?mn(t,sl,Vn):i},Bi.minBy=function(t,e){return t&&t.length?mn(t,hs(e,2),Vn):i},Bi.stubArray=bl,Bi.stubFalse=_l,Bi.stubObject=function(){return{}},Bi.stubString=function(){return""},Bi.stubTrue=function(){return!0},Bi.multiply=Ml,Bi.nth=function(t,e){return t&&t.length?$n(t,ma(e)):i},Bi.noConflict=function(){return pe._===this&&(pe._=Bt),this},Bi.noop=cl,Bi.now=Do,Bi.pad=function(t,e,i){t=va(t);var n=(e=ma(e))?di(t):0;if(!e||n>=e)return t;var r=(e-n)/2;return Ur(ge(r),i)+t+Ur(de(r),i)},Bi.padEnd=function(t,e,i){t=va(t);var n=(e=ma(e))?di(t):0;return e&&ne){var r=t;t=e,e=r}if(n||t%1||e%1){var s=wi();return xi(t+s*(e-t+ce("1e-"+((s+"").length-1))),e)}return Kn(t,e)},Bi.reduce=function(t,e,i){var n=Yo(t)?ze:Xe,r=arguments.length<3;return n(t,hs(e,4),i,r,dn)},Bi.reduceRight=function(t,e,i){var n=Yo(t)?Fe:Xe,r=arguments.length<3;return n(t,hs(e,4),i,r,pn)},Bi.repeat=function(t,e,n){return e=(n?vs(t,e,n):e===i)?1:ma(e),Zn(va(t),e)},Bi.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bi.result=function(t,e,n){var r=-1,s=(e=vr(e,t)).length;for(s||(s=1,t=i);++rd)return[];var i=g,n=xi(t,g);e=hs(e),t-=g;for(var r=Ze(n,e);++i=o)return t;var l=n-di(r);if(l<1)return r;var h=a?wr(a,0,l).join(""):t.slice(0,l);if(s===i)return h+r;if(a&&(l+=h.length-l),aa(s)){if(t.slice(l).search(s)){var c,u=h;for(s.global||(s=At(s.source,va(pt.exec(s))+"g")),s.lastIndex=0;c=s.exec(u);)var f=c.index;h=h.slice(0,f===i?l:f)}}else if(t.indexOf(cr(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+r},Bi.unescape=function(t){return(t=va(t))&&K.test(t)?t.replace(q,mi):t},Bi.uniqueId=function(t){var e=++zt;return va(t)+e},Bi.upperCase=Ga,Bi.upperFirst=Ja,Bi.each=vo,Bi.eachRight=yo,Bi.first=qs,hl(Bi,(kl={},yn(Bi,(function(t,e){It.call(Bi.prototype,e)||(kl[e]=t)})),kl),{chain:!1}),Bi.VERSION="4.17.21",De(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bi[t].placeholder=Bi})),De(["drop","take"],(function(t,e){$i.prototype[t]=function(n){n=n===i?1:_i(ma(n),0);var r=this.__filtered__&&!e?new $i(this):this.clone();return r.__filtered__?r.__takeCount__=xi(n,r.__takeCount__):r.__views__.push({size:xi(n,g),type:t+(r.__dir__<0?"Right":"")}),r},$i.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),De(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;$i.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:hs(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),De(["head","last"],(function(t,e){var i="take"+(e?"Right":"");$i.prototype[t]=function(){return this[i](1).value()[0]}})),De(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");$i.prototype[t]=function(){return this.__filtered__?new $i(this):this[i](1)}})),$i.prototype.compact=function(){return this.filter(sl)},$i.prototype.find=function(t){return this.filter(t).head()},$i.prototype.findLast=function(t){return this.reverse().find(t)},$i.prototype.invokeMap=Gn((function(t,e){return"function"==typeof t?new $i(this):this.map((function(i){return Tn(i,t,e)}))})),$i.prototype.reject=function(t){return this.filter(Fo(hs(t)))},$i.prototype.slice=function(t,e){t=ma(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $i(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ma(e))<0?n.dropRight(-e):n.take(e-t)),n)},$i.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},$i.prototype.toArray=function(){return this.take(g)},yn($i.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=Bi[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(Bi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof $i,h=a[0],c=l||Yo(e),u=function(t){var e=s.apply(Bi,Ie([t],a));return r&&f?e[0]:e};c&&n&&"function"==typeof h&&1!=h.length&&(l=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,g=l&&!d;if(!o&&c){e=g?e:new $i(this);var m=t.apply(e,a);return m.__actions__.push({func:go,args:[u],thisArg:i}),new Hi(m,f)}return p&&g?t.apply(this,a):(m=this.thru(u),p?r?m.value()[0]:m.value():m)})})),De(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Bi.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var r=this.value();return e.apply(Yo(r)?r:[],t)}return this[i]((function(i){return e.apply(Yo(i)?i:[],t)}))}})),yn($i.prototype,(function(t,e){var i=Bi[e];if(i){var n=i.name+"";It.call(Ti,n)||(Ti[n]=[]),Ti[n].push({name:e,func:i})}})),Ti[Wr(i,2).name]=[{name:"wrapper",func:i}],$i.prototype.clone=function(){var t=new $i(this.__wrapped__);return t.__actions__=Cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Cr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Cr(this.__views__),t},$i.prototype.reverse=function(){if(this.__filtered__){var t=new $i(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},$i.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=Yo(t),n=e<0,r=i?t.length:0,s=function(t,e,i){var n=-1,r=i.length;for(;++n=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Bi.prototype.plant=function(t){for(var e,n=this;n instanceof Ni;){var r=Bs(n);r.__index__=0,r.__values__=i,e?s.__wrapped__=r:e=r;var s=r;n=n.__wrapped__}return s.__wrapped__=t,e},Bi.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof $i){var e=t;return this.__actions__.length&&(e=new $i(this)),(e=e.reverse()).__actions__.push({func:go,args:[eo],thisArg:i}),new Hi(e,this.__chain__)}return this.thru(eo)},Bi.prototype.toJSON=Bi.prototype.valueOf=Bi.prototype.value=function(){return gr(this.__wrapped__,this.__actions__)},Bi.prototype.first=Bi.prototype.head,Gt&&(Bi.prototype[Gt]=function(){return this}),Bi}();me?((me.exports=bi)._=bi,ge._=bi):pe._=bi}).call(n)}(g,g.exports);const b=(t,e,i)=>Math.max(Math.min(t,i),e);function _(t){return b(m(2.55*t),0,255)}function x(t){return b(m(255*t),0,255)}function v(t){return b(m(t/2.55)/100,0,1)}function y(t){return b(m(100*t),0,100)}const w={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},k=[..."0123456789ABCDEF"],M=t=>k[15&t],S=t=>k[(240&t)>>4]+k[15&t],P=t=>(240&t)>>4==(15&t);function A(t){var e=(t=>P(t.r)&&P(t.g)&&P(t.b)&&P(t.a))(t)?M:S;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const D=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function O(t,e,i){const n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function C(t,e,i){const n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function T(t,e,i){const n=O(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function E(t){const e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),s=Math.min(e,i,n),o=(r+s)/2;let a,l,h;return r!==s&&(h=r-s,l=o>.5?h/(2-r-s):h/(r+s),a=function(t,e,i,n,r){return t===r?(e-i)/n+(e>16&255,s>>8&255,255&s]}return t}(),V.transparent=[0,0,0,0]);const e=V[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const W=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const N=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,H=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function $(t,e,i){if(t){let n=E(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=R(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function U(t,e){return t?Object.assign(e||{},t):t}function Y(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=x(t[3]))):(e=U(t,{r:0,g:0,b:0,a:1})).a=x(e.a),e}function q(t){return"r"===t.charAt(0)?function(t){const e=W.exec(t);let i,n,r,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?_(t):b(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?_(i):b(i,0,255)),n=255&(e[4]?_(n):b(n,0,255)),r=255&(e[6]?_(r):b(r,0,255)),{r:i,g:n,b:r,a:s}}}(t):z(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=Y(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*w[n[1]],g:255&17*w[n[2]],b:255&17*w[n[3]],a:5===s?17*w[n[4]]:255}:7!==s&&9!==s||(r={r:w[n[1]]<<4|w[n[2]],g:w[n[3]]<<4|w[n[4]],b:w[n[5]]<<4|w[n[6]],a:9===s?w[n[7]]<<4|w[n[8]]:255})),i=r||B(t)||q(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=U(this._rgb);return t&&(t.a=v(t.a)),t}set rgb(t){this._rgb=Y(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${v(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?A(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=E(t),i=e[0],n=y(e[1]),r=y(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${v(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=i.a-n.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=H(v(t.r)),r=H(v(t.g)),s=H(v(t.b));return{r:x(N(n+i*(H(v(e.r))-n))),g:x(N(r+i*(H(v(e.g))-r))),b:x(N(s+i*(H(v(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=x(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=m(.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 $(this._rgb,2,t),this}darken(t){return $(this._rgb,2,-t),this}saturate(t){return $(this._rgb,1,t),this}desaturate(t){return $(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=E(t);i[0]=I(i[0]+e),i=R(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}} /*! * Chart.js v4.1.2 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */function K(){}const Z=(()=>{let t=0;return()=>t++})();function G(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.slice(0,7)&&"Array]"===e.slice(-6)}function Q(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function tt(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function et(t,e){return tt(t)?t:e}function it(t,e){return void 0===t?e:t}const nt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function rt(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function st(t,e,i,n){let r,s,o;if(J(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;rt,x:t=>t.x,y:t=>t.y};function pt(t,e){const i=dt[e]||(dt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const r of e)n+=r,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 gt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const mt=t=>void 0!==t,bt=t=>"function"==typeof t,_t=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const xt=Math.PI,vt=2*xt,yt=vt+xt,wt=Number.POSITIVE_INFINITY,kt=xt/180,Mt=xt/2,St=xt/4,Pt=2*xt/3,At=Math.log10,Dt=Math.sign;function Ot(t,e,i){return Math.abs(t-e)l&&h=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Ht(t,e,i){i=i||(i=>t[i]1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const $t=(t,e,i,n)=>Ht(t,i,n?n=>{const r=t[n][e];return rt[n][e]Ht(t,i,(n=>t[n][e]>=i));const Yt=["push","pop","shift","splice","unshift"];function qt(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(Yt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Xt(t){const e=new Set;let i,n;for(i=0,n=t.length;i{n=!1,t.apply(e,i)})))}}const Gt=t=>"start"===t?"left":"end"===t?"right":"center",Jt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Qt(t,e,i){const n=e.length;let r=0,s=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:h,max:c,minDefined:u,maxDefined:f}=o.getUserBounds();u&&(r=Wt(Math.min($t(a,o.axis,h).lo,i?n:$t(e,l,o.getPixelForValue(h)).lo),0,n-1)),s=f?Wt(Math.max($t(a,o.axis,c,!0).hi+1,i?0:$t(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function te(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}const ee=t=>0===t||1===t,ie=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*vt/i),ne=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*vt/i)+1,re={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*Mt),easeOutSine:t=>Math.sin(t*Mt),easeInOutSine:t=>-.5*(Math.cos(xt*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=>ee(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=>ee(t)?t:ie(t,.075,.3),easeOutElastic:t=>ee(t)?t:ne(t,.075,.3),easeInOutElastic(t){const e=.1125;return ee(t)?t:t<.5?.5*ie(2*t,e,.45):.5+.5*ne(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-re.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*re.easeInBounce(2*t):.5*re.easeOutBounce(2*t-1)+.5};function se(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function oe(t){return se(t)?t:new X(t)}function ae(t){return se(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const le=["x","y","borderWidth","radius","tension"],he=["color","borderColor","backgroundColor"];const ce=new Map;function ue(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ce.get(i);return n||(n=new Intl.NumberFormat(t,e),ce.set(i,n)),n}(e,i).format(t)}const fe={values:t=>J(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let r,s=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)&&(r="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const o=At(Math.abs(s)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ue(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(At(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?fe.numeric.call(this,t,e,i):""}};var de={formatters:fe};const pe=Object.create(null),ge=Object.create(null);function me(t,e){if(!e)return t;const i=e.split(".");for(let n=0,r=i.length;nt.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)=>ae(e.backgroundColor),this.hoverBorderColor=(t,e)=>ae(e.borderColor),this.hoverColor=(t,e)=>ae(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 be(this,t,e)}get(t){return me(this,t)}describe(t,e){return be(ge,t,e)}override(t,e){return be(pe,t,e)}route(t,e,i,n){const r=me(this,t),s=me(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[n];return Q(t)?Object.assign({},e,t):it(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var xe=new _e({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:he},numbers:{type:"number",properties:le}}),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",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:de.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 ve(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function ye(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,h,c,u,f;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Pe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,h;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);G(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,s),l=0;lit(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of r)i[o]=+s(o)||0;return i}function Ve(t){return je(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Be(t){return je(t,["topLeft","topRight","bottomLeft","bottomRight"])}function We(t){const e=Ve(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ne(t,e){t=t||{},e=e||xe.font;let i=it(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=it(t.style,e.style);n&&!(""+n).match(ze)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:it(t.family,e.family),lineHeight:Fe(it(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:it(t.weight,e.weight),string:""};return r.string=function(t){return!t||G(t.size)||G(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function He(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;rt[0])){mt(n)||(n=ii("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>Ue([r,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Ze(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=ii(Xe(s,t),i),mt(r))return Ke(t,r)?ti(i,n,t,r):r}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ni(t).includes(e),ownKeys:t=>ni(t),set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ye(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:qe(t,n),setContext:e=>Ye(t,e,i,n),override:r=>Ye(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ze(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];bt(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t),e=e(s,o||n),a.delete(t),Ke(t,e)&&(e=ti(r._scopes,r,t,e));return e}(e,a,t,i));J(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(mt(s.index)&&n(t))e=e[s.index%e.length];else if(Q(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ti(n,r,t,l);e.push(Ye(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable));Ke(e,a)&&(a=Ye(a,r,s&&s[e],o));return a}(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 qe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:bt(i)?i:()=>i,isIndexable:bt(n)?n:()=>n}}const Xe=(t,e)=>t?t+gt(e):e,Ke=(t,e)=>Q(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ze(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ge(t,e,i){return bt(t)?t(e,i):t}const Je=(t,e)=>!0===t?e:"string"==typeof t?pt(e,t):void 0;function Qe(t,e,i,n,r){for(const s of e){const e=Je(i,s);if(e){t.add(e);const s=Ge(e._fallback,i,r);if(mt(s)&&s!==i&&s!==n)return s}else if(!1===e&&mt(n)&&i!==n)return null}return!1}function ti(t,e,i,n){const r=e._rootScopes,s=Ge(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=ei(a,o,i,s||i,n);return null!==l&&((!mt(s)||s===i||(l=ei(a,o,s,l,n),null!==l))&&Ue(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];if(J(r)&&Q(i))return i;return r||{}}(e,i,n))))}function ei(t,e,i,n,r){for(;i;)i=Qe(t,e,i,n,r);return i}function ii(t,e){for(const i of e){if(!i)continue;const e=i[t];if(mt(e))return e}}function ni(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}function ri(t,e,i,n){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(n);let a,l,h,c;for(a=0,l=n;ae"x"===t?"y":"x";function li(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=Ft(s,r),l=Ft(o,s);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const u=n*h,f=n*c;return{previous:{x:s.x-u*(o.x-r.x),y:s.y-u*(o.y-r.y)},next:{x:s.x+f*(o.x-r.x),y:s.y+f*(o.y-r.y)}}}function hi(t,e="x"){const i=ai(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,h=oi(t,0);for(o=0;o!t.skip))),"monotone"===e.cubicInterpolationMode)hi(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;st.ownerDocument.defaultView.getComputedStyle(t,null);const mi=["top","right","bottom","left"];function bi(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=mi[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function _i(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=gi(i),s="border-box"===r.boxSizing,o=bi(r,"padding"),a=bi(r,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:r,offsetY:s}=n;let o,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,i),u=o.left+(c&&a.left),f=o.top+(c&&a.top);let{width:d,height:p}=e;return s&&(d-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-u)/d*i.width/n),y:Math.round((h-f)/p*i.height/n)}}const xi=t=>Math.round(10*t)/10;function vi(t,e,i,n){const r=gi(t),s=bi(r,"margin"),o=pi(r.maxWidth,t,"clientWidth")||wt,a=pi(r.maxHeight,t,"clientHeight")||wt,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=di(t);if(s){const t=s.getBoundingClientRect(),o=gi(s),a=bi(o,"border","width"),l=bi(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=pi(o.maxWidth,s,"clientWidth"),r=pi(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||wt,maxHeight:r||wt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=bi(r,"border","width"),e=bi(r,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-s.width),c=Math.max(0,n?h/n:c-s.height),h=xi(Math.min(h,o,l.maxWidth)),c=xi(Math.min(c,a,l.maxHeight)),h&&!c&&(c=xi(h/2));return(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=xi(Math.floor(c*n))),{width:h,height:c}}function yi(t,e,i){const n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=n,o.height=r,o.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const wi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function ki(t,e){const i=function(t,e){return gi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Mi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Si(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 Pi(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Mi(t,r,i),a=Mi(r,s,i),l=Mi(s,e,i),h=Mi(o,a,i),c=Mi(a,l,i);return Mi(h,c,i)}function Ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Di(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Oi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ci(t){return"angle"===t?{between:Bt,compare:jt,normalize:Vt}:{between:Nt,compare:(t,e)=>t-e,normalize:t=>t}}function Ti({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function Ei(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:h}=Ci(n),{start:c,end:u,loop:f,style:d}=function(t,e,i){const{property:n,start:r,end:s}=i,{between:o,normalize:a}=Ci(n),l=e.length;let h,c,{start:u,end:f,loop:d}=t;if(d){for(u+=l,f+=l,h=0,c=l;h_||l(r,b,g)&&0!==a(r,b),y=()=>!_||0===a(s,g)||l(s,b,g);for(let w=c,k=c;w<=u;++w)m=e[w%o],m.skip||(g=h(m[n]),g!==b&&(_=l(g,r,s),null===x&&v()&&(x=0===a(g,r)?w:k),null!==x&&y()&&(p.push(Ti({start:x,end:w,loop:f,count:o,style:d})),x=null),k=w,b=g));return null!==x&&p.push(Ti({start:x,end:u,loop:f,count:o,style:d})),p}function Li(t,e){const i=[],n=t.segments;for(let r=0;rn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=Kt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.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 ji=new Fi;const Vi="transparent",Bi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=oe(t||Vi),r=n.valid&&oe(e||Vi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Wi{constructor(t,e,i,n){const r=e[i];n=He([t.to,n,r,t.from]);const s=He([t.from,r,n]);this._active=!0,this._fn=t.fn||Bi[t.type||typeof s],this._easing=re[t.easing]||re.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=s,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],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=He([t.to,e,n,t.from]),this._from=He([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,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n{const r=t[n];if(!Q(r))return;const s={};for(const t of e)s[t]=r[t];(J(r.properties)&&r.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,s)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let r=0;r{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,n=[],r=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=r[l];const u=i.get(l);if(c){if(u&&c.active()){c.update(u,h,o);continue}c.cancel()}u&&u.duration?(r[l]=c=new Wi(u,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?(ji.add(this._chart,i),!0):void 0}}function Hi(t,e){const i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function $i(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r0||!i&&e<0)return r.index}return null}function Ki(t,e){const{chart:i,_cachedMeta:n}=t,r=i._stacks||(i._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,h=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,o,n),u=e.length;let f;for(let d=0;di[t].axis===e)).shift()}function Gi(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 Ji=t=>"reset"===t||"none"===t,Qi=(t,e)=>e?t:Object.assign({},t);class tn{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=Yi(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&&Gi(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,r=e.xAxisID=it(i.xAxisID,Zi(t,"x")),s=e.yAxisID=it(i.yAxisID,Zi(t,"y")),o=e.rAxisID=it(i.rAxisID,Zi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,r,s,o),h=e.vAxisID=n(a,s,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),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&&qt(this._data,this),t._stacked&&Gi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Q(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,r,s;for(n=0,r=e.length;n{const e="_onData"+gt(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var n,r}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 r=e._stacked;e._stacked=Yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Gi(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&Ki(this,e._parsed)}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:r,_stacked:s}=i,o=r.axis;let a,l,h,c=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=J(n[t])?this.parseArrayData(i,n,t,e):Q(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]t&&!e.hidden&&e._stacked&&{keys:$i(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:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=n[u];const e=f[o.axis];return!tt(f[t.axis])||h>e||c=0;--u)if(!d()){this.updateRangeFromParsed(l,t,f,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,r,s;for(n=0,r=e.length;n=0&&tthis.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(Qi(d,a))),d}_resolveAnimations(t,e,i){const n=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),r);a=n.createResolver(s,this.getContext(t,i,e))}const l=new Ni(n,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ji(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){Ji(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Ji(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}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[o,a,l]of this._syncList)this[o](a,l);this._syncList=[];const n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;ot-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(mt(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;nMath.abs(a)&&(l=a,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function rn(t,e,i,n){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let h,c,u,f;for(h=i,c=i+n;ht.x,i="left",n="right"):(e=t.baset.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(G(n)||isNaN(n))return!0};for(const a of n)if((void 0===e||!o(a))&&((!1===r||-1===s.indexOf(a.stack)||void 0===r&&void 0===a.stack)&&s.push(a.stack),a.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let r,s;for(r=0,s=e.data.length;r=i?1:-1)}(u,e,o)*s,f===o&&(m-=u/2);const t=e.getPixelForDecimal(0),r=e.getPixelForDecimal(1),l=Math.min(t,r),d=Math.max(t,r);m=Math.max(Math.min(m,d),l),c=m+u,i&&!h&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const t=Dt(u)*e.getLineWidthForValue(o)/2;m+=t,u-=t}return{size:u,base:m,head:c,center:c+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,r=n.skipNull,s=it(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const r=e.pixels,s=r[t];let o=t>0?r[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:i[t]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),h=s.axis,c=o.axis;for(let u=e;u+i[t];if(Q(i[t])){const{key:t="value"}=this._parsing;o=e=>+pt(i[e],t)}for(r=t,s=t+e;rBt(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Bt(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=d(0,h,u),m=d(Mt,c,f),b=p(xt,h,u),_=p(xt+Mt,c,f);n=(g-b)/2,r=(m-_)/2,s=-(g+b)/2,o=-(m+_)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}(f,u,a),b=(i.width-s)/d,_=(i.height-s)/p,x=Math.max(Math.min(b,_)/2,0),v=nt(this.options.radius,x),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/vt)}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=r&&a.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?vt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=ue(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,r,s,o,a;if(!t)for(n=0,r=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t}),t(fn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class dn extends tn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Qt(e,n,s);this._drawStart=o,this._drawCount=a,te(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,n),u=s.axis,f=o.axis,{spanGaps:d,segment:p}=this.options,g=Tt(d)?d:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e+i,_=t.length;let x=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const i=t[v],d=m?i:{};if(v=b){d.skip=!0;continue}const _=this.getParsed(v),y=G(_[f]),w=d[u]=s.getPixelForValue(_[u],v),k=d[f]=r||y?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,_,a):_[f],v);d.skip=isNaN(w)||isNaN(k)||y,d.stop=v>0&&Math.abs(_[u]-x[u])>g,p&&(d.parsed=_,d.raw=l.data[v]),c&&(d.options=h||this.resolveDataElementOptions(v,i.active?"active":n)),m||this.updateElement(i,v,d,n),x=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}t(dn,"id","line"),t(dn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),t(dn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pn extends tn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=ue(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return ri.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,h=a.yCenter,c=a.getIndexAngle(0)-.5*xt;let u,f=c;const d=360/this.countVisibleElements();for(u=0;u{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Lt(this.resolveDataElementOptions(t,e).angle||i):0}}t(pn,"id","polarArea"),t(pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),t(pn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class gn extends fn{}t(gn,"id","pie"),t(gn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mn extends tn{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return ri.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const r=this._cachedMeta.rScale,s="reset"===n;for(let o=e;o0&&this.getParsed(e-1);for(let x=e;x0&&Math.abs(i[f]-_[f])>m,g&&(h.parsed=i,h.raw=l.data[x]),u&&(h.options=c||this.resolveDataElementOptions(x,e.active?"active":n)),b||this.updateElement(e,x,h,n),_=i}this.updateSharedOptions(c,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}}t(bn,"id","scatter"),t(bn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),t(bn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _n=Object.freeze({__proto__:null,BarController:cn,BubbleController:un,DoughnutController:fn,LineController:dn,PolarAreaController:pn,PieController:gn,RadarController:mn,ScatterController:bn});function xn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vn{static override(t){Object.assign(vn.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return xn()}parse(){return xn()}format(){return xn()}add(){return xn()}diff(){return xn()}startOf(){return xn()}endOf(){return xn()}}var yn=vn;function wn(t,e,i,n){const{controller:r,data:s,_sorted:o}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&s.length){const t=a._reversePixels?Ut:$t;if(!n)return t(s,e,i);if(r._sharedOptions){const n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){const n=t(s,e,i-r),o=t(s,e,i+r);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function kn(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let a=0,l=s.length;a{t[o](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,r))})),n&&!a?[]:s}var Dn={evaluateInteractionItems:kn,modes:{index(t,e,i,n){const r=_i(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Mn(t,r,s,n,o):Pn(t,r,s,!1,n,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const r=_i(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Mn(t,r,s,n,o):Pn(t,r,s,!1,n,o);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tMn(t,_i(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const r=_i(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return Pn(t,r,s,i.intersect,n,o)},x:(t,e,i,n)=>An(t,_i(e,t),"x",i.intersect,n),y:(t,e,i,n)=>An(t,_i(e,t),"y",i.intersect,n)}};const On=["left","top","right","bottom"];function Cn(t,e){return t.filter((t=>t.pos===e))}function Tn(t,e){return t.filter((t=>-1===On.indexOf(t.pos)&&t.box.axis===e))}function En(t,e){return t.sort(((t,i)=>{const n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function Ln(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!On.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let s,o,a;for(s=0,o=t.length;s{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function jn(t,e,i,n){const r=[];let s,o,a,l,h,c;for(s=0,o=t.length,h=0;st.box.fullSize)),!0),n=En(Cn(e,"left"),!0),r=En(Cn(e,"right")),s=En(Cn(e,"top"),!0),o=En(Cn(e,"bottom")),a=Tn(e,"x"),l=Tn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Cn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;st(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);In(f,We(n));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Ln(l.concat(h),u);jn(a.fullSize,d,u,p),jn(l,d,u,p),jn(h,d,u,p)&&jn(l,d,u,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),Bn(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,Bn(a.rightAndBottom,d,u,p),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},st(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class Nn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Hn extends Nn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $n="$chartjs",Un={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yn=t=>null===t||""===t;const qn=!!wi&&{passive:!0};function Xn(t,e,i){t.canvas.removeEventListener(e,i,qn)}function Kn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Zn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Kn(i.addedNodes,n),e=e&&!Kn(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Gn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Kn(i.removedNodes,n),e=e&&!Kn(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Jn=new Map;let Qn=0;function tr(){const t=window.devicePixelRatio;t!==Qn&&(Qn=t,Jn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function er(t,e,i){const n=t.canvas,r=n&&di(n);if(!r)return;const s=Zt(((t,e)=>{const n=r.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)}));return o.observe(r),function(t,e){Jn.size||window.addEventListener("resize",tr),Jn.set(t,e)}(t,s),o}function ir(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Jn.delete(t),Jn.size||window.removeEventListener("resize",tr)}(t)}function nr(t,e,i){const n=t.canvas,r=Zt((e=>{null!==t.ctx&&i(function(t,e){const i=Un[t.type]||t.type,{x:n,y:r}=_i(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,qn)}(n,e,r),r}class rr extends Nn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[$n]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Yn(r)){const e=ki(t,"width");void 0!==e&&(t.width=e)}if(Yn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ki(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[$n])return!1;const i=e[$n].initial;["height","width"].forEach((t=>{const n=i[t];G(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[$n],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Zn,detach:Gn,resize:er}[e]||nr;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ir,detach:ir,resize:ir}[e]||Xn)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return vi(t,e,i,n)}isAttached(t){const e=di(t);return!(!e||!e.isConnected)}}class sr{constructor(){t(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Tt(this.x)&&Tt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function or(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),s=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;ir)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;rt-e)).pop(),e}(n);for(let o=0,a=s.length-1;or)return t}return Math.max(r,1)}(s,e,r);if(o>0){let t,i;const n=o>1?Math.round((l-a)/(o-1)):null;for(ar(e,h,c,G(n)?0:a-n,a),t=0,i=o-1;t"top"===e||"left"===e?t[e]+i:t[e]-i;function hr(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;so+a)))return h}function ur(t){return t.drawTicks?t.tickLength:0}function fr(t,e){if(!t.display)return 0;const i=Ne(t.font,e),n=We(t.padding);return(J(t.text)?t.text.length:1)*i.lineHeight+n.height}function dr(t,e,i){let n=Gt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class pr extends sr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=et(t,Number.POSITIVE_INFINITY),e=et(e,Number.NEGATIVE_INFINITY),i=et(i,Number.POSITIVE_INFINITY),n=et(n,Number.NEGATIVE_INFINITY),{min:et(t,i),max:et(e,n),minDefined:tt(t),maxDefined:tt(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=r&&i>n?i:n,{min:et(i,et(n,i)),max:et(n,et(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:r}=t,s=nt(e,(r-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(s)),max:o(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=Wt(this.chart.width-c,0,this.maxWidth);s=t.offset?this.maxWidth/i:f/(i-1),c+6>s&&(s=f/(i-(t.offset?.5:1)),o=this.maxHeight-ur(t.grid)-e.padding-fr(t.title,this.chart.options.font),a=Math.sqrt(c*c+u*u),l=Rt(Math.min(Math.asin(Wt((h.highest.height+6)/s,-1,1)),Math.asin(Wt(o/a,-1,1))-Math.asin(Wt(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=fr(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=ur(r)+s):(t.height=this.maxHeight,t.width=ur(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=Lt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*r.width+c*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,c,h)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,u=0;a?l?(c=n*t.width,u=i*e.height):(c=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?c=t.width:"inner"!==r&&(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r({width:r[t]||0,height:s[t]||0});return{first:y(0),last:y(e-1),widest:y(x),highest:y(v),widths:r,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Wt(this._alignToPixels?we(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:r,position:s,border:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=ur(r),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,p=d/2,g=function(t){return we(i,t,d)};let m,b,_,x,v,y,w,k,M,S,P,A;if("top"===s)m=g(this.bottom),y=this.bottom-c,k=m-p,S=g(t.top)+p,A=t.bottom;else if("bottom"===s)m=g(this.top),S=t.top,A=g(t.bottom)-p,y=m+p,k=this.top+c;else if("left"===s)m=g(this.right),v=this.right-c,w=m-p,M=g(t.left)+p,P=t.right;else if("right"===s)m=g(this.left),M=t.left,P=g(t.right)-p,v=m+p,w=this.left+c;else if("x"===e){if("center"===s)m=g((t.top+t.bottom)/2+.5);else if(Q(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,A=t.bottom,y=m+p,k=y+c}else if("y"===e){if("center"===s)m=g((t.left+t.right)/2);else if(Q(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}v=m-p,w=v-c,M=t.left,P=t.right}const D=it(n.ticks.maxTicksLimit,h),O=Math.max(1,Math.ceil(h/D));for(b=0;be.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(r=0,s=n.length;r{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,s;for(r=0,s=e.length;r{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");xe.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&xe.describe(e,t.descriptors)}(t,s,i),this.override&&xe.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in xe[n]&&(delete xe[n][i],this.override&&delete pe[i])}}class mr{constructor(){this.controllers=new gr(tn,"datasets",!0),this.elements=new gr(sr,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr(pr,"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,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):st(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=gt(t);rt(i["before"+n],[],i),e[t](i),rt(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function xr(t,e){return e||!1!==t?!0===t?{}:t:null}function vr(t,{plugin:e,local:i},n,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(n,s);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yr(t,e){const i=xe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function wr(t,e){if("x"===t||"y"===t||"r"===t)return t;var i;if(t=e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&wr(t[0].toLowerCase(),e))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function kr(t){const e=t.options||(t.options={});e.plugins=it(e.plugins,{}),e.scales=function(t,e){const i=pe[t.type]||{scales:{}},n=e.scales||{},r=yr(t.type,e),s=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!Q(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const o=wr(t,e),a=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};s[t]=ut(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||yr(r,e),a=(pe[r]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||e;s[r]=s[r]||Object.create(null),ut(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];ut(e,[xe.scales[e.type],xe.scale])})),s}(t,e)}function Mr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Sr=new Map,Pr=new Set;function Ar(t,e){let i=Sr.get(t);return i||(i=e(),Sr.set(t,i),Pr.add(i)),i}const Dr=(t,e,i)=>{const n=pt(e,i);void 0!==n&&t.add(n)};class Or{constructor(t){this._config=function(t){return(t=t||{}).data=Mr(t.data),kr(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Mr(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(),kr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ar(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Ar(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Ar(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Ar(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:r}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>Dr(a,t,e)))),e.forEach((t=>Dr(a,n,t))),e.forEach((t=>Dr(a,pe[r]||{},t))),e.forEach((t=>Dr(a,xe,t))),e.forEach((t=>Dr(a,ge,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Pr.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,pe[e]||{},xe.datasets[e]||{},{type:e},xe,ge]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Cr(this._resolverCache,t,n);let a=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=qe(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(bt(o)||Tr(o))||s&&J(o))return!0}return!1}(s,e)){r.$shared=!1;a=Ye(s,i=bt(i)?i():i,this.createResolver(t,i,o))}for(const l of e)r[l]=a[l];return r}createResolver(t,e,i=[""],n){const{resolver:r}=Cr(this._resolverCache,t,i);return Q(e)?Ye(r,e,void 0,n):r}}function Cr(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=i.join();let s=n.get(r);if(!s){s={resolver:Ue(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)}return s}const Tr=t=>Q(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||bt(t[i])),!1);const Er=["top","bottom","left","right","chartArea"];function Lr(t,e){return"top"===t||"bottom"===t||-1===Er.indexOf(t)&&"x"===e}function Rr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Ir(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),rt(i&&i.onComplete,[t],e)}function zr(t){const e=t.chart,i=e.options.animation;rt(i&&i.onProgress,[t],e)}function Fr(t){return fi()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const jr={},Vr=t=>{const e=Fr(t);return Object.values(jr).filter((t=>t.canvas===e)).pop()};function Br(t,e,i){const n=Object.keys(t);for(const r of n){const n=+r;if(n>=e){const s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}class Wr{static register(...t){br.add(...t),Nr()}static unregister(...t){br.remove(...t),Nr()}constructor(t,e){const i=this.config=new Or(e),n=Fr(t),r=Vr(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!fi()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Hn:rr}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,s.aspectRatio),a=o&&o.canvas,l=a&&a.height,h=a&&a.width;this.id=Z(),this.ctx=o,this.canvas=a,this.width=h,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new _r,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),s.resizeDelay||0),this._dataChanges=[],jr[this.id]=this,o&&a?(ji.listen(this,"complete",Ir),ji.listen(this,"progress",zr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return G(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return br}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():yi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ke(this.canvas,this.ctx),this}stop(){return ji.stop(this),this}resize(t,e){ji.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,yi(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),rt(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){st(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],n=wr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),st(r,(e=>{const r=e.options,s=r.id,o=wr(s,r),a=it(r.type,e.dtype);void 0!==r.position&&Lr(r.position,o)===Lr(e.dposition)||(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===a)l=i[s];else{l=new(br.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)})),st(n,((t,e)=>{t||delete i[e]})),st(i,(t=>{Wn.configure(this,t,t.options),Wn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,h=this.data.datasets.length;l{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Rr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){st(this.scales,(t=>{Wn.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);_t(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:r}of e){Br(t,n,"_removeElements"===i?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let r=1;rt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Wn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],st(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,r=function(t){const{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&Ae(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&De(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=Dn.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=$e(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);mt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ji.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};st(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",s)};s=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){st(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},st(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!ot(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),s=r(e,t),o=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:r}=this,s=e,o=this._getActiveElements(t,n,i,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,rt(r.onHover,[t,o,this],this),a&&rt(r.onClick,[t,o,this],this));const h=!ot(o,n);return(h||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}function Nr(){return st(Wr.instances,(t=>t._plugins.invalidate()))}function Hr(t,e,i,n){const r=je(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,o=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return Wt(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Wt(r.innerStart,0,o),innerEnd:Wt(r.innerEnd,0,o)}}function $r(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Ur(t,e,i,n,r,s){const{x:o,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+n+i-h,0),f=c>0?c+n+i+h:0;let d=0;const p=r-l;if(n){const t=((c>0?c-n:0)+(u>0?u-n:0))/2;d=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*u-i/xt)/u)/2,m=l+g+d,b=r-g-d,{outerStart:_,outerEnd:x,innerStart:v,innerEnd:y}=Hr(e,f,u,b-m),w=u-_,k=u-x,M=m+_/w,S=b-x/k,P=f+v,A=f+y,D=m+v/P,O=b-y/A;if(t.beginPath(),s){const e=(M+S)/2;if(t.arc(o,a,u,M,e),t.arc(o,a,u,e,S),x>0){const e=$r(k,S,o,a);t.arc(e.x,e.y,x,S,b+Mt)}const i=$r(A,b,o,a);if(t.lineTo(i.x,i.y),y>0){const e=$r(A,O,o,a);t.arc(e.x,e.y,y,b+Mt,O+Math.PI)}const n=(b-y/f+(m+v/f))/2;if(t.arc(o,a,f,b-y/f,n,!0),t.arc(o,a,f,n,m+v/f,!0),v>0){const e=$r(P,D,o,a);t.arc(e.x,e.y,v,D+Math.PI,m-Mt)}const r=$r(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=$r(w,M,o,a);t.arc(e.x,e.y,_,m-Mt,M)}}else{t.moveTo(o,a);const e=Math.cos(M)*u+o,i=Math.sin(M)*u+a;t.lineTo(e,i);const n=Math.cos(S)*u+o,r=Math.sin(S)*u+a;t.lineTo(n,r)}t.closePath()}function Yr(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,u="inner"===l.borderAlign;if(!h)return;u?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let f=e.endAngle;if(s){Ur(t,e,i,n,f,r);for(let e=0;er?(h=r/l,t.arc(s,o,l,i+h,n-h,!0)):t.arc(s,o,r,i+Mt,n-Mt),t.closePath(),t.clip()}(t,e,f),s||(Ur(t,e,i,n,f,r),t.stroke())}t(Wr,"defaults",xe),t(Wr,"instances",jr),t(Wr,"overrides",pe),t(Wr,"registry",br),t(Wr,"version","4.1.2"),t(Wr,"getChart",Vr),e("C",Wr);class qr extends sr{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:r,distance:s}=zt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=it(c,a-o)>=vt||Bt(r,o,a),d=Nt(s,l+u,h+u);return f&&d}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,h=(n+r)/2,c=(s+o+l+a)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>vt?Math.floor(i/vt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*n,Math.sin(o)*n);const a=n*(1-Math.sin(Math.min(xt,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){Ur(t,e,i,n,l,r);for(let e=0;ea&&s>a;return{count:n,start:l,loop:e.loop,ilen:h(o+(h?a-t:t))%s,x=()=>{d!==p&&(t.lineTo(m,p),t.lineTo(m,d),t.lineTo(m,g))};for(l&&(u=r[_(0)],t.moveTo(u.x,u.y)),c=0;c<=a;++c){if(u=r[_(c)],u.skip)continue;const e=u.x,i=u.y,n=0|e;n===f?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),f=n,b=0,d=p=i),g=i}x()}function Qr(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Jr:Gr}t(qr,"id","arc"),t(qr,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),t(qr,"defaultRoutes",{backgroundColor:"backgroundColor"});const ts="function"==typeof Path2D;function es(t,e,i,n){ts&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Xr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=Qr(e);for(const a of r)Xr(t,s,a.style),t.beginPath(),o(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class is extends sr{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;ui(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;rr&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Ri(t,!0===n?[{start:o,end:a,loop:s}]:function(t,e,i,n){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%r];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%r,end:(o-1)%r,loop:n}),e=a=i.stop?o:null):(a=o,l.skip&&(e=o)),l=i}return null!==a&&s.push({start:e%r,end:a%r,loop:n}),s}(i,o,a"borderDash"!==t&&"fill"!==t});class rs extends sr{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)t.replace("rgb(","rgba(").replace(")",", 0.5)")));function gs(t){return ds[t%ds.length]}function ms(t){return ps[t%ps.length]}function bs(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof fn?e=function(t,e){return t.backgroundColor=t.data.map((()=>gs(e++))),e}(i,e):r instanceof pn?e=function(t,e){return t.backgroundColor=t.data.map((()=>ms(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=gs(e),t.backgroundColor=ms(e),++e}(i,e))}}function _s(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var xs={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{options:{elements:n},data:{datasets:r}}=t.config;if(!i.forceOverride&&(_s(r)||n&&_s(n)))return;const s=bs(t);r.forEach(s)}};function vs(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function ys(t){t.data.datasets.forEach((t=>{vs(t)}))}var ws={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void ys(t);const n=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:s,indexAxis:o}=e,a=t.getDatasetMeta(r),l=s||e.data;if("y"===He([o,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const h=t.scales[a.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:u}=function(t,e){const i=e.length;let n,r=0;const{iScale:s}=t,{min:o,max:a,minDefined:l,maxDefined:h}=s.getUserBounds();return l&&(r=Wt($t(e,s.axis,o).lo,0,i-1)),n=h?Wt($t(e,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(u<=(i.threshold||4*n))return void vs(e);let f;switch(G(s)&&(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}})),i.algorithm){case"lttb":f=function(t,e,i,n,r){const s=r.samples||n;if(s>=i)return t.slice(e,e+i);const o=[],a=(i-2)/(s-2);let l=0;const h=e+i-1;let c,u,f,d,p,g=e;for(o[l++]=t[g],c=0;cf&&(f=d,u=t[n],p=n);o[l++]=u,g=p}return o[l++]=t[h],o}(l,c,u,n,i);break;case"min-max":f=function(t,e,i,n){let r,s,o,a,l,h,c,u,f,d,p=0,g=0;const m=[],b=e+i-1,_=t[e].x,x=t[b].x-_;for(r=e;rd&&(d=a,c=r),p=(g*p+s.x)/++g;else{const i=r-1;if(!G(h)&&!G(c)){const e=Math.min(h,c),n=Math.max(h,c);e!==u&&e!==i&&m.push({...t[e],x:p}),n!==u&&n!==i&&m.push({...t[n],x:p})}r>0&&i!==u&&m.push(t[i]),m.push(s),l=e,g=0,f=d=a,h=c=u=r}}return m}(l,c,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=f}))},destroy(t){ys(t)}};function ks(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=Vt(r),s=Vt(s)),{property:t,start:r,end:s}}function Ms(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Ss(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ps(t,e){let i=[],n=!1;return J(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=Ms(t,e,r);const o=r[t],a=r[e];null!==n?(s.push({x:o.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:o.y}),s.push({x:i,y:a.y}))})),s}(t,e),i.length?new is({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function As(t){return t&&!1!==t.fill}function Ds(t,e,i){let n=t[e].fill;const r=[e];let s;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!tt(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function Os(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=it(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Q(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return tt(r)&&Math.floor(r)===r?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Cs(t,e,i){const n=[];for(let r=0;r=0;--o){const e=r[o].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&e.fill&&Rs(t.ctx,e,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){const e=n[r].$filler;As(e)&&Rs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;As(n)&&"beforeDatasetDraw"===i.drawTime&&Rs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Bs=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Ws extends sr{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=rt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=Ne(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Bs(i,r);let l,h;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(s,r,o,a)+10):(h=this.maxHeight,l=this._fitCols(s,n,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+o;let c=t;r.textAlign="left",r.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach(((t,d)=>{const p=i+e/2+r.measureText(t.text).width;(0===d||l[l.length-1]+p+2*o>s)&&(c+=h,l[l.length-(d>0?0:1)]=0,f+=h,u++),a[d]={left:0,top:f,row:u,width:p,height:n},l[l.length-1]+=p+o})),c}_fitCols(t,e,i,n){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t;let c=o,u=0,f=0,d=0,p=0;return this.legendItems.forEach(((t,s)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,r){const s=function(t,e,i,n){let r=t.text;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=Ns(e,i));return n}(r,n,e.lineHeight);return{itemWidth:s,itemHeight:o}}(i,e,r,t,n);s>0&&f+m+2*o>h&&(c+=u+o,l.push({width:u,height:f}),d+=u+o,p++,u=f=0),a[s]={left:d,top:f,col:p,width:g,height:m},u=Math.max(u,g),f+=m+o})),c+=u,l.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=Ai(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=Jt(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=Jt(i,this.left+n,this.right-this.lineWidths[r])),a.top+=this.top+t+n,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+n}else{let r=0,o=Jt(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=Jt(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+n,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Ae(t,this),this._draw(),De(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=xe.color,a=Ai(t.rtl,this.left,this.width),l=Ne(s.font),{padding:h}=s,c=l.size,u=c/2;let f;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:d,boxHeight:p,itemHeight:g}=Bs(s,c),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:Jt(r,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:Jt(r,this.top+b+h,this.bottom-e[0].height),line:0},Di(this.ctx,t.textDirection);const _=g+h;this.legendItems.forEach(((x,v)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const y=n.measureText(x.text).width,w=a.textAlign(x.textAlign||(x.textAlign=s.textAlign)),k=d+u+y;let M=f.x,S=f.y;a.setWidth(this.width),m?v>0&&M+k+h>this.right&&(S=f.y+=_,f.line++,M=f.x=Jt(r,this.left+h,this.right-i[f.line])):v>0&&S+_>this.bottom&&(M=f.x=M+e[f.line].width+h,f.line++,S=f.y=Jt(r,this.top+b+h,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;n.save();const r=it(i.lineWidth,1);if(n.fillStyle=it(i.fillStyle,o),n.lineCap=it(i.lineCap,"butt"),n.lineDashOffset=it(i.lineDashOffset,0),n.lineJoin=it(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=it(i.strokeStyle,o),n.setLineDash(it(i.lineDash,[])),s.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},l=a.xPlus(t,d/2);Se(n,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=Be(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?Re(n,{x:o,y:s,w:d,h:p,radius:l}):n.rect(o,s,d,p),n.fill(),0!==r&&n.stroke()}n.restore()}(a.x(M),S,x),M=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,M+d+u,m?M+k:this.right,t.rtl),function(t,e,i){Te(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(M),S,x),m)f.x+=k+h;else if("string"!=typeof x.text){const t=l.lineHeight;f.y+=Ns(x,t)}else f.y+=_})),Oi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ne(e.font),n=We(e.padding);if(!e.display)return;const r=Ai(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=i.size/2,l=n.top+a;let h,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+l,c=Jt(t.align,c,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+Jt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=Jt(o,c,c+u);s.textAlign=r.textAlign(Gt(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Te(s,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ne(t.font),i=We(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;inull!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&rt(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&rt(e.onHover,[t,i,this],this)}else i&&rt(e.onClick,[t,i,this],this)}}function Ns(t,e){return e*(t.text?t.text.length+.5:0)}var Hs={id:"legend",_element:Ws,start(t,e,i){const n=t.legend=new Ws({ctx:t.ctx,options:i,chart:t});Wn.configure(t,n,i),Wn.addBox(t,n)},stop(t){Wn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Wn.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=We(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:o&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $s extends sr{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=J(i.text)?i.text.length:1;this._padding=We(i.padding);const r=n*Ne(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:r,options:s}=this,o=s.align;let a,l,h,c=0;return this.isHorizontal()?(l=Jt(o,i,r),h=e+t,a=r-i):("left"===s.position?(l=i+t,h=Jt(o,n,e),c=-.5*xt):(l=r-t,h=Jt(o,e,n),c=.5*xt),a=n-e),{titleX:l,titleY:h,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ne(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);Te(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:Gt(e.align),textBaseline:"middle",translation:[r,s]})}}var Us={id:"title",_element:$s,start(t,e,i){!function(t,e){const i=new $s({ctx:t.ctx,options:e,chart:t});Wn.configure(t,i,e),Wn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Wn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Wn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ys=new WeakMap;var qs={id:"subtitle",start(t,e,i){const n=new $s({ctx:t.ctx,options:i,chart:t});Wn.configure(t,n,i),Wn.addBox(t,n),Ys.set(t,n)},stop(t){Wn.removeBox(t,Ys.get(t)),Ys.delete(t)},beforeUpdate(t,e,i){const n=Ys.get(t);Wn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Xs={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Gs(t,e){const{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Js(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Ne(e.bodyFont),h=Ne(e.titleFont),c=Ne(e.footerFont),u=s.length,f=r.length,d=n.length,p=We(e.padding);let g=p.height,m=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){g+=d*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-d)*l.lineHeight+(b-1)*e.bodySpacing}f&&(g+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const x=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=h.string,st(t.title,x),i.font=l.string,st(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,st(n,(t=>{st(t.before,x),st(t.lines,x),st(t.after,x)})),_=0,i.font=c.string,st(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function Qs(t,e,i,n){const{x:r,width:s}=i,{width:o,chartArea:{left:a,right:l}}=t;let h="center";return"center"===n?h=r<=(a+l)/2?"left":"right":r<=s/2?h="left":r>=o-s/2&&(h="right"),function(t,e,i,n){const{x:r,width:s}=n,o=i.caretSize+i.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(h,t,e,i)&&(h="center"),h}function to(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Qs(t,e,i,n),yAlign:n}}function eo(t,e,i,n){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,h=r+s,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=Be(o);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===a?p+=h:"right"===a&&(p-=h):"left"===a?p-=Math.max(c,f)+r:"right"===a&&(p+=Math.max(u,d)+r),{x:Wt(p,0,n.width-e.width),y:Wt(g,0,n.height-e.height)}}function io(t,e,i){const n=We(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function no(t){return Ks([],Zs(t))}function ro(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const so={beforeTitle:K,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{const e={before:[],lines:[],after:[]},r=ro(i,t);Ks(e.before,Zs(oo(r,"beforeLabel",this,t))),Ks(e.lines,oo(r,"label",this,t)),Ks(e.after,Zs(oo(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return no(oo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=oo(i,"beforeFooter",this,t),r=oo(i,"footer",this,t),s=oo(i,"afterFooter",this,t);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(r)),o=Ks(o,Zs(s)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],r=[],s=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),st(l,(e=>{const i=ro(t.callbacks,e);n.push(oo(i,"labelColor",this,e)),r.push(oo(i,"labelPointStyle",this,e)),s.push(oo(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let r,s=[];if(n.length){const t=Xs[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=Js(this,i),o=Object.assign({},t,e),a=to(this.chart,i,o),l=eo(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:r}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=Be(o),{x:u,y:f}=t,{width:d,height:p}=e;let g,m,b,_,x,v;return"center"===r?(x=f+p/2,"left"===n?(g=u,m=g-s,_=x+s,v=x-s):(g=u+d,m=g+s,_=x-s,v=x+s),b=g):(m="left"===n?u+Math.max(a,h)+s:"right"===n?u+d-Math.max(l,c)-s:this.caretX,"top"===r?(_=f,x=_-s,g=m-s,b=m+s):(_=f+p,x=_+s,g=m+s,b=m-s),v=_),{x1:g,x2:m,x3:b,y1:_,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,r=n.length;let s,o,a;if(r){const l=Ai(i.rtl,this.x,this.width);for(t.x=io(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ne(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Re(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Re(t,{x:i,y:p+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Ne(i.bodyFont);let u=c.lineHeight,f=0;const d=Ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,d.x(t.x+f),t.y+u/2),t.y+=u+r},g=d.textAlign(s);let m,b,_,x,v,y,w;for(e.textAlign=s,e.textBaseline="middle",e.font=c.string,t.x=io(this,g,i),e.fillStyle=i.bodyColor,st(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=n.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=Xs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=Js(this,t),o=Object.assign({},i,this._size),a=to(e,t,o),l=eo(t,o,a,e);n._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=We(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Di(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Oi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),r=!ot(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),o=this._positionChanged(s,t),a=e||!ot(s,r)||o;return a&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const r=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:r}=this,s=Xs[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}t(ao,"positioners",Xs);var lo={id:"tooltip",_element:ao,positioners:Xs,afterInit(t,e,i){i&&(t.tooltip=new ao({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:so},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"]},ho=Object.freeze({__proto__:null,Colors:xs,Decimation:ws,Filler:Vs,Legend:Hs,SubTitle:qs,Title:Us,Tooltip:lo});function co(t,e,i,n){const r=t.indexOf(e);if(-1===r)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return r!==t.lastIndexOf(e)?i:r}function uo(t){const e=this.getLabels();return t>=0&&tnull===t?null:Wt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:co(i,t,it(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)n.push({value:s});return n}getLabelForValue(t){return uo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function po(t,e){const i=[],{bounds:n,step:r,min:s,max:o,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:u}=t,f=r||1,d=h-1,{min:p,max:g}=e,m=!G(s),b=!G(o),_=!G(l),x=(g-p)/(c+1);let v,y,w,k,M=Ct((g-p)/d/f)*f;if(M<1e-14&&!m&&!b)return[{value:p},{value:g}];k=Math.ceil(g/M)-Math.floor(p/M),k>d&&(M=Ct(k*M/d/f)*f),G(a)||(v=Math.pow(10,a),M=Math.ceil(M*v)/v),"ticks"===n?(y=Math.floor(p/M)*M,w=Math.ceil(g/M)*M):(y=p,w=g),m&&b&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-s)/r,M/1e3)?(k=Math.round(Math.min((o-s)/M,h)),M=(o-s)/k,y=s,w=o):_?(y=m?s:y,w=b?o:w,k=l-1,M=(w-y)/k):(k=(w-y)/M,k=Ot(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(It(M),It(y));v=Math.pow(10,G(a)?S:a),y=Math.round(y*v)/v,w=Math.round(w*v)/v;let P=0;for(m&&(u&&y!==s?(i.push({value:s}),yn=e?n:t,o=t=>r=i?r:t;if(t){const t=Dt(n),e=Dt(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(n===r){let e=0===r?1:Math.abs(.05*r);o(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=po({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Et(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ue(t,this.chart.options.locale,this.options.ticks.format)}}class bo extends mo{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=tt(t)?t:0,this.max=tt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Lt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}t(bo,"id","linear"),t(bo,"defaults",{ticks:{callback:de.formatters.numeric}});const _o=t=>Math.floor(At(t)),xo=(t,e)=>Math.pow(10,_o(t)+e);function vo(t){return 1===t/Math.pow(10,_o(t))}function yo(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function wo(t,{min:e,max:i}){e=et(t.min,e);const n=[],r=_o(e);let s=function(t,e){let i=_o(e-t);for(;yo(t,e,i)>10;)i++;for(;yo(t,e,i)<10;)i--;return Math.min(i,_o(t))}(e,i),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,h=Math.round((e-l)*o)/o,c=Math.floor((e-l)/a/10)*a*10;let u=Math.floor((h-c)/Math.pow(10,s)),f=et(t.min,Math.round((l+c+u*Math.pow(10,s))*o)/o);for(;f=10?u=u<15?15:20:u++,u>=20&&(s++,u=2,o=s>=0?1:o),f=Math.round((l+c+u*Math.pow(10,s))*o)/o;const d=et(t.max,f);return n.push({value:d,major:vo(d),significand:u}),n}class ko extends pr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=mo.prototype.parse.apply(this,[t,e]);if(0!==i)return tt(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=tt(t)?Math.max(0,t):null,this.max=tt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!tt(this._userMin)&&(this.min=t===xo(this.min,0)?xo(this.min,-1):xo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const r=e=>i=t?i:e,s=t=>n=e?n:t;i===n&&(i<=0?(r(1),s(10)):(r(xo(i,-1)),s(xo(n,1)))),i<=0&&r(xo(n,-1)),n<=0&&s(xo(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=wo({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Et(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ue(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=At(t),this._valueRange=At(this.max)-At(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(At(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Mo(t){const e=t.ticks;if(e.display&&t.display){const t=We(e.backdropPadding);return it(e.font&&e.font.size,xe.font.size)+t.height}return 0}function So(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:tr?{start:e-i,end:e}:{start:e,end:e+i}}function Po(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?xt/s:0;for(let u=0;ue.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.starte.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Do(t){return 0===t||180===t?"center":t<180?"left":"right"}function Oo(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Co(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function To(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,vt);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s{const i=rt(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Po(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return Vt(t*(vt/(this._pointLabels.length||1))+Lt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(G(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(G(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;r--){const e=n.setContext(t.getPointLabelContext(r)),s=Ne(e.font),{x:o,y:a,textAlign:l,left:h,top:c,right:u,bottom:f}=t._pointLabelItems[r],{backdropColor:d}=e;if(!G(d)){const t=Be(e.borderRadius),n=We(e.backdropPadding);i.fillStyle=d;const r=h-n.left,s=c-n.top,o=u-h+n.width,a=f-c+n.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),Re(i,{x:r,y:s,w:o,h:a,radius:t}),i.fill()):i.fillRect(r,s,o,a)}Te(i,t._pointLabels[r],o,a+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),o=n.setContext(i),l=r.setContext(i);!function(t,e,i,n,r){const s=t.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!n||!a||!l||i<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),To(t,i,o,n),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}})),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=n;s&&r&&(t.lineWidth=s,t.strokeStyle=r,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=Ne(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=We(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}Te(t,n.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}t(Eo,"id","radialLinear"),t(Eo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:de.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),t(Eo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),t(Eo,"descriptors",{angleLines:{_fallback:"grid"}});const Lo={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}},Ro=Object.keys(Lo);function Io(t,e){return t-e}function zo(t,e){if(G(e))return null;const i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),tt(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!Tt(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function Fo(t,e,i,n){const r=Ro.length;for(let s=Ro.indexOf(t);s=e?i[n]:i[r]]=!0}}else t[e]=!0}function Vo(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Bo extends pr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new yn(t.adapters.date);n.init(e),ut(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:zo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(r=Math.max(r,t.max))}s&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=tt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=tt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;nn&&t[r-1]>i;)r--;return n>0||r=Ro.indexOf(i);s--){const i=Ro[s];if(Lo[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Ro[i?Ro.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Ro.indexOf(t)+1,i=Ro.length;e+t.value)))}initOffsets(t=[]){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Wt(n,0,s),r=Wt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,s=r.unit||Fo(r.minUnit,e,i,this._getLabelCapacity(e)),o=it(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=Tt(a)||!0===a,h={};let c,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,l?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const d="data"===n.ticks.source&&this.getDataTimestamps();for(c=f,u=0;ct-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const r=this.options,s=r.ticks.callback;if(s)return rt(s,[t,e,i],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&o[a],c=l&&o[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,n||(f?c:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=$t(t,"pos",e)),({pos:n,time:s}=t[a]),({pos:r,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=$t(t,"time",e)),({time:n,pos:s}=t[a]),({time:r,pos:o}=t[l]));const h=r-n;return h?s+(o-s)*(e-n)/h:s}t(Bo,"id","time"),t(Bo,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class No extends Bo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Wo(e,this.min),this._tableRange=Wo(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],r=[];let s,o,a,l,h;for(s=0,o=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=n.length;s