HumanBreak/assets/common-legacy.c70c1bcd.js
2023-02-26 04:36:54 +00:00

29 lines
276 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!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.690b7cec.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)=>f(e,i-1)));return t=>{const r=n.map(((n,r)=>n*e[r]*(1-t)**(i-r-1)*t**r));return c(...r)}},S:async function(t){return new Promise((e=>setTimeout(e,t)))},a:function(t,e){if("sin"===t)return d(e,(t=>(Math.cosh(2*t)-1)/(p-1)));if("tan"===t){const t=t=>1*Math.tanh(3*t)/m;return d(e,(e=>1-t(1-e)),t)}if("sec"===t){const t=t=>1/Math.cosh(t);return d(e,(e=>1-2*(t(e*g)-.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))}}e("I",a);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<t)throw new ReferenceError(`You are trying to wait ${t} animate, but there are only ${e} animate animating.`);let i=0;await new Promise((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)=>t.reduce(((t,e)=>t+e),0),u=t=>{if(0===t)return 1;let e=t;for(;t>1;)e*=--t;return e},f=(t,e)=>Math.round(u(e)/(u(t)*u(e-t))),d=(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,p=Math.cosh(2),g=Math.acosh(2),m=Math.tanh(3);var b=e("l",{exports:{}});
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* 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 _(t){return t+.5|0}!function(t,e){(function(){var i,r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",h=500,c="__lodash_placeholder__",u=1,f=2,d=4,p=1,g=2,m=1,b=2,_=4,x=8,v=16,y=32,w=64,k=128,M=256,S=512,P=30,A="...",D=800,O=16,C=1,T=2,E=1/0,L=9007199254740991,R=17976931348623157e292,I=NaN,z=4294967295,F=z-1,j=z>>>1,V=[["ary",k],["bind",m],["bindKey",b],["curry",x],["curryRight",v],["flip",S],["partial",y],["partialRight",w],["rearg",M]],B="[object Arguments]",W="[object Array]",N="[object AsyncFunction]",H="[object Boolean]",$="[object Date]",U="[object DOMException]",Y="[object Error]",q="[object Function]",X="[object GeneratorFunction]",K="[object Map]",Z="[object Number]",G="[object Null]",J="[object Object]",Q="[object Promise]",tt="[object Proxy]",et="[object RegExp]",it="[object Set]",nt="[object String]",rt="[object Symbol]",st="[object Undefined]",ot="[object WeakMap]",at="[object WeakSet]",lt="[object ArrayBuffer]",ht="[object DataView]",ct="[object Float32Array]",ut="[object Float64Array]",ft="[object Int8Array]",dt="[object Int16Array]",pt="[object Int32Array]",gt="[object Uint8Array]",mt="[object Uint8ClampedArray]",bt="[object Uint16Array]",_t="[object Uint32Array]",xt=/\b__p \+= '';/g,vt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,Mt=RegExp(wt.source),St=RegExp(kt.source),Pt=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Dt=/<%=([\s\S]+?)%>/g,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,Tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Et=/[\\^$.*+?()[\]{}|]/g,Lt=RegExp(Et.source),Rt=/^\s+/,It=/\s/,zt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,jt=/,? & /,Vt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bt=/[()=,{}\[\]\/\s]/,Wt=/\\(\\)?/g,Nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,$t=/^[-+]0x[0-9a-f]+$/i,Ut=/^0b[01]+$/i,Yt=/^\[object .+?Constructor\]$/,qt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Kt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zt=/($^)/,Gt=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",Qt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",te="\\u2700-\\u27bf",ee="a-z\\xdf-\\xf6\\xf8-\\xff",ie="A-Z\\xc0-\\xd6\\xd8-\\xde",ne="\\ufe0e\\ufe0f",re="\\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",se="[']",oe="["+Jt+"]",ae="["+re+"]",le="["+Qt+"]",he="\\d+",ce="["+te+"]",ue="["+ee+"]",fe="[^"+Jt+re+he+te+ee+ie+"]",de="\\ud83c[\\udffb-\\udfff]",pe="[^"+Jt+"]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",me="[\\ud800-\\udbff][\\udc00-\\udfff]",be="["+ie+"]",_e="\\u200d",xe="(?:"+ue+"|"+fe+")",ve="(?:"+be+"|"+fe+")",ye="(?:['](?:d|ll|m|re|s|t|ve))?",we="(?:['](?:D|LL|M|RE|S|T|VE))?",ke="(?:"+le+"|"+de+")"+"?",Me="["+ne+"]?",Se=Me+ke+("(?:"+_e+"(?:"+[pe,ge,me].join("|")+")"+Me+ke+")*"),Pe="(?:"+[ce,ge,me].join("|")+")"+Se,Ae="(?:"+[pe+le+"?",le,ge,me,oe].join("|")+")",De=RegExp(se,"g"),Oe=RegExp(le,"g"),Ce=RegExp(de+"(?="+de+")|"+Ae+Se,"g"),Te=RegExp([be+"?"+ue+"+"+ye+"(?="+[ae,be,"$"].join("|")+")",ve+"+"+we+"(?="+[ae,be+xe,"$"].join("|")+")",be+"?"+xe+"+"+ye,be+"+"+we,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",he,Pe].join("|"),"g"),Ee=RegExp("["+_e+Jt+Qt+ne+"]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["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"],Ie=-1,ze={};ze[ct]=ze[ut]=ze[ft]=ze[dt]=ze[pt]=ze[gt]=ze[mt]=ze[bt]=ze[_t]=!0,ze[B]=ze[W]=ze[lt]=ze[H]=ze[ht]=ze[$]=ze[Y]=ze[q]=ze[K]=ze[Z]=ze[J]=ze[et]=ze[it]=ze[nt]=ze[ot]=!1;var Fe={};Fe[B]=Fe[W]=Fe[lt]=Fe[ht]=Fe[H]=Fe[$]=Fe[ct]=Fe[ut]=Fe[ft]=Fe[dt]=Fe[pt]=Fe[K]=Fe[Z]=Fe[J]=Fe[et]=Fe[it]=Fe[nt]=Fe[rt]=Fe[gt]=Fe[mt]=Fe[bt]=Fe[_t]=!0,Fe[Y]=Fe[q]=Fe[ot]=!1;var je={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Be=parseInt,We="object"==typeof n&&n&&n.Object===Object&&n,Ne="object"==typeof self&&self&&self.Object===Object&&self,He=We||Ne||Function("return this")(),$e=e&&!e.nodeType&&e,Ue=$e&&t&&!t.nodeType&&t,Ye=Ue&&Ue.exports===$e,qe=Ye&&We.process,Xe=function(){try{var t=Ue&&Ue.require&&Ue.require("util").types;return t||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Ke=Xe&&Xe.isArrayBuffer,Ze=Xe&&Xe.isDate,Ge=Xe&&Xe.isMap,Je=Xe&&Xe.isRegExp,Qe=Xe&&Xe.isSet,ti=Xe&&Xe.isTypedArray;function ei(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 ii(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(n,o,i(o),t)}return n}function ni(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function ri(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function si(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function oi(t,e){for(var i=-1,n=null==t?0:t.length,r=0,s=[];++i<n;){var o=t[i];e(o,i,t)&&(s[r++]=o)}return s}function ai(t,e){return!!(null==t?0:t.length)&&bi(t,e,0)>-1}function li(t,e,i){for(var n=-1,r=null==t?0:t.length;++n<r;)if(i(e,t[n]))return!0;return!1}function hi(t,e){for(var i=-1,n=null==t?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r}function ci(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}function ui(t,e,i,n){var r=-1,s=null==t?0:t.length;for(n&&s&&(i=t[++r]);++r<s;)i=e(i,t[r],r,t);return i}function fi(t,e,i,n){var r=null==t?0:t.length;for(n&&r&&(i=t[--r]);r--;)i=e(i,t[r],r,t);return i}function di(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var pi=yi("length");function gi(t,e,i){var n;return i(t,(function(t,i,r){if(e(t,i,r))return n=i,!1})),n}function mi(t,e,i,n){for(var r=t.length,s=i+(n?1:-1);n?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function bi(t,e,i){return e==e?function(t,e,i){var n=i-1,r=t.length;for(;++n<r;)if(t[n]===e)return n;return-1}(t,e,i):mi(t,xi,i)}function _i(t,e,i,n){for(var r=i-1,s=t.length;++r<s;)if(n(t[r],e))return r;return-1}function xi(t){return t!=t}function vi(t,e){var i=null==t?0:t.length;return i?Mi(t,e)/i:I}function yi(t){return function(e){return null==e?i:e[t]}}function wi(t){return function(e){return null==t?i:t[e]}}function ki(t,e,i,n,r){return r(t,(function(t,r,s){i=n?(n=!1,t):e(i,t,r,s)})),i}function Mi(t,e){for(var n,r=-1,s=t.length;++r<s;){var o=e(t[r]);o!==i&&(n=n===i?o:n+o)}return n}function Si(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Pi(t){return t?t.slice(0,Hi(t)+1).replace(Rt,""):t}function Ai(t){return function(e){return t(e)}}function Di(t,e){return hi(e,(function(e){return t[e]}))}function Oi(t,e){return t.has(e)}function Ci(t,e){for(var i=-1,n=t.length;++i<n&&bi(e,t[i],0)>-1;);return i}function Ti(t,e){for(var i=t.length;i--&&bi(e,t[i],0)>-1;);return i}var Ei=wi({"À":"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"}),Li=wi({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ri(t){return"\\"+je[t]}function Ii(t){return Ee.test(t)}function zi(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function Fi(t,e){return function(i){return t(e(i))}}function ji(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var o=t[i];o!==e&&o!==c||(t[i]=c,s[r++]=i)}return s}function Vi(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function Bi(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}function Wi(t){return Ii(t)?function(t){var e=Ce.lastIndex=0;for(;Ce.test(t);)++e;return e}(t):pi(t)}function Ni(t){return Ii(t)?function(t){return t.match(Ce)||[]}(t):function(t){return t.split("")}(t)}function Hi(t){for(var e=t.length;e--&&It.test(t.charAt(e)););return e}var $i=wi({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Ui=function t(e){var n=(e=null==e?He:Ui.defaults(He.Object(),e,Ui.pick(He,Re))).Array,It=e.Date,Jt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,ie=e.RegExp,ne=e.String,re=e.TypeError,se=n.prototype,oe=Qt.prototype,ae=ee.prototype,le=e["__core-js_shared__"],he=oe.toString,ce=ae.hasOwnProperty,ue=0,fe=function(){var t=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),de=ae.toString,pe=he.call(ee),ge=He._,me=ie("^"+he.call(ce).replace(Et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Ye?e.Buffer:i,_e=e.Symbol,xe=e.Uint8Array,ve=be?be.allocUnsafe:i,ye=Fi(ee.getPrototypeOf,ee),we=ee.create,ke=ae.propertyIsEnumerable,Me=se.splice,Se=_e?_e.isConcatSpreadable:i,Pe=_e?_e.iterator:i,Ae=_e?_e.toStringTag:i,Ce=function(){try{var t=Bs(ee,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ee=e.clearTimeout!==He.clearTimeout&&e.clearTimeout,je=It&&It.now!==He.Date.now&&It.now,We=e.setTimeout!==He.setTimeout&&e.setTimeout,Ne=te.ceil,$e=te.floor,Ue=ee.getOwnPropertySymbols,qe=be?be.isBuffer:i,Xe=e.isFinite,pi=se.join,wi=Fi(ee.keys,ee),Yi=te.max,qi=te.min,Xi=It.now,Ki=e.parseInt,Zi=te.random,Gi=se.reverse,Ji=Bs(e,"DataView"),Qi=Bs(e,"Map"),tn=Bs(e,"Promise"),en=Bs(e,"Set"),nn=Bs(e,"WeakMap"),rn=Bs(ee,"create"),sn=nn&&new nn,on={},an=fo(Ji),ln=fo(Qi),hn=fo(tn),cn=fo(en),un=fo(nn),fn=_e?_e.prototype:i,dn=fn?fn.valueOf:i,pn=fn?fn.toString:i;function gn(t){if(Ca(t)&&!xa(t)&&!(t instanceof xn)){if(t instanceof _n)return t;if(ce.call(t,"__wrapped__"))return po(t)}return new _n(t)}var mn=function(){function t(){}return function(e){if(!Oa(e))return{};if(we)return we(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function bn(){}function _n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function xn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=z,this.__views__=[]}function vn(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function yn(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function wn(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function kn(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new wn;++e<i;)this.add(t[e])}function Mn(t){var e=this.__data__=new yn(t);this.size=e.size}function Sn(t,e){var i=xa(t),n=!i&&_a(t),r=!i&&!n&&ka(t),s=!i&&!n&&!r&&ja(t),o=i||n||r||s,a=o?Si(t.length,ne):[],l=a.length;for(var h in t)!e&&!ce.call(t,h)||o&&("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||qs(h,l))||a.push(h);return a}function Pn(t){var e=t.length;return e?t[kr(0,e-1)]:i}function An(t,e){return ho(rs(t),zn(e,0,t.length))}function Dn(t){return ho(rs(t))}function On(t,e,n){(n!==i&&!ga(t[e],n)||n===i&&!(e in t))&&Rn(t,e,n)}function Cn(t,e,n){var r=t[e];ce.call(t,e)&&ga(r,n)&&(n!==i||e in t)||Rn(t,e,n)}function Tn(t,e){for(var i=t.length;i--;)if(ga(t[i][0],e))return i;return-1}function En(t,e,i,n){return Wn(t,(function(t,r,s){e(n,t,i(t),s)})),n}function Ln(t,e){return t&&ss(e,ol(e),t)}function Rn(t,e,i){"__proto__"==e&&Ce?Ce(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function In(t,e){for(var r=-1,s=e.length,o=n(s),a=null==t;++r<s;)o[r]=a?i:el(t,e[r]);return o}function zn(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function Fn(t,e,n,r,s,o){var a,l=e&u,h=e&f,c=e&d;if(n&&(a=s?n(t,r,s,o):n(t)),a!==i)return a;if(!Oa(t))return t;var p=xa(t);if(p){if(a=function(t){var e=t.length,i=new t.constructor(e);e&&"string"==typeof t[0]&&ce.call(t,"index")&&(i.index=t.index,i.input=t.input);return i}(t),!l)return rs(t,a)}else{var g=Hs(t),m=g==q||g==X;if(ka(t))return Jr(t,l);if(g==J||g==B||m&&!s){if(a=h||m?{}:Us(t),!l)return h?function(t,e){return ss(t,Ns(t),e)}(t,function(t,e){return t&&ss(e,al(e),t)}(a,t)):function(t,e){return ss(t,Ws(t),e)}(t,Ln(a,t))}else{if(!Fe[g])return s?t:{};a=function(t,e,i){var n=t.constructor;switch(e){case lt:return Qr(t);case H:case $:return new n(+t);case ht:return function(t,e){var i=e?Qr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case ct:case ut:case ft:case dt:case pt:case gt:case mt:case bt:case _t:return ts(t,i);case K:return new n;case Z:case nt:return new n(t);case et:return function(t){var e=new t.constructor(t.source,Ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case it:return new n;case rt:return r=t,dn?ee(dn.call(r)):{}}var r}(t,g,l)}}o||(o=new Mn);var b=o.get(t);if(b)return b;o.set(t,a),Ia(t)?t.forEach((function(i){a.add(Fn(i,e,n,i,t,o))})):Ta(t)&&t.forEach((function(i,r){a.set(r,Fn(i,e,n,r,t,o))}));var _=p?i:(c?h?Ls:Es:h?al:ol)(t);return ni(_||t,(function(i,r){_&&(i=t[r=i]),Cn(a,r,Fn(i,e,n,r,t,o))})),a}function jn(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(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 Vn(t,e,n){if("function"!=typeof t)throw new re(o);return so((function(){t.apply(i,n)}),e)}function Bn(t,e,i,n){var s=-1,o=ai,a=!0,l=t.length,h=[],c=e.length;if(!l)return h;i&&(e=hi(e,Ai(i))),n?(o=li,a=!1):e.length>=r&&(o=Oi,a=!1,e=new kn(e));t:for(;++s<l;){var u=t[s],f=null==i?u:i(u);if(u=n||0!==u?u:0,a&&f==f){for(var d=c;d--;)if(e[d]===f)continue t;h.push(u)}else o(e,f,n)||h.push(u)}return h}gn.templateSettings={escape:Pt,evaluate:At,interpolate:Dt,variable:"",imports:{_:gn}},gn.prototype=bn.prototype,gn.prototype.constructor=gn,_n.prototype=mn(bn.prototype),_n.prototype.constructor=_n,xn.prototype=mn(bn.prototype),xn.prototype.constructor=xn,vn.prototype.clear=function(){this.__data__=rn?rn(null):{},this.size=0},vn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},vn.prototype.get=function(t){var e=this.__data__;if(rn){var n=e[t];return n===l?i:n}return ce.call(e,t)?e[t]:i},vn.prototype.has=function(t){var e=this.__data__;return rn?e[t]!==i:ce.call(e,t)},vn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=rn&&e===i?l:e,this},yn.prototype.clear=function(){this.__data__=[],this.size=0},yn.prototype.delete=function(t){var e=this.__data__,i=Tn(e,t);return!(i<0)&&(i==e.length-1?e.pop():Me.call(e,i,1),--this.size,!0)},yn.prototype.get=function(t){var e=this.__data__,n=Tn(e,t);return n<0?i:e[n][1]},yn.prototype.has=function(t){return Tn(this.__data__,t)>-1},yn.prototype.set=function(t,e){var i=this.__data__,n=Tn(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},wn.prototype.clear=function(){this.size=0,this.__data__={hash:new vn,map:new(Qi||yn),string:new vn}},wn.prototype.delete=function(t){var e=js(this,t).delete(t);return this.size-=e?1:0,e},wn.prototype.get=function(t){return js(this,t).get(t)},wn.prototype.has=function(t){return js(this,t).has(t)},wn.prototype.set=function(t,e){var i=js(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},kn.prototype.add=kn.prototype.push=function(t){return this.__data__.set(t,l),this},kn.prototype.has=function(t){return this.__data__.has(t)},Mn.prototype.clear=function(){this.__data__=new yn,this.size=0},Mn.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Mn.prototype.get=function(t){return this.__data__.get(t)},Mn.prototype.has=function(t){return this.__data__.has(t)},Mn.prototype.set=function(t,e){var i=this.__data__;if(i instanceof yn){var n=i.__data__;if(!Qi||n.length<r-1)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new wn(n)}return i.set(t,e),this.size=i.size,this};var Wn=ls(Kn),Nn=ls(Zn,!0);function Hn(t,e){var i=!0;return Wn(t,(function(t,n,r){return i=!!e(t,n,r)})),i}function $n(t,e,n){for(var r=-1,s=t.length;++r<s;){var o=t[r],a=e(o);if(null!=a&&(l===i?a==a&&!Fa(a):n(a,l)))var l=a,h=o}return h}function Un(t,e){var i=[];return Wn(t,(function(t,n,r){e(t,n,r)&&i.push(t)})),i}function Yn(t,e,i,n,r){var s=-1,o=t.length;for(i||(i=Ys),r||(r=[]);++s<o;){var a=t[s];e>0&&i(a)?e>1?Yn(a,e-1,i,n,r):ci(r,a):n||(r[r.length]=a)}return r}var qn=hs(),Xn=hs(!0);function Kn(t,e){return t&&qn(t,e,ol)}function Zn(t,e){return t&&Xn(t,e,ol)}function Gn(t,e){return oi(e,(function(e){return Pa(t[e])}))}function Jn(t,e){for(var n=0,r=(e=Xr(e,t)).length;null!=t&&n<r;)t=t[uo(e[n++])];return n&&n==r?t:i}function Qn(t,e,i){var n=e(t);return xa(t)?n:ci(n,i(t))}function tr(t){return null==t?t===i?st:G:Ae&&Ae in ee(t)?function(t){var e=ce.call(t,Ae),n=t[Ae];try{t[Ae]=i;var r=!0}catch(o){}var s=de.call(t);r&&(e?t[Ae]=n:delete t[Ae]);return s}(t):function(t){return de.call(t)}(t)}function er(t,e){return t>e}function ir(t,e){return null!=t&&ce.call(t,e)}function nr(t,e){return null!=t&&e in ee(t)}function rr(t,e,r){for(var s=r?li:ai,o=t[0].length,a=t.length,l=a,h=n(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=hi(f,Ai(e))),c=qi(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new kn(l&&f):i}f=t[0];var d=-1,p=h[0];t:for(;++d<o&&u.length<c;){var g=f[d],m=e?e(g):g;if(g=r||0!==g?g:0,!(p?Oi(p,m):s(u,m,r))){for(l=a;--l;){var b=h[l];if(!(b?Oi(b,m):s(t[l],m,r)))continue t}p&&p.push(m),u.push(g)}}return u}function sr(t,e,n){var r=null==(t=io(t,e=Xr(e,t)))?t:t[uo(So(e))];return null==r?i:ei(r,t,n)}function or(t){return Ca(t)&&tr(t)==B}function ar(t,e,n,r,s){return t===e||(null==t||null==e||!Ca(t)&&!Ca(e)?t!=t&&e!=e:function(t,e,n,r,s,o){var a=xa(t),l=xa(e),h=a?W:Hs(t),c=l?W:Hs(e),u=(h=h==B?J:h)==J,f=(c=c==B?J:c)==J,d=h==c;if(d&&ka(t)){if(!ka(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Mn),a||ja(t)?Cs(t,e,n,r,s,o):function(t,e,i,n,r,s,o){switch(i){case ht:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case lt:return!(t.byteLength!=e.byteLength||!s(new xe(t),new xe(e)));case H:case $:case Z:return ga(+t,+e);case Y:return t.name==e.name&&t.message==e.message;case et:case nt:return t==e+"";case K:var a=zi;case it:var l=n&p;if(a||(a=Vi),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;n|=g,o.set(t,e);var c=Cs(a(t),a(e),n,r,s,o);return o.delete(t),c;case rt:if(dn)return dn.call(t)==dn.call(e)}return!1}(t,e,h,n,r,s,o);if(!(n&p)){var m=u&&ce.call(t,"__wrapped__"),b=f&&ce.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,x=b?e.value():e;return o||(o=new Mn),s(_,x,n,r,o)}}if(!d)return!1;return o||(o=new Mn),function(t,e,n,r,s,o){var a=n&p,l=Es(t),h=l.length,c=Es(e),u=c.length;if(h!=u&&!a)return!1;var f=h;for(;f--;){var d=l[f];if(!(a?d in e:ce.call(e,d)))return!1}var g=o.get(t),m=o.get(e);if(g&&m)return g==e&&m==t;var b=!0;o.set(t,e),o.set(e,t);var _=a;for(;++f<h;){var x=t[d=l[f]],v=e[d];if(r)var y=a?r(v,x,d,e,t,o):r(x,v,d,t,e,o);if(!(y===i?x===v||s(x,v,n,r,o):y)){b=!1;break}_||(_="constructor"==d)}if(b&&!_){var w=t.constructor,k=e.constructor;w==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k||(b=!1)}return o.delete(t),o.delete(e),b}(t,e,n,r,s,o)}(t,e,n,r,ar,s))}function lr(t,e,n,r){var s=n.length,o=s,a=!r;if(null==t)return!o;for(t=ee(t);s--;){var l=n[s];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<o;){var h=(l=n[s])[0],c=t[h],u=l[1];if(a&&l[2]){if(c===i&&!(h in t))return!1}else{var f=new Mn;if(r)var d=r(c,u,h,t,e,f);if(!(d===i?ar(u,c,p|g,r,f):d))return!1}}return!0}function hr(t){return!(!Oa(t)||(e=t,fe&&fe in e))&&(Pa(t)?me:Yt).test(fo(t));var e}function cr(t){return"function"==typeof t?t:null==t?El:"object"==typeof t?xa(t)?mr(t[0],t[1]):gr(t):Wl(t)}function ur(t){if(!Js(t))return wi(t);var e=[];for(var i in ee(t))ce.call(t,i)&&"constructor"!=i&&e.push(i);return e}function fr(t){if(!Oa(t))return function(t){var e=[];if(null!=t)for(var i in ee(t))e.push(i);return e}(t);var e=Js(t),i=[];for(var n in t)("constructor"!=n||!e&&ce.call(t,n))&&i.push(n);return i}function dr(t,e){return t<e}function pr(t,e){var i=-1,r=ya(t)?n(t.length):[];return Wn(t,(function(t,n,s){r[++i]=e(t,n,s)})),r}function gr(t){var e=Vs(t);return 1==e.length&&e[0][2]?to(e[0][0],e[0][1]):function(i){return i===t||lr(i,t,e)}}function mr(t,e){return Ks(t)&&Qs(e)?to(uo(t),e):function(n){var r=el(n,t);return r===i&&r===e?il(n,t):ar(e,r,p|g)}}function br(t,e,n,r,s){t!==e&&qn(e,(function(o,a){if(s||(s=new Mn),Oa(o))!function(t,e,n,r,s,o,a){var l=no(t,n),h=no(e,n),c=a.get(h);if(c)return void On(t,n,c);var u=o?o(l,h,n+"",t,e,a):i,f=u===i;if(f){var d=xa(h),p=!d&&ka(h),g=!d&&!p&&ja(h);u=h,d||p||g?xa(l)?u=l:wa(l)?u=rs(l):p?(f=!1,u=Jr(h,!0)):g?(f=!1,u=ts(h,!0)):u=[]:La(h)||_a(h)?(u=l,_a(l)?u=Ya(l):Oa(l)&&!Pa(l)||(u=Us(h))):f=!1}f&&(a.set(h,u),s(u,h,r,o,a),a.delete(h));On(t,n,u)}(t,e,a,n,br,r,s);else{var l=r?r(no(t,a),o,a+"",t,e,s):i;l===i&&(l=o),On(t,a,l)}}),al)}function _r(t,e){var n=t.length;if(n)return qs(e+=e<0?n:0,n)?t[e]:i}function xr(t,e,i){e=e.length?hi(e,(function(t){return xa(t)?function(e){return Jn(e,1===t.length?t[0]:t)}:t})):[El];var n=-1;e=hi(e,Ai(Fs()));var r=pr(t,(function(t,i,r){var s=hi(e,(function(e){return e(t)}));return{criteria:s,index:++n,value:t}}));return function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(r,(function(t,e){return function(t,e,i){var n=-1,r=t.criteria,s=e.criteria,o=r.length,a=i.length;for(;++n<o;){var l=es(r[n],s[n]);if(l)return n>=a?l:l*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function vr(t,e,i){for(var n=-1,r=e.length,s={};++n<r;){var o=e[n],a=Jn(t,o);i(a,o)&&Dr(s,Xr(o,t),a)}return s}function yr(t,e,i,n){var r=n?_i:bi,s=-1,o=e.length,a=t;for(t===e&&(e=rs(e)),i&&(a=hi(t,Ai(i)));++s<o;)for(var l=0,h=e[s],c=i?i(h):h;(l=r(a,c,l,n))>-1;)a!==t&&Me.call(a,l,1),Me.call(t,l,1);return t}function wr(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;qs(r)?Me.call(t,r,1):Br(t,r)}}return t}function kr(t,e){return t+$e(Zi()*(e-t+1))}function Mr(t,e){var i="";if(!t||e<1||e>L)return i;do{e%2&&(i+=t),(e=$e(e/2))&&(t+=t)}while(e);return i}function Sr(t,e){return oo(eo(t,e,El),t+"")}function Pr(t){return Pn(gl(t))}function Ar(t,e){var i=gl(t);return ho(i,zn(e,0,i.length))}function Dr(t,e,n,r){if(!Oa(t))return t;for(var s=-1,o=(e=Xr(e,t)).length,a=o-1,l=t;null!=l&&++s<o;){var h=uo(e[s]),c=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return t;if(s!=a){var u=l[h];(c=r?r(u,h,l):i)===i&&(c=Oa(u)?u:qs(e[s+1])?[]:{})}Cn(l,h,c),l=l[h]}return t}var Or=sn?function(t,e){return sn.set(t,e),t}:El,Cr=Ce?function(t,e){return Ce(t,"toString",{configurable:!0,enumerable:!1,value:Ol(e),writable:!0})}:El;function Tr(t){return ho(gl(t))}function Er(t,e,i){var r=-1,s=t.length;e<0&&(e=-e>s?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<s;)o[r]=t[r+e];return o}function Lr(t,e){var i;return Wn(t,(function(t,n,r){return!(i=e(t,n,r))})),!!i}function Rr(t,e,i){var n=0,r=null==t?n:t.length;if("number"==typeof e&&e==e&&r<=j){for(;n<r;){var s=n+r>>>1,o=t[s];null!==o&&!Fa(o)&&(i?o<=e:o<e)?n=s+1:r=s}return r}return Ir(t,e,El,i)}function Ir(t,e,n,r){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,l=null===e,h=Fa(e),c=e===i;s<o;){var u=$e((s+o)/2),f=n(t[u]),d=f!==i,p=null===f,g=f==f,m=Fa(f);if(a)var b=r||g;else b=c?g&&(r||d):l?g&&d&&(r||!p):h?g&&d&&!p&&(r||!m):!p&&!m&&(r?f<=e:f<e);b?s=u+1:o=u}return qi(o,F)}function zr(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var o=t[i],a=e?e(o):o;if(!i||!ga(a,l)){var l=a;s[r++]=0===o?0:o}}return s}function Fr(t){return"number"==typeof t?t:Fa(t)?I:+t}function jr(t){if("string"==typeof t)return t;if(xa(t))return hi(t,jr)+"";if(Fa(t))return pn?pn.call(t):"";var e=t+"";return"0"==e&&1/t==-E?"-0":e}function Vr(t,e,i){var n=-1,s=ai,o=t.length,a=!0,l=[],h=l;if(i)a=!1,s=li;else if(o>=r){var c=e?null:Ms(t);if(c)return Vi(c);a=!1,s=Oi,h=new kn}else h=e?[]:l;t:for(;++n<o;){var u=t[n],f=e?e(u):u;if(u=i||0!==u?u:0,a&&f==f){for(var d=h.length;d--;)if(h[d]===f)continue t;e&&h.push(f),l.push(u)}else s(h,f,i)||(h!==l&&h.push(f),l.push(u))}return l}function Br(t,e){return null==(t=io(t,e=Xr(e,t)))||delete t[uo(So(e))]}function Wr(t,e,i,n){return Dr(t,e,i(Jn(t,e)),n)}function Nr(t,e,i,n){for(var r=t.length,s=n?r:-1;(n?s--:++s<r)&&e(t[s],s,t););return i?Er(t,n?0:s,n?s+1:r):Er(t,n?s+1:0,n?r:s)}function Hr(t,e){var i=t;return i instanceof xn&&(i=i.value()),ui(e,(function(t,e){return e.func.apply(e.thisArg,ci([t],e.args))}),i)}function $r(t,e,i){var r=t.length;if(r<2)return r?Vr(t[0]):[];for(var s=-1,o=n(r);++s<r;)for(var a=t[s],l=-1;++l<r;)l!=s&&(o[s]=Bn(o[s]||a,t[l],e,i));return Vr(Yn(o,1),e,i)}function Ur(t,e,n){for(var r=-1,s=t.length,o=e.length,a={};++r<s;){var l=r<o?e[r]:i;n(a,t[r],l)}return a}function Yr(t){return wa(t)?t:[]}function qr(t){return"function"==typeof t?t:El}function Xr(t,e){return xa(t)?t:Ks(t,e)?[t]:co(qa(t))}var Kr=Sr;function Zr(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:Er(t,e,n)}var Gr=Ee||function(t){return He.clearTimeout(t)};function Jr(t,e){if(e)return t.slice();var i=t.length,n=ve?ve(i):new t.constructor(i);return t.copy(n),n}function Qr(t){var e=new t.constructor(t.byteLength);return new xe(e).set(new xe(t)),e}function ts(t,e){var i=e?Qr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function es(t,e){if(t!==e){var n=t!==i,r=null===t,s=t==t,o=Fa(t),a=e!==i,l=null===e,h=e==e,c=Fa(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!n&&h||!s)return 1;if(!r&&!o&&!c&&t<e||c&&n&&s&&!r&&!o||l&&n&&s||!a&&s||!h)return-1}return 0}function is(t,e,i,r){for(var s=-1,o=t.length,a=i.length,l=-1,h=e.length,c=Yi(o-a,0),u=n(h+c),f=!r;++l<h;)u[l]=e[l];for(;++s<a;)(f||s<o)&&(u[i[s]]=t[s]);for(;c--;)u[l++]=t[s++];return u}function ns(t,e,i,r){for(var s=-1,o=t.length,a=-1,l=i.length,h=-1,c=e.length,u=Yi(o-l,0),f=n(u+c),d=!r;++s<u;)f[s]=t[s];for(var p=s;++h<c;)f[p+h]=e[h];for(;++a<l;)(d||s<o)&&(f[p+i[a]]=t[s++]);return f}function rs(t,e){var i=-1,r=t.length;for(e||(e=n(r));++i<r;)e[i]=t[i];return e}function ss(t,e,n,r){var s=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var l=e[o],h=r?r(n[l],t[l],l,n,t):i;h===i&&(h=t[l]),s?Rn(n,l,h):Cn(n,l,h)}return n}function os(t,e){return function(i,n){var r=xa(i)?ii:En,s=e?e():{};return r(i,t,Fs(n,2),s)}}function as(t){return Sr((function(e,n){var r=-1,s=n.length,o=s>1?n[s-1]:i,a=s>2?n[2]:i;for(o=t.length>3&&"function"==typeof o?(s--,o):i,a&&Xs(n[0],n[1],a)&&(o=s<3?i:o,s=1),e=ee(e);++r<s;){var l=n[r];l&&t(e,l,r,o)}return e}))}function ls(t,e){return function(i,n){if(null==i)return i;if(!ya(i))return t(i,n);for(var r=i.length,s=e?r:-1,o=ee(i);(e?s--:++s<r)&&!1!==n(o[s],s,o););return i}}function hs(t){return function(e,i,n){for(var r=-1,s=ee(e),o=n(e),a=o.length;a--;){var l=o[t?a:++r];if(!1===i(s[l],l,s))break}return e}}function cs(t){return function(e){var n=Ii(e=qa(e))?Ni(e):i,r=n?n[0]:e.charAt(0),s=n?Zr(n,1).join(""):e.slice(1);return r[t]()+s}}function us(t){return function(e){return ui(Pl(_l(e).replace(De,"")),t,"")}}function fs(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=mn(t.prototype),n=t.apply(i,e);return Oa(n)?n:i}}function ds(t){return function(e,n,r){var s=ee(e);if(!ya(e)){var o=Fs(n,3);e=ol(e),n=function(t){return o(s[t],t,s)}}var a=t(e,n,r);return a>-1?s[o?e[a]:a]:i}}function ps(t){return Ts((function(e){var n=e.length,r=n,s=_n.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new re(o);if(s&&!l&&"wrapper"==Is(a))var l=new _n([],!0)}for(r=l?r:n;++r<n;){var h=Is(a=e[r]),c="wrapper"==h?Rs(a):i;l=c&&Zs(c[0])&&c[1]==(k|x|y|M)&&!c[4].length&&1==c[9]?l[Is(c[0])].apply(l,c[3]):1==a.length&&Zs(a)?l[h]():l.thru(a)}return function(){var t=arguments,i=t[0];if(l&&1==t.length&&xa(i))return l.plant(i).value();for(var r=0,s=n?e[r].apply(this,t):i;++r<n;)s=e[r].call(this,s);return s}}))}function gs(t,e,r,s,o,a,l,h,c,u){var f=e&k,d=e&m,p=e&b,g=e&(x|v),_=e&S,y=p?i:fs(t);return function m(){for(var b=arguments.length,x=n(b),v=b;v--;)x[v]=arguments[v];if(g)var w=zs(m),k=function(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}(x,w);if(s&&(x=is(x,s,o,g)),a&&(x=ns(x,a,l,g)),b-=k,g&&b<u){var M=ji(x,w);return ws(t,e,gs,m.placeholder,r,x,M,h,c,u-b)}var S=d?r:this,P=p?S[t]:t;return b=x.length,h?x=function(t,e){var n=t.length,r=qi(e.length,n),s=rs(t);for(;r--;){var o=e[r];t[r]=qs(o,n)?s[o]:i}return t}(x,h):_&&b>1&&x.reverse(),f&&c<b&&(x.length=c),this&&this!==He&&this instanceof m&&(P=y||fs(P)),P.apply(S,x)}}function ms(t,e){return function(i,n){return function(t,e,i,n){return Kn(t,(function(t,r,s){e(n,i(t),r,s)})),n}(i,t,e(n),{})}}function bs(t,e){return function(n,r){var s;if(n===i&&r===i)return e;if(n!==i&&(s=n),r!==i){if(s===i)return r;"string"==typeof n||"string"==typeof r?(n=jr(n),r=jr(r)):(n=Fr(n),r=Fr(r)),s=t(n,r)}return s}}function _s(t){return Ts((function(e){return e=hi(e,Ai(Fs())),Sr((function(i){var n=this;return t(e,(function(t){return ei(t,n,i)}))}))}))}function xs(t,e){var n=(e=e===i?" ":jr(e)).length;if(n<2)return n?Mr(e,t):e;var r=Mr(e,Ne(t/Wi(e)));return Ii(e)?Zr(Ni(r),0,t).join(""):r.slice(0,t)}function vs(t){return function(e,r,s){return s&&"number"!=typeof s&&Xs(e,r,s)&&(r=s=i),e=Na(e),r===i?(r=e,e=0):r=Na(r),function(t,e,i,r){for(var s=-1,o=Yi(Ne((e-t)/(i||1)),0),a=n(o);o--;)a[r?o:++s]=t,t+=i;return a}(e,r,s=s===i?e<r?1:-1:Na(s),t)}}function ys(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=Ua(e),i=Ua(i)),t(e,i)}}function ws(t,e,n,r,s,o,a,l,h,c){var u=e&x;e|=u?y:w,(e&=~(u?w:y))&_||(e&=~(m|b));var f=[t,e,s,u?o:i,u?a:i,u?i:o,u?i:a,l,h,c],d=n.apply(i,f);return Zs(t)&&ro(d,f),d.placeholder=r,ao(d,t,e)}function ks(t){var e=te[t];return function(t,i){if(t=Ua(t),(i=null==i?0:qi(Ha(i),292))&&Xe(t)){var n=(qa(t)+"e").split("e");return+((n=(qa(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var Ms=en&&1/Vi(new en([,-0]))[1]==E?function(t){return new en(t)}:Fl;function Ss(t){return function(e){var i=Hs(e);return i==K?zi(e):i==it?Bi(e):function(t,e){return hi(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ps(t,e,r,s,a,l,h,u){var f=e&b;if(!f&&"function"!=typeof t)throw new re(o);var d=s?s.length:0;if(d||(e&=~(y|w),s=a=i),h=h===i?h:Yi(Ha(h),0),u=u===i?u:Ha(u),d-=a?a.length:0,e&w){var p=s,g=a;s=a=i}var S=f?i:Rs(t),P=[t,e,r,s,a,p,g,l,h,u];if(S&&function(t,e){var i=t[1],n=e[1],r=i|n,s=r<(m|b|k),o=n==k&&i==x||n==k&&i==M&&t[7].length<=e[8]||n==(k|M)&&e[7].length<=e[8]&&i==x;if(!s&&!o)return t;n&m&&(t[2]=e[2],r|=i&m?0:_);var a=e[3];if(a){var l=t[3];t[3]=l?is(l,a,e[4]):a,t[4]=l?ji(t[3],c):e[4]}(a=e[5])&&(l=t[5],t[5]=l?ns(l,a,e[6]):a,t[6]=l?ji(t[5],c):e[6]);(a=e[7])&&(t[7]=a);n&k&&(t[8]=null==t[8]?e[8]:qi(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=r}(P,S),t=P[0],e=P[1],r=P[2],s=P[3],a=P[4],!(u=P[9]=P[9]===i?f?0:t.length:Yi(P[9]-d,0))&&e&(x|v)&&(e&=~(x|v)),e&&e!=m)A=e==x||e==v?function(t,e,r){var s=fs(t);return function o(){for(var a=arguments.length,l=n(a),h=a,c=zs(o);h--;)l[h]=arguments[h];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:ji(l,c);return(a-=u.length)<r?ws(t,e,gs,o.placeholder,i,l,u,i,i,r-a):ei(this&&this!==He&&this instanceof o?s:t,this,l)}}(t,e,u):e!=y&&e!=(m|y)||a.length?gs.apply(i,P):function(t,e,i,r){var s=e&m,o=fs(t);return function e(){for(var a=-1,l=arguments.length,h=-1,c=r.length,u=n(c+l),f=this&&this!==He&&this instanceof e?o:t;++h<c;)u[h]=r[h];for(;l--;)u[h++]=arguments[++a];return ei(f,s?i:this,u)}}(t,e,r,s);else var A=function(t,e,i){var n=e&m,r=fs(t);return function e(){return(this&&this!==He&&this instanceof e?r:t).apply(n?i:this,arguments)}}(t,e,r);return ao((S?Or:ro)(A,P),t,e)}function As(t,e,n,r){return t===i||ga(t,ae[n])&&!ce.call(r,n)?e:t}function Ds(t,e,n,r,s,o){return Oa(t)&&Oa(e)&&(o.set(e,t),br(t,e,i,Ds,o),o.delete(e)),t}function Os(t){return La(t)?i:t}function Cs(t,e,n,r,s,o){var a=n&p,l=t.length,h=e.length;if(l!=h&&!(a&&h>l))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,m=n&g?new kn:i;for(o.set(t,e),o.set(e,t);++f<l;){var b=t[f],_=e[f];if(r)var x=a?r(_,b,f,e,t,o):r(b,_,f,t,e,o);if(x!==i){if(x)continue;d=!1;break}if(m){if(!di(e,(function(t,e){if(!Oi(m,e)&&(b===t||s(b,t,n,r,o)))return m.push(e)}))){d=!1;break}}else if(b!==_&&!s(b,_,n,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function Ts(t){return oo(eo(t,i,vo),t+"")}function Es(t){return Qn(t,ol,Ws)}function Ls(t){return Qn(t,al,Ns)}var Rs=sn?function(t){return sn.get(t)}:Fl;function Is(t){for(var e=t.name+"",i=on[e],n=ce.call(on,e)?i.length:0;n--;){var r=i[n],s=r.func;if(null==s||s==t)return r.name}return e}function zs(t){return(ce.call(gn,"placeholder")?gn:t).placeholder}function Fs(){var t=gn.iteratee||Ll;return t=t===Ll?cr:t,arguments.length?t(arguments[0],arguments[1]):t}function js(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function Vs(t){for(var e=ol(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,Qs(r)]}return e}function Bs(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return hr(n)?n:i}var Ws=Ue?function(t){return null==t?[]:(t=ee(t),oi(Ue(t),(function(e){return ke.call(t,e)})))}:$l,Ns=Ue?function(t){for(var e=[];t;)ci(e,Ws(t)),t=ye(t);return e}:$l,Hs=tr;function $s(t,e,i){for(var n=-1,r=(e=Xr(e,t)).length,s=!1;++n<r;){var o=uo(e[n]);if(!(s=null!=t&&i(t,o)))break;t=t[o]}return s||++n!=r?s:!!(r=null==t?0:t.length)&&Da(r)&&qs(o,r)&&(xa(t)||_a(t))}function Us(t){return"function"!=typeof t.constructor||Js(t)?{}:mn(ye(t))}function Ys(t){return xa(t)||_a(t)||!!(Se&&t&&t[Se])}function qs(t,e){var i=typeof t;return!!(e=null==e?L:e)&&("number"==i||"symbol"!=i&&Xt.test(t))&&t>-1&&t%1==0&&t<e}function Xs(t,e,i){if(!Oa(i))return!1;var n=typeof e;return!!("number"==n?ya(i)&&qs(e,i.length):"string"==n&&e in i)&&ga(i[e],t)}function Ks(t,e){if(xa(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!Fa(t))||(Ct.test(t)||!Ot.test(t)||null!=e&&t in ee(e))}function Zs(t){var e=Is(t),i=gn[e];if("function"!=typeof i||!(e in xn.prototype))return!1;if(t===i)return!0;var n=Rs(i);return!!n&&t===n[0]}(Ji&&Hs(new Ji(new ArrayBuffer(1)))!=ht||Qi&&Hs(new Qi)!=K||tn&&Hs(tn.resolve())!=Q||en&&Hs(new en)!=it||nn&&Hs(new nn)!=ot)&&(Hs=function(t){var e=tr(t),n=e==J?t.constructor:i,r=n?fo(n):"";if(r)switch(r){case an:return ht;case ln:return K;case hn:return Q;case cn:return it;case un:return ot}return e});var Gs=le?Pa:Ul;function Js(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ae)}function Qs(t){return t==t&&!Oa(t)}function to(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==i||t in ee(n)))}}function eo(t,e,r){return e=Yi(e===i?t.length-1:e,0),function(){for(var i=arguments,s=-1,o=Yi(i.length-e,0),a=n(o);++s<o;)a[s]=i[e+s];s=-1;for(var l=n(e+1);++s<e;)l[s]=i[s];return l[e]=r(a),ei(t,this,l)}}function io(t,e){return e.length<2?t:Jn(t,Er(e,0,-1))}function no(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var ro=lo(Or),so=We||function(t,e){return He.setTimeout(t,e)},oo=lo(Cr);function ao(t,e,i){var n=e+"";return oo(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(zt,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return ni(V,(function(i){var n="_."+i[0];e&i[1]&&!ai(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(Ft);return e?e[1].split(jt):[]}(n),i)))}function lo(t){var e=0,n=0;return function(){var r=Xi(),s=O-(r-n);if(n=r,s>0){if(++e>=D)return arguments[0]}else e=0;return t.apply(i,arguments)}}function ho(t,e){var n=-1,r=t.length,s=r-1;for(e=e===i?r:e;++n<e;){var o=kr(n,s),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}var co=function(t){var e=ha(t,(function(t){return i.size===h&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Tt,(function(t,i,n,r){e.push(n?r.replace(Wt,"$1"):i||t)})),e}));function uo(t){if("string"==typeof t||Fa(t))return t;var e=t+"";return"0"==e&&1/t==-E?"-0":e}function fo(t){if(null!=t){try{return he.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function po(t){if(t instanceof xn)return t.clone();var e=new _n(t.__wrapped__,t.__chain__);return e.__actions__=rs(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var go=Sr((function(t,e){return wa(t)?Bn(t,Yn(e,1,wa,!0)):[]})),mo=Sr((function(t,e){var n=So(e);return wa(n)&&(n=i),wa(t)?Bn(t,Yn(e,1,wa,!0),Fs(n,2)):[]})),bo=Sr((function(t,e){var n=So(e);return wa(n)&&(n=i),wa(t)?Bn(t,Yn(e,1,wa,!0),i,n):[]}));function _o(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:Ha(i);return r<0&&(r=Yi(n+r,0)),mi(t,Fs(e,3),r)}function xo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r-1;return n!==i&&(s=Ha(n),s=n<0?Yi(r+s,0):qi(s,r-1)),mi(t,Fs(e,3),s,!0)}function vo(t){return(null==t?0:t.length)?Yn(t,1):[]}function yo(t){return t&&t.length?t[0]:i}var wo=Sr((function(t){var e=hi(t,Yr);return e.length&&e[0]===t[0]?rr(e):[]})),ko=Sr((function(t){var e=So(t),n=hi(t,Yr);return e===So(n)?e=i:n.pop(),n.length&&n[0]===t[0]?rr(n,Fs(e,2)):[]})),Mo=Sr((function(t){var e=So(t),n=hi(t,Yr);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?rr(n,i,e):[]}));function So(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Po=Sr(Ao);function Ao(t,e){return t&&t.length&&e&&e.length?yr(t,e):t}var Do=Ts((function(t,e){var i=null==t?0:t.length,n=In(t,e);return wr(t,hi(e,(function(t){return qs(t,i)?+t:t})).sort(es)),n}));function Oo(t){return null==t?t:Gi.call(t)}var Co=Sr((function(t){return Vr(Yn(t,1,wa,!0))})),To=Sr((function(t){var e=So(t);return wa(e)&&(e=i),Vr(Yn(t,1,wa,!0),Fs(e,2))})),Eo=Sr((function(t){var e=So(t);return e="function"==typeof e?e:i,Vr(Yn(t,1,wa,!0),i,e)}));function Lo(t){if(!t||!t.length)return[];var e=0;return t=oi(t,(function(t){if(wa(t))return e=Yi(t.length,e),!0})),Si(e,(function(e){return hi(t,yi(e))}))}function Ro(t,e){if(!t||!t.length)return[];var n=Lo(t);return null==e?n:hi(n,(function(t){return ei(e,i,t)}))}var Io=Sr((function(t,e){return wa(t)?Bn(t,e):[]})),zo=Sr((function(t){return $r(oi(t,wa))})),Fo=Sr((function(t){var e=So(t);return wa(e)&&(e=i),$r(oi(t,wa),Fs(e,2))})),jo=Sr((function(t){var e=So(t);return e="function"==typeof e?e:i,$r(oi(t,wa),i,e)})),Vo=Sr(Lo);var Bo=Sr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,Ro(t,n)}));function Wo(t){var e=gn(t);return e.__chain__=!0,e}function No(t,e){return e(t)}var Ho=Ts((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,s=function(e){return In(e,t)};return!(e>1||this.__actions__.length)&&r instanceof xn&&qs(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:No,args:[s],thisArg:i}),new _n(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(s)}));var $o=os((function(t,e,i){ce.call(t,i)?++t[i]:Rn(t,i,1)}));var Uo=ds(_o),Yo=ds(xo);function qo(t,e){return(xa(t)?ni:Wn)(t,Fs(e,3))}function Xo(t,e){return(xa(t)?ri:Nn)(t,Fs(e,3))}var Ko=os((function(t,e,i){ce.call(t,i)?t[i].push(e):Rn(t,i,[e])}));var Zo=Sr((function(t,e,i){var r=-1,s="function"==typeof e,o=ya(t)?n(t.length):[];return Wn(t,(function(t){o[++r]=s?ei(e,t,i):sr(t,e,i)})),o})),Go=os((function(t,e,i){Rn(t,i,e)}));function Jo(t,e){return(xa(t)?hi:pr)(t,Fs(e,3))}var Qo=os((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]}));var ta=Sr((function(t,e){if(null==t)return[];var i=e.length;return i>1&&Xs(t,e[0],e[1])?e=[]:i>2&&Xs(e[0],e[1],e[2])&&(e=[e[0]]),xr(t,Yn(e,1),[])})),ea=je||function(){return He.Date.now()};function ia(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ps(t,k,i,i,i,i,e)}function na(t,e){var n;if("function"!=typeof e)throw new re(o);return t=Ha(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var ra=Sr((function(t,e,i){var n=m;if(i.length){var r=ji(i,zs(ra));n|=y}return Ps(t,n,e,i,r)})),sa=Sr((function(t,e,i){var n=m|b;if(i.length){var r=ji(i,zs(sa));n|=y}return Ps(e,n,t,i,r)}));function oa(t,e,n){var r,s,a,l,h,c,u=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new re(o);function g(e){var n=r,o=s;return r=s=i,u=e,l=t.apply(o,n)}function m(t){var n=t-c;return c===i||n>=e||n<0||d&&t-u>=a}function b(){var t=ea();if(m(t))return _(t);h=so(b,function(t){var i=e-(t-c);return d?qi(i,a-(t-u)):i}(t))}function _(t){return h=i,p&&r?g(t):(r=s=i,l)}function x(){var t=ea(),n=m(t);if(r=arguments,s=this,c=t,n){if(h===i)return function(t){return u=t,h=so(b,e),f?g(t):l}(c);if(d)return Gr(h),h=so(b,e),g(c)}return h===i&&(h=so(b,e)),l}return e=Ua(e)||0,Oa(n)&&(f=!!n.leading,a=(d="maxWait"in n)?Yi(Ua(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){h!==i&&Gr(h),u=0,r=c=s=h=i},x.flush=function(){return h===i?l:_(ea())},x}var aa=Sr((function(t,e){return Vn(t,1,e)})),la=Sr((function(t,e,i){return Vn(t,Ua(e)||0,i)}));function ha(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new re(o);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(ha.Cache||wn),i}function ca(t){if("function"!=typeof t)throw new re(o);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)}}ha.Cache=wn;var ua=Kr((function(t,e){var i=(e=1==e.length&&xa(e[0])?hi(e[0],Ai(Fs())):hi(Yn(e,1),Ai(Fs()))).length;return Sr((function(n){for(var r=-1,s=qi(n.length,i);++r<s;)n[r]=e[r].call(this,n[r]);return ei(t,this,n)}))})),fa=Sr((function(t,e){var n=ji(e,zs(fa));return Ps(t,y,i,e,n)})),da=Sr((function(t,e){var n=ji(e,zs(da));return Ps(t,w,i,e,n)})),pa=Ts((function(t,e){return Ps(t,M,i,i,i,e)}));function ga(t,e){return t===e||t!=t&&e!=e}var ma=ys(er),ba=ys((function(t,e){return t>=e})),_a=or(function(){return arguments}())?or:function(t){return Ca(t)&&ce.call(t,"callee")&&!ke.call(t,"callee")},xa=n.isArray,va=Ke?Ai(Ke):function(t){return Ca(t)&&tr(t)==lt};function ya(t){return null!=t&&Da(t.length)&&!Pa(t)}function wa(t){return Ca(t)&&ya(t)}var ka=qe||Ul,Ma=Ze?Ai(Ze):function(t){return Ca(t)&&tr(t)==$};function Sa(t){if(!Ca(t))return!1;var e=tr(t);return e==Y||e==U||"string"==typeof t.message&&"string"==typeof t.name&&!La(t)}function Pa(t){if(!Oa(t))return!1;var e=tr(t);return e==q||e==X||e==N||e==tt}function Aa(t){return"number"==typeof t&&t==Ha(t)}function Da(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=L}function Oa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ca(t){return null!=t&&"object"==typeof t}var Ta=Ge?Ai(Ge):function(t){return Ca(t)&&Hs(t)==K};function Ea(t){return"number"==typeof t||Ca(t)&&tr(t)==Z}function La(t){if(!Ca(t)||tr(t)!=J)return!1;var e=ye(t);if(null===e)return!0;var i=ce.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&he.call(i)==pe}var Ra=Je?Ai(Je):function(t){return Ca(t)&&tr(t)==et};var Ia=Qe?Ai(Qe):function(t){return Ca(t)&&Hs(t)==it};function za(t){return"string"==typeof t||!xa(t)&&Ca(t)&&tr(t)==nt}function Fa(t){return"symbol"==typeof t||Ca(t)&&tr(t)==rt}var ja=ti?Ai(ti):function(t){return Ca(t)&&Da(t.length)&&!!ze[tr(t)]};var Va=ys(dr),Ba=ys((function(t,e){return t<=e}));function Wa(t){if(!t)return[];if(ya(t))return za(t)?Ni(t):rs(t);if(Pe&&t[Pe])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Pe]());var e=Hs(t);return(e==K?zi:e==it?Vi:gl)(t)}function Na(t){return t?(t=Ua(t))===E||t===-E?(t<0?-1:1)*R:t==t?t:0:0===t?t:0}function Ha(t){var e=Na(t),i=e%1;return e==e?i?e-i:e:0}function $a(t){return t?zn(Ha(t),0,z):0}function Ua(t){if("number"==typeof t)return t;if(Fa(t))return I;if(Oa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Oa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Pi(t);var i=Ut.test(t);return i||qt.test(t)?Be(t.slice(2),i?2:8):$t.test(t)?I:+t}function Ya(t){return ss(t,al(t))}function qa(t){return null==t?"":jr(t)}var Xa=as((function(t,e){if(Js(e)||ya(e))ss(e,ol(e),t);else for(var i in e)ce.call(e,i)&&Cn(t,i,e[i])})),Ka=as((function(t,e){ss(e,al(e),t)})),Za=as((function(t,e,i,n){ss(e,al(e),t,n)})),Ga=as((function(t,e,i,n){ss(e,ol(e),t,n)})),Ja=Ts(In);var Qa=Sr((function(t,e){t=ee(t);var n=-1,r=e.length,s=r>2?e[2]:i;for(s&&Xs(e[0],e[1],s)&&(r=1);++n<r;)for(var o=e[n],a=al(o),l=-1,h=a.length;++l<h;){var c=a[l],u=t[c];(u===i||ga(u,ae[c])&&!ce.call(t,c))&&(t[c]=o[c])}return t})),tl=Sr((function(t){return t.push(i,Ds),ei(hl,i,t)}));function el(t,e,n){var r=null==t?i:Jn(t,e);return r===i?n:r}function il(t,e){return null!=t&&$s(t,e,nr)}var nl=ms((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),t[e]=i}),Ol(El)),rl=ms((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),ce.call(t,e)?t[e].push(i):t[e]=[i]}),Fs),sl=Sr(sr);function ol(t){return ya(t)?Sn(t):ur(t)}function al(t){return ya(t)?Sn(t,!0):fr(t)}var ll=as((function(t,e,i){br(t,e,i)})),hl=as((function(t,e,i,n){br(t,e,i,n)})),cl=Ts((function(t,e){var i={};if(null==t)return i;var n=!1;e=hi(e,(function(e){return e=Xr(e,t),n||(n=e.length>1),e})),ss(t,Ls(t),i),n&&(i=Fn(i,u|f|d,Os));for(var r=e.length;r--;)Br(i,e[r]);return i}));var ul=Ts((function(t,e){return null==t?{}:function(t,e){return vr(t,e,(function(e,i){return il(t,i)}))}(t,e)}));function fl(t,e){if(null==t)return{};var i=hi(Ls(t),(function(t){return[t]}));return e=Fs(e),vr(t,i,(function(t,i){return e(t,i[0])}))}var dl=Ss(ol),pl=Ss(al);function gl(t){return null==t?[]:Di(t,ol(t))}var ml=us((function(t,e,i){return e=e.toLowerCase(),t+(i?bl(e):e)}));function bl(t){return Sl(qa(t).toLowerCase())}function _l(t){return(t=qa(t))&&t.replace(Kt,Ei).replace(Oe,"")}var xl=us((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),vl=us((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),yl=cs("toLowerCase");var wl=us((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()}));var kl=us((function(t,e,i){return t+(i?" ":"")+Sl(e)}));var Ml=us((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Sl=cs("toUpperCase");function Pl(t,e,n){return t=qa(t),(e=n?i:e)===i?function(t){return Le.test(t)}(t)?function(t){return t.match(Te)||[]}(t):function(t){return t.match(Vt)||[]}(t):t.match(e)||[]}var Al=Sr((function(t,e){try{return ei(t,i,e)}catch(n){return Sa(n)?n:new Jt(n)}})),Dl=Ts((function(t,e){return ni(e,(function(e){e=uo(e),Rn(t,e,ra(t[e],t))})),t}));function Ol(t){return function(){return t}}var Cl=ps(),Tl=ps(!0);function El(t){return t}function Ll(t){return cr("function"==typeof t?t:Fn(t,u))}var Rl=Sr((function(t,e){return function(i){return sr(i,t,e)}})),Il=Sr((function(t,e){return function(i){return sr(t,i,e)}}));function zl(t,e,i){var n=ol(e),r=Gn(e,n);null!=i||Oa(e)&&(r.length||!n.length)||(i=e,e=t,t=this,r=Gn(e,ol(e)));var s=!(Oa(i)&&"chain"in i&&!i.chain),o=Pa(t);return ni(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__);return(i.__actions__=rs(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,ci([this.value()],arguments))})})),t}function Fl(){}var jl=_s(hi),Vl=_s(si),Bl=_s(di);function Wl(t){return Ks(t)?yi(uo(t)):function(t){return function(e){return Jn(e,t)}}(t)}var Nl=vs(),Hl=vs(!0);function $l(){return[]}function Ul(){return!1}var Yl=bs((function(t,e){return t+e}),0),ql=ks("ceil"),Xl=bs((function(t,e){return t/e}),1),Kl=ks("floor");var Zl,Gl=bs((function(t,e){return t*e}),1),Jl=ks("round"),Ql=bs((function(t,e){return t-e}),0);return gn.after=function(t,e){if("function"!=typeof e)throw new re(o);return t=Ha(t),function(){if(--t<1)return e.apply(this,arguments)}},gn.ary=ia,gn.assign=Xa,gn.assignIn=Ka,gn.assignInWith=Za,gn.assignWith=Ga,gn.at=Ja,gn.before=na,gn.bind=ra,gn.bindAll=Dl,gn.bindKey=sa,gn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return xa(t)?t:[t]},gn.chain=Wo,gn.chunk=function(t,e,r){e=(r?Xs(t,e,r):e===i)?1:Yi(Ha(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=n(Ne(s/e));o<s;)l[a++]=Er(t,o,o+=e);return l},gn.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,r=[];++e<i;){var s=t[e];s&&(r[n++]=s)}return r},gn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=n(t-1),i=arguments[0],r=t;r--;)e[r-1]=arguments[r];return ci(xa(i)?rs(i):[i],Yn(e,1))},gn.cond=function(t){var e=null==t?0:t.length,i=Fs();return t=e?hi(t,(function(t){if("function"!=typeof t[1])throw new re(o);return[i(t[0]),t[1]]})):[],Sr((function(i){for(var n=-1;++n<e;){var r=t[n];if(ei(r[0],this,i))return ei(r[1],this,i)}}))},gn.conforms=function(t){return function(t){var e=ol(t);return function(i){return jn(i,t,e)}}(Fn(t,u))},gn.constant=Ol,gn.countBy=$o,gn.create=function(t,e){var i=mn(t);return null==e?i:Ln(i,e)},gn.curry=function t(e,n,r){var s=Ps(e,x,i,i,i,i,i,n=r?i:n);return s.placeholder=t.placeholder,s},gn.curryRight=function t(e,n,r){var s=Ps(e,v,i,i,i,i,i,n=r?i:n);return s.placeholder=t.placeholder,s},gn.debounce=oa,gn.defaults=Qa,gn.defaultsDeep=tl,gn.defer=aa,gn.delay=la,gn.difference=go,gn.differenceBy=mo,gn.differenceWith=bo,gn.drop=function(t,e,n){var r=null==t?0:t.length;return r?Er(t,(e=n||e===i?1:Ha(e))<0?0:e,r):[]},gn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Er(t,0,(e=r-(e=n||e===i?1:Ha(e)))<0?0:e):[]},gn.dropRightWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3),!0,!0):[]},gn.dropWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3),!0):[]},gn.fill=function(t,e,n,r){var s=null==t?0:t.length;return s?(n&&"number"!=typeof n&&Xs(t,e,n)&&(n=0,r=s),function(t,e,n,r){var s=t.length;for((n=Ha(n))<0&&(n=-n>s?0:s+n),(r=r===i||r>s?s:Ha(r))<0&&(r+=s),r=n>r?0:$a(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},gn.filter=function(t,e){return(xa(t)?oi:Un)(t,Fs(e,3))},gn.flatMap=function(t,e){return Yn(Jo(t,e),1)},gn.flatMapDeep=function(t,e){return Yn(Jo(t,e),E)},gn.flatMapDepth=function(t,e,n){return n=n===i?1:Ha(n),Yn(Jo(t,e),n)},gn.flatten=vo,gn.flattenDeep=function(t){return(null==t?0:t.length)?Yn(t,E):[]},gn.flattenDepth=function(t,e){return(null==t?0:t.length)?Yn(t,e=e===i?1:Ha(e)):[]},gn.flip=function(t){return Ps(t,S)},gn.flow=Cl,gn.flowRight=Tl,gn.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var r=t[e];n[r[0]]=r[1]}return n},gn.functions=function(t){return null==t?[]:Gn(t,ol(t))},gn.functionsIn=function(t){return null==t?[]:Gn(t,al(t))},gn.groupBy=Ko,gn.initial=function(t){return(null==t?0:t.length)?Er(t,0,-1):[]},gn.intersection=wo,gn.intersectionBy=ko,gn.intersectionWith=Mo,gn.invert=nl,gn.invertBy=rl,gn.invokeMap=Zo,gn.iteratee=Ll,gn.keyBy=Go,gn.keys=ol,gn.keysIn=al,gn.map=Jo,gn.mapKeys=function(t,e){var i={};return e=Fs(e,3),Kn(t,(function(t,n,r){Rn(i,e(t,n,r),t)})),i},gn.mapValues=function(t,e){var i={};return e=Fs(e,3),Kn(t,(function(t,n,r){Rn(i,n,e(t,n,r))})),i},gn.matches=function(t){return gr(Fn(t,u))},gn.matchesProperty=function(t,e){return mr(t,Fn(e,u))},gn.memoize=ha,gn.merge=ll,gn.mergeWith=hl,gn.method=Rl,gn.methodOf=Il,gn.mixin=zl,gn.negate=ca,gn.nthArg=function(t){return t=Ha(t),Sr((function(e){return _r(e,t)}))},gn.omit=cl,gn.omitBy=function(t,e){return fl(t,ca(Fs(e)))},gn.once=function(t){return na(2,t)},gn.orderBy=function(t,e,n,r){return null==t?[]:(xa(e)||(e=null==e?[]:[e]),xa(n=r?i:n)||(n=null==n?[]:[n]),xr(t,e,n))},gn.over=jl,gn.overArgs=ua,gn.overEvery=Vl,gn.overSome=Bl,gn.partial=fa,gn.partialRight=da,gn.partition=Qo,gn.pick=ul,gn.pickBy=fl,gn.property=Wl,gn.propertyOf=function(t){return function(e){return null==t?i:Jn(t,e)}},gn.pull=Po,gn.pullAll=Ao,gn.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?yr(t,e,Fs(i,2)):t},gn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?yr(t,e,i,n):t},gn.pullAt=Do,gn.range=Nl,gn.rangeRight=Hl,gn.rearg=pa,gn.reject=function(t,e){return(xa(t)?oi:Un)(t,ca(Fs(e,3)))},gn.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,r=[],s=t.length;for(e=Fs(e,3);++n<s;){var o=t[n];e(o,n,t)&&(i.push(o),r.push(n))}return wr(t,r),i},gn.rest=function(t,e){if("function"!=typeof t)throw new re(o);return Sr(t,e=e===i?e:Ha(e))},gn.reverse=Oo,gn.sampleSize=function(t,e,n){return e=(n?Xs(t,e,n):e===i)?1:Ha(e),(xa(t)?An:Ar)(t,e)},gn.set=function(t,e,i){return null==t?t:Dr(t,e,i)},gn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Dr(t,e,n,r)},gn.shuffle=function(t){return(xa(t)?Dn:Tr)(t)},gn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Xs(t,e,n)?(e=0,n=r):(e=null==e?0:Ha(e),n=n===i?r:Ha(n)),Er(t,e,n)):[]},gn.sortBy=ta,gn.sortedUniq=function(t){return t&&t.length?zr(t):[]},gn.sortedUniqBy=function(t,e){return t&&t.length?zr(t,Fs(e,2)):[]},gn.split=function(t,e,n){return n&&"number"!=typeof n&&Xs(t,e,n)&&(e=n=i),(n=n===i?z:n>>>0)?(t=qa(t))&&("string"==typeof e||null!=e&&!Ra(e))&&!(e=jr(e))&&Ii(t)?Zr(Ni(t),0,n):t.split(e,n):[]},gn.spread=function(t,e){if("function"!=typeof t)throw new re(o);return e=null==e?0:Yi(Ha(e),0),Sr((function(i){var n=i[e],r=Zr(i,0,e);return n&&ci(r,n),ei(t,this,r)}))},gn.tail=function(t){var e=null==t?0:t.length;return e?Er(t,1,e):[]},gn.take=function(t,e,n){return t&&t.length?Er(t,0,(e=n||e===i?1:Ha(e))<0?0:e):[]},gn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Er(t,(e=r-(e=n||e===i?1:Ha(e)))<0?0:e,r):[]},gn.takeRightWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3),!1,!0):[]},gn.takeWhile=function(t,e){return t&&t.length?Nr(t,Fs(e,3)):[]},gn.tap=function(t,e){return e(t),t},gn.throttle=function(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new re(o);return Oa(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),oa(t,e,{leading:n,maxWait:e,trailing:r})},gn.thru=No,gn.toArray=Wa,gn.toPairs=dl,gn.toPairsIn=pl,gn.toPath=function(t){return xa(t)?hi(t,uo):Fa(t)?[t]:rs(co(qa(t)))},gn.toPlainObject=Ya,gn.transform=function(t,e,i){var n=xa(t),r=n||ka(t)||ja(t);if(e=Fs(e,4),null==i){var s=t&&t.constructor;i=r?n?new s:[]:Oa(t)&&Pa(s)?mn(ye(t)):{}}return(r?ni:Kn)(t,(function(t,n,r){return e(i,t,n,r)})),i},gn.unary=function(t){return ia(t,1)},gn.union=Co,gn.unionBy=To,gn.unionWith=Eo,gn.uniq=function(t){return t&&t.length?Vr(t):[]},gn.uniqBy=function(t,e){return t&&t.length?Vr(t,Fs(e,2)):[]},gn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?Vr(t,i,e):[]},gn.unset=function(t,e){return null==t||Br(t,e)},gn.unzip=Lo,gn.unzipWith=Ro,gn.update=function(t,e,i){return null==t?t:Wr(t,e,qr(i))},gn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Wr(t,e,qr(n),r)},gn.values=gl,gn.valuesIn=function(t){return null==t?[]:Di(t,al(t))},gn.without=Io,gn.words=Pl,gn.wrap=function(t,e){return fa(qr(e),t)},gn.xor=zo,gn.xorBy=Fo,gn.xorWith=jo,gn.zip=Vo,gn.zipObject=function(t,e){return Ur(t||[],e||[],Cn)},gn.zipObjectDeep=function(t,e){return Ur(t||[],e||[],Dr)},gn.zipWith=Bo,gn.entries=dl,gn.entriesIn=pl,gn.extend=Ka,gn.extendWith=Za,zl(gn,gn),gn.add=Yl,gn.attempt=Al,gn.camelCase=ml,gn.capitalize=bl,gn.ceil=ql,gn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=Ua(n))==n?n:0),e!==i&&(e=(e=Ua(e))==e?e:0),zn(Ua(t),e,n)},gn.clone=function(t){return Fn(t,d)},gn.cloneDeep=function(t){return Fn(t,u|d)},gn.cloneDeepWith=function(t,e){return Fn(t,u|d,e="function"==typeof e?e:i)},gn.cloneWith=function(t,e){return Fn(t,d,e="function"==typeof e?e:i)},gn.conformsTo=function(t,e){return null==e||jn(t,e,ol(e))},gn.deburr=_l,gn.defaultTo=function(t,e){return null==t||t!=t?e:t},gn.divide=Xl,gn.endsWith=function(t,e,n){t=qa(t),e=jr(e);var r=t.length,s=n=n===i?r:zn(Ha(n),0,r);return(n-=e.length)>=0&&t.slice(n,s)==e},gn.eq=ga,gn.escape=function(t){return(t=qa(t))&&St.test(t)?t.replace(kt,Li):t},gn.escapeRegExp=function(t){return(t=qa(t))&&Lt.test(t)?t.replace(Et,"\\$&"):t},gn.every=function(t,e,n){var r=xa(t)?si:Hn;return n&&Xs(t,e,n)&&(e=i),r(t,Fs(e,3))},gn.find=Uo,gn.findIndex=_o,gn.findKey=function(t,e){return gi(t,Fs(e,3),Kn)},gn.findLast=Yo,gn.findLastIndex=xo,gn.findLastKey=function(t,e){return gi(t,Fs(e,3),Zn)},gn.floor=Kl,gn.forEach=qo,gn.forEachRight=Xo,gn.forIn=function(t,e){return null==t?t:qn(t,Fs(e,3),al)},gn.forInRight=function(t,e){return null==t?t:Xn(t,Fs(e,3),al)},gn.forOwn=function(t,e){return t&&Kn(t,Fs(e,3))},gn.forOwnRight=function(t,e){return t&&Zn(t,Fs(e,3))},gn.get=el,gn.gt=ma,gn.gte=ba,gn.has=function(t,e){return null!=t&&$s(t,e,ir)},gn.hasIn=il,gn.head=yo,gn.identity=El,gn.includes=function(t,e,i,n){t=ya(t)?t:gl(t),i=i&&!n?Ha(i):0;var r=t.length;return i<0&&(i=Yi(r+i,0)),za(t)?i<=r&&t.indexOf(e,i)>-1:!!r&&bi(t,e,i)>-1},gn.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:Ha(i);return r<0&&(r=Yi(n+r,0)),bi(t,e,r)},gn.inRange=function(t,e,n){return e=Na(e),n===i?(n=e,e=0):n=Na(n),function(t,e,i){return t>=qi(e,i)&&t<Yi(e,i)}(t=Ua(t),e,n)},gn.invoke=sl,gn.isArguments=_a,gn.isArray=xa,gn.isArrayBuffer=va,gn.isArrayLike=ya,gn.isArrayLikeObject=wa,gn.isBoolean=function(t){return!0===t||!1===t||Ca(t)&&tr(t)==H},gn.isBuffer=ka,gn.isDate=Ma,gn.isElement=function(t){return Ca(t)&&1===t.nodeType&&!La(t)},gn.isEmpty=function(t){if(null==t)return!0;if(ya(t)&&(xa(t)||"string"==typeof t||"function"==typeof t.splice||ka(t)||ja(t)||_a(t)))return!t.length;var e=Hs(t);if(e==K||e==it)return!t.size;if(Js(t))return!ur(t).length;for(var i in t)if(ce.call(t,i))return!1;return!0},gn.isEqual=function(t,e){return ar(t,e)},gn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?ar(t,e,i,n):!!r},gn.isError=Sa,gn.isFinite=function(t){return"number"==typeof t&&Xe(t)},gn.isFunction=Pa,gn.isInteger=Aa,gn.isLength=Da,gn.isMap=Ta,gn.isMatch=function(t,e){return t===e||lr(t,e,Vs(e))},gn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,lr(t,e,Vs(e),n)},gn.isNaN=function(t){return Ea(t)&&t!=+t},gn.isNative=function(t){if(Gs(t))throw new Jt(s);return hr(t)},gn.isNil=function(t){return null==t},gn.isNull=function(t){return null===t},gn.isNumber=Ea,gn.isObject=Oa,gn.isObjectLike=Ca,gn.isPlainObject=La,gn.isRegExp=Ra,gn.isSafeInteger=function(t){return Aa(t)&&t>=-L&&t<=L},gn.isSet=Ia,gn.isString=za,gn.isSymbol=Fa,gn.isTypedArray=ja,gn.isUndefined=function(t){return t===i},gn.isWeakMap=function(t){return Ca(t)&&Hs(t)==ot},gn.isWeakSet=function(t){return Ca(t)&&tr(t)==at},gn.join=function(t,e){return null==t?"":pi.call(t,e)},gn.kebabCase=xl,gn.last=So,gn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r;return n!==i&&(s=(s=Ha(n))<0?Yi(r+s,0):qi(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):mi(t,xi,s,!0)},gn.lowerCase=vl,gn.lowerFirst=yl,gn.lt=Va,gn.lte=Ba,gn.max=function(t){return t&&t.length?$n(t,El,er):i},gn.maxBy=function(t,e){return t&&t.length?$n(t,Fs(e,2),er):i},gn.mean=function(t){return vi(t,El)},gn.meanBy=function(t,e){return vi(t,Fs(e,2))},gn.min=function(t){return t&&t.length?$n(t,El,dr):i},gn.minBy=function(t,e){return t&&t.length?$n(t,Fs(e,2),dr):i},gn.stubArray=$l,gn.stubFalse=Ul,gn.stubObject=function(){return{}},gn.stubString=function(){return""},gn.stubTrue=function(){return!0},gn.multiply=Gl,gn.nth=function(t,e){return t&&t.length?_r(t,Ha(e)):i},gn.noConflict=function(){return He._===this&&(He._=ge),this},gn.noop=Fl,gn.now=ea,gn.pad=function(t,e,i){t=qa(t);var n=(e=Ha(e))?Wi(t):0;if(!e||n>=e)return t;var r=(e-n)/2;return xs($e(r),i)+t+xs(Ne(r),i)},gn.padEnd=function(t,e,i){t=qa(t);var n=(e=Ha(e))?Wi(t):0;return e&&n<e?t+xs(e-n,i):t},gn.padStart=function(t,e,i){t=qa(t);var n=(e=Ha(e))?Wi(t):0;return e&&n<e?xs(e-n,i)+t:t},gn.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),Ki(qa(t).replace(Rt,""),e||0)},gn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&Xs(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=Na(t),e===i?(e=t,t=0):e=Na(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var s=Zi();return qi(t+s*(e-t+Ve("1e-"+((s+"").length-1))),e)}return kr(t,e)},gn.reduce=function(t,e,i){var n=xa(t)?ui:ki,r=arguments.length<3;return n(t,Fs(e,4),i,r,Wn)},gn.reduceRight=function(t,e,i){var n=xa(t)?fi:ki,r=arguments.length<3;return n(t,Fs(e,4),i,r,Nn)},gn.repeat=function(t,e,n){return e=(n?Xs(t,e,n):e===i)?1:Ha(e),Mr(qa(t),e)},gn.replace=function(){var t=arguments,e=qa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},gn.result=function(t,e,n){var r=-1,s=(e=Xr(e,t)).length;for(s||(s=1,t=i);++r<s;){var o=null==t?i:t[uo(e[r])];o===i&&(r=s,o=n),t=Pa(o)?o.call(t):o}return t},gn.round=Jl,gn.runInContext=t,gn.sample=function(t){return(xa(t)?Pn:Pr)(t)},gn.size=function(t){if(null==t)return 0;if(ya(t))return za(t)?Wi(t):t.length;var e=Hs(t);return e==K||e==it?t.size:ur(t).length},gn.snakeCase=wl,gn.some=function(t,e,n){var r=xa(t)?di:Lr;return n&&Xs(t,e,n)&&(e=i),r(t,Fs(e,3))},gn.sortedIndex=function(t,e){return Rr(t,e)},gn.sortedIndexBy=function(t,e,i){return Ir(t,e,Fs(i,2))},gn.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=Rr(t,e);if(n<i&&ga(t[n],e))return n}return-1},gn.sortedLastIndex=function(t,e){return Rr(t,e,!0)},gn.sortedLastIndexBy=function(t,e,i){return Ir(t,e,Fs(i,2),!0)},gn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var i=Rr(t,e,!0)-1;if(ga(t[i],e))return i}return-1},gn.startCase=kl,gn.startsWith=function(t,e,i){return t=qa(t),i=null==i?0:zn(Ha(i),0,t.length),e=jr(e),t.slice(i,i+e.length)==e},gn.subtract=Ql,gn.sum=function(t){return t&&t.length?Mi(t,El):0},gn.sumBy=function(t,e){return t&&t.length?Mi(t,Fs(e,2)):0},gn.template=function(t,e,n){var r=gn.templateSettings;n&&Xs(t,e,n)&&(e=i),t=qa(t),e=Za({},e,r,As);var s,o,l=Za({},e.imports,r.imports,As),h=ol(l),c=Di(l,h),u=0,f=e.interpolate||Zt,d="__p += '",p=ie((e.escape||Zt).source+"|"+f.source+"|"+(f===Dt?Nt:Zt).source+"|"+(e.evaluate||Zt).source+"|$","g"),g="//# sourceURL="+(ce.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ie+"]")+"\n";t.replace(p,(function(e,i,n,r,a,l){return n||(n=r),d+=t.slice(u,l).replace(Gt,Ri),i&&(s=!0,d+="' +\n__e("+i+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),d+="';\n";var m=ce.call(e,"variable")&&e.variable;if(m){if(Bt.test(m))throw new Jt(a)}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(xt,""):d).replace(vt,"$1").replace(yt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var b=Al((function(){return Qt(h,g+"return "+d).apply(i,c)}));if(b.source=d,Sa(b))throw b;return b},gn.times=function(t,e){if((t=Ha(t))<1||t>L)return[];var i=z,n=qi(t,z);e=Fs(e),t-=z;for(var r=Si(n,e);++i<t;)e(i);return r},gn.toFinite=Na,gn.toInteger=Ha,gn.toLength=$a,gn.toLower=function(t){return qa(t).toLowerCase()},gn.toNumber=Ua,gn.toSafeInteger=function(t){return t?zn(Ha(t),-L,L):0===t?t:0},gn.toString=qa,gn.toUpper=function(t){return qa(t).toUpperCase()},gn.trim=function(t,e,n){if((t=qa(t))&&(n||e===i))return Pi(t);if(!t||!(e=jr(e)))return t;var r=Ni(t),s=Ni(e);return Zr(r,Ci(r,s),Ti(r,s)+1).join("")},gn.trimEnd=function(t,e,n){if((t=qa(t))&&(n||e===i))return t.slice(0,Hi(t)+1);if(!t||!(e=jr(e)))return t;var r=Ni(t);return Zr(r,0,Ti(r,Ni(e))+1).join("")},gn.trimStart=function(t,e,n){if((t=qa(t))&&(n||e===i))return t.replace(Rt,"");if(!t||!(e=jr(e)))return t;var r=Ni(t);return Zr(r,Ci(r,Ni(e))).join("")},gn.truncate=function(t,e){var n=P,r=A;if(Oa(e)){var s="separator"in e?e.separator:s;n="length"in e?Ha(e.length):n,r="omission"in e?jr(e.omission):r}var o=(t=qa(t)).length;if(Ii(t)){var a=Ni(t);o=a.length}if(n>=o)return t;var l=n-Wi(r);if(l<1)return r;var h=a?Zr(a,0,l).join(""):t.slice(0,l);if(s===i)return h+r;if(a&&(l+=h.length-l),Ra(s)){if(t.slice(l).search(s)){var c,u=h;for(s.global||(s=ie(s.source,qa(Ht.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(jr(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+r},gn.unescape=function(t){return(t=qa(t))&&Mt.test(t)?t.replace(wt,$i):t},gn.uniqueId=function(t){var e=++ue;return qa(t)+e},gn.upperCase=Ml,gn.upperFirst=Sl,gn.each=qo,gn.eachRight=Xo,gn.first=yo,zl(gn,(Zl={},Kn(gn,(function(t,e){ce.call(gn.prototype,e)||(Zl[e]=t)})),Zl),{chain:!1}),gn.VERSION="4.17.21",ni(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){gn[t].placeholder=gn})),ni(["drop","take"],(function(t,e){xn.prototype[t]=function(n){n=n===i?1:Yi(Ha(n),0);var r=this.__filtered__&&!e?new xn(this):this.clone();return r.__filtered__?r.__takeCount__=qi(n,r.__takeCount__):r.__views__.push({size:qi(n,z),type:t+(r.__dir__<0?"Right":"")}),r},xn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ni(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=i==C||3==i;xn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Fs(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),ni(["head","last"],(function(t,e){var i="take"+(e?"Right":"");xn.prototype[t]=function(){return this[i](1).value()[0]}})),ni(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");xn.prototype[t]=function(){return this.__filtered__?new xn(this):this[i](1)}})),xn.prototype.compact=function(){return this.filter(El)},xn.prototype.find=function(t){return this.filter(t).head()},xn.prototype.findLast=function(t){return this.reverse().find(t)},xn.prototype.invokeMap=Sr((function(t,e){return"function"==typeof t?new xn(this):this.map((function(i){return sr(i,t,e)}))})),xn.prototype.reject=function(t){return this.filter(ca(Fs(t)))},xn.prototype.slice=function(t,e){t=Ha(t);var n=this;return n.__filtered__&&(t>0||e<0)?new xn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=Ha(e))<0?n.dropRight(-e):n.take(e-t)),n)},xn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},xn.prototype.toArray=function(){return this.take(z)},Kn(xn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=gn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(gn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof xn,h=a[0],c=l||xa(e),u=function(t){var e=s.apply(gn,ci([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 xn(this);var m=t.apply(e,a);return m.__actions__.push({func:No,args:[u],thisArg:i}),new _n(m,f)}return p&&g?t.apply(this,a):(m=this.thru(u),p?r?m.value()[0]:m.value():m)})})),ni(["pop","push","shift","sort","splice","unshift"],(function(t){var e=se[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);gn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var r=this.value();return e.apply(xa(r)?r:[],t)}return this[i]((function(i){return e.apply(xa(i)?i:[],t)}))}})),Kn(xn.prototype,(function(t,e){var i=gn[e];if(i){var n=i.name+"";ce.call(on,n)||(on[n]=[]),on[n].push({name:e,func:i})}})),on[gs(i,b).name]=[{name:"wrapper",func:i}],xn.prototype.clone=function(){var t=new xn(this.__wrapped__);return t.__actions__=rs(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=rs(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=rs(this.__views__),t},xn.prototype.reverse=function(){if(this.__filtered__){var t=new xn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},xn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=xa(t),n=e<0,r=i?t.length:0,s=function(t,e,i){var n=-1,r=i.length;for(;++n<r;){var s=i[n],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=qi(e,t+o);break;case"takeRight":t=Yi(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,l=a-o,h=n?a:o-1,c=this.__iteratees__,u=c.length,f=0,d=qi(l,this.__takeCount__);if(!i||!n&&r==l&&d==l)return Hr(t,this.__actions__);var p=[];t:for(;l--&&f<d;){for(var g=-1,m=t[h+=e];++g<u;){var b=c[g],_=b.iteratee,x=b.type,v=_(m);if(x==T)m=v;else if(!v){if(x==C)continue t;break t}}p[f++]=m}return p},gn.prototype.at=Ho,gn.prototype.chain=function(){return Wo(this)},gn.prototype.commit=function(){return new _n(this.value(),this.__chain__)},gn.prototype.next=function(){this.__values__===i&&(this.__values__=Wa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},gn.prototype.plant=function(t){for(var e,n=this;n instanceof bn;){var r=po(n);r.__index__=0,r.__values__=i,e?s.__wrapped__=r:e=r;var s=r;n=n.__wrapped__}return s.__wrapped__=t,e},gn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof xn){var e=t;return this.__actions__.length&&(e=new xn(this)),(e=e.reverse()).__actions__.push({func:No,args:[Oo],thisArg:i}),new _n(e,this.__chain__)}return this.thru(Oo)},gn.prototype.toJSON=gn.prototype.valueOf=gn.prototype.value=function(){return Hr(this.__wrapped__,this.__actions__)},gn.prototype.first=gn.prototype.head,Pe&&(gn.prototype[Pe]=function(){return this}),gn}();Ue?((Ue.exports=Ui)._=Ui,$e._=Ui):He._=Ui}).call(n)}(b,b.exports);const x=(t,e,i)=>Math.max(Math.min(t,i),e);function v(t){return x(_(2.55*t),0,255)}function y(t){return x(_(255*t),0,255)}function w(t){return x(_(t/2.55)/100,0,1)}function k(t){return x(_(100*t),0,100)}const M={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},S=[..."0123456789ABCDEF"],P=t=>S[15&t],A=t=>S[(240&t)>>4]+S[15&t],D=t=>(240&t)>>4==(15&t),O=t=>D(t.r)&&D(t.g)&&D(t.b)&&D(t.a);const C=(t,e)=>t<255?e(t):"";const T=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function E(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 L(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 R(t,e,i){const n=E(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 I(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<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(e,i,n,h,r),a=60*a+.5),[0|a,l||0,o]}function z(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(y)}function F(t,e,i){return z(E,t,e,i)}function j(t){return(t%360+360)%360}function V(t){const e=T.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?v(+e[5]):y(+e[5]));const r=j(+e[2]),s=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return z(R,t,e,i)}(r,s,o):"hsv"===e[1]?function(t,e,i){return z(L,t,e,i)}(r,s,o):F(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}const B={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},W={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let N;function H(t){N||(N=function(){const t={},e=Object.keys(W),i=Object.keys(B);let n,r,s,o,a;for(n=0;n<e.length;n++){for(o=a=e[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,B[s]);s=parseInt(W[o],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}(),N.transparent=[0,0,0,0]);const e=N[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const $=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const U=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Y=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function q(t,e,i){if(t){let n=I(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=F(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function X(t,e){return t?Object.assign(e||{},t):t}function K(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=y(t[3]))):(e=X(t,{r:0,g:0,b:0,a:1})).a=y(e.a),e}function Z(t){return"r"===t.charAt(0)?function(t){const e=$.exec(t);let i,n,r,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?v(t):x(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?v(i):x(i,0,255)),n=255&(e[4]?v(n):x(n,0,255)),r=255&(e[6]?v(r):x(r,0,255)),{r:i,g:n,b:r,a:s}}}(t):V(t)}class G{constructor(t){if(t instanceof G)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=K(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*M[n[1]],g:255&17*M[n[2]],b:255&17*M[n[3]],a:5===s?17*M[n[4]]:255}:7!==s&&9!==s||(r={r:M[n[1]]<<4|M[n[2]],g:M[n[3]]<<4|M[n[4]],b:M[n[5]]<<4|M[n[6]],a:9===s?M[n[7]]<<4|M[n[8]]:255})),i=r||H(t)||Z(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=X(this._rgb);return t&&(t.a=w(t.a)),t}set rgb(t){this._rgb=K(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${w(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=O(t)?P:A,t?"#"+e(t.r)+e(t.g)+e(t.b)+C(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=I(t),i=e[0],n=k(e[1]),r=k(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${w(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=Y(w(t.r)),r=Y(w(t.g)),s=Y(w(t.b));return{r:y(U(n+i*(Y(w(e.r))-n))),g:y(U(r+i*(Y(w(e.g))-r))),b:y(U(s+i*(Y(w(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new G(this.rgb)}alpha(t){return this._rgb.a=y(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=_(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return q(this._rgb,2,t),this}darken(t){return q(this._rgb,2,-t),this}saturate(t){return q(this._rgb,1,t),this}desaturate(t){return q(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=I(t);i[0]=j(i[0]+e),i=F(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}
/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function J(){}const Q=(()=>{let t=0;return()=>t++})();function tt(t){return null==t}function et(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 it(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function nt(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function rt(t,e){return nt(t)?t:e}function st(t,e){return void 0===t?e:t}const ot=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function at(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function lt(t,e,i,n){let r,s,o;if(et(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(it(t))for(o=Object.keys(t),s=o.length,r=0;r<s;r++)e.call(i,t[o[r]],o[r])}function ht(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function ct(t){if(et(t))return t.map(ct);if(it(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let r=0;for(;r<n;++r)e[i[r]]=ct(t[i[r]]);return e}return t}function ut(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ft(t,e,i,n){if(!ut(t))return;const r=e[t],s=i[t];it(r)&&it(s)?dt(r,s,n):e[t]=ct(s)}function dt(t,e,i){const n=et(e)?e:[e],r=n.length;if(!it(t))return t;const s=(i=i||{}).merger||ft;let o;for(let a=0;a<r;++a){if(o=n[a],!it(o))continue;const e=Object.keys(o);for(let n=0,r=e.length;n<r;++n)s(e[n],t,o,i)}return t}function pt(t,e){return dt(t,e,{merger:gt})}function gt(t,e,i){if(!ut(t))return;const n=e[t],r=i[t];it(n)&&it(r)?pt(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ct(r))}const mt={"":t=>t,x:t=>t.x,y:t=>t.y};function bt(t,e){const i=mt[e]||(mt[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 _t(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xt=t=>void 0!==t,vt=t=>"function"==typeof t,yt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const wt=Math.PI,kt=2*wt,Mt=kt+wt,St=Number.POSITIVE_INFINITY,Pt=wt/180,At=wt/2,Dt=wt/4,Ot=2*wt/3,Ct=Math.log10,Tt=Math.sign;function Et(t,e,i){return Math.abs(t-e)<i}function Lt(t){const e=Math.round(t);t=Et(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Ct(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Rt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function It(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function zt(t){return t*(wt/180)}function Ft(t){return t*(180/wt)}function jt(t){if(!nt(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Vt(t,e){const i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*wt&&(s+=kt),{angle:s,distance:r}}function Bt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Wt(t,e){return(t-e+Mt)%kt-wt}function Nt(t){return(t%kt+kt)%kt}function Ht(t,e,i,n){const r=Nt(t),s=Nt(e),o=Nt(i),a=Nt(s-r),l=Nt(o-r),h=Nt(r-s),c=Nt(r-o);return r===s||r===o||n&&s===o||a>l&&h<c}function $t(t,e,i){return Math.max(e,Math.min(i,t))}function Ut(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Yt(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const qt=(t,e,i,n)=>Yt(t,i,n?n=>{const r=t[n][e];return r<i||r===i&&t[n+1][e]===i}:n=>t[n][e]<i),Xt=(t,e,i)=>Yt(t,i,(n=>t[n][e]>=i));const Kt=["push","pop","shift","splice","unshift"];function Zt(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||(Kt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Gt(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}const Jt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Qt(t,e){let i=[],n=!1;return function(...r){i=r,n||(n=!0,Jt.call(window,(()=>{n=!1,t.apply(e,i)})))}}const te=t=>"start"===t?"left":"end"===t?"right":"center",ee=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function ie(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=$t(Math.min(qt(a,o.axis,h).lo,i?n:qt(e,l,o.getPixelForValue(h)).lo),0,n-1)),s=f?$t(Math.max(qt(a,o.axis,c,!0).hi+1,i?0:qt(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function ne(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 re=t=>0===t||1===t,se=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*kt/i),oe=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*kt/i)+1,ae={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*At),easeOutSine:t=>Math.sin(t*At),easeInOutSine:t=>-.5*(Math.cos(wt*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=>re(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=>re(t)?t:se(t,.075,.3),easeOutElastic:t=>re(t)?t:oe(t,.075,.3),easeInOutElastic(t){const e=.1125;return re(t)?t:t<.5?.5*se(2*t,e,.45):.5+.5*oe(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ae.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*ae.easeInBounce(2*t):.5*ae.easeOutBounce(2*t-1)+.5};function le(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function he(t){return le(t)?t:new G(t)}function ce(t){return le(t)?t:new G(t).saturate(.5).darken(.1).hexString()}const ue=["x","y","borderWidth","radius","tension"],fe=["color","borderColor","backgroundColor"];const de=new Map;function pe(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=de.get(i);return n||(n=new Intl.NumberFormat(t,e),de.set(i,n)),n}(e,i).format(t)}const ge={values:t=>et(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=Ct(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),pe(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(Ct(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?ge.numeric.call(this,t,e,i):""}};var me={formatters:ge};const be=Object.create(null),_e=Object.create(null);function xe(t,e){if(!e)return t;const i=e.split(".");for(let n=0,r=i.length;n<r;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function ve(t,e,i){return"string"==typeof e?dt(xe(t,e),i):dt(xe(t,""),e)}class ye{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>ce(e.backgroundColor),this.hoverBorderColor=(t,e)=>ce(e.borderColor),this.hoverColor=(t,e)=>ce(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ve(this,t,e)}get(t){return xe(this,t)}describe(t,e){return ve(_e,t,e)}override(t,e){return ve(be,t,e)}route(t,e,i,n){const r=xe(this,t),s=xe(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 it(t)?Object.assign({},e,t):st(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var we=new ye({_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:fe},numbers:{type:"number",properties:ue}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:me.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function ke(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 Me(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;l<a;l++)if(u=i[l],null!=u&&!0!==et(u))o=ke(t,r,s,o,u);else if(et(u))for(h=0,c=u.length;h<c;h++)f=u[h],null==f||et(f)||(o=ke(t,r,s,o,f));t.restore();const d=s.length/2;if(d>i.length){for(l=0;l<d;l++)delete r[s[l]];s.splice(0,d)}return o}function Se(t,e,i){const n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function Pe(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Ae(t,e,i,n){De(t,e,i,n,null)}function De(t,e,i,n,r){let s,o,a,l,h,c,u,f;const d=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Pt;if(d&&"object"==typeof d&&(s=d.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),d){default:r?t.ellipse(i,n,r/2,g,0,0,kt):t.arc(i,n,g,0,kt),t.closePath();break;case"triangle":c=r?r/2:g,t.moveTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Ot,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Ot,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,o=Math.cos(m+Dt)*l,u=Math.cos(m+Dt)*(r?r/2-h:l),a=Math.sin(m+Dt)*l,f=Math.sin(m+Dt)*(r?r/2-h:l),t.arc(i-u,n-a,h,m-wt,m-At),t.arc(i+f,n-o,h,m-At,m),t.arc(i+u,n+a,h,m,m+At),t.arc(i-f,n+o,h,m+At,m+wt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=r?r/2:l,t.rect(i-c,n-l,2*c,2*l);break}m+=Dt;case"rectRot":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+f,n-o),t.lineTo(i+u,n+a),t.lineTo(i-f,n+o),t.closePath();break;case"crossRot":m+=Dt;case"cross":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"star":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o),m+=Dt,u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"line":o=r?r/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(r?r/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Oe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ce(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Te(t){t.restore()}function Ee(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Le(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Re(t,e,i,n,r,s={}){const o=et(e)?e:[e],a=s.strokeWidth>0&&""!==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]);tt(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;l<o.length;++l)h=o[l],s.backdrop&&ze(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),tt(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(h,i,n,s.maxWidth)),t.fillText(h,i,n,s.maxWidth),Ie(t,i,n,h,s),n+=r.lineHeight;t.restore()}function Ie(t,e,i,n,r){if(r.strikethrough||r.underline){const s=t.measureText(n),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,c=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,c),t.lineTo(a,c),t.stroke()}}function ze(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Fe(t,e){const{x:i,y:n,w:r,h:s,radius:o}=e;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,-At,wt,!0),t.lineTo(i,n+s-o.bottomLeft),t.arc(i+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,wt,At,!0),t.lineTo(i+r-o.bottomRight,n+s),t.arc(i+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,At,0,!0),t.lineTo(i+r,n+o.topRight),t.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-At,!0),t.lineTo(i+o.topLeft,n)}const je=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ve=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Be(t,e){const i=(""+t).match(je);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const We=t=>+t||0;function Ne(t,e){const i={},n=it(e),r=n?Object.keys(e):e,s=it(t)?n?i=>st(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of r)i[o]=We(s(o));return i}function He(t){return Ne(t,{top:"y",right:"x",bottom:"y",left:"x"})}function $e(t){return Ne(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(t){const e=He(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ye(t,e){t=t||{},e=e||we.font;let i=st(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=st(t.style,e.style);n&&!(""+n).match(Ve)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:st(t.family,e.family),lineHeight:Be(st(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:st(t.weight,e.weight),string:""};return r.string=function(t){return!t||tt(t.size)||tt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function qe(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;r<s;++r)if(o=t[r],void 0!==o&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&et(o)&&(o=o[i%o.length],a=!1),void 0!==o))return n&&!a&&(n.cacheable=!1),o}function Xe(t,e){return Object.assign(Object.create(t),e)}function Ke(t,e=[""],i=t,n,r=(()=>t[0])){xt(n)||(n=oi("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>Ke([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)=>ti(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=oi(Je(s,t),i),xt(r))return Qe(t,r)?ri(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)=>ai(t).includes(e),ownKeys:t=>ai(t),set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ze(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ge(t,n),setContext:e=>Ze(t,e,i,n),override:r=>Ze(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ti(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];vt(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),Qe(t,e)&&(e=ri(r._scopes,r,t,e));return e}(e,a,t,i));et(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(xt(s.index)&&n(t))e=e[s.index%e.length];else if(it(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ri(n,r,t,l);e.push(Ze(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable));Qe(e,a)&&(a=Ze(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 Ge(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:vt(i)?i:()=>i,isIndexable:vt(n)?n:()=>n}}const Je=(t,e)=>t?t+_t(e):e,Qe=(t,e)=>it(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ti(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function ei(t,e,i){return vt(t)?t(e,i):t}const ii=(t,e)=>!0===t?e:"string"==typeof t?bt(e,t):void 0;function ni(t,e,i,n,r){for(const s of e){const e=ii(i,s);if(e){t.add(e);const s=ei(e._fallback,i,r);if(xt(s)&&s!==i&&s!==n)return s}else if(!1===e&&xt(n)&&i!==n)return null}return!1}function ri(t,e,i,n){const r=e._rootScopes,s=ei(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=si(a,o,i,s||i,n);return null!==l&&((!xt(s)||s===i||(l=si(a,o,s,l,n),null!==l))&&Ke(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];if(et(r)&&it(i))return i;return r||{}}(e,i,n))))}function si(t,e,i,n,r){for(;i;)i=ni(t,e,i,n,r);return i}function oi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(xt(e))return e}}function ai(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 li(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;a<l;++a)h=a+i,c=e[h],o[a]={r:r.parse(bt(c,s),h)};return o}const hi=Number.EPSILON||1e-14,ci=(t,e)=>e<t.length&&!t[e].skip&&t[e],ui=t=>"x"===t?"y":"x";function fi(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=Bt(s,r),l=Bt(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 di(t,e="x"){const i=ui(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,h=ci(t,0);for(o=0;o<n;++o)if(a=l,l=h,h=ci(t,o+1),l){if(h){const t=h[e]-l[e];r[o]=0!==t?(h[i]-l[i])/t:0}s[o]=a?h?Tt(r[o-1])!==Tt(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}!function(t,e,i){const n=t.length;let r,s,o,a,l,h=ci(t,0);for(let c=0;c<n-1;++c)l=h,h=ci(t,c+1),l&&h&&(Et(e[c],0,hi)?i[c]=i[c+1]=0:(r=i[c]/e[c],s=i[c+1]/e[c],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),i[c]=r*o*e[c],i[c+1]=s*o*e[c])))}(t,r,s),function(t,e,i="x"){const n=ui(i),r=t.length;let s,o,a,l=ci(t,0);for(let h=0;h<r;++h){if(o=a,a=l,l=ci(t,h+1),!a)continue;const r=a[i],c=a[n];o&&(s=(r-o[i])/3,a[`cp1${i}`]=r-s,a[`cp1${n}`]=c-s*e[h]),l&&(s=(l[i]-r)/3,a[`cp2${i}`]=r+s,a[`cp2${n}`]=c+s*e[h])}}(t,s,e)}function pi(t,e,i){return Math.max(Math.min(t,i),e)}function gi(t,e,i,n,r){let s,o,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)di(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],l=fi(i,a,t[Math.min(s+1,o-(n?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,r,s,o,a=Oe(t[0],e);for(i=0,n=t.length;i<n;++i)o=s,s=a,a=i<n-1&&Oe(t[i+1],e),s&&(r=t[i],o&&(r.cp1x=pi(r.cp1x,e.left,e.right),r.cp1y=pi(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=pi(r.cp2x,e.left,e.right),r.cp2y=pi(r.cp2y,e.top,e.bottom)))}(t,i)}function mi(){return"undefined"!=typeof window&&"undefined"!=typeof document}function bi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function _i(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const xi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const vi=["top","right","bottom","left"];function yi(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=vi[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const wi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ki(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=xi(i),s="border-box"===r.boxSizing,o=yi(r,"padding"),a=yi(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(wi(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 Mi=t=>Math.round(10*t)/10;function Si(t,e,i,n){const r=xi(t),s=yi(r,"margin"),o=_i(r.maxWidth,t,"clientWidth")||St,a=_i(r.maxHeight,t,"clientHeight")||St,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=bi(t);if(s){const t=s.getBoundingClientRect(),o=xi(s),a=yi(o,"border","width"),l=yi(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=_i(o.maxWidth,s,"clientWidth"),r=_i(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||St,maxHeight:r||St}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=yi(r,"border","width"),e=yi(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=Mi(Math.min(h,o,l.maxWidth)),c=Mi(Math.min(c,a,l.maxHeight)),h&&!c&&(c=Mi(h/2));return(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=Mi(Math.floor(c*n))),{width:h,height:c}}function Pi(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 Ai=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 Di(t,e){const i=function(t,e){return xi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Oi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ci(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 Ti(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Oi(t,r,i),a=Oi(r,s,i),l=Oi(s,e,i),h=Oi(o,a,i),c=Oi(a,l,i);return Oi(h,c,i)}const Ei=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}},Li=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function Ri(t,e,i){return t?Ei(e,i):Li()}function Ii(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 zi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Fi(t){return"angle"===t?{between:Ht,compare:Wt,normalize:Nt}:{between:Ut,compare:(t,e)=>t-e,normalize:t=>t}}function ji({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 Vi(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:h}=Fi(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}=Fi(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<c&&o(a(e[u%l][n]),r,s);++h)u--,f--;u%=l,f%=l}return f<u&&(f+=l),{start:u,end:f,loop:d,style:t.style}}(t,e,i),p=[];let g,m,b,_=!1,x=null;const v=()=>_||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(ji({start:x,end:w,loop:f,count:o,style:d})),x=null),k=w,b=g));return null!==x&&p.push(ji({start:x,end:u,loop:f,count:o,style:d})),p}function Bi(t,e){const i=[],n=t.segments;for(let r=0;r<n.length;r++){const s=Vi(n[r],t.points,e);s.length&&i.push(...s)}return i}function Wi(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const r=t._chart.getContext(),s=Ni(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,h=[];let c=s,u=e[0].start,f=u;function d(t,e,n,r){const s=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),c=r,u=e%l)}}for(const p of e){u=a?u:p.start;let t,e=i[u%l];for(f=u+1;f<=p.end;f++){const s=i[f%l];t=Ni(n.setContext(Xe(r,{type:"segment",p0:e,p1:s,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Hi(t,c)&&d(u,f-1,p.loop,c),e=s,c=t}u<f-1&&d(u,f-1,p.loop,c)}return h}(t,e,i,n):e}function Ni(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Hi(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}
/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class $i{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const r=e.listeners[n],s=e.duration;r.forEach((n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=Jt.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 Ui=new $i;const Yi="transparent",qi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=he(t||Yi),r=n.valid&&he(e||Yi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Xi{constructor(t,e,i,n){const r=e[i];n=qe([t.to,n,r,t.from]);const s=qe([t.from,r,n]);this._active=!0,this._fn=t.fn||qi[t.type||typeof s],this._easing=ae[t.easing]||ae.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=qe([t.to,e,n,t.from]),this._from=qe([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||e<i),!this._active)return this._target[n]=o,void this._notify(!0);e<0?this._target[n]=r:(a=e/i%2,a=s&&a>1?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<i.length;n++)i[n][e]()}}class Ki{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!it(t))return;const e=Object.keys(we.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const r=t[n];if(!it(r))return;const s={};for(const t of e)s[t]=r[t];(et(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<n.length;r++){const e=t[n[r]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{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 Xi(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?(Ui.add(this._chart,i),!0):void 0}}function Zi(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 Gi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r<s;++r)i.push(n[r].index);return i}function Ji(t,e,i,n={}){const r=t.keys,s="single"===n.mode;let o,a,l,h;if(null!==e){for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===i){if(n.all)continue;break}h=t.values[l],nt(h)&&(s||0===e||Tt(e)===Tt(h))&&(e+=h)}return e}}function Qi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function tn(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function en(t,e,i,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function nn(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;d<u;++d){const t=e[d],{[l]:i,[h]:s}=t;f=(t._stacks||(t._stacks={}))[h]=tn(r,c,i),f[a]=s,f._top=en(f,o,!0,n.type),f._bottom=en(f,o,!1,n.type);(f._visualValues||(f._visualValues={}))[a]=s}}function rn(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function sn(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 on=t=>"reset"===t||"none"===t,an=(t,e)=>e?t:Object.assign({},t);class ln{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=Qi(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&&sn(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=st(i.xAxisID,rn(t,"x")),s=e.yAxisID=st(i.yAxisID,rn(t,"y")),o=e.rAxisID=st(i.rAxisID,rn(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&&Zt(this._data,this),t._stacked&&sn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(it(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<r;++n)s=e[n],i[n]={x:s,y:t[s]};return i}(e);else if(i!==e){if(i){Zt(i,this);const t=this._cachedMeta;sn(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(n=e)._chartjs?n._chartjs.listeners.push(r):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Kt.forEach((t=>{const e="_onData"+_t(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=Qi(e.vScale,e),e.stack!==i.stack&&(n=!0,sn(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&nn(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=et(n[t])?this.parseArrayData(i,n,t,e):it(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]<u[o];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(r()&&(c=!1),u=l);i._sorted=c}s&&nn(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:r,vScale:s}=t,o=r.axis,a=s.axis,l=r.getLabels(),h=r===s,c=new Array(n);let u,f,d;for(u=0,f=n;u<f;++u)d=u+i,c[u]={[o]:h||r.parse(l[d],d),[a]:s.parse(e[d],d)};return c}parseArrayData(t,e,i,n){const{xScale:r,yScale:s}=t,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],o[a]={x:r.parse(c[0],h),y:s.parse(c[1],h)};return o}parseObjectData(t,e,i,n){const{xScale:r,yScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let h,c,u,f;for(h=0,c=n;h<c;++h)u=h+i,f=e[u],l[h]={x:r.parse(bt(f,o),u),y:s.parse(bt(f,a),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,r=this._cachedMeta,s=e[t.axis];return Ji({keys:Gi(n,!0),values:e._stacks[t.axis]._visualValues},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const r=i[e.axis];let s=null===r?NaN:r;const o=n&&i._stacks[e.axis];n&&o&&(n.values=o,s=Ji(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,s=n.length,o=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Gi(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!nt(f[t.axis])||h>e||c<e}for(u=0;u<s&&(d()||(this.updateRangeFromParsed(l,t,f,a),!r));++u);if(r)for(u=s-1;u>=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<r;++n)s=e[n][t.axis],nt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return it(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(st(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=Zi(t,i),r=Zi(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||n.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,r,o,a),h=o;h<o+a;++h){const e=n[h];e.hidden||(e.active&&l?s.push(e):e.draw(t,r))}for(h=0;h<s.length;++h)s[h].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,i){return Xe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return Xe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,o=r[s],a=this.enableOptionSharing&&xt(i);if(o)return an(o,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),f=Object.keys(we.elements[t]),d=l.resolveNamedOptions(u,f,(()=>this.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(an(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 Ki(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||on(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){on(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!on(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<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){const n=this._cachedMeta,r=n.data,s=t+e;let o;const a=t=>{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;o<s;++o)r[o]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&sn(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function hn(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Gt(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(xt(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;n<r;++n)s=e.getPixelForValue(i[n]),l();for(o=void 0,n=0,r=e.ticks.length;n<r;++n)s=e.getPixelForTick(n),l();return a}function cn(t,e,i,n){return et(t)?function(t,e,i,n){const r=i.parse(t[0],n),s=i.parse(t[1],n),o=Math.min(r,s),a=Math.max(r,s);let l=o,h=a;Math.abs(o)>Math.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 un(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;h<c;++h)f=e[h],u={},u[r.axis]=a||r.parse(o[h],h),l.push(cn(f,u,s,h));return l}function fn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function dn(t,e,i,n){let r=e.borderSkipped;const s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:l,top:h,bottom:c}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=c:(s[pn(c,o,a,l)]=!0,r=h)),s[pn(r,o,a,l)]=!0,t.borderSkipped=s}function pn(t,e,i,n){var r,s,o;return n?(o=i,t=gn(t=(r=t)===(s=e)?o:r===o?s:r,i,e)):t=gn(t,e,i),t}function gn(t,e,i){return"start"===t?e:"end"===t?i:t}function mn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}t(ln,"defaults",{}),t(ln,"datasetElementType",null),t(ln,"dataElementType",null);class bn extends ln{parsePrimitiveData(t,e,i,n){return un(t,e,i,n)}parseArrayData(t,e,i,n){return un(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:r,vScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l="x"===r.axis?o:a,h="x"===s.axis?o:a,c=[];let u,f,d,p;for(u=i,f=i+n;u<f;++u)p=e[u],d={},d[r.axis]=r.parse(bt(p,l),u),c.push(cn(bt(p,h),d,s,u));return c}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,o=fn(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const r="reset"===n,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=r||tt(e[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(f),d=this._calculateBarIndexPixels(f,h),p=(e._stacks||{})[o.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||fn(e._custom)||s===p._top||s===p._bottom,x:l?i.head:d.center,y:l?d.center:i.head,height:l?d.size:Math.abs(i.size),width:l?Math.abs(i.size):d.size};u&&(g.options=c||this.resolveDataElementOptions(f,t[f].active?"active":n));const m=g.options||t[f].options;dn(g,m,p,s),mn(g,m,h.ratio),this.updateElement(t[f],f,g,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(tt(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<s;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||hn(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(t),l=a._custom,h=fn(l);let c,u,f=a[e.axis],d=0,p=i?this.applyStack(e,a,i):f;p!==f&&(d=p-f,p=f),h&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&Tt(f)!==Tt(l.barEnd)&&(d=0),d+=f);const g=tt(r)||h?d:r;let m=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(d+p):m,u=c-m,Math.abs(u)<s){u=function(t,e,i){return 0!==t?Tt(t):(e.isHorizontal()?1:-1)*(e.min>=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=Tt(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=st(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<r.length-1?r[t+1]:null;const l=i.categoryPercentage;null===o&&(o=s-(null===a?e.end-e.start:a-s)),null===a&&(a=s+s-o);const h=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const r=i.barThickness;let s,o;return tt(r)?(s=e.min*i.categoryPercentage,o=i.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:e.pixels[t]-s/2}}(t,e,n,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=l.start+l.chunk*h+l.chunk/2,a=Math.min(s,l.chunk*l.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(s,e.min*e.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}}t(bn,"id","bar"),t(bn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),t(bn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class _n extends ln{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const r=super.parsePrimitiveData(t,e,i,n);for(let s=0;s<r.length;s++)r[s]._custom=this.resolveDataElementOptions(s+i).radius;return r}parseArrayData(t,e,i,n){const r=super.parseArrayData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=st(t[2],this.resolveDataElementOptions(s+i).radius)}return r}parseObjectData(t,e,i,n){const r=super.parseObjectData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=st(t&&t.r&&+t.r,this.resolveDataElementOptions(s+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale: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<e+i;u++){const e=t[u],i=!r&&this.getParsed(u),f={},d=f[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),p=f[c]=r?o.getBasePixel():o.getPixelForValue(i[c]);f.skip=isNaN(d)||isNaN(p),l&&(f.options=a||this.resolveDataElementOptions(u,e.active?"active":n),r&&(f.options.radius=0)),this.updateElement(e,u,f,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=st(i&&i._custom,r),n}}t(_n,"id","bubble"),t(_n,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),t(_n,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});class xn extends ln{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,o=t=>+i[t];if(it(i[t])){const{key:t="value"}=this._parsing;o=e=>+bt(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=o(r)}}_getRotation(){return zt(this.options.rotation-90)}_getCircumference(){return zt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),a=Math.min((l=this.options.cutout,h=o,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let n=1,r=1,s=0,o=0;if(e<kt){const a=t,l=a+e,h=Math.cos(a),c=Math.sin(a),u=Math.cos(l),f=Math.sin(l),d=(t,e,n)=>Ht(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Ht(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=d(0,h,u),m=d(At,c,f),b=p(wt,h,u),_=p(wt+At,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=ot(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/kt)}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;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+i;++g){const e=this._circumference(g,r),i=t[g],s={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:f,innerRadius:u};p&&(s.options=d||this.resolveDataElementOptions(g,i.active?"active":n)),m+=e,this.updateElement(i,g,s,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const r=t._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=pe(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<r;++n)if(i.isDatasetVisible(n)){s=i.getDatasetMeta(n),t=s.data,o=s.controller;break}if(!t)return 0;for(n=0,r=t.length;n<r;++n)a=o.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}t(xn,"id","doughnut"),t(xn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),t(xn,"descriptors",{_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t}),t(xn,"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 vn extends ln{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}=ie(e,n,s);this._drawStart=o,this._drawCount=a,ne(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=Rt(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<e||v>=b){d.skip=!0;continue}const _=this.getParsed(v),y=tt(_[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(vn,"id","line"),t(vn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),t(vn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class yn extends ln{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=pe(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return li.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)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),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*wt;let u,f=c;const d=360/this.countVisibleElements();for(u=0;u<e;++u)f+=this._computeAngle(u,n,d);for(u=e;u<e+i;u++){const e=t[u];let i=f,p=f+this._computeAngle(u,n,d),g=s.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=p,r&&(o.animateScale&&(g=0),o.animateRotate&&(i=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(u,e.active?"active":n)};this.updateElement(e,u,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?zt(this.resolveDataElementOptions(t,e).angle||i):0}}t(yn,"id","polarArea"),t(yn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),t(yn,"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 wn extends xn{}t(wn,"id","pie"),t(wn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class kn extends ln{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 li.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;o<e+i;o++){const e=t[o],i=this.resolveDataElementOptions(o,e.active?"active":n),a=r.getPointPositionForValue(o,this.getParsed(o).r),l=s?r.xCenter:a.x,h=s?r.yCenter:a.y,c={x:l,y:h,angle:a.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,o,c,n)}}}t(kn,"id","radar"),t(kn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),t(kn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Mn extends ln{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);return{label:i[t]||"",value:"("+o+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:r,count:s}=ie(e,i,n);if(this._drawStart=r,this._drawCount=s,ne(e)&&(r=0,s=i.length),this.options.showLine){const{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:o},t)}this.updateElements(i,r,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),u=this.includeOptions(n,c),f=s.axis,d=o.axis,{spanGaps:p,segment:g}=this.options,m=Rt(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||"none"===n;let _=e>0&&this.getParsed(e-1);for(let x=e;x<e+i;++x){const e=t[x],i=this.getParsed(x),h=b?e:{},p=tt(i[d]),v=h[f]=s.getPixelForValue(i[f],x),y=h[d]=r||p?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,i,a):i[d],x);h.skip=isNaN(v)||isNaN(y)||p,h.stop=x>0&&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(Mn,"id","scatter"),t(Mn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),t(Mn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Sn=Object.freeze({__proto__:null,BarController:bn,BubbleController:_n,DoughnutController:xn,LineController:vn,PolarAreaController:yn,PieController:wn,RadarController:kn,ScatterController:Mn});function Pn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class An{static override(t){Object.assign(An.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return Pn()}parse(){return Pn()}format(){return Pn()}add(){return Pn()}diff(){return Pn()}startOf(){return Pn()}endOf(){return Pn()}}var Dn=An;function On(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?Xt:qt;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 Cn(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let a=0,l=s.length;a<l;++a){const{index:t,data:i}=s[a],{lo:l,hi:h}=On(s[a],e,o,r);for(let e=l;e<=h;++e){const r=i[e];r.skip||n(r,t,e)}}}function Tn(t,e,i,n,r){const s=[];if(!r&&!t.isPointInArea(e))return s;return Cn(t,i,e,(function(i,o,a){(r||Oe(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:o,index:a})}),!0),s}function En(t,e,i,n,r,s){let o=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return Cn(t,i,e,(function(i,h,c){const u=i.inRange(e.x,e.y,r);if(n&&!u)return;const f=i.getCenterPoint(r);if(!(!!s||t.isPointInArea(f))&&!u)return;const d=a(e,f);d<l?(o=[{element:i,datasetIndex:h,index:c}],l=d):d===l&&o.push({element:i,datasetIndex:h,index:c})})),o}function Ln(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?En(t,e,i,n,r,s):function(t,e,i,n){let r=[];return Cn(t,i,e,(function(t,i,s){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=Vt(t,{x:e.x,y:e.y});Ht(l,o,a)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function Rn(t,e,i,n,r){const s=[],o="x"===i?"inXRange":"inYRange";let a=!1;return Cn(t,i,e,((t,n,l)=>{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 In={evaluateInteractionItems:Cn,modes:{index(t,e,i,n){const r=ki(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Tn(t,r,s,n,o):Ln(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=ki(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Tn(t,r,s,n,o):Ln(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;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>Tn(t,ki(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const r=ki(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return Ln(t,r,s,i.intersect,n,o)},x:(t,e,i,n)=>Rn(t,ki(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Rn(t,ki(e,t),"y",i.intersect,n)}};const zn=["left","top","right","bottom"];function Fn(t,e){return t.filter((t=>t.pos===e))}function jn(t,e){return t.filter((t=>-1===zn.indexOf(t.pos)&&t.box.axis===e))}function Vn(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 Bn(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!zn.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<o;++s){a=t[s];const{fullSize:o}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*n:o&&e.availableWidth,a.height=r):(a.width=n,a.height=h?h*r:o&&e.availableHeight)}return i}function Wn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function Nn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Hn(t,e,i,n){const{pos:r,box:s}=i,o=t.maxPadding;if(!it(r)){i.size&&(t[r]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&Nn(o,s.getPadding());const a=Math.max(0,e.outerWidth-Wn(o,t,"left","right")),l=Math.max(0,e.outerHeight-Wn(o,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function $n(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function Un(t,e,i,n){const r=[];let s,o,a,l,h,c;for(s=0,o=t.length,h=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,$n(a.horizontal,e));const{same:o,other:u}=Hn(e,i,a,n);h|=o&&r.length,c=c||u,l.fullSize||r.push(a)}return h&&Un(r,e,i,n)||c}function Yn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function qn(t,e,i,n){const r=i.padding;let{x:s,y:o}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*h,s=l.size||t.height;xt(l.start)&&(o=l.start),t.fullSize?Yn(t,r.left,o,i.outerWidth-r.right-r.left,s):Yn(t,e.left+l.placed,o,n,s),l.start=o,l.placed+=n,o=t.bottom}else{const n=e.h*h,o=l.size||t.width;xt(l.start)&&(s=l.start),t.fullSize?Yn(t,s,r.top,o,i.outerHeight-r.bottom-r.top):Yn(t,s,e.top+l.placed,o,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=o}var Xn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const r=Ue(t.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(i-r.height,0),a=function(t){const e=function(t){const e=[];let i,n,r,s,o,a;for(i=0,n=(t||[]).length;i<n;++i)r=t[i],({position:s,options:{stack:o,stackWeight:a=1}}=r),e.push({index:i,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}(t),i=Vn(e.filter((t=>t.box.fullSize)),!0),n=Vn(Fn(e,"left"),!0),r=Vn(Fn(e,"right")),s=Vn(Fn(e,"top"),!0),o=Vn(Fn(e,"bottom")),a=jn(e,"x"),l=jn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Fn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;lt(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);Nn(f,Ue(n));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Bn(l.concat(h),u);Un(a.fullSize,d,u,p),Un(l,d,u,p),Un(h,d,u,p)&&Un(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),qn(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,qn(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},lt(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 Kn{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 Zn extends Kn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gn="$chartjs",Jn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qn=t=>null===t||""===t;const tr=!!Ai&&{passive:!0};function er(t,e,i){t.canvas.removeEventListener(e,i,tr)}function ir(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function nr(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ir(i.addedNodes,n),e=e&&!ir(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function rr(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ir(i.removedNodes,n),e=e&&!ir(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const sr=new Map;let or=0;function ar(){const t=window.devicePixelRatio;t!==or&&(or=t,sr.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function lr(t,e,i){const n=t.canvas,r=n&&bi(n);if(!r)return;const s=Qt(((t,e)=>{const n=r.clientWidth;i(t,e),n<r.clientWidth&&i()}),window),o=new ResizeObserver((t=>{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){sr.size||window.addEventListener("resize",ar),sr.set(t,e)}(t,s),o}function hr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){sr.delete(t),sr.size||window.removeEventListener("resize",ar)}(t)}function cr(t,e,i){const n=t.canvas,r=Qt((e=>{null!==t.ctx&&i(function(t,e){const i=Jn[t.type]||t.type,{x:n,y:r}=ki(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,tr)}(n,e,r),r}class ur extends Kn{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[Gn]={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",Qn(r)){const e=Di(t,"width");void 0!==e&&(t.width=e)}if(Qn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Di(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Gn])return!1;const i=e[Gn].initial;["height","width"].forEach((t=>{const n=i[t];tt(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[Gn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:nr,detach:rr,resize:lr}[e]||cr;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:hr,detach:hr,resize:hr}[e]||er)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Si(t,e,i,n)}isAttached(t){const e=bi(t);return!(!e||!e.isConnected)}}class fr{constructor(){t(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Rt(this.x)&&Rt(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 dr(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;i<n;i++)t[i].major&&e.push(i);return e}(e):[],o=s.length,a=s[0],l=s[o-1],h=[];if(o>r)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=i[s*n])}(e,h,s,o/r),h;const c=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),r=e.length/i;if(!n)return Math.max(r,1);const s=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let o=0,a=s.length-1;o<a;o++){const t=s[o];if(t>r)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(pr(e,h,c,tt(n)?0:a-n,a),t=0,i=o-1;t<i;t++)pr(e,h,c,s[t],s[t+1]);return pr(e,h,c,l,tt(n)?e.length:l+n),h}return pr(e,h,c),h}function pr(t,e,i,n,r){const s=st(n,0),o=Math.min(st(r,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),r&&(a=r-n,i=a/Math.floor(a/i)),h=s;h<0;)c++,h=Math.round(s+c*i);for(l=Math.max(s,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(s+c*i))}t(fr,"defaults",{}),t(fr,"defaultRoutes",void 0);const gr=t=>"left"===t?"right":"right"===t?"left":t,mr=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,br=(t,e)=>Math.min(e||t,t);function _r(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function xr(t,e,i){const n=t.ticks.length,r=Math.min(e,n-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(h-s,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(r-1))/2,h+=r<e?l:-l,h<s-a||h>o+a)))return h}function vr(t){return t.drawTicks?t.tickLength:0}function yr(t,e){if(!t.display)return 0;const i=Ye(t.font,e),n=Ue(t.padding);return(et(t.text)?t.text.length:1)*i.lineHeight+n.height}function wr(t,e,i){let n=te(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=gr(n)),n}class kr extends fr{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=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),i=rt(i,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,i),max:rt(e,n),minDefined:nt(t),maxDefined:nt(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;a<l;++a)e=o[a].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:rt(i,rt(n,i)),max:rt(n,rt(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(){at(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=ot(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<this.ticks.length;this._convertTicksToLabels(a?_r(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=dr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){at(this.options.afterUpdate,[this])}beforeSetDimensions(){at(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){at(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),at(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){at(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=at(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){at(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){at(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=br(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,r=e.maxRotation;let s,o,a,l=n;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=$t(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-vr(t.grid)-e.padding-yr(t.title,this.chart.options.font),a=Math.sqrt(c*c+u*u),l=Ft(Math.min(Math.asin($t((h.highest.height+6)/s,-1,1)),Math.asin($t(o/a,-1,1))-Math.asin($t(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(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=yr(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=vr(r)+s):(t.height=this.maxHeight,t.width=vr(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=zt(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(){at(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)tt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=_r(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:r}=this,s=[],o=[],a=Math.floor(e/br(e,i));let l,h,c,u,f,d,p,g,m,b,_,x=0,v=0;for(l=0;l<e;l+=a){if(u=t[l].label,f=this._resolveTickFontOptions(l),n.font=d=f.string,p=r[d]=r[d]||{data:{},gc:[]},g=f.lineHeight,m=b=0,tt(u)||et(u)){if(et(u))for(h=0,c=u.length;h<c;++h)_=u[h],tt(_)||et(_)||(m=ke(n,p.data,p.gc,m,_),b+=g)}else m=ke(n,p.data,p.gc,m,u),b=g;s.push(m),o.push(b),x=Math.max(m,x),v=Math.max(b,v)}!function(t,e){lt(t,(t=>{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r<n;++r)delete t.data[i[r]];i.splice(0,n)}}))}(r,e);const y=s.indexOf(x),w=o.indexOf(v),k=t=>({width:s[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(y),highest:k(w),widths:s,heights:o}}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 $t(this._alignToPixels?Se(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&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return Xe(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Xe(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=zt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,o=r?r.widest.width+s:0,a=r?r.highest.height+s:0;return this.isHorizontal()?a*i>o*n?o/i:a/n:a*n<o*i?a/i:o/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_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=vr(r),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,p=d/2,g=function(t){return Se(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(it(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(it(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=st(n.ticks.maxTicksLimit,h),O=Math.max(1,Math.ceil(h/D));for(b=0;b<h;b+=O){const t=this.getContext(b),e=r.setContext(t),n=o.setContext(t),s=e.lineWidth,h=e.color,c=n.dash||[],f=n.dashOffset,d=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;_=xr(this,b,a),void 0!==_&&(x=Se(i,_,s),l?v=w=M=P=x:y=k=S=A=x,u.push({tx1:v,ty1:y,tx2:w,ty2:k,x1:M,y1:S,x2:P,y2:A,width:s,color:h,borderDash:c,borderDashOffset:f,tickWidth:d,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=h,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:r}=i,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=r,u=vr(i.grid),f=u+h,d=c?-h:f,p=-zt(this.labelRotation),g=[];let m,b,_,x,v,y,w,k,M,S,P,A,D="middle";if("top"===n)y=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===n)y=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===n)y=(t.top+t.bottom)/2+f;else if(it(n)){const t=Object.keys(n)[0],e=n[t];y=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if(it(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===a?D="top":"end"===a&&(D="bottom"));const O=this._getLabelSizes();for(m=0,b=o.length;m<b;++m){_=o[m],x=_.label;const t=r.setContext(this.getContext(m));k=this.getPixelForTick(m)+r.labelOffset,M=this._resolveTickFontOptions(m),S=M.lineHeight,P=et(x)?x.length:1;const e=P/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let u,f=w;if(s?(v=k,"inner"===w&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===l||0!==p?-P*S+S/2:"center"===l?-O.highest.height/2-e*S+S:-O.highest.height+S/2:"near"===l||0!==p?S/2:"center"===l?O.highest.height/2-e*S:O.highest.height-P*S,c&&(A*=-1),0===p||t.showLabelBackdrop||(v+=S/2*Math.sin(p))):(y=k,A=(1-P)*S/2),t.showLabelBackdrop){const e=Ue(t.backdropPadding),i=O.heights[m],n=O.widths[m];let r=A-e.top,s=0-e.left;switch(D){case"middle":r-=i/2;break;case"bottom":r-=i}switch(w){case"center":s-=n/2;break;case"right":s-=n}u={left:s,top:r,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:x,font:M,textOffset:A,options:{rotation:p,color:i,strokeColor:a,strokeWidth:h,textAlign:f,textBaseline:D,translation:[v,y],backdrop:u}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-zt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,s=t+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+r,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+r,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.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<s;++r){const t=n[r];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),s=i.display?r.width:0;if(!s)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,u;this.isHorizontal()?(l=Se(t,this.left,s)-s/2,h=Se(t,this.right,o)+o/2,c=u=a):(c=Se(t,this.top,s)-s/2,u=Se(t,this.bottom,o)+o/2,l=h=a),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Ce(e,i);const n=this.getLabelItems(t);for(const r of n){const t=r.options,i=r.font;Re(e,r.label,0,r.textOffset,i,t)}i&&Te(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const r=Ye(i.font),s=Ue(i.padding),o=i.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||it(e)?(a+=s.bottom,et(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:h,maxWidth:c,rotation:u}=function(t,e,i,n){const{top:r,left:s,bottom:o,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let u,f,d,p=0;const g=o-r,m=a-s;if(t.isHorizontal()){if(f=ee(n,s,a),it(i)){const t=Object.keys(i)[0],n=i[t];d=c[t].getPixelForValue(n)+g-e}else d="center"===i?(h.bottom+h.top)/2+g-e:mr(t,i,e);u=a-s}else{if(it(i)){const t=Object.keys(i)[0],n=i[t];f=c[t].getPixelForValue(n)-m+e}else f="center"===i?(h.left+h.right)/2-m+e:mr(t,i,e);d=ee(n,o,r),p="left"===i?-At:At}return{titleX:f,titleY:d,maxWidth:u,rotation:p}}(this,a,e,o);Re(t,i.text,0,0,r,{color:i.color,maxWidth:c,rotation:u,textAlign:wr(o,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=st(t.grid&&t.grid.z,-1),n=st(t.border&&t.border.z,0);return this._isVisible()&&this.draw===kr.prototype.draw?[{z:i,draw:t=>{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<s;++r){const s=e[r];s[i]!==this.id||t&&s.type!==t||n.push(s)}return n}_resolveTickFontOptions(t){return Ye(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Mr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,r=t.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){const n=dt(Object.create(null),[i?we.get(i):{},we.get(e),t.defaults]);we.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");we.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&we.describe(e,t.descriptors)}(t,s,i),this.override&&we.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 we[n]&&(delete we[n][i],this.override&&delete be[i])}}class Sr{constructor(){this.controllers=new Mr(ln,"datasets",!0),this.elements=new Mr(fr,"elements"),this.plugins=new Mr(Object,"plugins"),this.scales=new Mr(kr,"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):lt(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=_t(t);at(i["before"+n],[],i),e[t](i),at(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var Pr=new Sr;class Ar{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(const r of t){const t=r.plugin;if(!1===at(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=st(i.options&&i.options.plugins,{}),r=function(t){const e={},i=[],n=Object.keys(Pr.plugins.items);for(let s=0;s<n.length;s++)i.push(Pr.getPlugin(n[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const t=r[s];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){const s=[],o=t.getContext();for(const a of e){const e=a.id,l=Dr(n[e],r);null!==l&&s.push({plugin:a,options:Or(t.config,{plugin:a,local:i[e]},l,o)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Dr(t,e){return e||!1!==t?!0===t?{}:t:null}function Or(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 Cr(t,e){const i=we.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Tr(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&&Tr(t[0].toLowerCase(),e))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Er(t){const e=t.options||(t.options={});e.plugins=st(e.plugins,{}),e.scales=function(t,e){const i=be[t.type]||{scales:{}},n=e.scales||{},r=Cr(t.type,e),s=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!it(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=Tr(t,e),a=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};s[t]=pt(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||Cr(r,e),a=(be[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),pt(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];pt(e,[we.scales[e.type],we.scale])})),s}(t,e)}function Lr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Rr=new Map,Ir=new Set;function zr(t,e){let i=Rr.get(t);return i||(i=e(),Rr.set(t,i),Ir.add(i)),i}const Fr=(t,e,i)=>{const n=bt(e,i);void 0!==n&&t.add(n)};class jr{constructor(t){this._config=function(t){return(t=t||{}).data=Lr(t.data),Er(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=Lr(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(),Er(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return zr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return zr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return zr(`${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=>Fr(a,t,e)))),e.forEach((t=>Fr(a,n,t))),e.forEach((t=>Fr(a,be[r]||{},t))),e.forEach((t=>Fr(a,we,t))),e.forEach((t=>Fr(a,_e,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Ir.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,be[e]||{},we.datasets[e]||{},{type:e},we,_e]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Vr(this._resolverCache,t,n);let a=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=Ge(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(vt(o)||Br(o))||s&&et(o))return!0}return!1}(s,e)){r.$shared=!1;a=Ze(s,i=vt(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}=Vr(this._resolverCache,t,i);return it(e)?Ze(r,e,void 0,n):r}}function Vr(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:Ke(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)}return s}const Br=t=>it(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||vt(t[i])),!1);const Wr=["top","bottom","left","right","chartArea"];function Nr(t,e){return"top"===t||"bottom"===t||-1===Wr.indexOf(t)&&"x"===e}function Hr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function $r(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),at(i&&i.onComplete,[t],e)}function Ur(t){const e=t.chart,i=e.options.animation;at(i&&i.onProgress,[t],e)}function Yr(t){return mi()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Xr=t=>{const e=Yr(t);return Object.values(qr).filter((t=>t.canvas===e)).pop()};function Kr(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 Zr{static register(...t){Pr.add(...t),Gr()}static unregister(...t){Pr.remove(...t),Gr()}constructor(t,e){const i=this.config=new jr(e),n=Yr(t),r=Xr(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!mi()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Zn:ur}(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=Q(),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 Ar,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=[],qr[this.id]=this,o&&a?(Ui.listen(this,"complete",$r),Ui.listen(this,"progress",Ur),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 tt(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 Pr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Pi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Pe(this.canvas,this.ctx),this}stop(){return Ui.stop(this),this}resize(t,e){Ui.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,Pi(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),at(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){lt(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=Tr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),lt(r,(e=>{const r=e.options,s=r.id,o=Tr(s,r),a=st(r.type,e.dtype);void 0!==r.position&&Nr(r.position,o)===Nr(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(Pr.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)})),lt(n,((t,e)=>{t||delete i[e]})),lt(i,(t=>{Xn.configure(this,t,t.options),Xn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Hr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let r=this.getDatasetMeta(i);const s=n.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=s,r.indexAxis=n.indexAxis||Cr(s,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const e=Pr.getController(s),{datasetElementType:n,dataElementType:o}=we.datasets[s];Object.assign(e,{dataElementType:Pr.getElement(o),datasetElementType:n&&Pr.getElement(n)}),r.controller=new e(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){lt(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),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<h;l++){const{controller:t}=this.getDatasetMeta(l),e=!n&&-1===r.indexOf(t);t.buildOrUpdateElements(e),s=Math.max(+t.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||lt(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Hr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){lt(this.scales,(t=>{Xn.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);yt(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){Kr(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;r<e;r++)if(!yt(n,i(r)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Xn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],lt(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,vt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Ui.has(this)?this.attached&&!Ui.running(this)&&Ui.start(this):(this.draw(),$r({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,r;for(n=0,r=e.length;n<r;++n){const r=e[n];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,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&&Ce(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&&Te(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Oe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=In.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=Xe(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);xt(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(),Ui.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Pe(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};lt(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(){lt(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},lt(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<a;++o){s=t[o];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!ht(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,at(r.onHover,[t,o,this],this),a&&at(r.onClick,[t,o,this],this));const h=!ht(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 Gr(){return lt(Zr.instances,(t=>t._plugins.invalidate()))}function Jr(t,e,i,n){const r=Ne(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 $t(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:$t(r.innerStart,0,o),innerEnd:$t(r.innerEnd,0,o)}}function Qr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ts(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/wt)/u)/2,m=l+g+d,b=r-g-d,{outerStart:_,outerEnd:x,innerStart:v,innerEnd:y}=Jr(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=Qr(k,S,o,a);t.arc(e.x,e.y,x,S,b+At)}const i=Qr(A,b,o,a);if(t.lineTo(i.x,i.y),y>0){const e=Qr(A,O,o,a);t.arc(e.x,e.y,y,b+At,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=Qr(P,D,o,a);t.arc(e.x,e.y,v,D+Math.PI,m-At)}const r=Qr(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=Qr(w,M,o,a);t.arc(e.x,e.y,_,m-At,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 es(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){ts(t,e,i,n,f,r);for(let e=0;e<s;++e)t.stroke();isNaN(a)||(f=o+(a%kt||kt))}u&&function(t,e,i){const{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let h=r/a;t.beginPath(),t.arc(s,o,a,n-h,i+h),l>r?(h=r/l,t.arc(s,o,l,i+h,n-h,!0)):t.arc(s,o,r,i+At,n-At),t.closePath(),t.clip()}(t,e,f),s||(ts(t,e,i,n,f,r),t.stroke())}t(Zr,"defaults",we),t(Zr,"instances",qr),t(Zr,"overrides",be),t(Zr,"registry",Pr),t(Zr,"version","4.2.1"),t(Zr,"getChart",Xr),e("C",Zr);class is extends fr{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}=Vt(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=st(c,a-o)>=kt||Ht(r,o,a),d=Ut(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"],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>kt?Math.floor(i/kt):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(wt,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){ts(t,e,i,n,l,r);for(let e=0;e<s;++e)t.fill();isNaN(a)||(l=o+(a%kt||kt))}ts(t,e,i,n,l,r),t.fill()}(t,this,a,r,s),es(t,this,a,r,s),t.restore()}}function ns(t,e,i=e){t.lineCap=st(i.borderCapStyle,e.borderCapStyle),t.setLineDash(st(i.borderDash,e.borderDash)),t.lineDashOffset=st(i.borderDashOffset,e.borderDashOffset),t.lineJoin=st(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=st(i.borderWidth,e.borderWidth),t.strokeStyle=st(i.borderColor,e.borderColor)}function rs(t,e,i){t.lineTo(i.x,i.y)}function ss(t,e,i={}){const n=t.length,{start:r=0,end:s=n-1}=i,{start:o,end:a}=e,l=Math.max(r,o),h=Math.min(s,a),c=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:h<l&&!c?n+h-l:h-l}}function os(t,e,i,n){const{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:h}=ss(r,i,n),c=function(t){return t.stepped?Ee:t.tension||"monotone"===t.cubicInterpolationMode?Le:rs}(s);let u,f,d,{move:p=!0,reverse:g}=n||{};for(u=0;u<=h;++u)f=r[(a+(g?h-u:u))%o],f.skip||(p?(t.moveTo(f.x,f.y),p=!1):c(t,d,f,g,s.stepped),d=f);return l&&(f=r[(a+(g?h:0))%o],c(t,d,f,g,s.stepped)),!!l}function as(t,e,i,n){const r=e.points,{count:s,start:o,ilen:a}=ss(r,i,n),{move:l=!0,reverse:h}=n||{};let c,u,f,d,p,g,m=0,b=0;const _=t=>(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?(i<d?d=i:i>p&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),f=n,b=0,d=p=i),g=i}x()}function ls(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?as:os}t(is,"id","arc"),t(is,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),t(is,"defaultRoutes",{backgroundColor:"backgroundColor"});const hs="function"==typeof Path2D;function cs(t,e,i,n){hs&&!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()),ns(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=ls(e);for(const a of r)ns(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 us extends fr{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;gi(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(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Wi(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<o?a+r:a,!!t._fullLoop&&0===o&&a===r-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],r=this.points,s=Bi(this,{property:e,start:n,end:n});if(!s.length)return;const o=[],a=function(t){return t.stepped?Ci:t.tension||"monotone"===t.cubicInterpolationMode?Ti:Oi}(i);let l,h;for(l=0,h=s.length;l<h;++l){const{start:h,end:c}=s[l],u=r[h],f=r[c];if(u===f){o.push(u);continue}const d=a(u,f,Math.abs((n-u[e])/(f[e]-u[e])),i.stepped);d[e]=t[e],o.push(d)}return 1===o.length?o[0]:o}pathSegment(t,e,i){return ls(this)(t,this,e,i)}path(t,e,i){const n=this.segments,r=ls(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of n)s&=r(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),cs(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function fs(t,e,i,n){const r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}t(us,"id","line"),t(us,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),t(us,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),t(us,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t});class ds extends fr{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)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return fs(this,t,"x",e)}inYRange(t,e){return fs(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Oe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ae(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ps(t,e){const{x:i,y:n,base:r,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,h,c,u;return t.horizontal?(u=o/2,a=Math.min(i,r),l=Math.max(i,r),h=n-u,c=n+u):(u=s/2,a=i-u,l=i+u,h=Math.min(n,r),c=Math.max(n,r)),{left:a,top:h,right:l,bottom:c}}function gs(t,e,i,n){return t?0:$t(e,i,n)}function ms(t){const e=ps(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){const n=t.options.borderWidth,r=t.borderSkipped,s=He(n);return{t:gs(r.top,s.top,0,i),r:gs(r.right,s.right,0,e),b:gs(r.bottom,s.bottom,0,i),l:gs(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=$e(r),o=Math.min(e,i),a=t.borderSkipped,l=n||it(r);return{topLeft:gs(!l||a.top||a.left,s.topLeft,0,o),topRight:gs(!l||a.top||a.right,s.topRight,0,o),bottomLeft:gs(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:gs(!l||a.bottom||a.right,s.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function bs(t,e,i,n){const r=null===e,s=null===i,o=t&&!(r&&s)&&ps(t,n);return o&&(r||Ut(e,o.left,o.right))&&(s||Ut(i,o.top,o.bottom))}function _s(t,e){t.rect(e.x,e.y,e.w,e.h)}function xs(t,e,i={}){const n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+o,radius:t.radius}}t(ds,"id","point"),t(ds,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),t(ds,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class vs extends fr{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=ms(this),o=(a=s.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Fe:_s;var a;t.save(),s.w===r.w&&s.h===r.h||(t.beginPath(),o(t,xs(s,e,r)),t.clip(),o(t,xs(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,xs(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return bs(this,t,e,i)}inXRange(t,e){return bs(this,t,null,e)}inYRange(t,e){return bs(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}t(vs,"id","bar"),t(vs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),t(vs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ys=Object.freeze({__proto__:null,ArcElement:is,LineElement:us,PointElement:ds,BarElement:vs});const ws=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ks=ws.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Ms(t){return ws[t%ws.length]}function Ss(t){return ks[t%ks.length]}function Ps(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof xn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ms(e++))),e}(i,e):r instanceof yn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Ss(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=Ms(e),t.backgroundColor=Ss(e),++e}(i,e))}}function As(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Ds={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:r}=t.config,{elements:s}=r;if(!i.forceOverride&&(As(n)||(o=r)&&(o.borderColor||o.backgroundColor)||s&&As(s)))return;var o;const a=Ps(t);n.forEach(a)}};function Os(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Cs(t){t.data.datasets.forEach((t=>{Os(t)}))}var Ts={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Cs(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"===qe([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=$t(qt(e,s.axis,o).lo,0,i-1)),n=h?$t(qt(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 Os(e);let f;switch(tt(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;c<s-2;c++){let n,r=0,s=0;const h=Math.floor((c+1)*a)+1+e,m=Math.min(Math.floor((c+2)*a)+1,i)+e,b=m-h;for(n=h;n<m;n++)r+=t[n].x,s+=t[n].y;r/=b,s/=b;const _=Math.floor(c*a)+1+e,x=Math.min(Math.floor((c+1)*a)+1,i)+e,{x:v,y:y}=t[g];for(f=d=-1,n=_;n<x;n++)d=.5*Math.abs((v-r)*(t[n].y-y)-(v-t[n].x)*(s-y)),d>f&&(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;r<e+i;++r){s=t[r],o=(s.x-_)/x*n,a=s.y;const e=0|o;if(e===l)a<f?(f=a,h=r):a>d&&(d=a,c=r),p=(g*p+s.x)/++g;else{const i=r-1;if(!tt(h)&&!tt(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){Cs(t)}};function Es(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=Nt(r),s=Nt(s)),{property:t,start:r,end:s}}function Ls(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Rs(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Is(t,e){let i=[],n=!1;return et(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=Ls(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 us({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function zs(t){return t&&!1!==t.fill}function Fs(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(!nt(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function js(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=st(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(it(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return nt(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 Vs(t,e,i){const n=[];for(let r=0;r<i.length;r++){const s=i[r],{first:o,last:a,point:l}=Bs(s,e,"x");if(!(!l||o&&a))if(o)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function Bs(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const r=n[i],s=t.segments,o=t.points;let a=!1,l=!1;for(let h=0;h<s.length;h++){const t=s[h],e=o[t.start][i],n=o[t.end][i];if(Ut(r,e,n)){a=r===e,l=r===n;break}}return{first:a,last:l,point:n}}class Ws{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:r,radius:s}=this;return e=e||{start:0,end:kt},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function Ns(t){const{chart:e,fill:i,line:n}=t;if(nt(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,r=[],s=n.segments,o=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){const t=n[r];if(t.index===e)break;t.hidden||i.unshift(t.dataset)}return i}(e,i);a.push(Is({x:null,y:e.bottom},n));for(let l=0;l<s.length;l++){const t=s[l];for(let e=t.start;e<=t.end;e++)Vs(r,o[e],a)}return new us({points:r,options:{}})}(t);if("shape"===i)return!0;const r=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,o=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:it(t)?t.value:e.getBaseValue(),n}(i,e,s),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,s);return new Ws({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,o));return a}(t);return function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:it(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(nt(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof Ws?r:Is(r,n)}function Hs(t,e,i){const n=Ns(e),{line:r,scale:s,axis:o}=e,a=r.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:u=h}=l||{};n&&r.points.length&&(Ce(t,i),function(t,e){const{line:i,target:n,above:r,below:s,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&($s(t,n,o.top),Us(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore(),t.save(),$s(t,n,o.bottom));Us(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore()}(t,{line:r,target:n,above:c,below:u,area:i,scale:s,axis:o}),Te(t))}function $s(t,e,i){const{segments:n,points:r}=e;let s=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,h=r[n],c=r[Ls(n,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Us(t,e){const{line:i,target:n,property:r,color:s,scale:o}=e,a=function(t,e,i){const n=t.segments,r=t.points,s=e.points,o=[];for(const a of n){let{start:t,end:n}=a;n=Ls(t,n,r);const l=Es(i,r[t],r[n],a.loop);if(!e.segments){o.push({source:a,target:l,start:r[t],end:r[n]});continue}const h=Bi(e,l);for(const e of h){const t=Es(i,s[e.start],s[e.end],e.loop),n=Vi(a,r,t);for(const r of n)o.push({source:r,target:e,start:{[i]:Rs(l,t,"start",Math.max)},end:{[i]:Rs(l,t,"end",Math.min)}})}}return o}(i,n,r);for(const{source:l,target:h,start:c,end:u}of a){const{style:{backgroundColor:e=s}={}}=l,a=!0!==n;t.save(),t.fillStyle=e,Ys(t,o,a&&Es(r,c,u)),t.beginPath();const f=!!i.pathSegment(t,l);let d;if(a){f?t.closePath():qs(t,n,u,r);const e=!!n.pathSegment(t,h,{move:f,reverse:!0});d=f&&e,d||qs(t,n,c,r)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function Ys(t,e,i){const{top:n,bottom:r}=e.chart.chartArea,{property:s,start:o,end:a}=i||{};"x"===s&&(t.beginPath(),t.rect(o,n,a-o,r-n),t.clip())}function qs(t,e,i,n){const r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var Xs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<n;++o)s=t.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof us&&(l={visible:t.isDatasetVisible(o),index:o,fill:js(a,o,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],l&&!1!==l.fill&&(l.fill=Fs(r,o,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let o=r.length-1;o>=0;--o){const e=r[o].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&e.fill&&Hs(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;zs(e)&&Hs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;zs(n)&&"beforeDatasetDraw"===i.drawTime&&Hs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ks=(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 Zs extends fr{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=at(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=Ye(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Ks(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=Gs(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=Ri(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=ee(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=ee(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=ee(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=ee(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;Ce(t,this),this._draw(),Te(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=we.color,a=Ri(t.rtl,this.left,this.width),l=Ye(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}=Ks(s,c),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:ee(r,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:ee(r,this.top+b+h,this.bottom-e[0].height),line:0},Ii(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=ee(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=ee(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=st(i.lineWidth,1);if(n.fillStyle=st(i.fillStyle,o),n.lineCap=st(i.lineCap,"butt"),n.lineDashOffset=st(i.lineDashOffset,0),n.lineJoin=st(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=st(i.strokeStyle,o),n.setLineDash(st(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);De(n,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=$e(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?Fe(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){Re(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+=Gs(x,t)}else f.y+=_})),zi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ye(e.font),n=Ue(e.padding);if(!e.display)return;const r=Ri(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=ee(t.align,c,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ee(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=ee(o,c,c+u);s.textAlign=r.textAlign(te(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Re(s,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ye(t.font),i=Ue(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Ut(t,this.left,this.right)&&Ut(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],Ut(t,n.left,n.left+n.width)&&Ut(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&at(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&at(e.onHover,[t,i,this],this)}else i&&at(e.onClick,[t,i,this],this)}}function Gs(t,e){return e*(t.text?t.text.length+.5:0)}var Js={id:"legend",_element:Zs,start(t,e,i){const n=t.legend=new Zs({ctx:t.ctx,options:i,chart:t});Xn.configure(t,n,i),Xn.addBox(t,n)},stop(t){Xn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Xn.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=Ue(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 Qs extends fr{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=et(i.text)?i.text.length:1;this._padding=Ue(i.padding);const r=n*Ye(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=ee(o,i,r),h=e+t,a=r-i):("left"===s.position?(l=i+t,h=ee(o,n,e),c=-.5*wt):(l=r-t,h=ee(o,e,n),c=.5*wt),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=Ye(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);Re(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:te(e.align),textBaseline:"middle",translation:[r,s]})}}var to={id:"title",_element:Qs,start(t,e,i){!function(t,e){const i=new Qs({ctx:t.ctx,options:e,chart:t});Xn.configure(t,i,e),Xn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Xn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Xn.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 eo=new WeakMap;var io={id:"subtitle",start(t,e,i){const n=new Qs({ctx:t.ctx,options:i,chart:t});Xn.configure(t,n,i),Xn.addBox(t,n),eo.set(t,n)},stop(t){Xn.removeBox(t,eo.get(t)),eo.delete(t)},beforeUpdate(t,e,i){const n=eo.get(t);Xn.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 no={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,o=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=Bt(e,n.getCenterPoint());t<a&&(a=t,r=n)}}if(r){const t=r.tooltipPosition();s=t.x,o=t.y}return{x:s,y:o}}};function ro(t,e){return e&&(et(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function so(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function oo(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 ao(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Ye(e.bodyFont),h=Ye(e.titleFont),c=Ye(e.footerFont),u=s.length,f=r.length,d=n.length,p=Ue(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,lt(t.title,x),i.font=l.string,lt(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,lt(n,(t=>{lt(t.before,x),lt(t.lines,x),lt(t.after,x)})),_=0,i.font=c.string,lt(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function lo(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 ho(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||lo(t,e,i,n),yAlign:n}}function co(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}=$e(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:$t(p,0,n.width-e.width),y:$t(g,0,n.height-e.height)}}function uo(t,e,i){const n=Ue(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function fo(t){return ro([],so(t))}function po(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const go={beforeTitle:J,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:J,beforeBody:J,beforeLabel:J,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return tt(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:J,afterBody:J,beforeFooter:J,footer:J,afterFooter:J};function mo(t,e,i,n){const r=t[e].call(i,n);return void 0===r?go[e].call(i,n):r}class bo extends fr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Ki(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Xe(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=mo(i,"beforeTitle",this,t),r=mo(i,"title",this,t),s=mo(i,"afterTitle",this,t);let o=[];return o=ro(o,so(n)),o=ro(o,so(r)),o=ro(o,so(s)),o}getBeforeBody(t,e){return fo(mo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return lt(t,(t=>{const e={before:[],lines:[],after:[]},r=po(i,t);ro(e.before,so(mo(r,"beforeLabel",this,t))),ro(e.lines,mo(r,"label",this,t)),ro(e.after,so(mo(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return fo(mo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=mo(i,"beforeFooter",this,t),r=mo(i,"footer",this,t),s=mo(i,"afterFooter",this,t);let o=[];return o=ro(o,so(n)),o=ro(o,so(r)),o=ro(o,so(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;o<a;++o)l.push(oo(this.chart,e[o]));return t.filter&&(l=l.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),lt(l,(e=>{const i=po(t.callbacks,e);n.push(mo(i,"labelColor",this,e)),r.push(mo(i,"labelPointStyle",this,e)),s.push(mo(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=no[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=ao(this,i),o=Object.assign({},t,e),a=ho(this.chart,i,o),l=co(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}=$e(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=Ri(i.rtl,this.x,this.width);for(t.x=uo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ye(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,a+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,n,r){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:a,boxWidth:l,boxPadding:h}=r,c=Ye(r.bodyFont),u=uo(this,"left",r),f=n.x(u),d=a<c.lineHeight?(c.lineHeight-a)/2:0,p=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=n.leftForLtr(f,l)+l/2,h=p+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ae(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ae(t,e,i,h)}else{t.lineWidth=it(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=n.leftForLtr(f,l-h),i=n.leftForLtr(n.xPlus(f,1),l-h-2),o=$e(s.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Fe(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Fe(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=Ye(i.bodyFont);let u=c.lineHeight,f=0;const d=Ri(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=uo(this,g,i),e.fillStyle=i.bodyColor,lt(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=n.length;x<y;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,lt(m.before,p),_=m.lines,o&&_.length&&(this._drawColorBox(e,t,x,d,i),u=Math.max(c.lineHeight,a)),v=0,w=_.length;v<w;++v)p(_[v]),u=c.lineHeight;lt(m.after,p)}f=0,u=c.lineHeight,lt(this.afterBody,p),t.y-=r}drawFooter(t,e,i){const n=this.footer,r=n.length;let s,o;if(r){const a=Ri(i.rtl,this.x,this.width);for(t.x=uo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",s=Ye(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<r;++o)e.fillText(n[o],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=$e(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+c,a),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+l-u,a),e.quadraticCurveTo(o+l,a,o+l,a+u),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l,a+h-d),e.quadraticCurveTo(o+l,a+h,o+l-d,a+h),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+f,a+h),e.quadraticCurveTo(o,a+h,o,a+h-f),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(o,a+c),e.quadraticCurveTo(o,a,o+c,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=no[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ao(this,t),o=Object.assign({},i,this._size),a=ho(e,t,o),l=co(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=Ue(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),Ii(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zi(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=!ht(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||!ht(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=no[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}t(bo,"positioners",no);var _o={id:"tooltip",_element:bo,positioners:no,afterInit(t,e,i){i&&(t.tooltip=new bo({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:go},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"]},xo=Object.freeze({__proto__:null,Colors:Ds,Decimation:Ts,Filler:Xs,Legend:Js,SubTitle:io,Title:to,Tooltip:_o});const vo=(t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function yo(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class wo extends kr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(tt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const r=t.indexOf(e);return-1===r?vo(t,e,i,n):r!==t.lastIndexOf(e)?i:r}(i,t,st(e,t),this._addedLabels),((t,e)=>null===t?null:$t(Math.round(t),0,e))(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let 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 yo.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 ko(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=!tt(s),b=!tt(o),_=!tt(l),x=(g-p)/(c+1);let v,y,w,k,M=Lt((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=Lt(k*M/d/f)*f),tt(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=Et(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(jt(M),jt(y));v=Math.pow(10,tt(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}),y<s&&P++,Et(Math.round((y+P*M)*v)/v,s,Mo(s,x,t))&&P++):y<s&&P++);P<k;++P)i.push({value:Math.round((y+P*M)*v)/v});return b&&u&&w!==o?i.length&&Et(i[i.length-1].value,o,Mo(o,x,t))?i[i.length-1].value=o:i.push({value:o}):b&&w!==o||i.push({value:w}),i}function Mo(t,e,{horizontal:i,minRotation:n}){const r=zt(n),s=(i?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}t(wo,"id","category"),t(wo,"defaults",{ticks:{callback:yo}});class So extends kr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return tt(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const s=t=>n=e?n:t,o=t=>r=i?r:t;if(t){const t=Tt(n),e=Tt(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=ko({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&&It(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 pe(t,this.chart.options.locale,this.options.ticks.format)}}class Po extends So{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=nt(t)?t:0,this.max=nt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=zt(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(Po,"id","linear"),t(Po,"defaults",{ticks:{callback:me.formatters.numeric}});const Ao=t=>Math.floor(Ct(t)),Do=(t,e)=>Math.pow(10,Ao(t)+e);function Oo(t){return 1===t/Math.pow(10,Ao(t))}function Co(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function To(t,{min:e,max:i}){e=rt(t.min,e);const n=[],r=Ao(e);let s=function(t,e){let i=Ao(e-t);for(;Co(t,e,i)>10;)i++;for(;Co(t,e,i)<10;)i--;return Math.min(i,Ao(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=rt(t.min,Math.round((l+c+u*Math.pow(10,s))*o)/o);for(;f<i;)n.push({value:f,major:Oo(f),significand:u}),u>=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=rt(t.max,f);return n.push({value:d,major:Oo(d),significand:u}),n}class Eo extends kr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=So.prototype.parse.apply(this,[t,e]);if(0!==i)return nt(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=nt(t)?Math.max(0,t):null,this.max=nt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!nt(this._userMin)&&(this.min=t===Do(this.min,0)?Do(this.min,-1):Do(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(Do(i,-1)),s(Do(n,1)))),i<=0&&r(Do(n,-1)),n<=0&&s(Do(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=To({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&It(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":pe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ct(t),this._valueRange=Ct(this.max)-Ct(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ct(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Lo(t){const e=t.ticks;if(e.display&&t.display){const t=Ue(e.backdropPadding);return st(e.font&&e.font.size,we.font.size)+t.height}return 0}function Ro(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Io(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?wt/s:0;for(let u=0;u<s;u++){const s=o.setContext(t.getPointLabelContext(u));r[u]=s.padding;const f=t.getPointPosition(u,t.drawingArea+r[u],a),d=Ye(s.font),p=(l=t.ctx,h=d,c=et(c=t._pointLabels[u])?c:[c],{w:Me(l,h.string,c),h:c.length*h.lineHeight});n[u]=p;const g=Nt(t.getIndexAngle(u)+a),m=Math.round(Ft(g));zo(i,e,g,Ro(m,f.x,p.w,0,180),Ro(m,f.y,p.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],r=t._pointLabels.length,s=t.options,o=Lo(s)/2,a=t.drawingArea,l=s.pointLabels.centerPointLabels?wt/r:0;for(let h=0;h<r;h++){const r=t.getPointPosition(h,a+o+i[h],l),s=Math.round(Ft(Nt(r.angle+At))),c=e[h],u=Vo(r.y,c.h,s),f=Fo(s),d=jo(r.x,c.w,f);n.push({x:r.x,y:u,textAlign:f,left:d,top:u,right:d+c.w,bottom:u+c.h})}return n}(t,n,r)}function zo(t,e,i,n,r){const s=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Fo(t){return 0===t||180===t?"center":t<180?"left":"right"}function jo(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Vo(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Bo(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,kt);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}t(Eo,"id","logarithmic"),t(Eo,"defaults",{ticks:{callback:me.formatters.logarithmic,major:{enabled:!0}}});class Wo extends So{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ue(Lo(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=nt(t)&&!isNaN(t)?t:0,this.max=nt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Lo(this.options))}generateTickLabels(t){So.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=at(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?Io(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 Nt(t*(kt/(this._pointLabels.length||1))+zt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(tt(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(tt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return Xe(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-At+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Bo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:r}=e,s=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const e=n.setContext(t.getPointLabelContext(r)),s=Ye(e.font),{x:o,y:a,textAlign:l,left:h,top:c,right:u,bottom:f}=t._pointLabelItems[r],{backdropColor:d}=e;if(!tt(d)){const t=$e(e.borderRadius),n=Ue(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(),Fe(i,{x:r,y:s,w:o,h:a,radius:t}),i.fill()):i.fillRect(r,s,o,a)}Re(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(),Bo(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=Ye(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=Ue(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}Re(t,n.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}t(Wo,"id","radialLinear"),t(Wo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:me.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),t(Wo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),t(Wo,"descriptors",{angleLines:{_fallback:"grid"}});const No={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ho=Object.keys(No);function $o(t,e){return t-e}function Uo(t,e){if(tt(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)),nt(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!Rt(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function Yo(t,e,i,n){const r=Ho.length;for(let s=Ho.indexOf(t);s<r-1;++s){const t=No[Ho[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return Ho[s]}return Ho[r-1]}function qo(t,e,i){if(i){if(i.length){const{lo:n,hi:r}=Yt(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function Xo(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,n.push({value:a,major:!1});return 0!==s&&i?function(t,e,i,n){const r=t._adapter,s=+r.startOf(e[0].value,n),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Ko extends kr{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 Dn(t.adapters.date);n.init(e),pt(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:Uo(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=nt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=nt(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(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?Yo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=Ho.length-1;s>=Ho.indexOf(i);s--){const i=Ho[s];if(No[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Ho[i?Ho.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=Ho.indexOf(t)+1,i=Ho.length;e<i;++e)if(No[Ho[e]].common)return Ho[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),Xo(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+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=$t(n,0,s),r=$t(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||Yo(r.minUnit,e,i,this._getLabelCapacity(e)),o=st(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=Rt(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;c<i;c=+t.add(c,o,s),u++)qo(h,c,d);return c!==i&&"ticks"!==n.bounds&&1!==u||qo(h,c,d),Object.keys(h).sort(((t,e)=>t-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)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,r=e||i[n];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const r=this.options,s=r.ticks.callback;if(s)return at(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;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=zt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*s,h:i*s+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Xo(this,[t],this._majorUnit),n),s=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?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<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(Uo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Gt(t.sort($o))}}function Zo(t,e,i){let n,r,s,o,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=qt(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}=qt(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(Ko,"id","time"),t(Ko,"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 Go extends Ko{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=Zo(e,this.min),this._tableRange=Zo(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<o;++s)l=t[s],l>=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<o;++s)h=n[s+1],a=n[s-1],l=n[s],Math.round((h+a)/2)!==l&&r.push({time:l,pos:s/(o-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Zo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Zo(this._table,i*this._tableRange+this._minPos,!0)}}t(Go,"id","timeseries"),t(Go,"defaults",Ko.defaults);e("r",[Sn,ys,xo,Object.freeze({__proto__:null,CategoryScale:wo,LinearScale:Po,LogarithmicScale:Eo,RadialLinearScale:Wo,TimeScale:Ko,TimeSeriesScale:Go})])}}}))}();