mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-19 17:16:08 +08:00
45 lines
279 KiB
JavaScript
45 lines
279 KiB
JavaScript
var Lx=Object.defineProperty;var Rx=(n,t,e)=>t in n?Lx(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var U=(n,t,e)=>(Rx(n,typeof t!="symbol"?t+"":t,e),e);import{c as Ei}from"./antdv.10579f22.js";var Ex=Object.defineProperty,Ix=(n,t,e)=>t in n?Ex(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,gt=(n,t,e)=>(Ix(n,typeof t!="symbol"?t+"":t,e),e);let ur=[];const Xu=n=>{for(const t of ur)if(t.status==="running")try{for(const e of t.funcs)e(n-t.startTime)}catch(e){t.destroy(),console.error(e)}requestAnimationFrame(Xu)};requestAnimationFrame(Xu);class Fx{constructor(){gt(this,"funcs",[]),gt(this,"status","stop"),gt(this,"startTime",0),this.status="running",ur.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(i=>i===t);if(e===-1)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",ur=ur.filter(t=>t!==this)}}class Gu{constructor(){gt(this,"timing"),gt(this,"relation","absolute"),gt(this,"easeTime",0),gt(this,"applying",{}),gt(this,"ticker",new Fx),gt(this,"value",{}),gt(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every(t=>t===!0))throw new ReferenceError("There is no animates to be waited.");await new Promise(t=>{const e=()=>{Object.values(this.applying).every(i=>i===!1)&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)})}async n(t){const e=Object.values(this.applying).filter(r=>r===!0).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(r=>{const a=()=>{i++,i===t&&(this.unlisten("end",a),r(`${t} animated.`))};this.listen("end",a)})}async w(t){if(this.applying[t]===!1)throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise(e=>{const i=()=>{this.applying[t]===!1&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)})}listen(t,e){var i;(i=this.listener)[t]!=null||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex(r=>r===e);if(i===-1)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(i=>t.includes(i[0]));for(const[i,r]of e)for(const a of r)a(this,i)}}function ba(n){return n!=null}async function $S(n){return new Promise(t=>setTimeout(t,n))}class YS extends Gu{constructor(){super(),gt(this,"shakeTiming"),gt(this,"path"),gt(this,"multiTiming"),gt(this,"value",{}),gt(this,"size",1),gt(this,"angle",0),gt(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),gt(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),gt(this,"ox",0),gt(this,"oy",0),gt(this,"sx",0),gt(this,"sy",0),gt(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(ba(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 typeof t(0)=="number"?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 this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return this.applying["@@bind"]===!0&&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){this.applying.shake===!0&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:r}=this,a=Date.now();this.hook("start","shakestart");const l=()=>{const c=Date.now()-a;c>i&&(this.ticker.remove(l),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const u=c/i,f=r(u);this.sx=f*t,this.sy=f*e};return this.ticker.add(l),this.animateFn.system.shake=l,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:r}=this,a=Date.now(),[l,c]=[this.x,this.y],[u,f]=(()=>{if(i==="absolute")return t(1);{const[p,_]=t(1);return[l+p,c+_]}})();this.hook("start","movestart");const g=()=>{const p=Date.now()-a;if(p>e){this.end(!0,"moveAs");return}const _=p/e,[y,w]=t(r(_));i==="absolute"?(this.ox=y,this.oy=w):(this.ox=l+y,this.oy=c+w)};return this.ticker.add(g,!0),this.animateFn.system.moveAs=g,this.targetValue.system.moveAs=[u,f],this}register(t,e){if(typeof this.value[t]=="number")return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){this.applying[t]===!0&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const r=this.value[t],a=Date.now(),{timing:l,relation:c,easeTime:u}=this,f=c==="absolute"?e-r:e;this.hook("start");const g=()=>{const p=Date.now()-a;if(p>u){this.end(!1,t);return}const _=p/u,y=l(_);this.value[t]=r+y*f};return this.ticker.add(g,i),this.animateFn.custom[t]=g,this.targetValue.custom[t]=f+r,this}applyMulti(t=!1){this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map(g=>this.value[g]),r=Date.now(),{multiTiming:a,relation:l,easeTime:c}=this,u=a(1);if(u.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: ${u.length}`);this.hook("start");const f=()=>{const g=Date.now()-r;if(g>c){this.end(!1,"@@bind");return}const p=g/c,_=a(p);e.forEach((y,w)=>{l==="absolute"?this.value[y]=_[w]:this.value[y]=i[w]+_[w]})};return this.ticker.add(f,t),this.animateFn.custom["@@bind"]=f,this.targetValue.system["@@bind"]=u,this}applySys(t,e,i){i!=="move"&&this.applying[i]===!0&&this.end(!0,i),this.applying[i]=!0;const r=this[t],a=Date.now(),l=this.timing,c=this.relation,u=this.easeTime,f=c==="absolute"?e-r:e;this.hook("start",`${i}start`);const g=()=>{const p=Date.now()-a;if(p>u){this.end(!0,i);return}const _=p/u,y=l(_);this[t]=r+f*y,t!=="oy"&&this.hook(i)};this.ticker.add(g,!0),t==="ox"?this.animateFn.system.move[0]=g:t==="oy"?this.animateFn.system.move[1]=g:this.animateFn.system[i]=g,i==="move"?(t==="ox"&&(this.targetValue.system.move[0]=f+r),t==="oy"&&(this.targetValue.system.move[1]=f+r)):i!=="shake"&&(this.targetValue.system[i]=f+r)}error(t,e){throw e==="repeat"?new Error(`Cannot execute the same animation twice. Info: ${t}`):e==="reregister"?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(t===!0)if(this.applying[e]=!1,e==="move"?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):e==="moveAs"?this.ticker.remove(this.animateFn.system.moveAs):e==="@@bind"?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),e==="move"){const[i,r]=this.targetValue.system.move;this.ox=i,this.oy=r,this.hook("moveend","end")}else if(e==="moveAs"){const[i,r]=this.targetValue.system.moveAs;this.ox=i,this.oy=r,this.hook("moveend","end")}else e==="rotate"?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):e==="resize"?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):e==="@@bind"?this.bindInfo.forEach((i,r)=>{this.value[i]=this.targetValue.system["@@bind"][r]}):(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")}}class XS extends Gu{constructor(){super(),gt(this,"now",{}),gt(this,"target",{}),gt(this,"transitionFn",{}),gt(this,"value"),gt(this,"handleSet",(t,e,i)=>(this.transition(e,i),!0)),gt(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(!ba(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(),r=this.easeTime,a=this.timing,l=this.now[t],c=e+(this.relation==="absolute"?0:l),u=c-l;this.target[t]=c;const f=()=>{const g=Date.now()-i;g>=r&&this.end(t);const p=g/r;this.now[t]=a(p)*u+l,this.hook("running")};return this.transitionFn[t]=f,this.ticker.add(f),this}end(t,e=!1){const i=this.transitionFn[t];if(!ba(i))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 Bx=(...n)=>n.reduce((t,e)=>t+e,0),sa=n=>{if(n===0)return 1;let t=n;for(;n>1;)n--,t*=n;return t},zx=(n,t)=>Math.round(sa(t)/(sa(n)*sa(t-n))),ra=(n,t,e=i=>1-t(1-i))=>n==="in"?t:n==="out"?e:n==="in-out"?i=>i<.5?t(i*2)/2:.5+e((i-.5)*2)/2:i=>i<.5?e(i*2)/2:.5+t((i-.5)*2)/2,Wx=Math.cosh(2),Nx=Math.acosh(2),Hx=Math.tanh(3);function GS(){return n=>n}function KS(...n){const t=[0].concat(n);t.push(1);const e=t.length,i=Array(e).fill(0).map((r,a)=>zx(a,e-1));return r=>{const a=i.map((l,c)=>l*t[c]*(1-r)**(e-c-1)*r**c);return Bx(...a)}}function jS(n,t){if(n==="sin")return ra(t,e=>(Math.cosh(e*2)-1)/(Wx-1));if(n==="tan"){const e=i=>Math.tanh(i*3)*1/Hx;return ra(t,i=>1-e(1-i),e)}if(n==="sec"){const e=i=>1/Math.cosh(i);return ra(t,i=>1-(e(i*Nx)-.5)*2)}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")}var kh={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
|
|
*/(function(n,t){(function(){var e,i="4.17.21",r=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",p=1,_=2,y=4,w=1,S=2,A=1,C=2,T=4,I=8,B=16,L=32,z=64,W=128,N=256,Y=512,J=30,Q="...",at=800,Rt=16,Vt=1,ht=2,_t=3,ft=1/0,Lt=9007199254740991,Bt=17976931348623157e292,Se=0/0,Kt=4294967295,nn=Kt-1,vn=Kt>>>1,wn=[["ary",W],["bind",A],["bindKey",C],["curry",I],["curryRight",B],["flip",Y],["partial",L],["partialRight",z],["rearg",N]],fe="[object Arguments]",Re="[object Array]",Gf="[object AsyncFunction]",fi="[object Boolean]",di="[object Date]",Kf="[object DOMException]",as="[object Error]",ls="[object Function]",ja="[object GeneratorFunction]",Me="[object Map]",gi="[object Number]",jf="[object Null]",Ne="[object Object]",qa="[object Promise]",qf="[object Proxy]",pi="[object RegExp]",Ae="[object Set]",mi="[object String]",cs="[object Symbol]",Zf="[object Undefined]",_i="[object WeakMap]",Jf="[object WeakSet]",bi="[object ArrayBuffer]",Yn="[object DataView]",Fr="[object Float32Array]",Br="[object Float64Array]",zr="[object Int8Array]",Wr="[object Int16Array]",Nr="[object Int32Array]",Hr="[object Uint8Array]",Vr="[object Uint8ClampedArray]",Ur="[object Uint16Array]",$r="[object Uint32Array]",Qf=/\b__p \+= '';/g,td=/\b(__p \+=) '' \+/g,ed=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Za=/&(?:amp|lt|gt|quot|#39);/g,Ja=/[&<>"']/g,nd=RegExp(Za.source),id=RegExp(Ja.source),sd=/<%-([\s\S]+?)%>/g,rd=/<%([\s\S]+?)%>/g,Qa=/<%=([\s\S]+?)%>/g,od=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ad=/^\w*$/,ld=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/[\\^$.*+?()[\]{}|]/g,cd=RegExp(Yr.source),Xr=/^\s+/,hd=/\s/,ud=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fd=/\{\n\/\* \[wrapped with (.+)\] \*/,dd=/,? & /,gd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pd=/[()=,{}\[\]\/\s]/,md=/\\(\\)?/g,_d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tl=/\w*$/,bd=/^[-+]0x[0-9a-f]+$/i,xd=/^0b[01]+$/i,yd=/^\[object .+?Constructor\]$/,vd=/^0o[0-7]+$/i,wd=/^(?:0|[1-9]\d*)$/,Sd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hs=/($^)/,Md=/['\n\r\u2028\u2029\\]/g,us="\\ud800-\\udfff",Ad="\\u0300-\\u036f",kd="\\ufe20-\\ufe2f",Pd="\\u20d0-\\u20ff",el=Ad+kd+Pd,nl="\\u2700-\\u27bf",il="a-z\\xdf-\\xf6\\xf8-\\xff",Cd="\\xac\\xb1\\xd7\\xf7",Od="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Td="\\u2000-\\u206f",Dd=" \\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",sl="A-Z\\xc0-\\xd6\\xd8-\\xde",rl="\\ufe0e\\ufe0f",ol=Cd+Od+Td+Dd,Gr="['\u2019]",Ld="["+us+"]",al="["+ol+"]",fs="["+el+"]",ll="\\d+",Rd="["+nl+"]",cl="["+il+"]",hl="[^"+us+ol+ll+nl+il+sl+"]",Kr="\\ud83c[\\udffb-\\udfff]",Ed="(?:"+fs+"|"+Kr+")",ul="[^"+us+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",qr="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+sl+"]",fl="\\u200d",dl="(?:"+cl+"|"+hl+")",Id="(?:"+Xn+"|"+hl+")",gl="(?:"+Gr+"(?:d|ll|m|re|s|t|ve))?",pl="(?:"+Gr+"(?:D|LL|M|RE|S|T|VE))?",ml=Ed+"?",_l="["+rl+"]?",Fd="(?:"+fl+"(?:"+[ul,jr,qr].join("|")+")"+_l+ml+")*",Bd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bl=_l+ml+Fd,Wd="(?:"+[Rd,jr,qr].join("|")+")"+bl,Nd="(?:"+[ul+fs+"?",fs,jr,qr,Ld].join("|")+")",Hd=RegExp(Gr,"g"),Vd=RegExp(fs,"g"),Zr=RegExp(Kr+"(?="+Kr+")|"+Nd+bl,"g"),Ud=RegExp([Xn+"?"+cl+"+"+gl+"(?="+[al,Xn,"$"].join("|")+")",Id+"+"+pl+"(?="+[al,Xn+dl,"$"].join("|")+")",Xn+"?"+dl+"+"+gl,Xn+"+"+pl,zd,Bd,ll,Wd].join("|"),"g"),$d=RegExp("["+fl+us+el+rl+"]"),Yd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xd=["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"],Gd=-1,yt={};yt[Fr]=yt[Br]=yt[zr]=yt[Wr]=yt[Nr]=yt[Hr]=yt[Vr]=yt[Ur]=yt[$r]=!0,yt[fe]=yt[Re]=yt[bi]=yt[fi]=yt[Yn]=yt[di]=yt[as]=yt[ls]=yt[Me]=yt[gi]=yt[Ne]=yt[pi]=yt[Ae]=yt[mi]=yt[_i]=!1;var bt={};bt[fe]=bt[Re]=bt[bi]=bt[Yn]=bt[fi]=bt[di]=bt[Fr]=bt[Br]=bt[zr]=bt[Wr]=bt[Nr]=bt[Me]=bt[gi]=bt[Ne]=bt[pi]=bt[Ae]=bt[mi]=bt[cs]=bt[Hr]=bt[Vr]=bt[Ur]=bt[$r]=!0,bt[as]=bt[ls]=bt[_i]=!1;var Kd={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jd={"&":"&","<":"<",">":">",'"':""","'":"'"},qd={"&":"&","<":"<",">":">",""":'"',"'":"'"},Zd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jd=parseFloat,Qd=parseInt,xl=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei,tg=typeof self=="object"&&self&&self.Object===Object&&self,Nt=xl||tg||Function("return this")(),Jr=t&&!t.nodeType&&t,Sn=Jr&&!0&&n&&!n.nodeType&&n,yl=Sn&&Sn.exports===Jr,Qr=yl&&xl.process,de=function(){try{var k=Sn&&Sn.require&&Sn.require("util").types;return k||Qr&&Qr.binding&&Qr.binding("util")}catch(D){}}(),vl=de&&de.isArrayBuffer,wl=de&&de.isDate,Sl=de&&de.isMap,Ml=de&&de.isRegExp,Al=de&&de.isSet,kl=de&&de.isTypedArray;function se(k,D,O){switch(O.length){case 0:return k.call(D);case 1:return k.call(D,O[0]);case 2:return k.call(D,O[0],O[1]);case 3:return k.call(D,O[0],O[1],O[2])}return k.apply(D,O)}function eg(k,D,O,V){for(var j=-1,ct=k==null?0:k.length;++j<ct;){var Et=k[j];D(V,Et,O(Et),k)}return V}function ge(k,D){for(var O=-1,V=k==null?0:k.length;++O<V&&D(k[O],O,k)!==!1;);return k}function ng(k,D){for(var O=k==null?0:k.length;O--&&D(k[O],O,k)!==!1;);return k}function Pl(k,D){for(var O=-1,V=k==null?0:k.length;++O<V;)if(!D(k[O],O,k))return!1;return!0}function sn(k,D){for(var O=-1,V=k==null?0:k.length,j=0,ct=[];++O<V;){var Et=k[O];D(Et,O,k)&&(ct[j++]=Et)}return ct}function ds(k,D){var O=k==null?0:k.length;return!!O&&Gn(k,D,0)>-1}function to(k,D,O){for(var V=-1,j=k==null?0:k.length;++V<j;)if(O(D,k[V]))return!0;return!1}function St(k,D){for(var O=-1,V=k==null?0:k.length,j=Array(V);++O<V;)j[O]=D(k[O],O,k);return j}function rn(k,D){for(var O=-1,V=D.length,j=k.length;++O<V;)k[j+O]=D[O];return k}function eo(k,D,O,V){var j=-1,ct=k==null?0:k.length;for(V&&ct&&(O=k[++j]);++j<ct;)O=D(O,k[j],j,k);return O}function ig(k,D,O,V){var j=k==null?0:k.length;for(V&&j&&(O=k[--j]);j--;)O=D(O,k[j],j,k);return O}function no(k,D){for(var O=-1,V=k==null?0:k.length;++O<V;)if(D(k[O],O,k))return!0;return!1}var sg=io("length");function rg(k){return k.split("")}function og(k){return k.match(gd)||[]}function Cl(k,D,O){var V;return O(k,function(j,ct,Et){if(D(j,ct,Et))return V=ct,!1}),V}function gs(k,D,O,V){for(var j=k.length,ct=O+(V?1:-1);V?ct--:++ct<j;)if(D(k[ct],ct,k))return ct;return-1}function Gn(k,D,O){return D===D?bg(k,D,O):gs(k,Ol,O)}function ag(k,D,O,V){for(var j=O-1,ct=k.length;++j<ct;)if(V(k[j],D))return j;return-1}function Ol(k){return k!==k}function Tl(k,D){var O=k==null?0:k.length;return O?ro(k,D)/O:Se}function io(k){return function(D){return D==null?e:D[k]}}function so(k){return function(D){return k==null?e:k[D]}}function Dl(k,D,O,V,j){return j(k,function(ct,Et,mt){O=V?(V=!1,ct):D(O,ct,Et,mt)}),O}function lg(k,D){var O=k.length;for(k.sort(D);O--;)k[O]=k[O].value;return k}function ro(k,D){for(var O,V=-1,j=k.length;++V<j;){var ct=D(k[V]);ct!==e&&(O=O===e?ct:O+ct)}return O}function oo(k,D){for(var O=-1,V=Array(k);++O<k;)V[O]=D(O);return V}function cg(k,D){return St(D,function(O){return[O,k[O]]})}function Ll(k){return k&&k.slice(0,Fl(k)+1).replace(Xr,"")}function re(k){return function(D){return k(D)}}function ao(k,D){return St(D,function(O){return k[O]})}function xi(k,D){return k.has(D)}function Rl(k,D){for(var O=-1,V=k.length;++O<V&&Gn(D,k[O],0)>-1;);return O}function El(k,D){for(var O=k.length;O--&&Gn(D,k[O],0)>-1;);return O}function hg(k,D){for(var O=k.length,V=0;O--;)k[O]===D&&++V;return V}var ug=so(Kd),fg=so(jd);function dg(k){return"\\"+Zd[k]}function gg(k,D){return k==null?e:k[D]}function Kn(k){return $d.test(k)}function pg(k){return Yd.test(k)}function mg(k){for(var D,O=[];!(D=k.next()).done;)O.push(D.value);return O}function lo(k){var D=-1,O=Array(k.size);return k.forEach(function(V,j){O[++D]=[j,V]}),O}function Il(k,D){return function(O){return k(D(O))}}function on(k,D){for(var O=-1,V=k.length,j=0,ct=[];++O<V;){var Et=k[O];(Et===D||Et===g)&&(k[O]=g,ct[j++]=O)}return ct}function ps(k){var D=-1,O=Array(k.size);return k.forEach(function(V){O[++D]=V}),O}function _g(k){var D=-1,O=Array(k.size);return k.forEach(function(V){O[++D]=[V,V]}),O}function bg(k,D,O){for(var V=O-1,j=k.length;++V<j;)if(k[V]===D)return V;return-1}function xg(k,D,O){for(var V=O+1;V--;)if(k[V]===D)return V;return V}function jn(k){return Kn(k)?vg(k):sg(k)}function ke(k){return Kn(k)?wg(k):rg(k)}function Fl(k){for(var D=k.length;D--&&hd.test(k.charAt(D)););return D}var yg=so(qd);function vg(k){for(var D=Zr.lastIndex=0;Zr.test(k);)++D;return D}function wg(k){return k.match(Zr)||[]}function Sg(k){return k.match(Ud)||[]}var Mg=function k(D){D=D==null?Nt:qn.defaults(Nt.Object(),D,qn.pick(Nt,Xd));var O=D.Array,V=D.Date,j=D.Error,ct=D.Function,Et=D.Math,mt=D.Object,co=D.RegExp,Ag=D.String,pe=D.TypeError,ms=O.prototype,kg=ct.prototype,Zn=mt.prototype,_s=D["__core-js_shared__"],bs=kg.toString,dt=Zn.hasOwnProperty,Pg=0,Bl=function(){var s=/[^.]+$/.exec(_s&&_s.keys&&_s.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),xs=Zn.toString,Cg=bs.call(mt),Og=Nt._,Tg=co("^"+bs.call(dt).replace(Yr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ys=yl?D.Buffer:e,an=D.Symbol,vs=D.Uint8Array,zl=ys?ys.allocUnsafe:e,ws=Il(mt.getPrototypeOf,mt),Wl=mt.create,Nl=Zn.propertyIsEnumerable,Ss=ms.splice,Hl=an?an.isConcatSpreadable:e,yi=an?an.iterator:e,Mn=an?an.toStringTag:e,Ms=function(){try{var s=On(mt,"defineProperty");return s({},"",{}),s}catch(o){}}(),Dg=D.clearTimeout!==Nt.clearTimeout&&D.clearTimeout,Lg=V&&V.now!==Nt.Date.now&&V.now,Rg=D.setTimeout!==Nt.setTimeout&&D.setTimeout,As=Et.ceil,ks=Et.floor,ho=mt.getOwnPropertySymbols,Eg=ys?ys.isBuffer:e,Vl=D.isFinite,Ig=ms.join,Fg=Il(mt.keys,mt),It=Et.max,Ut=Et.min,Bg=V.now,zg=D.parseInt,Ul=Et.random,Wg=ms.reverse,uo=On(D,"DataView"),vi=On(D,"Map"),fo=On(D,"Promise"),Jn=On(D,"Set"),wi=On(D,"WeakMap"),Si=On(mt,"create"),Ps=wi&&new wi,Qn={},Ng=Tn(uo),Hg=Tn(vi),Vg=Tn(fo),Ug=Tn(Jn),$g=Tn(wi),Cs=an?an.prototype:e,Mi=Cs?Cs.valueOf:e,$l=Cs?Cs.toString:e;function b(s){if(kt(s)&&!q(s)&&!(s instanceof st)){if(s instanceof me)return s;if(dt.call(s,"__wrapped__"))return Yc(s)}return new me(s)}var ti=function(){function s(){}return function(o){if(!At(o))return{};if(Wl)return Wl(o);s.prototype=o;var h=new s;return s.prototype=e,h}}();function Os(){}function me(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=e}b.templateSettings={escape:sd,evaluate:rd,interpolate:Qa,variable:"",imports:{_:b}},b.prototype=Os.prototype,b.prototype.constructor=b,me.prototype=ti(Os.prototype),me.prototype.constructor=me;function st(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Kt,this.__views__=[]}function Yg(){var s=new st(this.__wrapped__);return s.__actions__=Jt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Jt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Jt(this.__views__),s}function Xg(){if(this.__filtered__){var s=new st(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function Gg(){var s=this.__wrapped__.value(),o=this.__dir__,h=q(s),d=o<0,m=h?s.length:0,x=rm(0,m,this.__views__),v=x.start,M=x.end,P=M-v,R=d?M:v-1,E=this.__iteratees__,F=E.length,H=0,$=Ut(P,this.__takeCount__);if(!h||!d&&m==P&&$==P)return gc(s,this.__actions__);var G=[];t:for(;P--&&H<$;){R+=o;for(var et=-1,K=s[R];++et<F;){var it=E[et],ot=it.iteratee,le=it.type,Zt=ot(K);if(le==ht)K=Zt;else if(!Zt){if(le==Vt)continue t;break t}}G[H++]=K}return G}st.prototype=ti(Os.prototype),st.prototype.constructor=st;function An(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function Kg(){this.__data__=Si?Si(null):{},this.size=0}function jg(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function qg(s){var o=this.__data__;if(Si){var h=o[s];return h===u?e:h}return dt.call(o,s)?o[s]:e}function Zg(s){var o=this.__data__;return Si?o[s]!==e:dt.call(o,s)}function Jg(s,o){var h=this.__data__;return this.size+=this.has(s)?0:1,h[s]=Si&&o===e?u:o,this}An.prototype.clear=Kg,An.prototype.delete=jg,An.prototype.get=qg,An.prototype.has=Zg,An.prototype.set=Jg;function He(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function Qg(){this.__data__=[],this.size=0}function tp(s){var o=this.__data__,h=Ts(o,s);if(h<0)return!1;var d=o.length-1;return h==d?o.pop():Ss.call(o,h,1),--this.size,!0}function ep(s){var o=this.__data__,h=Ts(o,s);return h<0?e:o[h][1]}function np(s){return Ts(this.__data__,s)>-1}function ip(s,o){var h=this.__data__,d=Ts(h,s);return d<0?(++this.size,h.push([s,o])):h[d][1]=o,this}He.prototype.clear=Qg,He.prototype.delete=tp,He.prototype.get=ep,He.prototype.has=np,He.prototype.set=ip;function Ve(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function sp(){this.size=0,this.__data__={hash:new An,map:new(vi||He),string:new An}}function rp(s){var o=Vs(this,s).delete(s);return this.size-=o?1:0,o}function op(s){return Vs(this,s).get(s)}function ap(s){return Vs(this,s).has(s)}function lp(s,o){var h=Vs(this,s),d=h.size;return h.set(s,o),this.size+=h.size==d?0:1,this}Ve.prototype.clear=sp,Ve.prototype.delete=rp,Ve.prototype.get=op,Ve.prototype.has=ap,Ve.prototype.set=lp;function kn(s){var o=-1,h=s==null?0:s.length;for(this.__data__=new Ve;++o<h;)this.add(s[o])}function cp(s){return this.__data__.set(s,u),this}function hp(s){return this.__data__.has(s)}kn.prototype.add=kn.prototype.push=cp,kn.prototype.has=hp;function Pe(s){var o=this.__data__=new He(s);this.size=o.size}function up(){this.__data__=new He,this.size=0}function fp(s){var o=this.__data__,h=o.delete(s);return this.size=o.size,h}function dp(s){return this.__data__.get(s)}function gp(s){return this.__data__.has(s)}function pp(s,o){var h=this.__data__;if(h instanceof He){var d=h.__data__;if(!vi||d.length<r-1)return d.push([s,o]),this.size=++h.size,this;h=this.__data__=new Ve(d)}return h.set(s,o),this.size=h.size,this}Pe.prototype.clear=up,Pe.prototype.delete=fp,Pe.prototype.get=dp,Pe.prototype.has=gp,Pe.prototype.set=pp;function Yl(s,o){var h=q(s),d=!h&&Dn(s),m=!h&&!d&&fn(s),x=!h&&!d&&!m&&si(s),v=h||d||m||x,M=v?oo(s.length,Ag):[],P=M.length;for(var R in s)(o||dt.call(s,R))&&!(v&&(R=="length"||m&&(R=="offset"||R=="parent")||x&&(R=="buffer"||R=="byteLength"||R=="byteOffset")||Xe(R,P)))&&M.push(R);return M}function Xl(s){var o=s.length;return o?s[Mo(0,o-1)]:e}function mp(s,o){return Us(Jt(s),Pn(o,0,s.length))}function _p(s){return Us(Jt(s))}function go(s,o,h){(h!==e&&!Ce(s[o],h)||h===e&&!(o in s))&&Ue(s,o,h)}function Ai(s,o,h){var d=s[o];(!(dt.call(s,o)&&Ce(d,h))||h===e&&!(o in s))&&Ue(s,o,h)}function Ts(s,o){for(var h=s.length;h--;)if(Ce(s[h][0],o))return h;return-1}function bp(s,o,h,d){return ln(s,function(m,x,v){o(d,m,h(m),v)}),d}function Gl(s,o){return s&&Ie(o,zt(o),s)}function xp(s,o){return s&&Ie(o,te(o),s)}function Ue(s,o,h){o=="__proto__"&&Ms?Ms(s,o,{configurable:!0,enumerable:!0,value:h,writable:!0}):s[o]=h}function po(s,o){for(var h=-1,d=o.length,m=O(d),x=s==null;++h<d;)m[h]=x?e:jo(s,o[h]);return m}function Pn(s,o,h){return s===s&&(h!==e&&(s=s<=h?s:h),o!==e&&(s=s>=o?s:o)),s}function _e(s,o,h,d,m,x){var v,M=o&p,P=o&_,R=o&y;if(h&&(v=m?h(s,d,m,x):h(s)),v!==e)return v;if(!At(s))return s;var E=q(s);if(E){if(v=am(s),!M)return Jt(s,v)}else{var F=$t(s),H=F==ls||F==ja;if(fn(s))return _c(s,M);if(F==Ne||F==fe||H&&!m){if(v=P||H?{}:Fc(s),!M)return P?qp(s,xp(v,s)):jp(s,Gl(v,s))}else{if(!bt[F])return m?s:{};v=lm(s,F,M)}}x||(x=new Pe);var $=x.get(s);if($)return $;x.set(s,v),uh(s)?s.forEach(function(K){v.add(_e(K,o,h,K,s,x))}):ch(s)&&s.forEach(function(K,it){v.set(it,_e(K,o,h,it,s,x))});var G=R?P?Io:Eo:P?te:zt,et=E?e:G(s);return ge(et||s,function(K,it){et&&(it=K,K=s[it]),Ai(v,it,_e(K,o,h,it,s,x))}),v}function yp(s){var o=zt(s);return function(h){return Kl(h,s,o)}}function Kl(s,o,h){var d=h.length;if(s==null)return!d;for(s=mt(s);d--;){var m=h[d],x=o[m],v=s[m];if(v===e&&!(m in s)||!x(v))return!1}return!0}function jl(s,o,h){if(typeof s!="function")throw new pe(l);return Li(function(){s.apply(e,h)},o)}function ki(s,o,h,d){var m=-1,x=ds,v=!0,M=s.length,P=[],R=o.length;if(!M)return P;h&&(o=St(o,re(h))),d?(x=to,v=!1):o.length>=r&&(x=xi,v=!1,o=new kn(o));t:for(;++m<M;){var E=s[m],F=h==null?E:h(E);if(E=d||E!==0?E:0,v&&F===F){for(var H=R;H--;)if(o[H]===F)continue t;P.push(E)}else x(o,F,d)||P.push(E)}return P}var ln=wc(Ee),ql=wc(_o,!0);function vp(s,o){var h=!0;return ln(s,function(d,m,x){return h=!!o(d,m,x),h}),h}function Ds(s,o,h){for(var d=-1,m=s.length;++d<m;){var x=s[d],v=o(x);if(v!=null&&(M===e?v===v&&!ae(v):h(v,M)))var M=v,P=x}return P}function wp(s,o,h,d){var m=s.length;for(h=tt(h),h<0&&(h=-h>m?0:m+h),d=d===e||d>m?m:tt(d),d<0&&(d+=m),d=h>d?0:dh(d);h<d;)s[h++]=o;return s}function Zl(s,o){var h=[];return ln(s,function(d,m,x){o(d,m,x)&&h.push(d)}),h}function Ht(s,o,h,d,m){var x=-1,v=s.length;for(h||(h=hm),m||(m=[]);++x<v;){var M=s[x];o>0&&h(M)?o>1?Ht(M,o-1,h,d,m):rn(m,M):d||(m[m.length]=M)}return m}var mo=Sc(),Jl=Sc(!0);function Ee(s,o){return s&&mo(s,o,zt)}function _o(s,o){return s&&Jl(s,o,zt)}function Ls(s,o){return sn(o,function(h){return Ge(s[h])})}function Cn(s,o){o=hn(o,s);for(var h=0,d=o.length;s!=null&&h<d;)s=s[Fe(o[h++])];return h&&h==d?s:e}function Ql(s,o,h){var d=o(s);return q(s)?d:rn(d,h(s))}function jt(s){return s==null?s===e?Zf:jf:Mn&&Mn in mt(s)?sm(s):_m(s)}function bo(s,o){return s>o}function Sp(s,o){return s!=null&&dt.call(s,o)}function Mp(s,o){return s!=null&&o in mt(s)}function Ap(s,o,h){return s>=Ut(o,h)&&s<It(o,h)}function xo(s,o,h){for(var d=h?to:ds,m=s[0].length,x=s.length,v=x,M=O(x),P=1/0,R=[];v--;){var E=s[v];v&&o&&(E=St(E,re(o))),P=Ut(E.length,P),M[v]=!h&&(o||m>=120&&E.length>=120)?new kn(v&&E):e}E=s[0];var F=-1,H=M[0];t:for(;++F<m&&R.length<P;){var $=E[F],G=o?o($):$;if($=h||$!==0?$:0,!(H?xi(H,G):d(R,G,h))){for(v=x;--v;){var et=M[v];if(!(et?xi(et,G):d(s[v],G,h)))continue t}H&&H.push(G),R.push($)}}return R}function kp(s,o,h,d){return Ee(s,function(m,x,v){o(d,h(m),x,v)}),d}function Pi(s,o,h){o=hn(o,s),s=Nc(s,o);var d=s==null?s:s[Fe(xe(o))];return d==null?e:se(d,s,h)}function tc(s){return kt(s)&&jt(s)==fe}function Pp(s){return kt(s)&&jt(s)==bi}function Cp(s){return kt(s)&&jt(s)==di}function Ci(s,o,h,d,m){return s===o?!0:s==null||o==null||!kt(s)&&!kt(o)?s!==s&&o!==o:Op(s,o,h,d,Ci,m)}function Op(s,o,h,d,m,x){var v=q(s),M=q(o),P=v?Re:$t(s),R=M?Re:$t(o);P=P==fe?Ne:P,R=R==fe?Ne:R;var E=P==Ne,F=R==Ne,H=P==R;if(H&&fn(s)){if(!fn(o))return!1;v=!0,E=!1}if(H&&!E)return x||(x=new Pe),v||si(s)?Rc(s,o,h,d,m,x):nm(s,o,P,h,d,m,x);if(!(h&w)){var $=E&&dt.call(s,"__wrapped__"),G=F&&dt.call(o,"__wrapped__");if($||G){var et=$?s.value():s,K=G?o.value():o;return x||(x=new Pe),m(et,K,h,d,x)}}return H?(x||(x=new Pe),im(s,o,h,d,m,x)):!1}function Tp(s){return kt(s)&&$t(s)==Me}function yo(s,o,h,d){var m=h.length,x=m,v=!d;if(s==null)return!x;for(s=mt(s);m--;){var M=h[m];if(v&&M[2]?M[1]!==s[M[0]]:!(M[0]in s))return!1}for(;++m<x;){M=h[m];var P=M[0],R=s[P],E=M[1];if(v&&M[2]){if(R===e&&!(P in s))return!1}else{var F=new Pe;if(d)var H=d(R,E,P,s,o,F);if(!(H===e?Ci(E,R,w|S,d,F):H))return!1}}return!0}function ec(s){if(!At(s)||fm(s))return!1;var o=Ge(s)?Tg:yd;return o.test(Tn(s))}function Dp(s){return kt(s)&&jt(s)==pi}function Lp(s){return kt(s)&&$t(s)==Ae}function Rp(s){return kt(s)&&js(s.length)&&!!yt[jt(s)]}function nc(s){return typeof s=="function"?s:s==null?ee:typeof s=="object"?q(s)?rc(s[0],s[1]):sc(s):Mh(s)}function vo(s){if(!Di(s))return Fg(s);var o=[];for(var h in mt(s))dt.call(s,h)&&h!="constructor"&&o.push(h);return o}function Ep(s){if(!At(s))return mm(s);var o=Di(s),h=[];for(var d in s)d=="constructor"&&(o||!dt.call(s,d))||h.push(d);return h}function wo(s,o){return s<o}function ic(s,o){var h=-1,d=Qt(s)?O(s.length):[];return ln(s,function(m,x,v){d[++h]=o(m,x,v)}),d}function sc(s){var o=Bo(s);return o.length==1&&o[0][2]?zc(o[0][0],o[0][1]):function(h){return h===s||yo(h,s,o)}}function rc(s,o){return Wo(s)&&Bc(o)?zc(Fe(s),o):function(h){var d=jo(h,s);return d===e&&d===o?qo(h,s):Ci(o,d,w|S)}}function Rs(s,o,h,d,m){s!==o&&mo(o,function(x,v){if(m||(m=new Pe),At(x))Ip(s,o,v,h,Rs,d,m);else{var M=d?d(Ho(s,v),x,v+"",s,o,m):e;M===e&&(M=x),go(s,v,M)}},te)}function Ip(s,o,h,d,m,x,v){var M=Ho(s,h),P=Ho(o,h),R=v.get(P);if(R){go(s,h,R);return}var E=x?x(M,P,h+"",s,o,v):e,F=E===e;if(F){var H=q(P),$=!H&&fn(P),G=!H&&!$&&si(P);E=P,H||$||G?q(M)?E=M:Ot(M)?E=Jt(M):$?(F=!1,E=_c(P,!0)):G?(F=!1,E=bc(P,!0)):E=[]:Ri(P)||Dn(P)?(E=M,Dn(M)?E=gh(M):(!At(M)||Ge(M))&&(E=Fc(P))):F=!1}F&&(v.set(P,E),m(E,P,d,x,v),v.delete(P)),go(s,h,E)}function oc(s,o){var h=s.length;if(!!h)return o+=o<0?h:0,Xe(o,h)?s[o]:e}function ac(s,o,h){o.length?o=St(o,function(x){return q(x)?function(v){return Cn(v,x.length===1?x[0]:x)}:x}):o=[ee];var d=-1;o=St(o,re(X()));var m=ic(s,function(x,v,M){var P=St(o,function(R){return R(x)});return{criteria:P,index:++d,value:x}});return lg(m,function(x,v){return Kp(x,v,h)})}function Fp(s,o){return lc(s,o,function(h,d){return qo(s,d)})}function lc(s,o,h){for(var d=-1,m=o.length,x={};++d<m;){var v=o[d],M=Cn(s,v);h(M,v)&&Oi(x,hn(v,s),M)}return x}function Bp(s){return function(o){return Cn(o,s)}}function So(s,o,h,d){var m=d?ag:Gn,x=-1,v=o.length,M=s;for(s===o&&(o=Jt(o)),h&&(M=St(s,re(h)));++x<v;)for(var P=0,R=o[x],E=h?h(R):R;(P=m(M,E,P,d))>-1;)M!==s&&Ss.call(M,P,1),Ss.call(s,P,1);return s}function cc(s,o){for(var h=s?o.length:0,d=h-1;h--;){var m=o[h];if(h==d||m!==x){var x=m;Xe(m)?Ss.call(s,m,1):Po(s,m)}}return s}function Mo(s,o){return s+ks(Ul()*(o-s+1))}function zp(s,o,h,d){for(var m=-1,x=It(As((o-s)/(h||1)),0),v=O(x);x--;)v[d?x:++m]=s,s+=h;return v}function Ao(s,o){var h="";if(!s||o<1||o>Lt)return h;do o%2&&(h+=s),o=ks(o/2),o&&(s+=s);while(o);return h}function nt(s,o){return Vo(Wc(s,o,ee),s+"")}function Wp(s){return Xl(ri(s))}function Np(s,o){var h=ri(s);return Us(h,Pn(o,0,h.length))}function Oi(s,o,h,d){if(!At(s))return s;o=hn(o,s);for(var m=-1,x=o.length,v=x-1,M=s;M!=null&&++m<x;){var P=Fe(o[m]),R=h;if(P==="__proto__"||P==="constructor"||P==="prototype")return s;if(m!=v){var E=M[P];R=d?d(E,P,M):e,R===e&&(R=At(E)?E:Xe(o[m+1])?[]:{})}Ai(M,P,R),M=M[P]}return s}var hc=Ps?function(s,o){return Ps.set(s,o),s}:ee,Hp=Ms?function(s,o){return Ms(s,"toString",{configurable:!0,enumerable:!1,value:Jo(o),writable:!0})}:ee;function Vp(s){return Us(ri(s))}function be(s,o,h){var d=-1,m=s.length;o<0&&(o=-o>m?0:m+o),h=h>m?m:h,h<0&&(h+=m),m=o>h?0:h-o>>>0,o>>>=0;for(var x=O(m);++d<m;)x[d]=s[d+o];return x}function Up(s,o){var h;return ln(s,function(d,m,x){return h=o(d,m,x),!h}),!!h}function Es(s,o,h){var d=0,m=s==null?d:s.length;if(typeof o=="number"&&o===o&&m<=vn){for(;d<m;){var x=d+m>>>1,v=s[x];v!==null&&!ae(v)&&(h?v<=o:v<o)?d=x+1:m=x}return m}return ko(s,o,ee,h)}function ko(s,o,h,d){var m=0,x=s==null?0:s.length;if(x===0)return 0;o=h(o);for(var v=o!==o,M=o===null,P=ae(o),R=o===e;m<x;){var E=ks((m+x)/2),F=h(s[E]),H=F!==e,$=F===null,G=F===F,et=ae(F);if(v)var K=d||G;else R?K=G&&(d||H):M?K=G&&H&&(d||!$):P?K=G&&H&&!$&&(d||!et):$||et?K=!1:K=d?F<=o:F<o;K?m=E+1:x=E}return Ut(x,nn)}function uc(s,o){for(var h=-1,d=s.length,m=0,x=[];++h<d;){var v=s[h],M=o?o(v):v;if(!h||!Ce(M,P)){var P=M;x[m++]=v===0?0:v}}return x}function fc(s){return typeof s=="number"?s:ae(s)?Se:+s}function oe(s){if(typeof s=="string")return s;if(q(s))return St(s,oe)+"";if(ae(s))return $l?$l.call(s):"";var o=s+"";return o=="0"&&1/s==-ft?"-0":o}function cn(s,o,h){var d=-1,m=ds,x=s.length,v=!0,M=[],P=M;if(h)v=!1,m=to;else if(x>=r){var R=o?null:tm(s);if(R)return ps(R);v=!1,m=xi,P=new kn}else P=o?[]:M;t:for(;++d<x;){var E=s[d],F=o?o(E):E;if(E=h||E!==0?E:0,v&&F===F){for(var H=P.length;H--;)if(P[H]===F)continue t;o&&P.push(F),M.push(E)}else m(P,F,h)||(P!==M&&P.push(F),M.push(E))}return M}function Po(s,o){return o=hn(o,s),s=Nc(s,o),s==null||delete s[Fe(xe(o))]}function dc(s,o,h,d){return Oi(s,o,h(Cn(s,o)),d)}function Is(s,o,h,d){for(var m=s.length,x=d?m:-1;(d?x--:++x<m)&&o(s[x],x,s););return h?be(s,d?0:x,d?x+1:m):be(s,d?x+1:0,d?m:x)}function gc(s,o){var h=s;return h instanceof st&&(h=h.value()),eo(o,function(d,m){return m.func.apply(m.thisArg,rn([d],m.args))},h)}function Co(s,o,h){var d=s.length;if(d<2)return d?cn(s[0]):[];for(var m=-1,x=O(d);++m<d;)for(var v=s[m],M=-1;++M<d;)M!=m&&(x[m]=ki(x[m]||v,s[M],o,h));return cn(Ht(x,1),o,h)}function pc(s,o,h){for(var d=-1,m=s.length,x=o.length,v={};++d<m;){var M=d<x?o[d]:e;h(v,s[d],M)}return v}function Oo(s){return Ot(s)?s:[]}function To(s){return typeof s=="function"?s:ee}function hn(s,o){return q(s)?s:Wo(s,o)?[s]:$c(ut(s))}var $p=nt;function un(s,o,h){var d=s.length;return h=h===e?d:h,!o&&h>=d?s:be(s,o,h)}var mc=Dg||function(s){return Nt.clearTimeout(s)};function _c(s,o){if(o)return s.slice();var h=s.length,d=zl?zl(h):new s.constructor(h);return s.copy(d),d}function Do(s){var o=new s.constructor(s.byteLength);return new vs(o).set(new vs(s)),o}function Yp(s,o){var h=o?Do(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function Xp(s){var o=new s.constructor(s.source,tl.exec(s));return o.lastIndex=s.lastIndex,o}function Gp(s){return Mi?mt(Mi.call(s)):{}}function bc(s,o){var h=o?Do(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function xc(s,o){if(s!==o){var h=s!==e,d=s===null,m=s===s,x=ae(s),v=o!==e,M=o===null,P=o===o,R=ae(o);if(!M&&!R&&!x&&s>o||x&&v&&P&&!M&&!R||d&&v&&P||!h&&P||!m)return 1;if(!d&&!x&&!R&&s<o||R&&h&&m&&!d&&!x||M&&h&&m||!v&&m||!P)return-1}return 0}function Kp(s,o,h){for(var d=-1,m=s.criteria,x=o.criteria,v=m.length,M=h.length;++d<v;){var P=xc(m[d],x[d]);if(P){if(d>=M)return P;var R=h[d];return P*(R=="desc"?-1:1)}}return s.index-o.index}function yc(s,o,h,d){for(var m=-1,x=s.length,v=h.length,M=-1,P=o.length,R=It(x-v,0),E=O(P+R),F=!d;++M<P;)E[M]=o[M];for(;++m<v;)(F||m<x)&&(E[h[m]]=s[m]);for(;R--;)E[M++]=s[m++];return E}function vc(s,o,h,d){for(var m=-1,x=s.length,v=-1,M=h.length,P=-1,R=o.length,E=It(x-M,0),F=O(E+R),H=!d;++m<E;)F[m]=s[m];for(var $=m;++P<R;)F[$+P]=o[P];for(;++v<M;)(H||m<x)&&(F[$+h[v]]=s[m++]);return F}function Jt(s,o){var h=-1,d=s.length;for(o||(o=O(d));++h<d;)o[h]=s[h];return o}function Ie(s,o,h,d){var m=!h;h||(h={});for(var x=-1,v=o.length;++x<v;){var M=o[x],P=d?d(h[M],s[M],M,h,s):e;P===e&&(P=s[M]),m?Ue(h,M,P):Ai(h,M,P)}return h}function jp(s,o){return Ie(s,zo(s),o)}function qp(s,o){return Ie(s,Ec(s),o)}function Fs(s,o){return function(h,d){var m=q(h)?eg:bp,x=o?o():{};return m(h,s,X(d,2),x)}}function ei(s){return nt(function(o,h){var d=-1,m=h.length,x=m>1?h[m-1]:e,v=m>2?h[2]:e;for(x=s.length>3&&typeof x=="function"?(m--,x):e,v&&qt(h[0],h[1],v)&&(x=m<3?e:x,m=1),o=mt(o);++d<m;){var M=h[d];M&&s(o,M,d,x)}return o})}function wc(s,o){return function(h,d){if(h==null)return h;if(!Qt(h))return s(h,d);for(var m=h.length,x=o?m:-1,v=mt(h);(o?x--:++x<m)&&d(v[x],x,v)!==!1;);return h}}function Sc(s){return function(o,h,d){for(var m=-1,x=mt(o),v=d(o),M=v.length;M--;){var P=v[s?M:++m];if(h(x[P],P,x)===!1)break}return o}}function Zp(s,o,h){var d=o&A,m=Ti(s);function x(){var v=this&&this!==Nt&&this instanceof x?m:s;return v.apply(d?h:this,arguments)}return x}function Mc(s){return function(o){o=ut(o);var h=Kn(o)?ke(o):e,d=h?h[0]:o.charAt(0),m=h?un(h,1).join(""):o.slice(1);return d[s]()+m}}function ni(s){return function(o){return eo(wh(vh(o).replace(Hd,"")),s,"")}}function Ti(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var h=ti(s.prototype),d=s.apply(h,o);return At(d)?d:h}}function Jp(s,o,h){var d=Ti(s);function m(){for(var x=arguments.length,v=O(x),M=x,P=ii(m);M--;)v[M]=arguments[M];var R=x<3&&v[0]!==P&&v[x-1]!==P?[]:on(v,P);if(x-=R.length,x<h)return Oc(s,o,Bs,m.placeholder,e,v,R,e,e,h-x);var E=this&&this!==Nt&&this instanceof m?d:s;return se(E,this,v)}return m}function Ac(s){return function(o,h,d){var m=mt(o);if(!Qt(o)){var x=X(h,3);o=zt(o),h=function(M){return x(m[M],M,m)}}var v=s(o,h,d);return v>-1?m[x?o[v]:v]:e}}function kc(s){return Ye(function(o){var h=o.length,d=h,m=me.prototype.thru;for(s&&o.reverse();d--;){var x=o[d];if(typeof x!="function")throw new pe(l);if(m&&!v&&Hs(x)=="wrapper")var v=new me([],!0)}for(d=v?d:h;++d<h;){x=o[d];var M=Hs(x),P=M=="wrapper"?Fo(x):e;P&&No(P[0])&&P[1]==(W|I|L|N)&&!P[4].length&&P[9]==1?v=v[Hs(P[0])].apply(v,P[3]):v=x.length==1&&No(x)?v[M]():v.thru(x)}return function(){var R=arguments,E=R[0];if(v&&R.length==1&&q(E))return v.plant(E).value();for(var F=0,H=h?o[F].apply(this,R):E;++F<h;)H=o[F].call(this,H);return H}})}function Bs(s,o,h,d,m,x,v,M,P,R){var E=o&W,F=o&A,H=o&C,$=o&(I|B),G=o&Y,et=H?e:Ti(s);function K(){for(var it=arguments.length,ot=O(it),le=it;le--;)ot[le]=arguments[le];if($)var Zt=ii(K),ce=hg(ot,Zt);if(d&&(ot=yc(ot,d,m,$)),x&&(ot=vc(ot,x,v,$)),it-=ce,$&&it<R){var Tt=on(ot,Zt);return Oc(s,o,Bs,K.placeholder,h,ot,Tt,M,P,R-it)}var Oe=F?h:this,je=H?Oe[s]:s;return it=ot.length,M?ot=bm(ot,M):G&&it>1&&ot.reverse(),E&&P<it&&(ot.length=P),this&&this!==Nt&&this instanceof K&&(je=et||Ti(je)),je.apply(Oe,ot)}return K}function Pc(s,o){return function(h,d){return kp(h,s,o(d),{})}}function zs(s,o){return function(h,d){var m;if(h===e&&d===e)return o;if(h!==e&&(m=h),d!==e){if(m===e)return d;typeof h=="string"||typeof d=="string"?(h=oe(h),d=oe(d)):(h=fc(h),d=fc(d)),m=s(h,d)}return m}}function Lo(s){return Ye(function(o){return o=St(o,re(X())),nt(function(h){var d=this;return s(o,function(m){return se(m,d,h)})})})}function Ws(s,o){o=o===e?" ":oe(o);var h=o.length;if(h<2)return h?Ao(o,s):o;var d=Ao(o,As(s/jn(o)));return Kn(o)?un(ke(d),0,s).join(""):d.slice(0,s)}function Qp(s,o,h,d){var m=o&A,x=Ti(s);function v(){for(var M=-1,P=arguments.length,R=-1,E=d.length,F=O(E+P),H=this&&this!==Nt&&this instanceof v?x:s;++R<E;)F[R]=d[R];for(;P--;)F[R++]=arguments[++M];return se(H,m?h:this,F)}return v}function Cc(s){return function(o,h,d){return d&&typeof d!="number"&&qt(o,h,d)&&(h=d=e),o=Ke(o),h===e?(h=o,o=0):h=Ke(h),d=d===e?o<h?1:-1:Ke(d),zp(o,h,d,s)}}function Ns(s){return function(o,h){return typeof o=="string"&&typeof h=="string"||(o=ye(o),h=ye(h)),s(o,h)}}function Oc(s,o,h,d,m,x,v,M,P,R){var E=o&I,F=E?v:e,H=E?e:v,$=E?x:e,G=E?e:x;o|=E?L:z,o&=~(E?z:L),o&T||(o&=~(A|C));var et=[s,o,m,$,F,G,H,M,P,R],K=h.apply(e,et);return No(s)&&Hc(K,et),K.placeholder=d,Vc(K,s,o)}function Ro(s){var o=Et[s];return function(h,d){if(h=ye(h),d=d==null?0:Ut(tt(d),292),d&&Vl(h)){var m=(ut(h)+"e").split("e"),x=o(m[0]+"e"+(+m[1]+d));return m=(ut(x)+"e").split("e"),+(m[0]+"e"+(+m[1]-d))}return o(h)}}var tm=Jn&&1/ps(new Jn([,-0]))[1]==ft?function(s){return new Jn(s)}:ea;function Tc(s){return function(o){var h=$t(o);return h==Me?lo(o):h==Ae?_g(o):cg(o,s(o))}}function $e(s,o,h,d,m,x,v,M){var P=o&C;if(!P&&typeof s!="function")throw new pe(l);var R=d?d.length:0;if(R||(o&=~(L|z),d=m=e),v=v===e?v:It(tt(v),0),M=M===e?M:tt(M),R-=m?m.length:0,o&z){var E=d,F=m;d=m=e}var H=P?e:Fo(s),$=[s,o,h,d,m,E,F,x,v,M];if(H&&pm($,H),s=$[0],o=$[1],h=$[2],d=$[3],m=$[4],M=$[9]=$[9]===e?P?0:s.length:It($[9]-R,0),!M&&o&(I|B)&&(o&=~(I|B)),!o||o==A)var G=Zp(s,o,h);else o==I||o==B?G=Jp(s,o,M):(o==L||o==(A|L))&&!m.length?G=Qp(s,o,h,d):G=Bs.apply(e,$);var et=H?hc:Hc;return Vc(et(G,$),s,o)}function Dc(s,o,h,d){return s===e||Ce(s,Zn[h])&&!dt.call(d,h)?o:s}function Lc(s,o,h,d,m,x){return At(s)&&At(o)&&(x.set(o,s),Rs(s,o,e,Lc,x),x.delete(o)),s}function em(s){return Ri(s)?e:s}function Rc(s,o,h,d,m,x){var v=h&w,M=s.length,P=o.length;if(M!=P&&!(v&&P>M))return!1;var R=x.get(s),E=x.get(o);if(R&&E)return R==o&&E==s;var F=-1,H=!0,$=h&S?new kn:e;for(x.set(s,o),x.set(o,s);++F<M;){var G=s[F],et=o[F];if(d)var K=v?d(et,G,F,o,s,x):d(G,et,F,s,o,x);if(K!==e){if(K)continue;H=!1;break}if($){if(!no(o,function(it,ot){if(!xi($,ot)&&(G===it||m(G,it,h,d,x)))return $.push(ot)})){H=!1;break}}else if(!(G===et||m(G,et,h,d,x))){H=!1;break}}return x.delete(s),x.delete(o),H}function nm(s,o,h,d,m,x,v){switch(h){case Yn:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case bi:return!(s.byteLength!=o.byteLength||!x(new vs(s),new vs(o)));case fi:case di:case gi:return Ce(+s,+o);case as:return s.name==o.name&&s.message==o.message;case pi:case mi:return s==o+"";case Me:var M=lo;case Ae:var P=d&w;if(M||(M=ps),s.size!=o.size&&!P)return!1;var R=v.get(s);if(R)return R==o;d|=S,v.set(s,o);var E=Rc(M(s),M(o),d,m,x,v);return v.delete(s),E;case cs:if(Mi)return Mi.call(s)==Mi.call(o)}return!1}function im(s,o,h,d,m,x){var v=h&w,M=Eo(s),P=M.length,R=Eo(o),E=R.length;if(P!=E&&!v)return!1;for(var F=P;F--;){var H=M[F];if(!(v?H in o:dt.call(o,H)))return!1}var $=x.get(s),G=x.get(o);if($&&G)return $==o&&G==s;var et=!0;x.set(s,o),x.set(o,s);for(var K=v;++F<P;){H=M[F];var it=s[H],ot=o[H];if(d)var le=v?d(ot,it,H,o,s,x):d(it,ot,H,s,o,x);if(!(le===e?it===ot||m(it,ot,h,d,x):le)){et=!1;break}K||(K=H=="constructor")}if(et&&!K){var Zt=s.constructor,ce=o.constructor;Zt!=ce&&"constructor"in s&&"constructor"in o&&!(typeof Zt=="function"&&Zt instanceof Zt&&typeof ce=="function"&&ce instanceof ce)&&(et=!1)}return x.delete(s),x.delete(o),et}function Ye(s){return Vo(Wc(s,e,Kc),s+"")}function Eo(s){return Ql(s,zt,zo)}function Io(s){return Ql(s,te,Ec)}var Fo=Ps?function(s){return Ps.get(s)}:ea;function Hs(s){for(var o=s.name+"",h=Qn[o],d=dt.call(Qn,o)?h.length:0;d--;){var m=h[d],x=m.func;if(x==null||x==s)return m.name}return o}function ii(s){var o=dt.call(b,"placeholder")?b:s;return o.placeholder}function X(){var s=b.iteratee||Qo;return s=s===Qo?nc:s,arguments.length?s(arguments[0],arguments[1]):s}function Vs(s,o){var h=s.__data__;return um(o)?h[typeof o=="string"?"string":"hash"]:h.map}function Bo(s){for(var o=zt(s),h=o.length;h--;){var d=o[h],m=s[d];o[h]=[d,m,Bc(m)]}return o}function On(s,o){var h=gg(s,o);return ec(h)?h:e}function sm(s){var o=dt.call(s,Mn),h=s[Mn];try{s[Mn]=e;var d=!0}catch(x){}var m=xs.call(s);return d&&(o?s[Mn]=h:delete s[Mn]),m}var zo=ho?function(s){return s==null?[]:(s=mt(s),sn(ho(s),function(o){return Nl.call(s,o)}))}:na,Ec=ho?function(s){for(var o=[];s;)rn(o,zo(s)),s=ws(s);return o}:na,$t=jt;(uo&&$t(new uo(new ArrayBuffer(1)))!=Yn||vi&&$t(new vi)!=Me||fo&&$t(fo.resolve())!=qa||Jn&&$t(new Jn)!=Ae||wi&&$t(new wi)!=_i)&&($t=function(s){var o=jt(s),h=o==Ne?s.constructor:e,d=h?Tn(h):"";if(d)switch(d){case Ng:return Yn;case Hg:return Me;case Vg:return qa;case Ug:return Ae;case $g:return _i}return o});function rm(s,o,h){for(var d=-1,m=h.length;++d<m;){var x=h[d],v=x.size;switch(x.type){case"drop":s+=v;break;case"dropRight":o-=v;break;case"take":o=Ut(o,s+v);break;case"takeRight":s=It(s,o-v);break}}return{start:s,end:o}}function om(s){var o=s.match(fd);return o?o[1].split(dd):[]}function Ic(s,o,h){o=hn(o,s);for(var d=-1,m=o.length,x=!1;++d<m;){var v=Fe(o[d]);if(!(x=s!=null&&h(s,v)))break;s=s[v]}return x||++d!=m?x:(m=s==null?0:s.length,!!m&&js(m)&&Xe(v,m)&&(q(s)||Dn(s)))}function am(s){var o=s.length,h=new s.constructor(o);return o&&typeof s[0]=="string"&&dt.call(s,"index")&&(h.index=s.index,h.input=s.input),h}function Fc(s){return typeof s.constructor=="function"&&!Di(s)?ti(ws(s)):{}}function lm(s,o,h){var d=s.constructor;switch(o){case bi:return Do(s);case fi:case di:return new d(+s);case Yn:return Yp(s,h);case Fr:case Br:case zr:case Wr:case Nr:case Hr:case Vr:case Ur:case $r:return bc(s,h);case Me:return new d;case gi:case mi:return new d(s);case pi:return Xp(s);case Ae:return new d;case cs:return Gp(s)}}function cm(s,o){var h=o.length;if(!h)return s;var d=h-1;return o[d]=(h>1?"& ":"")+o[d],o=o.join(h>2?", ":" "),s.replace(ud,`{
|
|
/* [wrapped with `+o+`] */
|
|
`)}function hm(s){return q(s)||Dn(s)||!!(Hl&&s&&s[Hl])}function Xe(s,o){var h=typeof s;return o=o==null?Lt:o,!!o&&(h=="number"||h!="symbol"&&wd.test(s))&&s>-1&&s%1==0&&s<o}function qt(s,o,h){if(!At(h))return!1;var d=typeof o;return(d=="number"?Qt(h)&&Xe(o,h.length):d=="string"&&o in h)?Ce(h[o],s):!1}function Wo(s,o){if(q(s))return!1;var h=typeof s;return h=="number"||h=="symbol"||h=="boolean"||s==null||ae(s)?!0:ad.test(s)||!od.test(s)||o!=null&&s in mt(o)}function um(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function No(s){var o=Hs(s),h=b[o];if(typeof h!="function"||!(o in st.prototype))return!1;if(s===h)return!0;var d=Fo(h);return!!d&&s===d[0]}function fm(s){return!!Bl&&Bl in s}var dm=_s?Ge:ia;function Di(s){var o=s&&s.constructor,h=typeof o=="function"&&o.prototype||Zn;return s===h}function Bc(s){return s===s&&!At(s)}function zc(s,o){return function(h){return h==null?!1:h[s]===o&&(o!==e||s in mt(h))}}function gm(s){var o=Gs(s,function(d){return h.size===f&&h.clear(),d}),h=o.cache;return o}function pm(s,o){var h=s[1],d=o[1],m=h|d,x=m<(A|C|W),v=d==W&&h==I||d==W&&h==N&&s[7].length<=o[8]||d==(W|N)&&o[7].length<=o[8]&&h==I;if(!(x||v))return s;d&A&&(s[2]=o[2],m|=h&A?0:T);var M=o[3];if(M){var P=s[3];s[3]=P?yc(P,M,o[4]):M,s[4]=P?on(s[3],g):o[4]}return M=o[5],M&&(P=s[5],s[5]=P?vc(P,M,o[6]):M,s[6]=P?on(s[5],g):o[6]),M=o[7],M&&(s[7]=M),d&W&&(s[8]=s[8]==null?o[8]:Ut(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=m,s}function mm(s){var o=[];if(s!=null)for(var h in mt(s))o.push(h);return o}function _m(s){return xs.call(s)}function Wc(s,o,h){return o=It(o===e?s.length-1:o,0),function(){for(var d=arguments,m=-1,x=It(d.length-o,0),v=O(x);++m<x;)v[m]=d[o+m];m=-1;for(var M=O(o+1);++m<o;)M[m]=d[m];return M[o]=h(v),se(s,this,M)}}function Nc(s,o){return o.length<2?s:Cn(s,be(o,0,-1))}function bm(s,o){for(var h=s.length,d=Ut(o.length,h),m=Jt(s);d--;){var x=o[d];s[d]=Xe(x,h)?m[x]:e}return s}function Ho(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var Hc=Uc(hc),Li=Rg||function(s,o){return Nt.setTimeout(s,o)},Vo=Uc(Hp);function Vc(s,o,h){var d=o+"";return Vo(s,cm(d,xm(om(d),h)))}function Uc(s){var o=0,h=0;return function(){var d=Bg(),m=Rt-(d-h);if(h=d,m>0){if(++o>=at)return arguments[0]}else o=0;return s.apply(e,arguments)}}function Us(s,o){var h=-1,d=s.length,m=d-1;for(o=o===e?d:o;++h<o;){var x=Mo(h,m),v=s[x];s[x]=s[h],s[h]=v}return s.length=o,s}var $c=gm(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(ld,function(h,d,m,x){o.push(m?x.replace(md,"$1"):d||h)}),o});function Fe(s){if(typeof s=="string"||ae(s))return s;var o=s+"";return o=="0"&&1/s==-ft?"-0":o}function Tn(s){if(s!=null){try{return bs.call(s)}catch(o){}try{return s+""}catch(o){}}return""}function xm(s,o){return ge(wn,function(h){var d="_."+h[0];o&h[1]&&!ds(s,d)&&s.push(d)}),s.sort()}function Yc(s){if(s instanceof st)return s.clone();var o=new me(s.__wrapped__,s.__chain__);return o.__actions__=Jt(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function ym(s,o,h){(h?qt(s,o,h):o===e)?o=1:o=It(tt(o),0);var d=s==null?0:s.length;if(!d||o<1)return[];for(var m=0,x=0,v=O(As(d/o));m<d;)v[x++]=be(s,m,m+=o);return v}function vm(s){for(var o=-1,h=s==null?0:s.length,d=0,m=[];++o<h;){var x=s[o];x&&(m[d++]=x)}return m}function wm(){var s=arguments.length;if(!s)return[];for(var o=O(s-1),h=arguments[0],d=s;d--;)o[d-1]=arguments[d];return rn(q(h)?Jt(h):[h],Ht(o,1))}var Sm=nt(function(s,o){return Ot(s)?ki(s,Ht(o,1,Ot,!0)):[]}),Mm=nt(function(s,o){var h=xe(o);return Ot(h)&&(h=e),Ot(s)?ki(s,Ht(o,1,Ot,!0),X(h,2)):[]}),Am=nt(function(s,o){var h=xe(o);return Ot(h)&&(h=e),Ot(s)?ki(s,Ht(o,1,Ot,!0),e,h):[]});function km(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),be(s,o<0?0:o,d)):[]}function Pm(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),o=d-o,be(s,0,o<0?0:o)):[]}function Cm(s,o){return s&&s.length?Is(s,X(o,3),!0,!0):[]}function Om(s,o){return s&&s.length?Is(s,X(o,3),!0):[]}function Tm(s,o,h,d){var m=s==null?0:s.length;return m?(h&&typeof h!="number"&&qt(s,o,h)&&(h=0,d=m),wp(s,o,h,d)):[]}function Xc(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=h==null?0:tt(h);return m<0&&(m=It(d+m,0)),gs(s,X(o,3),m)}function Gc(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=d-1;return h!==e&&(m=tt(h),m=h<0?It(d+m,0):Ut(m,d-1)),gs(s,X(o,3),m,!0)}function Kc(s){var o=s==null?0:s.length;return o?Ht(s,1):[]}function Dm(s){var o=s==null?0:s.length;return o?Ht(s,ft):[]}function Lm(s,o){var h=s==null?0:s.length;return h?(o=o===e?1:tt(o),Ht(s,o)):[]}function Rm(s){for(var o=-1,h=s==null?0:s.length,d={};++o<h;){var m=s[o];d[m[0]]=m[1]}return d}function jc(s){return s&&s.length?s[0]:e}function Em(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=h==null?0:tt(h);return m<0&&(m=It(d+m,0)),Gn(s,o,m)}function Im(s){var o=s==null?0:s.length;return o?be(s,0,-1):[]}var Fm=nt(function(s){var o=St(s,Oo);return o.length&&o[0]===s[0]?xo(o):[]}),Bm=nt(function(s){var o=xe(s),h=St(s,Oo);return o===xe(h)?o=e:h.pop(),h.length&&h[0]===s[0]?xo(h,X(o,2)):[]}),zm=nt(function(s){var o=xe(s),h=St(s,Oo);return o=typeof o=="function"?o:e,o&&h.pop(),h.length&&h[0]===s[0]?xo(h,e,o):[]});function Wm(s,o){return s==null?"":Ig.call(s,o)}function xe(s){var o=s==null?0:s.length;return o?s[o-1]:e}function Nm(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=d;return h!==e&&(m=tt(h),m=m<0?It(d+m,0):Ut(m,d-1)),o===o?xg(s,o,m):gs(s,Ol,m,!0)}function Hm(s,o){return s&&s.length?oc(s,tt(o)):e}var Vm=nt(qc);function qc(s,o){return s&&s.length&&o&&o.length?So(s,o):s}function Um(s,o,h){return s&&s.length&&o&&o.length?So(s,o,X(h,2)):s}function $m(s,o,h){return s&&s.length&&o&&o.length?So(s,o,e,h):s}var Ym=Ye(function(s,o){var h=s==null?0:s.length,d=po(s,o);return cc(s,St(o,function(m){return Xe(m,h)?+m:m}).sort(xc)),d});function Xm(s,o){var h=[];if(!(s&&s.length))return h;var d=-1,m=[],x=s.length;for(o=X(o,3);++d<x;){var v=s[d];o(v,d,s)&&(h.push(v),m.push(d))}return cc(s,m),h}function Uo(s){return s==null?s:Wg.call(s)}function Gm(s,o,h){var d=s==null?0:s.length;return d?(h&&typeof h!="number"&&qt(s,o,h)?(o=0,h=d):(o=o==null?0:tt(o),h=h===e?d:tt(h)),be(s,o,h)):[]}function Km(s,o){return Es(s,o)}function jm(s,o,h){return ko(s,o,X(h,2))}function qm(s,o){var h=s==null?0:s.length;if(h){var d=Es(s,o);if(d<h&&Ce(s[d],o))return d}return-1}function Zm(s,o){return Es(s,o,!0)}function Jm(s,o,h){return ko(s,o,X(h,2),!0)}function Qm(s,o){var h=s==null?0:s.length;if(h){var d=Es(s,o,!0)-1;if(Ce(s[d],o))return d}return-1}function t_(s){return s&&s.length?uc(s):[]}function e_(s,o){return s&&s.length?uc(s,X(o,2)):[]}function n_(s){var o=s==null?0:s.length;return o?be(s,1,o):[]}function i_(s,o,h){return s&&s.length?(o=h||o===e?1:tt(o),be(s,0,o<0?0:o)):[]}function s_(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),o=d-o,be(s,o<0?0:o,d)):[]}function r_(s,o){return s&&s.length?Is(s,X(o,3),!1,!0):[]}function o_(s,o){return s&&s.length?Is(s,X(o,3)):[]}var a_=nt(function(s){return cn(Ht(s,1,Ot,!0))}),l_=nt(function(s){var o=xe(s);return Ot(o)&&(o=e),cn(Ht(s,1,Ot,!0),X(o,2))}),c_=nt(function(s){var o=xe(s);return o=typeof o=="function"?o:e,cn(Ht(s,1,Ot,!0),e,o)});function h_(s){return s&&s.length?cn(s):[]}function u_(s,o){return s&&s.length?cn(s,X(o,2)):[]}function f_(s,o){return o=typeof o=="function"?o:e,s&&s.length?cn(s,e,o):[]}function $o(s){if(!(s&&s.length))return[];var o=0;return s=sn(s,function(h){if(Ot(h))return o=It(h.length,o),!0}),oo(o,function(h){return St(s,io(h))})}function Zc(s,o){if(!(s&&s.length))return[];var h=$o(s);return o==null?h:St(h,function(d){return se(o,e,d)})}var d_=nt(function(s,o){return Ot(s)?ki(s,o):[]}),g_=nt(function(s){return Co(sn(s,Ot))}),p_=nt(function(s){var o=xe(s);return Ot(o)&&(o=e),Co(sn(s,Ot),X(o,2))}),m_=nt(function(s){var o=xe(s);return o=typeof o=="function"?o:e,Co(sn(s,Ot),e,o)}),__=nt($o);function b_(s,o){return pc(s||[],o||[],Ai)}function x_(s,o){return pc(s||[],o||[],Oi)}var y_=nt(function(s){var o=s.length,h=o>1?s[o-1]:e;return h=typeof h=="function"?(s.pop(),h):e,Zc(s,h)});function Jc(s){var o=b(s);return o.__chain__=!0,o}function v_(s,o){return o(s),s}function $s(s,o){return o(s)}var w_=Ye(function(s){var o=s.length,h=o?s[0]:0,d=this.__wrapped__,m=function(x){return po(x,s)};return o>1||this.__actions__.length||!(d instanceof st)||!Xe(h)?this.thru(m):(d=d.slice(h,+h+(o?1:0)),d.__actions__.push({func:$s,args:[m],thisArg:e}),new me(d,this.__chain__).thru(function(x){return o&&!x.length&&x.push(e),x}))});function S_(){return Jc(this)}function M_(){return new me(this.value(),this.__chain__)}function A_(){this.__values__===e&&(this.__values__=fh(this.value()));var s=this.__index__>=this.__values__.length,o=s?e:this.__values__[this.__index__++];return{done:s,value:o}}function k_(){return this}function P_(s){for(var o,h=this;h instanceof Os;){var d=Yc(h);d.__index__=0,d.__values__=e,o?m.__wrapped__=d:o=d;var m=d;h=h.__wrapped__}return m.__wrapped__=s,o}function C_(){var s=this.__wrapped__;if(s instanceof st){var o=s;return this.__actions__.length&&(o=new st(this)),o=o.reverse(),o.__actions__.push({func:$s,args:[Uo],thisArg:e}),new me(o,this.__chain__)}return this.thru(Uo)}function O_(){return gc(this.__wrapped__,this.__actions__)}var T_=Fs(function(s,o,h){dt.call(s,h)?++s[h]:Ue(s,h,1)});function D_(s,o,h){var d=q(s)?Pl:vp;return h&&qt(s,o,h)&&(o=e),d(s,X(o,3))}function L_(s,o){var h=q(s)?sn:Zl;return h(s,X(o,3))}var R_=Ac(Xc),E_=Ac(Gc);function I_(s,o){return Ht(Ys(s,o),1)}function F_(s,o){return Ht(Ys(s,o),ft)}function B_(s,o,h){return h=h===e?1:tt(h),Ht(Ys(s,o),h)}function Qc(s,o){var h=q(s)?ge:ln;return h(s,X(o,3))}function th(s,o){var h=q(s)?ng:ql;return h(s,X(o,3))}var z_=Fs(function(s,o,h){dt.call(s,h)?s[h].push(o):Ue(s,h,[o])});function W_(s,o,h,d){s=Qt(s)?s:ri(s),h=h&&!d?tt(h):0;var m=s.length;return h<0&&(h=It(m+h,0)),qs(s)?h<=m&&s.indexOf(o,h)>-1:!!m&&Gn(s,o,h)>-1}var N_=nt(function(s,o,h){var d=-1,m=typeof o=="function",x=Qt(s)?O(s.length):[];return ln(s,function(v){x[++d]=m?se(o,v,h):Pi(v,o,h)}),x}),H_=Fs(function(s,o,h){Ue(s,h,o)});function Ys(s,o){var h=q(s)?St:ic;return h(s,X(o,3))}function V_(s,o,h,d){return s==null?[]:(q(o)||(o=o==null?[]:[o]),h=d?e:h,q(h)||(h=h==null?[]:[h]),ac(s,o,h))}var U_=Fs(function(s,o,h){s[h?0:1].push(o)},function(){return[[],[]]});function $_(s,o,h){var d=q(s)?eo:Dl,m=arguments.length<3;return d(s,X(o,4),h,m,ln)}function Y_(s,o,h){var d=q(s)?ig:Dl,m=arguments.length<3;return d(s,X(o,4),h,m,ql)}function X_(s,o){var h=q(s)?sn:Zl;return h(s,Ks(X(o,3)))}function G_(s){var o=q(s)?Xl:Wp;return o(s)}function K_(s,o,h){(h?qt(s,o,h):o===e)?o=1:o=tt(o);var d=q(s)?mp:Np;return d(s,o)}function j_(s){var o=q(s)?_p:Vp;return o(s)}function q_(s){if(s==null)return 0;if(Qt(s))return qs(s)?jn(s):s.length;var o=$t(s);return o==Me||o==Ae?s.size:vo(s).length}function Z_(s,o,h){var d=q(s)?no:Up;return h&&qt(s,o,h)&&(o=e),d(s,X(o,3))}var J_=nt(function(s,o){if(s==null)return[];var h=o.length;return h>1&&qt(s,o[0],o[1])?o=[]:h>2&&qt(o[0],o[1],o[2])&&(o=[o[0]]),ac(s,Ht(o,1),[])}),Xs=Lg||function(){return Nt.Date.now()};function Q_(s,o){if(typeof o!="function")throw new pe(l);return s=tt(s),function(){if(--s<1)return o.apply(this,arguments)}}function eh(s,o,h){return o=h?e:o,o=s&&o==null?s.length:o,$e(s,W,e,e,e,e,o)}function nh(s,o){var h;if(typeof o!="function")throw new pe(l);return s=tt(s),function(){return--s>0&&(h=o.apply(this,arguments)),s<=1&&(o=e),h}}var Yo=nt(function(s,o,h){var d=A;if(h.length){var m=on(h,ii(Yo));d|=L}return $e(s,d,o,h,m)}),ih=nt(function(s,o,h){var d=A|C;if(h.length){var m=on(h,ii(ih));d|=L}return $e(o,d,s,h,m)});function sh(s,o,h){o=h?e:o;var d=$e(s,I,e,e,e,e,e,o);return d.placeholder=sh.placeholder,d}function rh(s,o,h){o=h?e:o;var d=$e(s,B,e,e,e,e,e,o);return d.placeholder=rh.placeholder,d}function oh(s,o,h){var d,m,x,v,M,P,R=0,E=!1,F=!1,H=!0;if(typeof s!="function")throw new pe(l);o=ye(o)||0,At(h)&&(E=!!h.leading,F="maxWait"in h,x=F?It(ye(h.maxWait)||0,o):x,H="trailing"in h?!!h.trailing:H);function $(Tt){var Oe=d,je=m;return d=m=e,R=Tt,v=s.apply(je,Oe),v}function G(Tt){return R=Tt,M=Li(it,o),E?$(Tt):v}function et(Tt){var Oe=Tt-P,je=Tt-R,Ah=o-Oe;return F?Ut(Ah,x-je):Ah}function K(Tt){var Oe=Tt-P,je=Tt-R;return P===e||Oe>=o||Oe<0||F&&je>=x}function it(){var Tt=Xs();if(K(Tt))return ot(Tt);M=Li(it,et(Tt))}function ot(Tt){return M=e,H&&d?$(Tt):(d=m=e,v)}function le(){M!==e&&mc(M),R=0,d=P=m=M=e}function Zt(){return M===e?v:ot(Xs())}function ce(){var Tt=Xs(),Oe=K(Tt);if(d=arguments,m=this,P=Tt,Oe){if(M===e)return G(P);if(F)return mc(M),M=Li(it,o),$(P)}return M===e&&(M=Li(it,o)),v}return ce.cancel=le,ce.flush=Zt,ce}var t0=nt(function(s,o){return jl(s,1,o)}),e0=nt(function(s,o,h){return jl(s,ye(o)||0,h)});function n0(s){return $e(s,Y)}function Gs(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new pe(l);var h=function(){var d=arguments,m=o?o.apply(this,d):d[0],x=h.cache;if(x.has(m))return x.get(m);var v=s.apply(this,d);return h.cache=x.set(m,v)||x,v};return h.cache=new(Gs.Cache||Ve),h}Gs.Cache=Ve;function Ks(s){if(typeof s!="function")throw new pe(l);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function i0(s){return nh(2,s)}var s0=$p(function(s,o){o=o.length==1&&q(o[0])?St(o[0],re(X())):St(Ht(o,1),re(X()));var h=o.length;return nt(function(d){for(var m=-1,x=Ut(d.length,h);++m<x;)d[m]=o[m].call(this,d[m]);return se(s,this,d)})}),Xo=nt(function(s,o){var h=on(o,ii(Xo));return $e(s,L,e,o,h)}),ah=nt(function(s,o){var h=on(o,ii(ah));return $e(s,z,e,o,h)}),r0=Ye(function(s,o){return $e(s,N,e,e,e,o)});function o0(s,o){if(typeof s!="function")throw new pe(l);return o=o===e?o:tt(o),nt(s,o)}function a0(s,o){if(typeof s!="function")throw new pe(l);return o=o==null?0:It(tt(o),0),nt(function(h){var d=h[o],m=un(h,0,o);return d&&rn(m,d),se(s,this,m)})}function l0(s,o,h){var d=!0,m=!0;if(typeof s!="function")throw new pe(l);return At(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),oh(s,o,{leading:d,maxWait:o,trailing:m})}function c0(s){return eh(s,1)}function h0(s,o){return Xo(To(o),s)}function u0(){if(!arguments.length)return[];var s=arguments[0];return q(s)?s:[s]}function f0(s){return _e(s,y)}function d0(s,o){return o=typeof o=="function"?o:e,_e(s,y,o)}function g0(s){return _e(s,p|y)}function p0(s,o){return o=typeof o=="function"?o:e,_e(s,p|y,o)}function m0(s,o){return o==null||Kl(s,o,zt(o))}function Ce(s,o){return s===o||s!==s&&o!==o}var _0=Ns(bo),b0=Ns(function(s,o){return s>=o}),Dn=tc(function(){return arguments}())?tc:function(s){return kt(s)&&dt.call(s,"callee")&&!Nl.call(s,"callee")},q=O.isArray,x0=vl?re(vl):Pp;function Qt(s){return s!=null&&js(s.length)&&!Ge(s)}function Ot(s){return kt(s)&&Qt(s)}function y0(s){return s===!0||s===!1||kt(s)&&jt(s)==fi}var fn=Eg||ia,v0=wl?re(wl):Cp;function w0(s){return kt(s)&&s.nodeType===1&&!Ri(s)}function S0(s){if(s==null)return!0;if(Qt(s)&&(q(s)||typeof s=="string"||typeof s.splice=="function"||fn(s)||si(s)||Dn(s)))return!s.length;var o=$t(s);if(o==Me||o==Ae)return!s.size;if(Di(s))return!vo(s).length;for(var h in s)if(dt.call(s,h))return!1;return!0}function M0(s,o){return Ci(s,o)}function A0(s,o,h){h=typeof h=="function"?h:e;var d=h?h(s,o):e;return d===e?Ci(s,o,e,h):!!d}function Go(s){if(!kt(s))return!1;var o=jt(s);return o==as||o==Kf||typeof s.message=="string"&&typeof s.name=="string"&&!Ri(s)}function k0(s){return typeof s=="number"&&Vl(s)}function Ge(s){if(!At(s))return!1;var o=jt(s);return o==ls||o==ja||o==Gf||o==qf}function lh(s){return typeof s=="number"&&s==tt(s)}function js(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Lt}function At(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var ch=Sl?re(Sl):Tp;function P0(s,o){return s===o||yo(s,o,Bo(o))}function C0(s,o,h){return h=typeof h=="function"?h:e,yo(s,o,Bo(o),h)}function O0(s){return hh(s)&&s!=+s}function T0(s){if(dm(s))throw new j(a);return ec(s)}function D0(s){return s===null}function L0(s){return s==null}function hh(s){return typeof s=="number"||kt(s)&&jt(s)==gi}function Ri(s){if(!kt(s)||jt(s)!=Ne)return!1;var o=ws(s);if(o===null)return!0;var h=dt.call(o,"constructor")&&o.constructor;return typeof h=="function"&&h instanceof h&&bs.call(h)==Cg}var Ko=Ml?re(Ml):Dp;function R0(s){return lh(s)&&s>=-Lt&&s<=Lt}var uh=Al?re(Al):Lp;function qs(s){return typeof s=="string"||!q(s)&&kt(s)&&jt(s)==mi}function ae(s){return typeof s=="symbol"||kt(s)&&jt(s)==cs}var si=kl?re(kl):Rp;function E0(s){return s===e}function I0(s){return kt(s)&&$t(s)==_i}function F0(s){return kt(s)&&jt(s)==Jf}var B0=Ns(wo),z0=Ns(function(s,o){return s<=o});function fh(s){if(!s)return[];if(Qt(s))return qs(s)?ke(s):Jt(s);if(yi&&s[yi])return mg(s[yi]());var o=$t(s),h=o==Me?lo:o==Ae?ps:ri;return h(s)}function Ke(s){if(!s)return s===0?s:0;if(s=ye(s),s===ft||s===-ft){var o=s<0?-1:1;return o*Bt}return s===s?s:0}function tt(s){var o=Ke(s),h=o%1;return o===o?h?o-h:o:0}function dh(s){return s?Pn(tt(s),0,Kt):0}function ye(s){if(typeof s=="number")return s;if(ae(s))return Se;if(At(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=At(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=Ll(s);var h=xd.test(s);return h||vd.test(s)?Qd(s.slice(2),h?2:8):bd.test(s)?Se:+s}function gh(s){return Ie(s,te(s))}function W0(s){return s?Pn(tt(s),-Lt,Lt):s===0?s:0}function ut(s){return s==null?"":oe(s)}var N0=ei(function(s,o){if(Di(o)||Qt(o)){Ie(o,zt(o),s);return}for(var h in o)dt.call(o,h)&&Ai(s,h,o[h])}),ph=ei(function(s,o){Ie(o,te(o),s)}),Zs=ei(function(s,o,h,d){Ie(o,te(o),s,d)}),H0=ei(function(s,o,h,d){Ie(o,zt(o),s,d)}),V0=Ye(po);function U0(s,o){var h=ti(s);return o==null?h:Gl(h,o)}var $0=nt(function(s,o){s=mt(s);var h=-1,d=o.length,m=d>2?o[2]:e;for(m&&qt(o[0],o[1],m)&&(d=1);++h<d;)for(var x=o[h],v=te(x),M=-1,P=v.length;++M<P;){var R=v[M],E=s[R];(E===e||Ce(E,Zn[R])&&!dt.call(s,R))&&(s[R]=x[R])}return s}),Y0=nt(function(s){return s.push(e,Lc),se(mh,e,s)});function X0(s,o){return Cl(s,X(o,3),Ee)}function G0(s,o){return Cl(s,X(o,3),_o)}function K0(s,o){return s==null?s:mo(s,X(o,3),te)}function j0(s,o){return s==null?s:Jl(s,X(o,3),te)}function q0(s,o){return s&&Ee(s,X(o,3))}function Z0(s,o){return s&&_o(s,X(o,3))}function J0(s){return s==null?[]:Ls(s,zt(s))}function Q0(s){return s==null?[]:Ls(s,te(s))}function jo(s,o,h){var d=s==null?e:Cn(s,o);return d===e?h:d}function tb(s,o){return s!=null&&Ic(s,o,Sp)}function qo(s,o){return s!=null&&Ic(s,o,Mp)}var eb=Pc(function(s,o,h){o!=null&&typeof o.toString!="function"&&(o=xs.call(o)),s[o]=h},Jo(ee)),nb=Pc(function(s,o,h){o!=null&&typeof o.toString!="function"&&(o=xs.call(o)),dt.call(s,o)?s[o].push(h):s[o]=[h]},X),ib=nt(Pi);function zt(s){return Qt(s)?Yl(s):vo(s)}function te(s){return Qt(s)?Yl(s,!0):Ep(s)}function sb(s,o){var h={};return o=X(o,3),Ee(s,function(d,m,x){Ue(h,o(d,m,x),d)}),h}function rb(s,o){var h={};return o=X(o,3),Ee(s,function(d,m,x){Ue(h,m,o(d,m,x))}),h}var ob=ei(function(s,o,h){Rs(s,o,h)}),mh=ei(function(s,o,h,d){Rs(s,o,h,d)}),ab=Ye(function(s,o){var h={};if(s==null)return h;var d=!1;o=St(o,function(x){return x=hn(x,s),d||(d=x.length>1),x}),Ie(s,Io(s),h),d&&(h=_e(h,p|_|y,em));for(var m=o.length;m--;)Po(h,o[m]);return h});function lb(s,o){return _h(s,Ks(X(o)))}var cb=Ye(function(s,o){return s==null?{}:Fp(s,o)});function _h(s,o){if(s==null)return{};var h=St(Io(s),function(d){return[d]});return o=X(o),lc(s,h,function(d,m){return o(d,m[0])})}function hb(s,o,h){o=hn(o,s);var d=-1,m=o.length;for(m||(m=1,s=e);++d<m;){var x=s==null?e:s[Fe(o[d])];x===e&&(d=m,x=h),s=Ge(x)?x.call(s):x}return s}function ub(s,o,h){return s==null?s:Oi(s,o,h)}function fb(s,o,h,d){return d=typeof d=="function"?d:e,s==null?s:Oi(s,o,h,d)}var bh=Tc(zt),xh=Tc(te);function db(s,o,h){var d=q(s),m=d||fn(s)||si(s);if(o=X(o,4),h==null){var x=s&&s.constructor;m?h=d?new x:[]:At(s)?h=Ge(x)?ti(ws(s)):{}:h={}}return(m?ge:Ee)(s,function(v,M,P){return o(h,v,M,P)}),h}function gb(s,o){return s==null?!0:Po(s,o)}function pb(s,o,h){return s==null?s:dc(s,o,To(h))}function mb(s,o,h,d){return d=typeof d=="function"?d:e,s==null?s:dc(s,o,To(h),d)}function ri(s){return s==null?[]:ao(s,zt(s))}function _b(s){return s==null?[]:ao(s,te(s))}function bb(s,o,h){return h===e&&(h=o,o=e),h!==e&&(h=ye(h),h=h===h?h:0),o!==e&&(o=ye(o),o=o===o?o:0),Pn(ye(s),o,h)}function xb(s,o,h){return o=Ke(o),h===e?(h=o,o=0):h=Ke(h),s=ye(s),Ap(s,o,h)}function yb(s,o,h){if(h&&typeof h!="boolean"&&qt(s,o,h)&&(o=h=e),h===e&&(typeof o=="boolean"?(h=o,o=e):typeof s=="boolean"&&(h=s,s=e)),s===e&&o===e?(s=0,o=1):(s=Ke(s),o===e?(o=s,s=0):o=Ke(o)),s>o){var d=s;s=o,o=d}if(h||s%1||o%1){var m=Ul();return Ut(s+m*(o-s+Jd("1e-"+((m+"").length-1))),o)}return Mo(s,o)}var vb=ni(function(s,o,h){return o=o.toLowerCase(),s+(h?yh(o):o)});function yh(s){return Zo(ut(s).toLowerCase())}function vh(s){return s=ut(s),s&&s.replace(Sd,ug).replace(Vd,"")}function wb(s,o,h){s=ut(s),o=oe(o);var d=s.length;h=h===e?d:Pn(tt(h),0,d);var m=h;return h-=o.length,h>=0&&s.slice(h,m)==o}function Sb(s){return s=ut(s),s&&id.test(s)?s.replace(Ja,fg):s}function Mb(s){return s=ut(s),s&&cd.test(s)?s.replace(Yr,"\\$&"):s}var Ab=ni(function(s,o,h){return s+(h?"-":"")+o.toLowerCase()}),kb=ni(function(s,o,h){return s+(h?" ":"")+o.toLowerCase()}),Pb=Mc("toLowerCase");function Cb(s,o,h){s=ut(s),o=tt(o);var d=o?jn(s):0;if(!o||d>=o)return s;var m=(o-d)/2;return Ws(ks(m),h)+s+Ws(As(m),h)}function Ob(s,o,h){s=ut(s),o=tt(o);var d=o?jn(s):0;return o&&d<o?s+Ws(o-d,h):s}function Tb(s,o,h){s=ut(s),o=tt(o);var d=o?jn(s):0;return o&&d<o?Ws(o-d,h)+s:s}function Db(s,o,h){return h||o==null?o=0:o&&(o=+o),zg(ut(s).replace(Xr,""),o||0)}function Lb(s,o,h){return(h?qt(s,o,h):o===e)?o=1:o=tt(o),Ao(ut(s),o)}function Rb(){var s=arguments,o=ut(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var Eb=ni(function(s,o,h){return s+(h?"_":"")+o.toLowerCase()});function Ib(s,o,h){return h&&typeof h!="number"&&qt(s,o,h)&&(o=h=e),h=h===e?Kt:h>>>0,h?(s=ut(s),s&&(typeof o=="string"||o!=null&&!Ko(o))&&(o=oe(o),!o&&Kn(s))?un(ke(s),0,h):s.split(o,h)):[]}var Fb=ni(function(s,o,h){return s+(h?" ":"")+Zo(o)});function Bb(s,o,h){return s=ut(s),h=h==null?0:Pn(tt(h),0,s.length),o=oe(o),s.slice(h,h+o.length)==o}function zb(s,o,h){var d=b.templateSettings;h&&qt(s,o,h)&&(o=e),s=ut(s),o=Zs({},o,d,Dc);var m=Zs({},o.imports,d.imports,Dc),x=zt(m),v=ao(m,x),M,P,R=0,E=o.interpolate||hs,F="__p += '",H=co((o.escape||hs).source+"|"+E.source+"|"+(E===Qa?_d:hs).source+"|"+(o.evaluate||hs).source+"|$","g"),$="//# sourceURL="+(dt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gd+"]")+`
|
|
`;s.replace(H,function(K,it,ot,le,Zt,ce){return ot||(ot=le),F+=s.slice(R,ce).replace(Md,dg),it&&(M=!0,F+=`' +
|
|
__e(`+it+`) +
|
|
'`),Zt&&(P=!0,F+=`';
|
|
`+Zt+`;
|
|
__p += '`),ot&&(F+=`' +
|
|
((__t = (`+ot+`)) == null ? '' : __t) +
|
|
'`),R=ce+K.length,K}),F+=`';
|
|
`;var G=dt.call(o,"variable")&&o.variable;if(!G)F=`with (obj) {
|
|
`+F+`
|
|
}
|
|
`;else if(pd.test(G))throw new j(c);F=(P?F.replace(Qf,""):F).replace(td,"$1").replace(ed,"$1;"),F="function("+(G||"obj")+`) {
|
|
`+(G?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(P?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+F+`return __p
|
|
}`;var et=Sh(function(){return ct(x,$+"return "+F).apply(e,v)});if(et.source=F,Go(et))throw et;return et}function Wb(s){return ut(s).toLowerCase()}function Nb(s){return ut(s).toUpperCase()}function Hb(s,o,h){if(s=ut(s),s&&(h||o===e))return Ll(s);if(!s||!(o=oe(o)))return s;var d=ke(s),m=ke(o),x=Rl(d,m),v=El(d,m)+1;return un(d,x,v).join("")}function Vb(s,o,h){if(s=ut(s),s&&(h||o===e))return s.slice(0,Fl(s)+1);if(!s||!(o=oe(o)))return s;var d=ke(s),m=El(d,ke(o))+1;return un(d,0,m).join("")}function Ub(s,o,h){if(s=ut(s),s&&(h||o===e))return s.replace(Xr,"");if(!s||!(o=oe(o)))return s;var d=ke(s),m=Rl(d,ke(o));return un(d,m).join("")}function $b(s,o){var h=J,d=Q;if(At(o)){var m="separator"in o?o.separator:m;h="length"in o?tt(o.length):h,d="omission"in o?oe(o.omission):d}s=ut(s);var x=s.length;if(Kn(s)){var v=ke(s);x=v.length}if(h>=x)return s;var M=h-jn(d);if(M<1)return d;var P=v?un(v,0,M).join(""):s.slice(0,M);if(m===e)return P+d;if(v&&(M+=P.length-M),Ko(m)){if(s.slice(M).search(m)){var R,E=P;for(m.global||(m=co(m.source,ut(tl.exec(m))+"g")),m.lastIndex=0;R=m.exec(E);)var F=R.index;P=P.slice(0,F===e?M:F)}}else if(s.indexOf(oe(m),M)!=M){var H=P.lastIndexOf(m);H>-1&&(P=P.slice(0,H))}return P+d}function Yb(s){return s=ut(s),s&&nd.test(s)?s.replace(Za,yg):s}var Xb=ni(function(s,o,h){return s+(h?" ":"")+o.toUpperCase()}),Zo=Mc("toUpperCase");function wh(s,o,h){return s=ut(s),o=h?e:o,o===e?pg(s)?Sg(s):og(s):s.match(o)||[]}var Sh=nt(function(s,o){try{return se(s,e,o)}catch(h){return Go(h)?h:new j(h)}}),Gb=Ye(function(s,o){return ge(o,function(h){h=Fe(h),Ue(s,h,Yo(s[h],s))}),s});function Kb(s){var o=s==null?0:s.length,h=X();return s=o?St(s,function(d){if(typeof d[1]!="function")throw new pe(l);return[h(d[0]),d[1]]}):[],nt(function(d){for(var m=-1;++m<o;){var x=s[m];if(se(x[0],this,d))return se(x[1],this,d)}})}function jb(s){return yp(_e(s,p))}function Jo(s){return function(){return s}}function qb(s,o){return s==null||s!==s?o:s}var Zb=kc(),Jb=kc(!0);function ee(s){return s}function Qo(s){return nc(typeof s=="function"?s:_e(s,p))}function Qb(s){return sc(_e(s,p))}function tx(s,o){return rc(s,_e(o,p))}var ex=nt(function(s,o){return function(h){return Pi(h,s,o)}}),nx=nt(function(s,o){return function(h){return Pi(s,h,o)}});function ta(s,o,h){var d=zt(o),m=Ls(o,d);h==null&&!(At(o)&&(m.length||!d.length))&&(h=o,o=s,s=this,m=Ls(o,zt(o)));var x=!(At(h)&&"chain"in h)||!!h.chain,v=Ge(s);return ge(m,function(M){var P=o[M];s[M]=P,v&&(s.prototype[M]=function(){var R=this.__chain__;if(x||R){var E=s(this.__wrapped__),F=E.__actions__=Jt(this.__actions__);return F.push({func:P,args:arguments,thisArg:s}),E.__chain__=R,E}return P.apply(s,rn([this.value()],arguments))})}),s}function ix(){return Nt._===this&&(Nt._=Og),this}function ea(){}function sx(s){return s=tt(s),nt(function(o){return oc(o,s)})}var rx=Lo(St),ox=Lo(Pl),ax=Lo(no);function Mh(s){return Wo(s)?io(Fe(s)):Bp(s)}function lx(s){return function(o){return s==null?e:Cn(s,o)}}var cx=Cc(),hx=Cc(!0);function na(){return[]}function ia(){return!1}function ux(){return{}}function fx(){return""}function dx(){return!0}function gx(s,o){if(s=tt(s),s<1||s>Lt)return[];var h=Kt,d=Ut(s,Kt);o=X(o),s-=Kt;for(var m=oo(d,o);++h<s;)o(h);return m}function px(s){return q(s)?St(s,Fe):ae(s)?[s]:Jt($c(ut(s)))}function mx(s){var o=++Pg;return ut(s)+o}var _x=zs(function(s,o){return s+o},0),bx=Ro("ceil"),xx=zs(function(s,o){return s/o},1),yx=Ro("floor");function vx(s){return s&&s.length?Ds(s,ee,bo):e}function wx(s,o){return s&&s.length?Ds(s,X(o,2),bo):e}function Sx(s){return Tl(s,ee)}function Mx(s,o){return Tl(s,X(o,2))}function Ax(s){return s&&s.length?Ds(s,ee,wo):e}function kx(s,o){return s&&s.length?Ds(s,X(o,2),wo):e}var Px=zs(function(s,o){return s*o},1),Cx=Ro("round"),Ox=zs(function(s,o){return s-o},0);function Tx(s){return s&&s.length?ro(s,ee):0}function Dx(s,o){return s&&s.length?ro(s,X(o,2)):0}return b.after=Q_,b.ary=eh,b.assign=N0,b.assignIn=ph,b.assignInWith=Zs,b.assignWith=H0,b.at=V0,b.before=nh,b.bind=Yo,b.bindAll=Gb,b.bindKey=ih,b.castArray=u0,b.chain=Jc,b.chunk=ym,b.compact=vm,b.concat=wm,b.cond=Kb,b.conforms=jb,b.constant=Jo,b.countBy=T_,b.create=U0,b.curry=sh,b.curryRight=rh,b.debounce=oh,b.defaults=$0,b.defaultsDeep=Y0,b.defer=t0,b.delay=e0,b.difference=Sm,b.differenceBy=Mm,b.differenceWith=Am,b.drop=km,b.dropRight=Pm,b.dropRightWhile=Cm,b.dropWhile=Om,b.fill=Tm,b.filter=L_,b.flatMap=I_,b.flatMapDeep=F_,b.flatMapDepth=B_,b.flatten=Kc,b.flattenDeep=Dm,b.flattenDepth=Lm,b.flip=n0,b.flow=Zb,b.flowRight=Jb,b.fromPairs=Rm,b.functions=J0,b.functionsIn=Q0,b.groupBy=z_,b.initial=Im,b.intersection=Fm,b.intersectionBy=Bm,b.intersectionWith=zm,b.invert=eb,b.invertBy=nb,b.invokeMap=N_,b.iteratee=Qo,b.keyBy=H_,b.keys=zt,b.keysIn=te,b.map=Ys,b.mapKeys=sb,b.mapValues=rb,b.matches=Qb,b.matchesProperty=tx,b.memoize=Gs,b.merge=ob,b.mergeWith=mh,b.method=ex,b.methodOf=nx,b.mixin=ta,b.negate=Ks,b.nthArg=sx,b.omit=ab,b.omitBy=lb,b.once=i0,b.orderBy=V_,b.over=rx,b.overArgs=s0,b.overEvery=ox,b.overSome=ax,b.partial=Xo,b.partialRight=ah,b.partition=U_,b.pick=cb,b.pickBy=_h,b.property=Mh,b.propertyOf=lx,b.pull=Vm,b.pullAll=qc,b.pullAllBy=Um,b.pullAllWith=$m,b.pullAt=Ym,b.range=cx,b.rangeRight=hx,b.rearg=r0,b.reject=X_,b.remove=Xm,b.rest=o0,b.reverse=Uo,b.sampleSize=K_,b.set=ub,b.setWith=fb,b.shuffle=j_,b.slice=Gm,b.sortBy=J_,b.sortedUniq=t_,b.sortedUniqBy=e_,b.split=Ib,b.spread=a0,b.tail=n_,b.take=i_,b.takeRight=s_,b.takeRightWhile=r_,b.takeWhile=o_,b.tap=v_,b.throttle=l0,b.thru=$s,b.toArray=fh,b.toPairs=bh,b.toPairsIn=xh,b.toPath=px,b.toPlainObject=gh,b.transform=db,b.unary=c0,b.union=a_,b.unionBy=l_,b.unionWith=c_,b.uniq=h_,b.uniqBy=u_,b.uniqWith=f_,b.unset=gb,b.unzip=$o,b.unzipWith=Zc,b.update=pb,b.updateWith=mb,b.values=ri,b.valuesIn=_b,b.without=d_,b.words=wh,b.wrap=h0,b.xor=g_,b.xorBy=p_,b.xorWith=m_,b.zip=__,b.zipObject=b_,b.zipObjectDeep=x_,b.zipWith=y_,b.entries=bh,b.entriesIn=xh,b.extend=ph,b.extendWith=Zs,ta(b,b),b.add=_x,b.attempt=Sh,b.camelCase=vb,b.capitalize=yh,b.ceil=bx,b.clamp=bb,b.clone=f0,b.cloneDeep=g0,b.cloneDeepWith=p0,b.cloneWith=d0,b.conformsTo=m0,b.deburr=vh,b.defaultTo=qb,b.divide=xx,b.endsWith=wb,b.eq=Ce,b.escape=Sb,b.escapeRegExp=Mb,b.every=D_,b.find=R_,b.findIndex=Xc,b.findKey=X0,b.findLast=E_,b.findLastIndex=Gc,b.findLastKey=G0,b.floor=yx,b.forEach=Qc,b.forEachRight=th,b.forIn=K0,b.forInRight=j0,b.forOwn=q0,b.forOwnRight=Z0,b.get=jo,b.gt=_0,b.gte=b0,b.has=tb,b.hasIn=qo,b.head=jc,b.identity=ee,b.includes=W_,b.indexOf=Em,b.inRange=xb,b.invoke=ib,b.isArguments=Dn,b.isArray=q,b.isArrayBuffer=x0,b.isArrayLike=Qt,b.isArrayLikeObject=Ot,b.isBoolean=y0,b.isBuffer=fn,b.isDate=v0,b.isElement=w0,b.isEmpty=S0,b.isEqual=M0,b.isEqualWith=A0,b.isError=Go,b.isFinite=k0,b.isFunction=Ge,b.isInteger=lh,b.isLength=js,b.isMap=ch,b.isMatch=P0,b.isMatchWith=C0,b.isNaN=O0,b.isNative=T0,b.isNil=L0,b.isNull=D0,b.isNumber=hh,b.isObject=At,b.isObjectLike=kt,b.isPlainObject=Ri,b.isRegExp=Ko,b.isSafeInteger=R0,b.isSet=uh,b.isString=qs,b.isSymbol=ae,b.isTypedArray=si,b.isUndefined=E0,b.isWeakMap=I0,b.isWeakSet=F0,b.join=Wm,b.kebabCase=Ab,b.last=xe,b.lastIndexOf=Nm,b.lowerCase=kb,b.lowerFirst=Pb,b.lt=B0,b.lte=z0,b.max=vx,b.maxBy=wx,b.mean=Sx,b.meanBy=Mx,b.min=Ax,b.minBy=kx,b.stubArray=na,b.stubFalse=ia,b.stubObject=ux,b.stubString=fx,b.stubTrue=dx,b.multiply=Px,b.nth=Hm,b.noConflict=ix,b.noop=ea,b.now=Xs,b.pad=Cb,b.padEnd=Ob,b.padStart=Tb,b.parseInt=Db,b.random=yb,b.reduce=$_,b.reduceRight=Y_,b.repeat=Lb,b.replace=Rb,b.result=hb,b.round=Cx,b.runInContext=k,b.sample=G_,b.size=q_,b.snakeCase=Eb,b.some=Z_,b.sortedIndex=Km,b.sortedIndexBy=jm,b.sortedIndexOf=qm,b.sortedLastIndex=Zm,b.sortedLastIndexBy=Jm,b.sortedLastIndexOf=Qm,b.startCase=Fb,b.startsWith=Bb,b.subtract=Ox,b.sum=Tx,b.sumBy=Dx,b.template=zb,b.times=gx,b.toFinite=Ke,b.toInteger=tt,b.toLength=dh,b.toLower=Wb,b.toNumber=ye,b.toSafeInteger=W0,b.toString=ut,b.toUpper=Nb,b.trim=Hb,b.trimEnd=Vb,b.trimStart=Ub,b.truncate=$b,b.unescape=Yb,b.uniqueId=mx,b.upperCase=Xb,b.upperFirst=Zo,b.each=Qc,b.eachRight=th,b.first=jc,ta(b,function(){var s={};return Ee(b,function(o,h){dt.call(b.prototype,h)||(s[h]=o)}),s}(),{chain:!1}),b.VERSION=i,ge(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),ge(["drop","take"],function(s,o){st.prototype[s]=function(h){h=h===e?1:It(tt(h),0);var d=this.__filtered__&&!o?new st(this):this.clone();return d.__filtered__?d.__takeCount__=Ut(h,d.__takeCount__):d.__views__.push({size:Ut(h,Kt),type:s+(d.__dir__<0?"Right":"")}),d},st.prototype[s+"Right"]=function(h){return this.reverse()[s](h).reverse()}}),ge(["filter","map","takeWhile"],function(s,o){var h=o+1,d=h==Vt||h==_t;st.prototype[s]=function(m){var x=this.clone();return x.__iteratees__.push({iteratee:X(m,3),type:h}),x.__filtered__=x.__filtered__||d,x}}),ge(["head","last"],function(s,o){var h="take"+(o?"Right":"");st.prototype[s]=function(){return this[h](1).value()[0]}}),ge(["initial","tail"],function(s,o){var h="drop"+(o?"":"Right");st.prototype[s]=function(){return this.__filtered__?new st(this):this[h](1)}}),st.prototype.compact=function(){return this.filter(ee)},st.prototype.find=function(s){return this.filter(s).head()},st.prototype.findLast=function(s){return this.reverse().find(s)},st.prototype.invokeMap=nt(function(s,o){return typeof s=="function"?new st(this):this.map(function(h){return Pi(h,s,o)})}),st.prototype.reject=function(s){return this.filter(Ks(X(s)))},st.prototype.slice=function(s,o){s=tt(s);var h=this;return h.__filtered__&&(s>0||o<0)?new st(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),o!==e&&(o=tt(o),h=o<0?h.dropRight(-o):h.take(o-s)),h)},st.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},st.prototype.toArray=function(){return this.take(Kt)},Ee(st.prototype,function(s,o){var h=/^(?:filter|find|map|reject)|While$/.test(o),d=/^(?:head|last)$/.test(o),m=b[d?"take"+(o=="last"?"Right":""):o],x=d||/^find/.test(o);!m||(b.prototype[o]=function(){var v=this.__wrapped__,M=d?[1]:arguments,P=v instanceof st,R=M[0],E=P||q(v),F=function(it){var ot=m.apply(b,rn([it],M));return d&&H?ot[0]:ot};E&&h&&typeof R=="function"&&R.length!=1&&(P=E=!1);var H=this.__chain__,$=!!this.__actions__.length,G=x&&!H,et=P&&!$;if(!x&&E){v=et?v:new st(this);var K=s.apply(v,M);return K.__actions__.push({func:$s,args:[F],thisArg:e}),new me(K,H)}return G&&et?s.apply(this,M):(K=this.thru(F),G?d?K.value()[0]:K.value():K)})}),ge(["pop","push","shift","sort","splice","unshift"],function(s){var o=ms[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var m=arguments;if(d&&!this.__chain__){var x=this.value();return o.apply(q(x)?x:[],m)}return this[h](function(v){return o.apply(q(v)?v:[],m)})}}),Ee(st.prototype,function(s,o){var h=b[o];if(h){var d=h.name+"";dt.call(Qn,d)||(Qn[d]=[]),Qn[d].push({name:o,func:h})}}),Qn[Bs(e,C).name]=[{name:"wrapper",func:e}],st.prototype.clone=Yg,st.prototype.reverse=Xg,st.prototype.value=Gg,b.prototype.at=w_,b.prototype.chain=S_,b.prototype.commit=M_,b.prototype.next=A_,b.prototype.plant=P_,b.prototype.reverse=C_,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=O_,b.prototype.first=b.prototype.head,yi&&(b.prototype[yi]=k_),b},qn=Mg();Sn?((Sn.exports=qn)._=qn,Jr._=qn):Nt._=qn}).call(Ei)})(kh,kh.exports);/*!
|
|
* @kurkle/color v0.3.2
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2023 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/function ss(n){return n+.5|0}const dn=(n,t,e)=>Math.max(Math.min(n,e),t);function Ni(n){return dn(ss(n*2.55),0,255)}function _n(n){return dn(ss(n*255),0,255)}function Qe(n){return dn(ss(n/2.55)/100,0,1)}function Ph(n){return dn(ss(n*100),0,100)}const ve={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},xa=[..."0123456789ABCDEF"],Vx=n=>xa[n&15],Ux=n=>xa[(n&240)>>4]+xa[n&15],Js=n=>(n&240)>>4===(n&15),$x=n=>Js(n.r)&&Js(n.g)&&Js(n.b)&&Js(n.a);function Yx(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ve[n[1]]*17,g:255&ve[n[2]]*17,b:255&ve[n[3]]*17,a:t===5?ve[n[4]]*17:255}:(t===7||t===9)&&(e={r:ve[n[1]]<<4|ve[n[2]],g:ve[n[3]]<<4|ve[n[4]],b:ve[n[5]]<<4|ve[n[6]],a:t===9?ve[n[7]]<<4|ve[n[8]]:255})),e}const Xx=(n,t)=>n<255?t(n):"";function Gx(n){var t=$x(n)?Vx:Ux;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Xx(n.a,t):void 0}const Kx=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ku(n,t,e){const i=t*Math.min(e,1-e),r=(a,l=(a+n/30)%12)=>e-i*Math.max(Math.min(l-3,9-l,1),-1);return[r(0),r(8),r(4)]}function jx(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function qx(n,t,e){const i=Ku(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function Zx(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Ea(n){const e=n.r/255,i=n.g/255,r=n.b/255,a=Math.max(e,i,r),l=Math.min(e,i,r),c=(a+l)/2;let u,f,g;return a!==l&&(g=a-l,f=c>.5?g/(2-a-l):g/(a+l),u=Zx(e,i,r,g,a),u=u*60+.5),[u|0,f||0,c]}function Ia(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(_n)}function Fa(n,t,e){return Ia(Ku,n,t,e)}function Jx(n,t,e){return Ia(qx,n,t,e)}function Qx(n,t,e){return Ia(jx,n,t,e)}function ju(n){return(n%360+360)%360}function ty(n){const t=Kx.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ni(+t[5]):_n(+t[5]));const r=ju(+t[2]),a=+t[3]/100,l=+t[4]/100;return t[1]==="hwb"?i=Jx(r,a,l):t[1]==="hsv"?i=Qx(r,a,l):i=Fa(r,a,l),{r:i[0],g:i[1],b:i[2],a:e}}function ey(n,t){var e=Ea(n);e[0]=ju(e[0]+t),e=Fa(e),n.r=e[0],n.g=e[1],n.b=e[2]}function ny(n){if(!n)return;const t=Ea(n),e=t[0],i=Ph(t[1]),r=Ph(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${Qe(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Ch={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"},Oh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function iy(){const n={},t=Object.keys(Oh),e=Object.keys(Ch);let i,r,a,l,c;for(i=0;i<t.length;i++){for(l=c=t[i],r=0;r<e.length;r++)a=e[r],c=c.replace(a,Ch[a]);a=parseInt(Oh[l],16),n[c]=[a>>16&255,a>>8&255,a&255]}return n}let Qs;function sy(n){Qs||(Qs=iy(),Qs.transparent=[0,0,0,0]);const t=Qs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ry=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oy(n){const t=ry.exec(n);let e=255,i,r,a;if(!!t){if(t[7]!==i){const l=+t[7];e=t[8]?Ni(l):dn(l*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?Ni(i):dn(i,0,255)),r=255&(t[4]?Ni(r):dn(r,0,255)),a=255&(t[6]?Ni(a):dn(a,0,255)),{r:i,g:r,b:a,a:e}}}function ay(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Qe(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const oa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,oi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function ly(n,t,e){const i=oi(Qe(n.r)),r=oi(Qe(n.g)),a=oi(Qe(n.b));return{r:_n(oa(i+e*(oi(Qe(t.r))-i))),g:_n(oa(r+e*(oi(Qe(t.g))-r))),b:_n(oa(a+e*(oi(Qe(t.b))-a))),a:n.a+e*(t.a-n.a)}}function tr(n,t,e){if(n){let i=Ea(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Fa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function qu(n,t){return n&&Object.assign(t||{},n)}function Th(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=_n(n[3]))):(t=qu(n,{r:0,g:0,b:0,a:1}),t.a=_n(t.a)),t}function cy(n){return n.charAt(0)==="r"?oy(n):ty(n)}class qi{constructor(t){if(t instanceof qi)return t;const e=typeof t;let i;e==="object"?i=Th(t):e==="string"&&(i=Yx(t)||sy(t)||cy(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qu(this._rgb);return t&&(t.a=Qe(t.a)),t}set rgb(t){this._rgb=Th(t)}rgbString(){return this._valid?ay(this._rgb):void 0}hexString(){return this._valid?Gx(this._rgb):void 0}hslString(){return this._valid?ny(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const l=e===a?.5:e,c=2*l-1,u=i.a-r.a,f=((c*u===-1?c:(c+u)/(1+c*u))+1)/2;a=1-f,i.r=255&f*i.r+a*r.r+.5,i.g=255&f*i.g+a*r.g+.5,i.b=255&f*i.b+a*r.b+.5,i.a=l*i.a+(1-l)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=ly(this._rgb,t._rgb,e)),this}clone(){return new qi(this.rgb)}alpha(t){return this._rgb.a=_n(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ss(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return tr(this._rgb,2,t),this}darken(t){return tr(this._rgb,2,-t),this}saturate(t){return tr(this._rgb,1,t),this}desaturate(t){return tr(this._rgb,1,-t),this}rotate(t){return ey(this._rgb,t),this}}/*!
|
|
* Chart.js v4.1.2
|
|
* https://www.chartjs.org
|
|
* (c) 2023 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/function qe(){}const hy=(()=>{let n=0;return()=>n++})();function lt(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function rt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Pt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function he(n,t){return Pt(n)?n:t}function Z(n,t){return typeof n>"u"?t:n}const uy=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Zu=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function xt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function pt(n,t,e,i){let r,a,l;if(vt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(rt(n))for(l=Object.keys(n),a=l.length,r=0;r<a;r++)t.call(e,n[l[r]],l[r])}function wr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function Sr(n){if(vt(n))return n.map(Sr);if(rt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=Sr(n[e[r]]);return t}return n}function Ju(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function fy(n,t,e,i){if(!Ju(n))return;const r=t[n],a=e[n];rt(r)&&rt(a)?Zi(r,a,i):t[n]=Sr(a)}function Zi(n,t,e){const i=vt(t)?t:[t],r=i.length;if(!rt(n))return n;e=e||{};const a=e.merger||fy;let l;for(let c=0;c<r;++c){if(l=i[c],!rt(l))continue;const u=Object.keys(l);for(let f=0,g=u.length;f<g;++f)a(u[f],n,l,e)}return n}function Yi(n,t){return Zi(n,t,{merger:dy})}function dy(n,t,e){if(!Ju(n))return;const i=t[n],r=e[n];rt(i)&&rt(r)?Yi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Sr(r))}const Dh={"":n=>n,x:n=>n.x,y:n=>n.y};function gy(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function py(n){const t=gy(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function bn(n,t){return(Dh[t]||(Dh[t]=py(t)))(n)}function Ba(n){return n.charAt(0).toUpperCase()+n.slice(1)}const we=n=>typeof n<"u",xn=n=>typeof n=="function",Lh=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function my(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Mt=Math.PI,wt=2*Mt,_y=wt+Mt,Mr=Number.POSITIVE_INFINITY,by=Mt/180,Ct=Mt/2,Ln=Mt/4,Rh=Mt*2/3,gn=Math.log10,We=Math.sign;function Xi(n,t,e){return Math.abs(n-t)<e}function Eh(n){const t=Math.round(n);n=Xi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(gn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function xy(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function ci(n){return!isNaN(parseFloat(n))&&isFinite(n)}function yy(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Qu(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Te(n){return n*(Mt/180)}function za(n){return n*(180/Mt)}function Ih(n){if(!Pt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function tf(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*Mt&&(a+=wt),{angle:a,distance:r}}function ya(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function vy(n,t){return(n-t+_y)%wt-Mt}function ue(n){return(n%wt+wt)%wt}function Ji(n,t,e,i){const r=ue(n),a=ue(t),l=ue(e),c=ue(a-r),u=ue(l-r),f=ue(r-a),g=ue(r-l);return r===a||r===l||i&&a===l||c>u&&f<g}function Wt(n,t,e){return Math.max(t,Math.min(e,n))}function wy(n){return Wt(n,-32768,32767)}function tn(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Wa(n,t,e){e=e||(l=>n[l]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const en=(n,t,e,i)=>Wa(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),Sy=(n,t,e)=>Wa(n,e,i=>n[i][t]>=e);function My(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const ef=["push","pop","shift","splice","unshift"];function Ay(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ef.forEach(e=>{const i="_onData"+Ba(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const l=r.apply(this,a);return n._chartjs.listeners.forEach(c=>{typeof c[i]=="function"&&c[i](...a)}),l}})})}function Fh(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(ef.forEach(a=>{delete n[a]}),delete n._chartjs)}function nf(n){const t=new Set;let e,i;for(e=0,i=n.length;e<i;++e)t.add(n[e]);return t.size===i?n:Array.from(t)}const sf=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function rf(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,sf.call(window,()=>{i=!1,n.apply(t,e)}))}}function ky(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Na=n=>n==="start"?"left":n==="end"?"right":"center",Yt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Py=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function of(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:l,_parsed:c}=n,u=l.axis,{min:f,max:g,minDefined:p,maxDefined:_}=l.getUserBounds();p&&(r=Wt(Math.min(en(c,l.axis,f).lo,e?i:en(t,u,l.getPixelForValue(f)).lo),0,i-1)),_?a=Wt(Math.max(en(c,l.axis,g,!0).hi+1,e?0:en(t,u,l.getPixelForValue(g),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function af(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const er=n=>n===0||n===1,Bh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*wt/e)),zh=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*wt/e)+1,Gi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ct)+1,easeOutSine:n=>Math.sin(n*Ct),easeInOutSine:n=>-.5*(Math.cos(Mt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>er(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>er(n)?n:Bh(n,.075,.3),easeOutElastic:n=>er(n)?n:zh(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*Bh(n*2,.1125,.45):.5+.5*zh(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Gi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Gi.easeInBounce(n*2)*.5:Gi.easeOutBounce(n*2-1)*.5+.5};function lf(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Wh(n){return lf(n)?n:new qi(n)}function aa(n){return lf(n)?n:new qi(n).saturate(.5).darken(.1).hexString()}const Cy=["x","y","borderWidth","radius","tension"],Oy=["color","borderColor","backgroundColor"];function Ty(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Oy},numbers:{type:"number",properties:Cy}}),n.describe("animations",{_fallback:"animation"}),n.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=>t|0}}}})}function Dy(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Nh=new Map;function Ly(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Nh.get(e);return i||(i=new Intl.NumberFormat(n,t),Nh.set(e,i)),i}function rs(n,t,e){return Ly(t,e).format(n)}const cf={values(n){return vt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const f=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(f<1e-4||f>1e15)&&(r="scientific"),a=Ry(n,e)}const l=gn(Math.abs(a)),c=Math.max(Math.min(-1*Math.floor(l),20),0),u={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(u,this.options.ticks.format),rs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(gn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?cf.numeric.call(this,n,t,e):""}};function Ry(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Dr={formatters:cf};function Ey(n){n.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:Dr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Vn=Object.create(null),va=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function la(n,t,e){return typeof t=="string"?Zi(Ki(n,t),e):Zi(Ki(n,""),t)}class Iy{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=i=>i.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=(i,r)=>aa(r.backgroundColor),this.hoverBorderColor=(i,r)=>aa(r.borderColor),this.hoverColor=(i,r)=>aa(r.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 la(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return la(va,t,e)}override(t,e){return la(Vn,t,e)}route(t,e,i,r){const a=Ki(this,t),l=Ki(this,i),c="_"+e;Object.defineProperties(a,{[c]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[c],f=l[r];return rt(u)?Object.assign({},f,u):Z(u,f)},set(u){this[c]=u}}})}apply(t){t.forEach(e=>e(this))}}var Dt=new Iy({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ty,Dy,Ey]);function Fy(n){return!n||lt(n.size)||lt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ar(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function By(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let l=0;const c=e.length;let u,f,g,p,_;for(u=0;u<c;u++)if(p=e[u],p!=null&&vt(p)!==!0)l=Ar(n,r,a,l,p);else if(vt(p))for(f=0,g=p.length;f<g;f++)_=p[f],_!=null&&!vt(_)&&(l=Ar(n,r,a,l,_));n.restore();const y=a.length/2;if(y>e.length){for(u=0;u<y;u++)delete r[a[u]];a.splice(0,y)}return l}function Rn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function Hh(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function wa(n,t,e,i){hf(n,t,e,i,null)}function hf(n,t,e,i,r){let a,l,c,u,f,g,p,_;const y=t.pointStyle,w=t.rotation,S=t.radius;let A=(w||0)*by;if(y&&typeof y=="object"&&(a=y.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(A),n.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),n.restore();return}if(!(isNaN(S)||S<=0)){switch(n.beginPath(),y){default:r?n.ellipse(e,i,r/2,S,0,0,wt):n.arc(e,i,S,0,wt),n.closePath();break;case"triangle":g=r?r/2:S,n.moveTo(e+Math.sin(A)*g,i-Math.cos(A)*S),A+=Rh,n.lineTo(e+Math.sin(A)*g,i-Math.cos(A)*S),A+=Rh,n.lineTo(e+Math.sin(A)*g,i-Math.cos(A)*S),n.closePath();break;case"rectRounded":f=S*.516,u=S-f,l=Math.cos(A+Ln)*u,p=Math.cos(A+Ln)*(r?r/2-f:u),c=Math.sin(A+Ln)*u,_=Math.sin(A+Ln)*(r?r/2-f:u),n.arc(e-p,i-c,f,A-Mt,A-Ct),n.arc(e+_,i-l,f,A-Ct,A),n.arc(e+p,i+c,f,A,A+Ct),n.arc(e-_,i+l,f,A+Ct,A+Mt),n.closePath();break;case"rect":if(!w){u=Math.SQRT1_2*S,g=r?r/2:u,n.rect(e-g,i-u,2*g,2*u);break}A+=Ln;case"rectRot":p=Math.cos(A)*(r?r/2:S),l=Math.cos(A)*S,c=Math.sin(A)*S,_=Math.sin(A)*(r?r/2:S),n.moveTo(e-p,i-c),n.lineTo(e+_,i-l),n.lineTo(e+p,i+c),n.lineTo(e-_,i+l),n.closePath();break;case"crossRot":A+=Ln;case"cross":p=Math.cos(A)*(r?r/2:S),l=Math.cos(A)*S,c=Math.sin(A)*S,_=Math.sin(A)*(r?r/2:S),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l);break;case"star":p=Math.cos(A)*(r?r/2:S),l=Math.cos(A)*S,c=Math.sin(A)*S,_=Math.sin(A)*(r?r/2:S),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l),A+=Ln,p=Math.cos(A)*(r?r/2:S),l=Math.cos(A)*S,c=Math.sin(A)*S,_=Math.sin(A)*(r?r/2:S),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l);break;case"line":l=r?r/2:Math.cos(A)*S,c=Math.sin(A)*S,n.moveTo(e-l,i-c),n.lineTo(e+l,i+c);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(A)*(r?r/2:S),i+Math.sin(A)*S);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Qi(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Lr(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Rr(n){n.restore()}function zy(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Wy(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Un(n,t,e,i,r,a={}){const l=vt(t)?t:[t],c=a.strokeWidth>0&&a.strokeColor!=="";let u,f;for(n.save(),n.font=r.string,Ny(n,a),u=0;u<l.length;++u)f=l[u],a.backdrop&&Vy(n,a.backdrop),c&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),lt(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(f,e,i,a.maxWidth)),n.fillText(f,e,i,a.maxWidth),Hy(n,e,i,f,a),i+=r.lineHeight;n.restore()}function Ny(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),lt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Hy(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),l=t-a.actualBoundingBoxLeft,c=t+a.actualBoundingBoxRight,u=e-a.actualBoundingBoxAscent,f=e+a.actualBoundingBoxDescent,g=r.strikethrough?(u+f)/2:f;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(l,g),n.lineTo(c,g),n.stroke()}}function Vy(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ts(n,t){const{x:e,y:i,w:r,h:a,radius:l}=t;n.arc(e+l.topLeft,i+l.topLeft,l.topLeft,-Ct,Mt,!0),n.lineTo(e,i+a-l.bottomLeft),n.arc(e+l.bottomLeft,i+a-l.bottomLeft,l.bottomLeft,Mt,Ct,!0),n.lineTo(e+r-l.bottomRight,i+a),n.arc(e+r-l.bottomRight,i+a-l.bottomRight,l.bottomRight,Ct,0,!0),n.lineTo(e+r,i+l.topRight),n.arc(e+r-l.topRight,i+l.topRight,l.topRight,0,-Ct,!0),n.lineTo(e+l.topLeft,i)}const Uy=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,$y=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yy(n,t){const e=(""+n).match(Uy);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Xy=n=>+n||0;function Ha(n,t){const e={},i=rt(t),r=i?Object.keys(t):t,a=rt(n)?i?l=>Z(n[l],n[t[l]]):l=>n[l]:()=>n;for(const l of r)e[l]=Xy(a(l));return e}function uf(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Nn(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gt(n){const t=uf(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ft(n,t){n=n||{},t=t||Dt.font;let e=Z(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Z(n.style,t.style);i&&!(""+i).match($y)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Z(n.family,t.family),lineHeight:Yy(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return r.string=Fy(r),r}function Hi(n,t,e,i){let r=!0,a,l,c;for(a=0,l=n.length;a<l;++a)if(c=n[a],c!==void 0&&(t!==void 0&&typeof c=="function"&&(c=c(t),r=!1),e!==void 0&&vt(c)&&(c=c[e%c.length],r=!1),c!==void 0))return i&&!r&&(i.cacheable=!1),c}function Gy(n,t,e){const{min:i,max:r}=n,a=Zu(t,(r-i)/2),l=(c,u)=>e&&c===0?0:c+u;return{min:l(i,-Math.abs(a)),max:l(r,a)}}function yn(n,t){return Object.assign(Object.create(n),t)}function Va(n,t=[""],e=n,i,r=()=>n[0]){we(i)||(i=pf("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:e,_fallback:i,_getTarget:r,override:l=>Va([l,...n],t,e,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return df(l,c,()=>ev(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return Uh(l).includes(c)},ownKeys(l){return Uh(l)},set(l,c,u){const f=l._storage||(l._storage=r());return l[c]=f[c]=u,delete l._keys,!0}})}function hi(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:ff(n,i),setContext:a=>hi(n,a,e,i),override:a=>hi(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete n[l],!0},get(a,l,c){return df(a,l,()=>jy(a,l,c))},getOwnPropertyDescriptor(a,l){return a._descriptors.allKeys?Reflect.has(n,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,l)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,l){return Reflect.has(n,l)},ownKeys(){return Reflect.ownKeys(n)},set(a,l,c){return n[l]=c,delete a[l],!0}})}function ff(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:xn(e)?e:()=>e,isIndexable:xn(i)?i:()=>i}}const Ky=(n,t)=>n?n+Ba(t):t,Ua=(n,t)=>rt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function df(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function jy(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:l}=n;let c=i[t];return xn(c)&&l.isScriptable(t)&&(c=qy(t,c,n,e)),vt(c)&&c.length&&(c=Zy(t,c,n,l.isIndexable)),Ua(t,c)&&(c=hi(c,r,a&&a[t],l)),c}function qy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_stack:c}=e;if(c.has(n))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+n);return c.add(n),t=t(a,l||i),c.delete(n),Ua(n,t)&&(t=$a(r._scopes,r,n,t)),t}function Zy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_descriptors:c}=e;if(we(a.index)&&i(n))t=t[a.index%t.length];else if(rt(t[0])){const u=t,f=r._scopes.filter(g=>g!==u);t=[];for(const g of u){const p=$a(f,r,n,g);t.push(hi(p,a,l&&l[n],c))}}return t}function gf(n,t,e){return xn(n)?n(t,e):n}const Jy=(n,t)=>n===!0?t:typeof n=="string"?bn(t,n):void 0;function Qy(n,t,e,i,r){for(const a of t){const l=Jy(e,a);if(l){n.add(l);const c=gf(l._fallback,e,r);if(we(c)&&c!==e&&c!==i)return c}else if(l===!1&&we(i)&&e!==i)return null}return!1}function $a(n,t,e,i){const r=t._rootScopes,a=gf(t._fallback,e,i),l=[...n,...r],c=new Set;c.add(i);let u=Vh(c,l,e,a||e,i);return u===null||we(a)&&a!==e&&(u=Vh(c,l,a,u,i),u===null)?!1:Va(Array.from(c),[""],r,a,()=>tv(t,e,i))}function Vh(n,t,e,i,r){for(;e;)e=Qy(n,t,e,i,r);return e}function tv(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return vt(r)&&rt(e)?e:r||{}}function ev(n,t,e,i){let r;for(const a of t)if(r=pf(Ky(a,n),e),we(r))return Ua(n,r)?$a(e,i,n,r):r}function pf(n,t){for(const e of t){if(!e)continue;const i=e[n];if(we(i))return i}}function Uh(n){let t=n._keys;return t||(t=n._keys=nv(n._scopes)),t}function nv(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function mf(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,l=new Array(i);let c,u,f,g;for(c=0,u=i;c<u;++c)f=c+e,g=t[f],l[c]={r:r.parse(bn(g,a),f)};return l}const iv=Number.EPSILON||1e-14,ui=(n,t)=>t<n.length&&!n[t].skip&&n[t],_f=n=>n==="x"?"y":"x";function sv(n,t,e,i){const r=n.skip?t:n,a=t,l=e.skip?t:e,c=ya(a,r),u=ya(l,a);let f=c/(c+u),g=u/(c+u);f=isNaN(f)?0:f,g=isNaN(g)?0:g;const p=i*f,_=i*g;return{previous:{x:a.x-p*(l.x-r.x),y:a.y-p*(l.y-r.y)},next:{x:a.x+_*(l.x-r.x),y:a.y+_*(l.y-r.y)}}}function rv(n,t,e){const i=n.length;let r,a,l,c,u,f=ui(n,0);for(let g=0;g<i-1;++g)if(u=f,f=ui(n,g+1),!(!u||!f)){if(Xi(t[g],0,iv)){e[g]=e[g+1]=0;continue}r=e[g]/t[g],a=e[g+1]/t[g],c=Math.pow(r,2)+Math.pow(a,2),!(c<=9)&&(l=3/Math.sqrt(c),e[g]=r*l*t[g],e[g+1]=a*l*t[g])}}function ov(n,t,e="x"){const i=_f(e),r=n.length;let a,l,c,u=ui(n,0);for(let f=0;f<r;++f){if(l=c,c=u,u=ui(n,f+1),!c)continue;const g=c[e],p=c[i];l&&(a=(g-l[e])/3,c[`cp1${e}`]=g-a,c[`cp1${i}`]=p-a*t[f]),u&&(a=(u[e]-g)/3,c[`cp2${e}`]=g+a,c[`cp2${i}`]=p+a*t[f])}}function av(n,t="x"){const e=_f(t),i=n.length,r=Array(i).fill(0),a=Array(i);let l,c,u,f=ui(n,0);for(l=0;l<i;++l)if(c=u,u=f,f=ui(n,l+1),!!u){if(f){const g=f[t]-u[t];r[l]=g!==0?(f[e]-u[e])/g:0}a[l]=c?f?We(r[l-1])!==We(r[l])?0:(r[l-1]+r[l])/2:r[l-1]:r[l]}rv(n,r,a),ov(n,a,t)}function nr(n,t,e){return Math.max(Math.min(n,e),t)}function lv(n,t){let e,i,r,a,l,c=Qi(n[0],t);for(e=0,i=n.length;e<i;++e)l=a,a=c,c=e<i-1&&Qi(n[e+1],t),a&&(r=n[e],l&&(r.cp1x=nr(r.cp1x,t.left,t.right),r.cp1y=nr(r.cp1y,t.top,t.bottom)),c&&(r.cp2x=nr(r.cp2x,t.left,t.right),r.cp2y=nr(r.cp2y,t.top,t.bottom)))}function cv(n,t,e,i,r){let a,l,c,u;if(t.spanGaps&&(n=n.filter(f=>!f.skip)),t.cubicInterpolationMode==="monotone")av(n,r);else{let f=i?n[n.length-1]:n[0];for(a=0,l=n.length;a<l;++a)c=n[a],u=sv(f,c,n[Math.min(a+1,l-(i?0:1))%l],t.tension),c.cp1x=u.previous.x,c.cp1y=u.previous.y,c.cp2x=u.next.x,c.cp2y=u.next.y,f=c}t.capBezierPoints&&lv(n,e)}function bf(){return typeof window<"u"&&typeof document<"u"}function Ya(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function kr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Er=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function hv(n,t){return Er(n).getPropertyValue(t)}const uv=["top","right","bottom","left"];function Hn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=uv[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const fv=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function dv(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let l=!1,c,u;if(fv(r,a,n.target))c=r,u=a;else{const f=t.getBoundingClientRect();c=i.clientX-f.left,u=i.clientY-f.top,l=!0}return{x:c,y:u,box:l}}function Fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Er(e),a=r.boxSizing==="border-box",l=Hn(r,"padding"),c=Hn(r,"border","width"),{x:u,y:f,box:g}=dv(n,e),p=l.left+(g&&c.left),_=l.top+(g&&c.top);let{width:y,height:w}=t;return a&&(y-=l.width+c.width,w-=l.height+c.height),{x:Math.round((u-p)/y*e.width/i),y:Math.round((f-_)/w*e.height/i)}}function gv(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Ya(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const l=a.getBoundingClientRect(),c=Er(a),u=Hn(c,"border","width"),f=Hn(c,"padding");t=l.width-f.width-u.width,e=l.height-f.height-u.height,i=kr(c.maxWidth,a,"clientWidth"),r=kr(c.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||Mr,maxHeight:r||Mr}}const ir=n=>Math.round(n*10)/10;function pv(n,t,e,i){const r=Er(n),a=Hn(r,"margin"),l=kr(r.maxWidth,n,"clientWidth")||Mr,c=kr(r.maxHeight,n,"clientHeight")||Mr,u=gv(n,t,e);let{width:f,height:g}=u;if(r.boxSizing==="content-box"){const _=Hn(r,"border","width"),y=Hn(r,"padding");f-=y.width+_.width,g-=y.height+_.height}return f=Math.max(0,f-a.width),g=Math.max(0,i?f/i:g-a.height),f=ir(Math.min(f,l,u.maxWidth)),g=ir(Math.min(g,c,u.maxHeight)),f&&!g&&(g=ir(f/2)),(t!==void 0||e!==void 0)&&i&&u.height&&g>u.height&&(g=u.height,f=ir(Math.floor(g*i))),{width:f,height:g}}function $h(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const l=n.canvas;return l.style&&(e||!l.style.height&&!l.style.width)&&(l.style.height=`${n.height}px`,l.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||l.height!==r||l.width!==a?(n.currentDevicePixelRatio=i,l.height=r,l.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const mv=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}return n}();function Yh(n,t){const e=hv(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function _v(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function bv(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},l=Bn(n,r,e),c=Bn(r,a,e),u=Bn(a,t,e),f=Bn(l,c,e),g=Bn(c,u,e);return Bn(f,g,e)}const xv=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},yv=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function li(n,t,e){return n?xv(t,e):yv()}function xf(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function yf(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function vf(n){return n==="angle"?{between:Ji,compare:vy,normalize:ue}:{between:tn,compare:(t,e)=>t-e,normalize:t=>t}}function Xh({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function vv(n,t,e){const{property:i,start:r,end:a}=e,{between:l,normalize:c}=vf(i),u=t.length;let{start:f,end:g,loop:p}=n,_,y;if(p){for(f+=u,g+=u,_=0,y=u;_<y&&l(c(t[f%u][i]),r,a);++_)f--,g--;f%=u,g%=u}return g<f&&(g+=u),{start:f,end:g,loop:p,style:n.style}}function wf(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,l=t.length,{compare:c,between:u,normalize:f}=vf(i),{start:g,end:p,loop:_,style:y}=vv(n,t,e),w=[];let S=!1,A=null,C,T,I;const B=()=>u(r,I,C)&&c(r,I)!==0,L=()=>c(a,C)===0||u(a,I,C),z=()=>S||B(),W=()=>!S||L();for(let N=g,Y=g;N<=p;++N)T=t[N%l],!T.skip&&(C=f(T[i]),C!==I&&(S=u(C,r,a),A===null&&z()&&(A=c(C,r)===0?N:Y),A!==null&&W()&&(w.push(Xh({start:A,end:N,loop:_,count:l,style:y})),A=null),Y=N,I=C));return A!==null&&w.push(Xh({start:A,end:p,loop:_,count:l,style:y})),w}function Sf(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=wf(i[r],n.points,t);a.length&&e.push(...a)}return e}function wv(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function Sv(n,t,e,i){const r=n.length,a=[];let l=t,c=n[t],u;for(u=t+1;u<=e;++u){const f=n[u%r];f.skip||f.stop?c.skip||(i=!1,a.push({start:t%r,end:(u-1)%r,loop:i}),t=l=f.stop?u:null):(l=u,c.skip&&(t=u)),c=f}return l!==null&&a.push({start:t%r,end:l%r,loop:i}),a}function Mv(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:l,end:c}=wv(e,r,a,i);if(i===!0)return Gh(n,[{start:l,end:c,loop:a}],e,t);const u=c<l?c+r:c,f=!!n._fullLoop&&l===0&&c===r-1;return Gh(n,Sv(e,l,u,f),e,t)}function Gh(n,t,e,i){return!i||!i.setContext||!e?t:Av(n,t,e,i)}function Av(n,t,e,i){const r=n._chart.getContext(),a=Kh(n.options),{_datasetIndex:l,options:{spanGaps:c}}=n,u=e.length,f=[];let g=a,p=t[0].start,_=p;function y(w,S,A,C){const T=c?-1:1;if(w!==S){for(w+=u;e[w%u].skip;)w-=T;for(;e[S%u].skip;)S+=T;w%u!==S%u&&(f.push({start:w%u,end:S%u,loop:A,style:C}),g=C,p=S%u)}}for(const w of t){p=c?p:w.start;let S=e[p%u],A;for(_=p+1;_<=w.end;_++){const C=e[_%u];A=Kh(i.setContext(yn(r,{type:"segment",p0:S,p1:C,p0DataIndex:(_-1)%u,p1DataIndex:_%u,datasetIndex:l}))),kv(A,g)&&y(p,_-1,w.loop,g),S=C,g=A}p<_-1&&y(p,_-1,w.loop,g)}return f}function Kh(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function kv(n,t){return t&&JSON.stringify(n)!==JSON.stringify(t)}/*!
|
|
* Chart.js v4.1.2
|
|
* https://www.chartjs.org
|
|
* (c) 2023 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/class Pv{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],l=e.duration;a.forEach(c=>c({chart:t,initial:e.initial,numSteps:l,currentStep:Math.min(i-e.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=sf.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let l=a.length-1,c=!1,u;for(;l>=0;--l)u=a[l],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),c=!0):(a[l]=a[a.length-1],a.pop());c&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(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((i,r)=>Math.max(i,r._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 r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ze=new Pv;const jh="transparent",Cv={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Wh(n||jh),r=i.valid&&Wh(t||jh);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Ov{constructor(t,e,i,r){const a=e[i];r=Hi([t.to,r,a,t.from]);const l=Hi([t.from,a,r]);this._active=!0,this._fn=t.fn||Cv[t.type||typeof l],this._easing=Gi[t.easing]||Gi.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=l,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,l=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(l,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Hi([t.to,e,r,t.from]),this._from=Hi([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,l=this._loop,c=this._to;let u;if(this._active=a!==c&&(l||e<i),!this._active){this._target[r]=c,this._notify(!0);return}if(e<0){this._target[r]=a;return}u=e/i%2,u=l&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(a,c,u)}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 r=0;r<i.length;r++)i[r][e]()}}class Mf{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!rt(t))return;const e=Object.keys(Dt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!rt(a))return;const l={};for(const c of e)l[c]=a[c];(vt(a.properties)&&a.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,l)})})}_animateOptions(t,e){const i=e.options,r=Dv(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&Tv(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),l=Object.keys(e),c=Date.now();let u;for(u=l.length-1;u>=0;--u){const f=l[u];if(f.charAt(0)==="$")continue;if(f==="options"){r.push(...this._animateOptions(t,e));continue}const g=e[f];let p=a[f];const _=i.get(f);if(p)if(_&&p.active()){p.update(_,g,c);continue}else p.cancel();if(!_||!_.duration){t[f]=g;continue}a[f]=p=new Ov(_,t,f,g),r.push(p)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Ze.add(this._chart,i),!0}}function Tv(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function Dv(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function qh(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function Lv(n,t,e){if(e===!1)return!1;const i=qh(n,e),r=qh(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Rv(n){let t,e,i,r;return rt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function Af(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function Zh(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let l,c,u,f;if(t!==null){for(l=0,c=r.length;l<c;++l){if(u=+r[l],u===e){if(i.all)continue;break}f=n.values[u],Pt(f)&&(a||t===0||We(t)===We(f))&&(t+=f)}return t}}function Ev(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function Jh(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Iv(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Fv(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function Bv(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Qh(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function tu(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:l,index:c}=i,u=a.axis,f=l.axis,g=Iv(a,l,i),p=t.length;let _;for(let y=0;y<p;++y){const w=t[y],{[u]:S,[f]:A}=w,C=w._stacks||(w._stacks={});_=C[f]=Bv(r,g,S),_[c]=A,_._top=Qh(_,l,!0,i.type),_._bottom=Qh(_,l,!1,i.type);const T=_._visualValues||(_._visualValues={});T[c]=A}}function ca(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function zv(n,t){return yn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Wv(n,t,e){return yn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ii(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const ha=n=>n==="reset"||n==="none",eu=(n,t)=>t?n:Object.assign({},n),Nv=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Af(e,!0),values:null};class De{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=Jh(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&&Ii(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(p,_,y,w)=>p==="x"?_:p==="r"?w:y,a=e.xAxisID=Z(i.xAxisID,ca(t,"x")),l=e.yAxisID=Z(i.yAxisID,ca(t,"y")),c=e.rAxisID=Z(i.rAxisID,ca(t,"r")),u=e.indexAxis,f=e.iAxisID=r(u,a,l,c),g=e.vAxisID=r(u,l,a,c);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(l),e.rScale=this.getScaleForId(c),e.iScale=this.getScaleForId(f),e.vScale=this.getScaleForId(g)}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&&Fh(this._data,this),t._stacked&&Ii(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(rt(e))this._data=Ev(e);else if(i!==e){if(i){Fh(i,this);const r=this._cachedMeta;Ii(r),r._parsed=[]}e&&Object.isExtensible(e)&&Ay(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=Jh(e.vScale,e),e.stack!==i.stack&&(r=!0,Ii(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&tu(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:r}=this,{iScale:a,_stacked:l}=i,c=a.axis;let u=t===0&&e===r.length?!0:i._sorted,f=t>0&&i._parsed[t-1],g,p,_;if(this._parsing===!1)i._parsed=r,i._sorted=!0,_=r;else{vt(r[t])?_=this.parseArrayData(i,r,t,e):rt(r[t])?_=this.parseObjectData(i,r,t,e):_=this.parsePrimitiveData(i,r,t,e);const y=()=>p[c]===null||f&&p[c]<f[c];for(g=0;g<e;++g)i._parsed[g+t]=p=_[g],u&&(y()&&(u=!1),f=p);i._sorted=u}l&&tu(this,_)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:l}=t,c=a.axis,u=l.axis,f=a.getLabels(),g=a===l,p=new Array(r);let _,y,w;for(_=0,y=r;_<y;++_)w=_+i,p[_]={[c]:g||a.parse(f[w],w),[u]:l.parse(e[w],w)};return p}parseArrayData(t,e,i,r){const{xScale:a,yScale:l}=t,c=new Array(r);let u,f,g,p;for(u=0,f=r;u<f;++u)g=u+i,p=e[g],c[u]={x:a.parse(p[0],g),y:l.parse(p[1],g)};return c}parseObjectData(t,e,i,r){const{xScale:a,yScale:l}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,f=new Array(r);let g,p,_,y;for(g=0,p=r;g<p;++g)_=g+i,y=e[_],f[g]={x:a.parse(bn(y,c),_),y:l.parse(bn(y,u),_)};return f}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,l=e[t.axis],c={keys:Af(r,!0),values:e._stacks[t.axis]._visualValues};return Zh(c,l,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let l=a===null?NaN:a;const c=r&&i._stacks[e.axis];r&&c&&(r.values=c,l=Zh(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,l),t.max=Math.max(t.max,l)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,l=r.length,c=this._getOtherScale(t),u=Nv(e,i,this.chart),f={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:g,max:p}=Fv(c);let _,y;function w(){y=r[_];const S=y[c.axis];return!Pt(y[t.axis])||g>S||p<S}for(_=0;_<l&&!(!w()&&(this.updateRangeFromParsed(f,t,y,u),a));++_);if(a){for(_=l-1;_>=0;--_)if(!w()){this.updateRangeFromParsed(f,t,y,u);break}}return f}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,l;for(r=0,a=e.length;r<a;++r)l=e[r][t.axis],Pt(l)&&i.push(l);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Rv(Z(this.options.clip,Lv(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,l=[],c=this._drawStart||0,u=this._drawCount||r.length-c,f=this.options.drawActiveElementsOnTop;let g;for(i.dataset&&i.dataset.draw(t,a,c,u),g=c;g<c+u;++g){const p=r[g];p.hidden||(p.active&&f?l.push(p):p.draw(t,a))}for(g=0;g<l.length;++g)l[g].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const l=this._cachedMeta.data[t];a=l.$context||(l.$context=Wv(this.getContext(),t,l)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=zv(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,l=t+"-"+e,c=a[l],u=this.enableOptionSharing&&we(i);if(c)return eu(c,u);const f=this.chart.config,g=f.datasetElementScopeKeys(this._type,t),p=r?[`${t}Hover`,"hover",t,""]:[t,""],_=f.getOptionScopes(this.getDataset(),g),y=Object.keys(Dt.elements[t]),w=()=>this.getContext(i,r,e),S=f.resolveNamedOptions(_,y,w,p);return S.$shared&&(S.$shared=u,a[l]=Object.freeze(eu(S,u))),S}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,l=`animation-${e}`,c=a[l];if(c)return c;let u;if(r.options.animation!==!1){const g=this.chart.config,p=g.datasetAnimationScopeKeys(this._type,e),_=g.getOptionScopes(this.getDataset(),p);u=g.createResolver(_,this.getContext(t,i,e))}const f=new Mf(r,u&&u.animations);return u&&u._cacheable&&(a[l]=Object.freeze(f)),f}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ha(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),l=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:l}}updateElement(t,e,i,r){ha(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ha(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}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[c,u,f]of this._syncList)this[c](u,f);this._syncList=[];const r=i.length,a=e.length,l=Math.min(a,r);l&&this.parse(0,l),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,l=t+e;let c;const u=f=>{for(f.length+=e,c=f.length-1;c>=l;c--)f[c]=f[c-e]};for(u(a),c=t;c<l;++c)a[c]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Ii(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}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])}}U(De,"defaults",{}),U(De,"datasetElementType",null),U(De,"dataElementType",null);function Hv(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=nf(i.sort((r,a)=>r-a))}return n._cache.$bar}function Vv(n){const t=n.iScale,e=Hv(t,n.type);let i=t._length,r,a,l,c;const u=()=>{l===32767||l===-32768||(we(c)&&(i=Math.min(i,Math.abs(l-c)||i)),c=l)};for(r=0,a=e.length;r<a;++r)l=t.getPixelForValue(e[r]),u();for(c=void 0,r=0,a=t.ticks.length;r<a;++r)l=t.getPixelForTick(r),u();return i}function Uv(n,t,e,i){const r=e.barThickness;let a,l;return lt(r)?(a=t.min*e.categoryPercentage,l=e.barPercentage):(a=r*i,l=1),{chunk:a/i,ratio:l,start:t.pixels[n]-a/2}}function $v(n,t,e,i){const r=t.pixels,a=r[n];let l=n>0?r[n-1]:null,c=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;l===null&&(l=a-(c===null?t.end-t.start:c-a)),c===null&&(c=a+a-l);const f=a-(a-Math.min(l,c))/2*u;return{chunk:Math.abs(c-l)/2*u/i,ratio:e.barPercentage,start:f}}function Yv(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),l=Math.min(r,a),c=Math.max(r,a);let u=l,f=c;Math.abs(l)>Math.abs(c)&&(u=c,f=l),t[e.axis]=f,t._custom={barStart:u,barEnd:f,start:r,end:a,min:l,max:c}}function kf(n,t,e,i){return vt(n)?Yv(n,t,e,i):t[e.axis]=e.parse(n,i),t}function nu(n,t,e,i){const r=n.iScale,a=n.vScale,l=r.getLabels(),c=r===a,u=[];let f,g,p,_;for(f=e,g=e+i;f<g;++f)_=t[f],p={},p[r.axis]=c||r.parse(l[f],f),u.push(kf(_,p,a,f));return u}function ua(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Xv(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Gv(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Kv(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:l,end:c,reverse:u,top:f,bottom:g}=Gv(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=f:(e._bottom||0)===i?r=g:(a[iu(g,l,c,u)]=!0,r=f)),a[iu(r,l,c,u)]=!0,n.borderSkipped=a}function iu(n,t,e,i){return i?(n=jv(n,t,e),n=su(n,e,t)):n=su(n,t,e),n}function jv(n,t,e){return n===t?e:n===e?t:n}function su(n,t,e){return n==="start"?t:n==="end"?e:n}function qv(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class fr extends De{parsePrimitiveData(t,e,i,r){return nu(t,e,i,r)}parseArrayData(t,e,i,r){return nu(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:l}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,f=a.axis==="x"?c:u,g=l.axis==="x"?c:u,p=[];let _,y,w,S;for(_=i,y=i+r;_<y;++_)S=e[_],w={},w[a.axis]=a.parse(bn(S,f),_),p.push(kf(bn(S,g),w,l,_));return p}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),l=a._custom,c=ua(l)?"["+l.start+", "+l.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:c}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:l,_cachedMeta:{vScale:c}}=this,u=c.getBasePixel(),f=c.isHorizontal(),g=this._getRuler(),{sharedOptions:p,includeOptions:_}=this._getSharedOptions(e,r);for(let y=e;y<e+i;y++){const w=this.getParsed(y),S=a||lt(w[c.axis])?{base:u,head:u}:this._calculateBarValuePixels(y),A=this._calculateBarIndexPixels(y,g),C=(w._stacks||{})[c.axis],T={horizontal:f,base:S.base,enableBorderRadius:!C||ua(w._custom)||l===C._top||l===C._bottom,x:f?S.head:A.center,y:f?A.center:S.head,height:f?A.size:Math.abs(S.size),width:f?Math.abs(S.size):A.size};_&&(T.options=p||this.resolveDataElementOptions(y,t[y].active?"active":r));const I=T.options||t[y].options;Kv(T,I,C,l),qv(T,I,g.ratio),this.updateElement(t[y],y,T,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),a=i.options.stacked,l=[],c=u=>{const f=u.controller.getParsed(e),g=f&&f[u.vScale.axis];if(lt(g)||isNaN(g))return!0};for(const u of r)if(!(e!==void 0&&c(u))&&((a===!1||l.indexOf(u.stack)===-1||a===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===t))break;return l.length||l.push(void 0),l}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,l;for(a=0,l=e.data.length;a<l;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const c=t.barThickness;return{min:c||Vv(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:c?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:l}}=this,c=a||0,u=this.getParsed(t),f=u._custom,g=ua(f);let p=u[e.axis],_=0,y=i?this.applyStack(e,u,i):p,w,S;y!==p&&(_=y-p,y=p),g&&(p=f.barStart,y=f.barEnd-f.barStart,p!==0&&We(p)!==We(f.barEnd)&&(_=0),_+=p);const A=!lt(a)&&!g?a:_;let C=e.getPixelForValue(A);if(this.chart.getDataVisibility(t)?w=e.getPixelForValue(_+y):w=C,S=w-C,Math.abs(S)<l){S=Xv(S,e,c)*l,p===c&&(C-=S/2);const T=e.getPixelForDecimal(0),I=e.getPixelForDecimal(1),B=Math.min(T,I),L=Math.max(T,I);C=Math.max(Math.min(C,L),B),w=C+S,i&&!g&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(w)-e.getValueForPixel(C))}if(C===e.getPixelForValue(c)){const T=We(S)*e.getLineWidthForValue(c)/2;C+=T,S-=T}return{size:S,base:C,head:w,center:w+S/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,l=Z(r.maxBarThickness,1/0);let c,u;if(e.grouped){const f=a?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?$v(t,e,r,f):Uv(t,e,r,f),p=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);c=g.start+g.chunk*p+g.chunk/2,u=Math.min(l,g.chunk*g.ratio)}else c=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(l,e.min*e.ratio);return{base:c-u/2,head:c+u/2,center:c,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}U(fr,"id","bar"),U(fr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),U(fr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class dr extends De{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let l=0;l<a.length;l++)a[l]._custom=this.resolveDataElementOptions(l+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let l=0;l<a.length;l++){const c=e[i+l];a[l]._custom=Z(c[2],this.resolveDataElementOptions(l+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let l=0;l<a.length;l++){const c=e[i+l];a[l]._custom=Z(c&&c.r&&+c.r,this.resolveDataElementOptions(l+i).radius)}return a}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:r,yScale:a}=e,l=this.getParsed(t),c=r.getLabelForValue(l.x),u=a.getLabelForValue(l.y),f=l._custom;return{label:i[t]||"",value:"("+c+", "+u+(f?", "+f:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,r),g=l.axis,p=c.axis;for(let _=e;_<e+i;_++){const y=t[_],w=!a&&this.getParsed(_),S={},A=S[g]=a?l.getPixelForDecimal(.5):l.getPixelForValue(w[g]),C=S[p]=a?c.getBasePixel():c.getPixelForValue(w[p]);S.skip=isNaN(A)||isNaN(C),f&&(S.options=u||this.resolveDataElementOptions(_,y.active?"active":r),a&&(S.options.radius=0)),this.updateElement(y,_,S,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Z(i&&i._custom,a),r}}U(dr,"id","bubble"),U(dr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),U(dr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Zv(n,t,e){let i=1,r=1,a=0,l=0;if(t<wt){const c=n,u=c+t,f=Math.cos(c),g=Math.sin(c),p=Math.cos(u),_=Math.sin(u),y=(I,B,L)=>Ji(I,c,u,!0)?1:Math.max(B,B*e,L,L*e),w=(I,B,L)=>Ji(I,c,u,!0)?-1:Math.min(B,B*e,L,L*e),S=y(0,f,p),A=y(Ct,g,_),C=w(Mt,f,p),T=w(Mt+Ct,g,_);i=(S-C)/2,r=(A-T)/2,a=-(S+C)/2,l=-(A+T)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:l}}class Wn extends De{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,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=u=>+i[u];if(rt(i[t])){const{key:u="value"}=this._parsing;a=f=>+bn(i[f],u)}let l,c;for(l=t,c=t+e;l<c;++l)r._parsed[l]=a(l)}}_getRotation(){return Te(this.options.rotation-90)}_getCircumference(){return Te(this.options.circumference)}_getRotationExtents(){let t=wt,e=-wt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),l=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+l)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,l=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,c=Math.max((Math.min(i.width,i.height)-l)/2,0),u=Math.min(uy(this.options.cutout,c),1),f=this._getRingWeight(this.index),{circumference:g,rotation:p}=this._getRotationExtents(),{ratioX:_,ratioY:y,offsetX:w,offsetY:S}=Zv(p,g,u),A=(i.width-l)/_,C=(i.height-l)/y,T=Math.max(Math.min(A,C)/2,0),I=Zu(this.options.radius,T),B=Math.max(I*u,0),L=(I-B)/this._getVisibleDatasetWeightTotal();this.offsetX=w*I,this.offsetY=S*I,r.total=this.calculateTotal(),this.outerRadius=I-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*f,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/wt)}updateElements(t,e,i,r){const a=r==="reset",l=this.chart,c=l.chartArea,f=l.options.animation,g=(c.left+c.right)/2,p=(c.top+c.bottom)/2,_=a&&f.animateScale,y=_?0:this.innerRadius,w=_?0:this.outerRadius,{sharedOptions:S,includeOptions:A}=this._getSharedOptions(e,r);let C=this._getRotation(),T;for(T=0;T<e;++T)C+=this._circumference(T,a);for(T=e;T<e+i;++T){const I=this._circumference(T,a),B=t[T],L={x:g+this.offsetX,y:p+this.offsetY,startAngle:C,endAngle:C+I,circumference:I,outerRadius:w,innerRadius:y};A&&(L.options=S||this.resolveDataElementOptions(T,B.active?"active":r)),C+=I,this.updateElement(B,T,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,l,c,u;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){l=i.getDatasetMeta(r),t=l.data,c=l.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)u=c.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.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(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}U(Wn,"id","doughnut"),U(Wn,"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"}),U(Wn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"}),U(Wn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class gr extends De{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,l=this.chart._animationsDisabled;let{start:c,count:u}=of(e,r,l);this._drawStart=c,this._drawCount=u,af(e)&&(c=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const f=this.resolveDatasetElementOptions(t);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:f},t),this.updateElements(r,c,u,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c,_stacked:u,_dataset:f}=this._cachedMeta,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,r),_=l.axis,y=c.axis,{spanGaps:w,segment:S}=this.options,A=ci(w)?w:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||a||r==="none",T=e+i,I=t.length;let B=e>0&&this.getParsed(e-1);for(let L=0;L<I;++L){const z=t[L],W=C?z:{};if(L<e||L>=T){W.skip=!0;continue}const N=this.getParsed(L),Y=lt(N[y]),J=W[_]=l.getPixelForValue(N[_],L),Q=W[y]=a||Y?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,N,u):N[y],L);W.skip=isNaN(J)||isNaN(Q)||Y,W.stop=L>0&&Math.abs(N[_]-B[_])>A,S&&(W.parsed=N,W.raw=f.data[L]),p&&(W.options=g||this.resolveDataElementOptions(L,z.active?"active":r)),C||this.updateElement(z,L,W,r),B=N}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),l=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,l)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}U(gr,"id","line"),U(gr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),U(gr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ji extends De{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return mf.bind(this)(t,e,i,r)}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((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),l=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),c=(a-l)/t.getVisibleDatasetCount();this.outerRadius=a-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,e,i,r){const a=r==="reset",l=this.chart,u=l.options.animation,f=this._cachedMeta.rScale,g=f.xCenter,p=f.yCenter,_=f.getIndexAngle(0)-.5*Mt;let y=_,w;const S=360/this.countVisibleElements();for(w=0;w<e;++w)y+=this._computeAngle(w,r,S);for(w=e;w<e+i;w++){const A=t[w];let C=y,T=y+this._computeAngle(w,r,S),I=l.getDataVisibility(w)?f.getDistanceFromCenterForValue(this.getParsed(w).r):0;y=T,a&&(u.animateScale&&(I=0),u.animateRotate&&(C=T=_));const B={x:g,y:p,innerRadius:0,outerRadius:I,startAngle:C,endAngle:T,options:this.resolveDataElementOptions(w,A.active?"active":r)};this.updateElement(A,w,B,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Te(this.resolveDataElementOptions(t,e).angle||i):0}}U(ji,"id","polarArea"),U(ji,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),U(ji,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}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 Sa extends Wn{}U(Sa,"id","pie"),U(Sa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class pr extends De{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,r){return mf.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0);const c={_loop:!0,_fullLoop:a.length===r.length,options:l};this.updateElement(i,void 0,c,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,l=r==="reset";for(let c=e;c<e+i;c++){const u=t[c],f=this.resolveDataElementOptions(c,u.active?"active":r),g=a.getPointPositionForValue(c,this.getParsed(c).r),p=l?a.xCenter:g.x,_=l?a.yCenter:g.y,y={x:p,y:_,angle:g.angle,skip:isNaN(p)||isNaN(_),options:f};this.updateElement(u,c,y,r)}}}U(pr,"id","radar"),U(pr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),U(pr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class mr extends De{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,l=this.getParsed(t),c=r.getLabelForValue(l.x),u=a.getLabelForValue(l.y);return{label:i[t]||"",value:"("+c+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=of(e,i,r);if(this._drawStart=a,this._drawCount=l,af(e)&&(a=0,l=i.length),this.options.showLine){const{dataset:c,_dataset:u}=e;c._chart=this.chart,c._datasetIndex=this.index,c._decimated=!!u._decimated,c.points=i;const f=this.resolveDatasetElementOptions(t);f.segment=this.options.segment,this.updateElement(c,void 0,{animated:!r,options:f},t)}this.updateElements(i,a,l,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c,_stacked:u,_dataset:f}=this._cachedMeta,g=this.resolveDataElementOptions(e,r),p=this.getSharedOptions(g),_=this.includeOptions(r,p),y=l.axis,w=c.axis,{spanGaps:S,segment:A}=this.options,C=ci(S)?S:Number.POSITIVE_INFINITY,T=this.chart._animationsDisabled||a||r==="none";let I=e>0&&this.getParsed(e-1);for(let B=e;B<e+i;++B){const L=t[B],z=this.getParsed(B),W=T?L:{},N=lt(z[w]),Y=W[y]=l.getPixelForValue(z[y],B),J=W[w]=a||N?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,z,u):z[w],B);W.skip=isNaN(Y)||isNaN(J)||N,W.stop=B>0&&Math.abs(z[y]-I[y])>C,A&&(W.parsed=z,W.raw=f.data[B]),_&&(W.options=p||this.resolveDataElementOptions(B,L.active?"active":r)),T||this.updateElement(L,B,W,r),I=z}this.updateSharedOptions(p,r,g)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let c=0;for(let u=e.length-1;u>=0;--u)c=Math.max(c,e[u].size(this.resolveDataElementOptions(u))/2);return c>0&&c}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),l=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,l)/2}}U(mr,"id","scatter"),U(mr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),U(mr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Jv=Object.freeze({__proto__:null,BarController:fr,BubbleController:dr,DoughnutController:Wn,LineController:gr,PolarAreaController:ji,PieController:Sa,RadarController:pr,ScatterController:mr});function En(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xa{static override(t){Object.assign(Xa.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return En()}parse(){return En()}format(){return En()}add(){return En()}diff(){return En()}startOf(){return En()}endOf(){return En()}}var Qv={_date:Xa};function t1(n,t,e,i){const{controller:r,data:a,_sorted:l}=n,c=r._cachedMeta.iScale;if(c&&t===c.axis&&t!=="r"&&l&&a.length){const u=c._reversePixels?Sy:en;if(i){if(r._sharedOptions){const f=a[0],g=typeof f.getRange=="function"&&f.getRange(t);if(g){const p=u(a,t,e-g),_=u(a,t,e+g);return{lo:p.lo,hi:_.hi}}}}else return u(a,t,e)}return{lo:0,hi:a.length-1}}function os(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),l=e[t];for(let c=0,u=a.length;c<u;++c){const{index:f,data:g}=a[c],{lo:p,hi:_}=t1(a[c],t,l,r);for(let y=p;y<=_;++y){const w=g[y];w.skip||i(w,f,y)}}}function e1(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,l=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(l,2))}}function fa(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||os(n,e,t,function(c,u,f){!r&&!Qi(c,n.chartArea,0)||c.inRange(t.x,t.y,i)&&a.push({element:c,datasetIndex:u,index:f})},!0),a}function n1(n,t,e,i){let r=[];function a(l,c,u){const{startAngle:f,endAngle:g}=l.getProps(["startAngle","endAngle"],i),{angle:p}=tf(l,{x:t.x,y:t.y});Ji(p,f,g)&&r.push({element:l,datasetIndex:c,index:u})}return os(n,e,t,a),r}function i1(n,t,e,i,r,a){let l=[];const c=e1(e);let u=Number.POSITIVE_INFINITY;function f(g,p,_){const y=g.inRange(t.x,t.y,r);if(i&&!y)return;const w=g.getCenterPoint(r);if(!(!!a||n.isPointInArea(w))&&!y)return;const A=c(t,w);A<u?(l=[{element:g,datasetIndex:p,index:_}],u=A):A===u&&l.push({element:g,datasetIndex:p,index:_})}return os(n,e,t,f),l}function da(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?n1(n,t,e,r):i1(n,t,e,i,r,a)}function ru(n,t,e,i,r){const a=[],l=e==="x"?"inXRange":"inYRange";let c=!1;return os(n,e,t,(u,f,g)=>{u[l](t[e],r)&&(a.push({element:u,datasetIndex:f,index:g}),c=c||u.inRange(t.x,t.y,r))}),i&&!c?[]:a}var s1={evaluateInteractionItems:os,modes:{index(n,t,e,i){const r=Fn(t,n),a=e.axis||"x",l=e.includeInvisible||!1,c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l),u=[];return c.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const g=c[0].index,p=f.data[g];p&&!p.skip&&u.push({element:p,datasetIndex:f.index,index:g})}),u):[]},dataset(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;let c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l);if(c.length>0){const u=c[0].datasetIndex,f=n.getDatasetMeta(u).data;c=[];for(let g=0;g<f.length;++g)c.push({element:f[g],datasetIndex:u,index:g})}return c},point(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;return fa(n,r,a,i,l)},nearest(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;return da(n,r,a,e.intersect,i,l)},x(n,t,e,i){const r=Fn(t,n);return ru(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Fn(t,n);return ru(n,r,"y",e.intersect,i)}}};const Pf=["left","top","right","bottom"];function Fi(n,t){return n.filter(e=>e.pos===t)}function ou(n,t){return n.filter(e=>Pf.indexOf(e.pos)===-1&&e.box.axis===t)}function Bi(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function r1(n){const t=[];let e,i,r,a,l,c;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:l,stackWeight:c=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:l&&a+l,stackWeight:c});return t}function o1(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!Pf.includes(r))continue;const l=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=a}return t}function a1(n,t){const e=o1(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,l,c;for(a=0,l=n.length;a<l;++a){c=n[a];const{fullSize:u}=c.box,f=e[c.stack],g=f&&c.stackWeight/f.weight;c.horizontal?(c.width=g?g*i:u&&t.availableWidth,c.height=r):(c.width=i,c.height=g?g*r:u&&t.availableHeight)}return e}function l1(n){const t=r1(n),e=Bi(t.filter(f=>f.box.fullSize),!0),i=Bi(Fi(t,"left"),!0),r=Bi(Fi(t,"right")),a=Bi(Fi(t,"top"),!0),l=Bi(Fi(t,"bottom")),c=ou(t,"x"),u=ou(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(u).concat(l).concat(c),chartArea:Fi(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:a.concat(l).concat(c)}}function au(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Cf(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function c1(n,t,e,i){const{pos:r,box:a}=e,l=n.maxPadding;if(!rt(r)){e.size&&(n[r]-=e.size);const p=i[e.stack]||{size:0,count:1};p.size=Math.max(p.size,e.horizontal?a.height:a.width),e.size=p.size/p.count,n[r]+=e.size}a.getPadding&&Cf(l,a.getPadding());const c=Math.max(0,t.outerWidth-au(l,n,"left","right")),u=Math.max(0,t.outerHeight-au(l,n,"top","bottom")),f=c!==n.w,g=u!==n.h;return n.w=c,n.h=u,e.horizontal?{same:f,other:g}:{same:g,other:f}}function h1(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function u1(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(l=>{a[l]=Math.max(t[l],e[l])}),a}return i(n?["left","right"]:["top","bottom"])}function Vi(n,t,e,i){const r=[];let a,l,c,u,f,g;for(a=0,l=n.length,f=0;a<l;++a){c=n[a],u=c.box,u.update(c.width||t.w,c.height||t.h,u1(c.horizontal,t));const{same:p,other:_}=c1(t,e,c,i);f|=p&&r.length,g=g||_,u.fullSize||r.push(c)}return f&&Vi(r,t,e,i)||g}function sr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function lu(n,t,e,i){const r=e.padding;let{x:a,y:l}=t;for(const c of n){const u=c.box,f=i[c.stack]||{count:1,placed:0,weight:1},g=c.stackWeight/f.weight||1;if(c.horizontal){const p=t.w*g,_=f.size||u.height;we(f.start)&&(l=f.start),u.fullSize?sr(u,r.left,l,e.outerWidth-r.right-r.left,_):sr(u,t.left+f.placed,l,p,_),f.start=l,f.placed+=p,l=u.bottom}else{const p=t.h*g,_=f.size||u.width;we(f.start)&&(a=f.start),u.fullSize?sr(u,a,r.top,_,e.outerHeight-r.bottom-r.top):sr(u,a,t.top+f.placed,_,p),f.start=a,f.placed+=p,a=u.right}}t.x=a,t.y=l}var Xt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=Gt(n.options.layout.padding),a=Math.max(t-r.width,0),l=Math.max(e-r.height,0),c=l1(n.boxes),u=c.vertical,f=c.horizontal;pt(n.boxes,S=>{typeof S.beforeLayout=="function"&&S.beforeLayout()});const g=u.reduce((S,A)=>A.box.options&&A.box.options.display===!1?S:S+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:l,vBoxMaxWidth:a/2/g,hBoxMaxHeight:l/2}),_=Object.assign({},r);Cf(_,Gt(i));const y=Object.assign({maxPadding:_,w:a,h:l,x:r.left,y:r.top},r),w=a1(u.concat(f),p);Vi(c.fullSize,y,p,w),Vi(u,y,p,w),Vi(f,y,p,w)&&Vi(u,y,p,w),h1(y),lu(c.leftAndTop,y,p,w),y.x+=y.w,y.y+=y.h,lu(c.rightAndBottom,y,p,w),n.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},pt(c.chartArea,S=>{const A=S.box;Object.assign(A,n.chartArea),A.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class Of{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class f1 extends Of{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const _r="$chartjs",d1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},cu=n=>n===null||n==="";function g1(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[_r]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",cu(r)){const a=Yh(n,"width");a!==void 0&&(n.width=a)}if(cu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=Yh(n,"height");a!==void 0&&(n.height=a)}return n}const Tf=mv?{passive:!0}:!1;function p1(n,t,e){n.addEventListener(t,e,Tf)}function m1(n,t,e){n.canvas.removeEventListener(t,e,Tf)}function _1(n,t){const e=d1[n.type]||n.type,{x:i,y:r}=Fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function b1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Pr(c.addedNodes,i),l=l&&!Pr(c.removedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function x1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Pr(c.removedNodes,i),l=l&&!Pr(c.addedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const es=new Map;let hu=0;function Df(){const n=window.devicePixelRatio;n!==hu&&(hu=n,es.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function y1(n,t){es.size||window.addEventListener("resize",Df),es.set(n,t)}function v1(n){es.delete(n),es.size||window.removeEventListener("resize",Df)}function w1(n,t,e){const i=n.canvas,r=i&&Ya(i);if(!r)return;const a=rf((c,u)=>{const f=r.clientWidth;e(c,u),f<r.clientWidth&&e()},window),l=new ResizeObserver(c=>{const u=c[0],f=u.contentRect.width,g=u.contentRect.height;f===0&&g===0||a(f,g)});return l.observe(r),y1(n,a),l}function ga(n,t,e){e&&e.disconnect(),t==="resize"&&v1(n)}function S1(n,t,e){const i=n.canvas,r=rf(a=>{n.ctx!==null&&e(_1(a,n))},n);return p1(i,t,r),r}class M1 extends Of{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(g1(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[_r])return!1;const i=e[_r].initial;["height","width"].forEach(a=>{const l=i[a];lt(l)?e.removeAttribute(a):e.setAttribute(a,l)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[_r],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),l={attach:b1,detach:x1,resize:w1}[e]||S1;r[e]=l(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:ga,detach:ga,resize:ga}[e]||m1)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return pv(t,e,i,r)}isAttached(t){const e=Ya(t);return!!(e&&e.isConnected)}}function A1(n){return!bf()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?f1:M1}class Le{constructor(){U(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ci(this.x)&&ci(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}U(Le,"defaults",{}),U(Le,"defaultRoutes");function k1(n,t){const e=n.options.ticks,i=P1(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?O1(t):[],l=a.length,c=a[0],u=a[l-1],f=[];if(l>r)return T1(t,f,a,l/r),f;const g=C1(a,t,r);if(l>0){let p,_;const y=l>1?Math.round((u-c)/(l-1)):null;for(rr(t,f,g,lt(y)?0:c-y,c),p=0,_=l-1;p<_;p++)rr(t,f,g,a[p],a[p+1]);return rr(t,f,g,u,lt(y)?t.length:u+y),f}return rr(t,f,g),f}function P1(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function C1(n,t,e){const i=D1(n),r=t.length/e;if(!i)return Math.max(r,1);const a=xy(i);for(let l=0,c=a.length-1;l<c;l++){const u=a[l];if(u>r)return u}return Math.max(r,1)}function O1(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function T1(n,t,e,i){let r=0,a=e[0],l;for(i=Math.ceil(i),l=0;l<n.length;l++)l===a&&(t.push(n[l]),r++,a=e[r*i])}function rr(n,t,e,i,r){const a=Z(i,0),l=Math.min(Z(r,n.length),n.length);let c=0,u,f,g;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),g=a;g<0;)c++,g=Math.round(a+c*e);for(f=Math.max(a,0);f<l;f++)f===g&&(t.push(n[f]),c++,g=Math.round(a+c*e))}function D1(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const L1=n=>n==="left"?"right":n==="right"?"left":n,uu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e;function fu(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function R1(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,l=n._endPixel,c=1e-6;let u=n.getPixelForTick(r),f;if(!(e&&(i===1?f=Math.max(u-a,l-u):t===0?f=(n.getPixelForTick(1)-u)/2:f=(u-n.getPixelForTick(r-1))/2,u+=r<t?f:-f,u<a-c||u>l+c)))return u}function E1(n,t){pt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function zi(n){return n.drawTicks?n.tickLength:0}function du(n,t){if(!n.display)return 0;const e=Ft(n.font,t),i=Gt(n.padding);return(vt(n.text)?n.text.length:1)*e.lineHeight+i.height}function I1(n,t){return yn(n,{scale:t,type:"scale"})}function F1(n,t,e){return yn(n,{tick:e,index:t,type:"tick"})}function B1(n,t,e){let i=Na(n);return(e&&t!=="right"||!e&&t==="right")&&(i=L1(i)),i}function z1(n,t,e,i){const{top:r,left:a,bottom:l,right:c,chart:u}=n,{chartArea:f,scales:g}=u;let p=0,_,y,w;const S=l-r,A=c-a;if(n.isHorizontal()){if(y=Yt(i,a,c),rt(e)){const C=Object.keys(e)[0],T=e[C];w=g[C].getPixelForValue(T)+S-t}else e==="center"?w=(f.bottom+f.top)/2+S-t:w=uu(n,e,t);_=c-a}else{if(rt(e)){const C=Object.keys(e)[0],T=e[C];y=g[C].getPixelForValue(T)-A+t}else e==="center"?y=(f.left+f.right)/2-A+t:y=uu(n,e,t);w=Yt(i,l,r),p=e==="left"?-Ct:Ct}return{titleX:y,titleY:w,maxWidth:_,rotation:p}}class $n extends Le{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:r}=this;return t=he(t,Number.POSITIVE_INFINITY),e=he(e,Number.NEGATIVE_INFINITY),i=he(i,Number.POSITIVE_INFINITY),r=he(r,Number.NEGATIVE_INFINITY),{min:he(t,i),max:he(e,r),minDefined:Pt(t),maxDefined:Pt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),l;if(r&&a)return{min:e,max:i};const c=this.getMatchingVisibleMetas();for(let u=0,f=c.length;u<f;++u)l=c[u].controller.getMinMax(this,t),r||(e=Math.min(e,l.min)),a||(i=Math.max(i,l.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:he(e,he(i,e)),max:he(i,he(e,i))}}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(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:l}=this.options,c=l.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=Gy(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=c<this.ticks.length;this._convertTicksToLabels(u?fu(this.ticks,c):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=k1(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(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(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=xt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,r=e.minRotation||0,a=e.maxRotation;let l=r,c,u,f;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const g=this._getLabelSizes(),p=g.widest.width,_=g.highest.height,y=Wt(this.chart.width-p,0,this.maxWidth);c=t.offset?this.maxWidth/i:y/(i-1),p+6>c&&(c=y/(i-(t.offset?.5:1)),u=this.maxHeight-zi(t.grid)-e.padding-du(t.title,this.chart.options.font),f=Math.sqrt(p*p+_*_),l=za(Math.min(Math.asin(Wt((g.highest.height+6)/c,-1,1)),Math.asin(Wt(u/f,-1,1))-Math.asin(Wt(_/f,-1,1)))),l=Math.max(r,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,l=this._isVisible(),c=this.isHorizontal();if(l){const u=du(r,e.options.font);if(c?(t.width=this.maxWidth,t.height=zi(a)+u):(t.height=this.maxHeight,t.width=zi(a)+u),i.display&&this.ticks.length){const{first:f,last:g,widest:p,highest:_}=this._getLabelSizes(),y=i.padding*2,w=Te(this.labelRotation),S=Math.cos(w),A=Math.sin(w);if(c){const C=i.mirror?0:A*p.width+S*_.height;t.height=Math.min(this.maxHeight,t.height+C+y)}else{const C=i.mirror?0:S*p.width+A*_.height;t.width=Math.min(this.maxWidth,t.width+C+y)}this._calculatePadding(f,g,A,S)}}this._handleMargins(),c?(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,r){const{ticks:{align:a,padding:l},position:c}=this.options,u=this.labelRotation!==0,f=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const g=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let _=0,y=0;u?f?(_=r*t.width,y=i*e.height):(_=i*t.height,y=r*e.width):a==="start"?y=e.width:a==="end"?_=t.width:a!=="inner"&&(_=t.width/2,y=e.width/2),this.paddingLeft=Math.max((_-g+l)*this.width/(this.width-g),0),this.paddingRight=Math.max((y-p+l)*this.width/(this.width-p),0)}else{let g=e.height/2,p=t.height/2;a==="start"?(g=0,p=t.height):a==="end"&&(g=e.height,p=0),this.paddingTop=g+l,this.paddingBottom=p+l}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)lt(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=fu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:r}=this,a=[],l=[];let c=0,u=0,f,g,p,_,y,w,S,A,C,T,I;for(f=0;f<e;++f){if(_=t[f].label,y=this._resolveTickFontOptions(f),i.font=w=y.string,S=r[w]=r[w]||{data:{},gc:[]},A=y.lineHeight,C=T=0,!lt(_)&&!vt(_))C=Ar(i,S.data,S.gc,C,_),T=A;else if(vt(_))for(g=0,p=_.length;g<p;++g)I=_[g],!lt(I)&&!vt(I)&&(C=Ar(i,S.data,S.gc,C,I),T+=A);a.push(C),l.push(T),c=Math.max(C,c),u=Math.max(T,u)}E1(r,e);const B=a.indexOf(c),L=l.indexOf(u),z=W=>({width:a[W]||0,height:l[W]||0});return{first:z(0),last:z(e-1),widest:z(B),highest:z(L),widths:a,heights:l}}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 wy(this._alignToPixels?Rn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=F1(this.getContext(),t,i))}return this.$context||(this.$context=I1(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Te(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),l=t.autoSkipPadding||0,c=a?a.widest.width+l:0,u=a?a.highest.height+l:0;return this.isHorizontal()?u*i>c*r?c/i:u/r:u*r<c*i?u/i:c/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:l,border:c}=r,u=a.offset,f=this.isHorizontal(),p=this.ticks.length+(u?1:0),_=zi(a),y=[],w=c.setContext(this.getContext()),S=w.display?w.width:0,A=S/2,C=function(_t){return Rn(i,_t,S)};let T,I,B,L,z,W,N,Y,J,Q,at,Rt;if(l==="top")T=C(this.bottom),W=this.bottom-_,Y=T-A,Q=C(t.top)+A,Rt=t.bottom;else if(l==="bottom")T=C(this.top),Q=t.top,Rt=C(t.bottom)-A,W=T+A,Y=this.top+_;else if(l==="left")T=C(this.right),z=this.right-_,N=T-A,J=C(t.left)+A,at=t.right;else if(l==="right")T=C(this.left),J=t.left,at=C(t.right)-A,z=T+A,N=this.left+_;else if(e==="x"){if(l==="center")T=C((t.top+t.bottom)/2+.5);else if(rt(l)){const _t=Object.keys(l)[0],ft=l[_t];T=C(this.chart.scales[_t].getPixelForValue(ft))}Q=t.top,Rt=t.bottom,W=T+A,Y=W+_}else if(e==="y"){if(l==="center")T=C((t.left+t.right)/2);else if(rt(l)){const _t=Object.keys(l)[0],ft=l[_t];T=C(this.chart.scales[_t].getPixelForValue(ft))}z=T-A,N=z-_,J=t.left,at=t.right}const Vt=Z(r.ticks.maxTicksLimit,p),ht=Math.max(1,Math.ceil(p/Vt));for(I=0;I<p;I+=ht){const _t=this.getContext(I),ft=a.setContext(_t),Lt=c.setContext(_t),Bt=ft.lineWidth,Se=ft.color,Kt=Lt.dash||[],nn=Lt.dashOffset,vn=ft.tickWidth,wn=ft.tickColor,fe=ft.tickBorderDash||[],Re=ft.tickBorderDashOffset;B=R1(this,I,u),B!==void 0&&(L=Rn(i,B,Bt),f?z=N=J=at=L:W=Y=Q=Rt=L,y.push({tx1:z,ty1:W,tx2:N,ty2:Y,x1:J,y1:Q,x2:at,y2:Rt,width:Bt,color:Se,borderDash:Kt,borderDashOffset:nn,tickWidth:vn,tickColor:wn,tickBorderDash:fe,tickBorderDashOffset:Re}))}return this._ticksLength=p,this._borderValue=T,y}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,l=this.isHorizontal(),c=this.ticks,{align:u,crossAlign:f,padding:g,mirror:p}=a,_=zi(i.grid),y=_+g,w=p?-g:y,S=-Te(this.labelRotation),A=[];let C,T,I,B,L,z,W,N,Y,J,Q,at,Rt="middle";if(r==="top")z=this.bottom-w,W=this._getXAxisLabelAlignment();else if(r==="bottom")z=this.top+w,W=this._getXAxisLabelAlignment();else if(r==="left"){const ht=this._getYAxisLabelAlignment(_);W=ht.textAlign,L=ht.x}else if(r==="right"){const ht=this._getYAxisLabelAlignment(_);W=ht.textAlign,L=ht.x}else if(e==="x"){if(r==="center")z=(t.top+t.bottom)/2+y;else if(rt(r)){const ht=Object.keys(r)[0],_t=r[ht];z=this.chart.scales[ht].getPixelForValue(_t)+y}W=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-y;else if(rt(r)){const ht=Object.keys(r)[0],_t=r[ht];L=this.chart.scales[ht].getPixelForValue(_t)}W=this._getYAxisLabelAlignment(_).textAlign}e==="y"&&(u==="start"?Rt="top":u==="end"&&(Rt="bottom"));const Vt=this._getLabelSizes();for(C=0,T=c.length;C<T;++C){I=c[C],B=I.label;const ht=a.setContext(this.getContext(C));N=this.getPixelForTick(C)+a.labelOffset,Y=this._resolveTickFontOptions(C),J=Y.lineHeight,Q=vt(B)?B.length:1;const _t=Q/2,ft=ht.color,Lt=ht.textStrokeColor,Bt=ht.textStrokeWidth;let Se=W;l?(L=N,W==="inner"&&(C===T-1?Se=this.options.reverse?"left":"right":C===0?Se=this.options.reverse?"right":"left":Se="center"),r==="top"?f==="near"||S!==0?at=-Q*J+J/2:f==="center"?at=-Vt.highest.height/2-_t*J+J:at=-Vt.highest.height+J/2:f==="near"||S!==0?at=J/2:f==="center"?at=Vt.highest.height/2-_t*J:at=Vt.highest.height-Q*J,p&&(at*=-1),S!==0&&!ht.showLabelBackdrop&&(L+=J/2*Math.sin(S))):(z=N,at=(1-Q)*J/2);let Kt;if(ht.showLabelBackdrop){const nn=Gt(ht.backdropPadding),vn=Vt.heights[C],wn=Vt.widths[C];let fe=at-nn.top,Re=0-nn.left;switch(Rt){case"middle":fe-=vn/2;break;case"bottom":fe-=vn;break}switch(W){case"center":Re-=wn/2;break;case"right":Re-=wn;break}Kt={left:Re,top:fe,width:wn+nn.width,height:vn+nn.height,color:ht.backdropColor}}A.push({label:B,font:Y,textOffset:at,options:{rotation:S,color:ft,strokeColor:Lt,strokeWidth:Bt,textAlign:Se,textBaseline:Rt,translation:[L,z],backdrop:Kt}})}return A}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Te(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,l=this._getLabelSizes(),c=t+a,u=l.widest.width;let f,g;return e==="left"?r?(g=this.right+a,i==="near"?f="left":i==="center"?(f="center",g+=u/2):(f="right",g+=u)):(g=this.right-c,i==="near"?f="right":i==="center"?(f="center",g-=u/2):(f="left",g=this.left)):e==="right"?r?(g=this.left+a,i==="near"?f="right":i==="center"?(f="center",g-=u/2):(f="left",g-=u)):(g=this.left+c,i==="near"?f="left":i==="center"?(f="center",g+=u/2):(f="right",g=this.right)):f="right",{textAlign:f,x:g}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:l}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,l),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,l;const c=(u,f,g)=>{!g.width||!g.color||(i.save(),i.lineWidth=g.width,i.strokeStyle=g.color,i.setLineDash(g.borderDash||[]),i.lineDashOffset=g.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(e.display)for(a=0,l=r.length;a<l;++a){const u=r[a];e.drawOnChartArea&&c({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&c({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,a=i.setContext(this.getContext()),l=i.display?a.width:0;if(!l)return;const c=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let f,g,p,_;this.isHorizontal()?(f=Rn(t,this.left,l)-l/2,g=Rn(t,this.right,c)+c/2,p=_=u):(p=Rn(t,this.top,l)-l/2,_=Rn(t,this.bottom,c)+c/2,f=g=u),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(f,p),e.lineTo(g,_),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Lr(i,r);const a=this.getLabelItems(t);for(const l of a){const c=l.options,u=l.font,f=l.label,g=l.textOffset;Un(i,f,0,g,u,c)}r&&Rr(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Ft(i.font),l=Gt(i.padding),c=i.align;let u=a.lineHeight/2;e==="bottom"||e==="center"||rt(e)?(u+=l.bottom,vt(i.text)&&(u+=a.lineHeight*(i.text.length-1))):u+=l.top;const{titleX:f,titleY:g,maxWidth:p,rotation:_}=z1(this,u,e,c);Un(t,i.text,0,0,a,{color:i.color,maxWidth:p,rotation:_,textAlign:B1(c,e,r),textBaseline:"middle",translation:[f,g]})}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=Z(t.grid&&t.grid.z,-1),r=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$n.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,l;for(a=0,l=e.length;a<l;++a){const c=e[a];c[i]===this.id&&(!t||c.type===t)&&r.push(c)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Ft(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class or{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;H1(e)&&(i=this.register(e));const r=this.items,a=t.id,l=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,W1(t,l,i),this.override&&Dt.override(t.id,t.overrides)),l}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Dt[r]&&(delete Dt[r][i],this.override&&delete Vn[i])}}function W1(n,t,e){const i=Zi(Object.create(null),[e?Dt.get(e):{},Dt.get(t),n.defaults]);Dt.set(t,i),n.defaultRoutes&&N1(t,n.defaultRoutes),n.descriptors&&Dt.describe(t,n.descriptors)}function N1(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),l=t[e].split("."),c=l.pop(),u=l.join(".");Dt.route(a,r,u,c)})}function H1(n){return"id"in n&&"defaults"in n}class V1{constructor(){this.controllers=new or(De,"datasets",!0),this.elements=new or(Le,"elements"),this.plugins=new or(Object,"plugins"),this.scales=new or($n,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):pt(r,l=>{const c=i||this._getRegistryForType(l);this._exec(t,c,l)})})}_exec(t,e,i){const r=Ba(t);xt(i["before"+r],[],i),e[t](i),xt(i["after"+r],[],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 r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var ze=new V1;class U1{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),l=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),l}_notify(t,e,i,r){r=r||{};for(const a of t){const l=a.plugin,c=l[i],u=[e,r,a.options];if(xt(c,u,l)===!1&&r.cancelable)return!1}return!0}invalidate(){lt(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,r=Z(i.options&&i.options.plugins,{}),a=$1(i);return r===!1&&!e?[]:X1(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,l)=>a.filter(c=>!l.some(u=>c.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function $1(n){const t={},e=[],i=Object.keys(ze.plugins.items);for(let a=0;a<i.length;a++)e.push(ze.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const l=r[a];e.indexOf(l)===-1&&(e.push(l),t[l.id]=!0)}return{plugins:e,localIds:t}}function Y1(n,t){return!t&&n===!1?null:n===!0?{}:n}function X1(n,{plugins:t,localIds:e},i,r){const a=[],l=n.getContext();for(const c of t){const u=c.id,f=Y1(i[u],r);f!==null&&a.push({plugin:c,options:G1(n.config,{plugin:c,local:e[u]},f,l)})}return a}function G1(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),l=n.getOptionScopes(i,a);return e&&t.defaults&&l.push(t.defaults),n.createResolver(l,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ma(n,t){const e=Dt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function K1(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function j1(n,t){return n===t?"_index_":"_value_"}function q1(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Cr(n,t){if(n==="x"||n==="y"||n==="r"||(n=t.axis||q1(t.position)||n.length>1&&Cr(n[0].toLowerCase(),t),n))return n;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Z1(n,t){const e=Vn[n.type]||{scales:{}},i=t.scales||{},r=Ma(n.type,t),a=Object.create(null);return Object.keys(i).forEach(l=>{const c=i[l];if(!rt(c))return console.error(`Invalid scale configuration for scale: ${l}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const u=Cr(l,c),f=j1(u,r),g=e.scales||{};a[l]=Yi(Object.create(null),[{axis:u},c,g[u],g[f]])}),n.data.datasets.forEach(l=>{const c=l.type||n.type,u=l.indexAxis||Ma(c,t),g=(Vn[c]||{}).scales||{};Object.keys(g).forEach(p=>{const _=K1(p,u),y=l[_+"AxisID"]||_;a[y]=a[y]||Object.create(null),Yi(a[y],[{axis:_},i[y],g[p]])})}),Object.keys(a).forEach(l=>{const c=a[l];Yi(c,[Dt.scales[c.type],Dt.scale])}),a}function Lf(n){const t=n.options||(n.options={});t.plugins=Z(t.plugins,{}),t.scales=Z1(n,t)}function Rf(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function J1(n){return n=n||{},n.data=Rf(n.data),Lf(n),n}const gu=new Map,Ef=new Set;function ar(n,t){let e=gu.get(n);return e||(e=t(),gu.set(n,e),Ef.add(e)),e}const Wi=(n,t,e)=>{const i=bn(t,e);i!==void 0&&n.add(i)};class Q1{constructor(t){this._config=J1(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=Rf(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(),Lf(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ar(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ar(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ar(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ar(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,l=this._cachedScopes(t,i),c=l.get(e);if(c)return c;const u=new Set;e.forEach(g=>{t&&(u.add(t),g.forEach(p=>Wi(u,t,p))),g.forEach(p=>Wi(u,r,p)),g.forEach(p=>Wi(u,Vn[a]||{},p)),g.forEach(p=>Wi(u,Dt,p)),g.forEach(p=>Wi(u,va,p))});const f=Array.from(u);return f.length===0&&f.push(Object.create(null)),Ef.has(e)&&l.set(e,f),f}chartOptionScopes(){const{options:t,type:e}=this;return[t,Vn[e]||{},Dt.datasets[e]||{},{type:e},Dt,va]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:l,subPrefixes:c}=pu(this._resolverCache,t,r);let u=l;if(ew(l,e)){a.$shared=!1,i=xn(i)?i():i;const f=this.createResolver(t,i,c);u=hi(l,i,f)}for(const f of e)a[f]=u[f];return a}createResolver(t,e,i=[""],r){const{resolver:a}=pu(this._resolverCache,t,i);return rt(e)?hi(a,e,void 0,r):a}}function pu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:Va(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,a)),a}const tw=n=>rt(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||xn(n[e]),!1);function ew(n,t){const{isScriptable:e,isIndexable:i}=ff(n);for(const r of t){const a=e(r),l=i(r),c=(l||a)&&n[r];if(a&&(xn(c)||tw(c))||l&&vt(c))return!0}return!1}var nw="4.1.2";const iw=["top","bottom","left","right","chartArea"];function mu(n,t){return n==="top"||n==="bottom"||iw.indexOf(n)===-1&&t==="x"}function _u(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function bu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function sw(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function If(n){return bf()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const br={},xu=n=>{const t=If(n);return Object.values(br).filter(e=>e.canvas===t).pop()};function rw(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const l=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=l)}}}function ow(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function aw(n){const{xScale:t,yScale:e}=n;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class zn{static register(...t){ze.add(...t),yu()}static unregister(...t){ze.remove(...t),yu()}constructor(t,e){const i=this.config=new Q1(e),r=If(t),a=xu(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||A1(r)),this.platform.updateConfig(i);const c=this.platform.acquireContext(r,l.aspectRatio),u=c&&c.canvas,f=u&&u.height,g=u&&u.width;if(this.id=hy(),this.ctx=c,this.canvas=u,this.width=g,this.height=f,this._options=l,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 U1,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ky(p=>this.update(p),l.resizeDelay||0),this._dataChanges=[],br[this.id]=this,!c||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ze.listen(this,"complete",bu),Ze.listen(this,"progress",sw),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return lt(t)?e&&a?a:r?i/r: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 ze}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():$h(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hh(this.canvas,this.ctx),this}stop(){return Ze.stop(this),this}resize(t,e){Ze.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(r,t,e,a),c=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,$h(this,c,!0)&&(this.notifyPlugins("resize",{size:l}),xt(i.onResize,[this,l],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};pt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((l,c)=>(l[c]=!1,l),{});let a=[];e&&(a=a.concat(Object.keys(e).map(l=>{const c=e[l],u=Cr(l,c),f=u==="r",g=u==="x";return{options:c,dposition:f?"chartArea":g?"bottom":"left",dtype:f?"radialLinear":g?"category":"linear"}}))),pt(a,l=>{const c=l.options,u=c.id,f=Cr(u,c),g=Z(c.type,l.dtype);(c.position===void 0||mu(c.position,f)!==mu(l.dposition))&&(c.position=l.dposition),r[u]=!0;let p=null;if(u in i&&i[u].type===g)p=i[u];else{const _=ze.getScale(g);p=new _({id:u,type:g,ctx:this.ctx,chart:this}),i[p.id]=p}p.init(c,t)}),pt(r,(l,c)=>{l||delete i[c]}),pt(i,l=>{Xt.configure(this,l,l.options),Xt.addBox(this,l)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(_u("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let l=this.getDatasetMeta(i);const c=a.type||this.config.type;if(l.type&&l.type!==c&&(this._destroyDatasetMeta(i),l=this.getDatasetMeta(i)),l.type=c,l.indexAxis=a.indexAxis||Ma(c,this.options),l.order=a.order||0,l.index=i,l.label=""+a.label,l.visible=this.isDatasetVisible(i),l.controller)l.controller.updateIndex(i),l.controller.linkScales();else{const u=ze.getController(c),{datasetElementType:f,dataElementType:g}=Dt.datasets[c];Object.assign(u,{dataElementType:ze.getElement(g),datasetElementType:f&&ze.getElement(f)}),l.controller=new u(this,i),t.push(l.controller)}}return this._updateMetasets(),t}_resetElements(){pt(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()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let f=0,g=this.data.datasets.length;f<g;f++){const{controller:p}=this.getDatasetMeta(f),_=!r&&a.indexOf(p)===-1;p.buildOrUpdateElements(_),l=Math.max(+p.getMaxOverflow(),l)}l=this._minPadding=i.layout.autoPadding?l:0,this._updateLayout(l),r||pt(a,f=>{f.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(_u("z","_idx"));const{_active:c,_lastEvent:u}=this;u?this._eventHandler(u,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){pt(this.scales,t=>{Xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Lh(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const l=i==="_removeElements"?-a:a;rw(t,r,l)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(l=>l[0]===a).map((l,c)=>c+","+l.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!Lh(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Xt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],pt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,xn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ze.has(this)?this.attached&&!Ze.running(this)&&Ze.start(this):(this.draw(),bu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)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 r,a;for(r=0,a=e.length;r<a;++r){const l=e[r];(!t||l.visible)&&i.push(l)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)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,r=!i.disabled,a=aw(t)||this.chartArea,l={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(r&&Lr(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Rr(e),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(t){return Qi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=s1.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=yn(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 typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),l=a.controller._resolveAnimations(void 0,r);we(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),l.update(a,{visible:i}),this.update(c=>c.datasetIndex===t?r: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(),Ze.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(),Hh(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete br[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=(a,l)=>{e.addEventListener(this,a,l),t[a]=l},r=(a,l,c)=>{a.offsetX=l,a.offsetY=c,this._eventHandler(a)};pt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,f)=>{e.addEventListener(this,u,f),t[u]=f},r=(u,f)=>{t[u]&&(e.removeEventListener(this,u,f),delete t[u])},a=(u,f)=>{this.canvas&&this.resize(u,f)};let l;const c=()=>{r("attach",c),this.attached=!0,this.resize(),i("resize",a),i("detach",l)};l=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",c)},e.isAttached(this.canvas)?c():l()}unbindEvents(){pt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},pt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,l,c,u;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),c=0,u=t.length;c<u;++c){l=t[c];const f=l&&this.getDatasetMeta(l.datasetIndex).controller;f&&f[r+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:l})=>{const c=this.getDatasetMeta(a);if(!c)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:c.data[l],index:l}});!wr(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 this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(u,f)=>u.filter(g=>!f.some(p=>g.datasetIndex===p.datasetIndex&&g.index===p.index)),l=a(e,t),c=i?t:a(t,e);l.length&&this.updateHoverStyle(l,r.mode,!1),c.length&&r.mode&&this.updateHoverStyle(c,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=l=>(l.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,l=e,c=this._getActiveElements(t,r,i,l),u=my(t),f=ow(t,this._lastEvent,i,u);i&&(this._lastEvent=null,xt(a.onHover,[t,c,this],this),u&&xt(a.onClick,[t,c,this],this));const g=!wr(c,r);return(g||e)&&(this._active=c,this._updateHoverStyles(c,r,e)),this._lastEvent=f,g}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}}U(zn,"defaults",Dt),U(zn,"instances",br),U(zn,"overrides",Vn),U(zn,"registry",ze),U(zn,"version",nw),U(zn,"getChart",xu);function yu(){return pt(zn.instances,n=>n._plugins.invalidate())}function lw(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:l,outerRadius:c,innerRadius:u}=t;let f=r/c;n.beginPath(),n.arc(a,l,c,i-f,e+f),u>r?(f=r/u,n.arc(a,l,u,e+f,i-f,!0)):n.arc(a,l,r,e+Ct,i-Ct),n.closePath(),n.clip()}function cw(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function hw(n,t,e,i){const r=cw(n.options.borderRadius),a=(e-t)/2,l=Math.min(a,i*t/2),c=u=>{const f=(e-Math.min(a,u))*i/2;return Wt(u,0,Math.min(a,f))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:Wt(r.innerStart,0,l),innerEnd:Wt(r.innerEnd,0,l)}}function ai(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Or(n,t,e,i,r,a){const{x:l,y:c,startAngle:u,pixelMargin:f,innerRadius:g}=t,p=Math.max(t.outerRadius+i+e-f,0),_=g>0?g+i+e+f:0;let y=0;const w=r-u;if(i){const ht=g>0?g-i:0,_t=p>0?p-i:0,ft=(ht+_t)/2,Lt=ft!==0?w*ft/(ft+i):w;y=(w-Lt)/2}const S=Math.max(.001,w*p-e/Mt)/p,A=(w-S)/2,C=u+A+y,T=r-A-y,{outerStart:I,outerEnd:B,innerStart:L,innerEnd:z}=hw(t,_,p,T-C),W=p-I,N=p-B,Y=C+I/W,J=T-B/N,Q=_+L,at=_+z,Rt=C+L/Q,Vt=T-z/at;if(n.beginPath(),a){const ht=(Y+J)/2;if(n.arc(l,c,p,Y,ht),n.arc(l,c,p,ht,J),B>0){const Bt=ai(N,J,l,c);n.arc(Bt.x,Bt.y,B,J,T+Ct)}const _t=ai(at,T,l,c);if(n.lineTo(_t.x,_t.y),z>0){const Bt=ai(at,Vt,l,c);n.arc(Bt.x,Bt.y,z,T+Ct,Vt+Math.PI)}const ft=(T-z/_+(C+L/_))/2;if(n.arc(l,c,_,T-z/_,ft,!0),n.arc(l,c,_,ft,C+L/_,!0),L>0){const Bt=ai(Q,Rt,l,c);n.arc(Bt.x,Bt.y,L,Rt+Math.PI,C-Ct)}const Lt=ai(W,C,l,c);if(n.lineTo(Lt.x,Lt.y),I>0){const Bt=ai(W,Y,l,c);n.arc(Bt.x,Bt.y,I,C-Ct,Y)}}else{n.moveTo(l,c);const ht=Math.cos(Y)*p+l,_t=Math.sin(Y)*p+c;n.lineTo(ht,_t);const ft=Math.cos(J)*p+l,Lt=Math.sin(J)*p+c;n.lineTo(ft,Lt)}n.closePath()}function uw(n,t,e,i,r){const{fullCircles:a,startAngle:l,circumference:c}=t;let u=t.endAngle;if(a){Or(n,t,e,i,u,r);for(let f=0;f<a;++f)n.fill();isNaN(c)||(u=l+(c%wt||wt))}return Or(n,t,e,i,u,r),n.fill(),u}function fw(n,t,e,i,r){const{fullCircles:a,startAngle:l,circumference:c,options:u}=t,{borderWidth:f,borderJoinStyle:g}=u,p=u.borderAlign==="inner";if(!f)return;p?(n.lineWidth=f*2,n.lineJoin=g||"round"):(n.lineWidth=f,n.lineJoin=g||"bevel");let _=t.endAngle;if(a){Or(n,t,e,i,_,r);for(let y=0;y<a;++y)n.stroke();isNaN(c)||(_=l+(c%wt||wt))}p&&lw(n,t,_),a||(Or(n,t,e,i,_,r),n.stroke())}class xr extends Le{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 r=this.getProps(["x","y"],i),{angle:a,distance:l}=tf(r,{x:t,y:e}),{startAngle:c,endAngle:u,innerRadius:f,outerRadius:g,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),_=this.options.spacing/2,w=Z(p,u-c)>=wt||Ji(a,c,u),S=tn(l,f+_,g+_);return w&&S}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:u,spacing:f}=this.options,g=(r+a)/2,p=(l+c+f+u)/2;return{x:e+Math.cos(g)*p,y:i+Math.sin(g)*p}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,a=(e.spacing||0)/2,l=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r);const u=1-Math.sin(Math.min(Mt,i||0)),f=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,uw(t,this,f,a,l),fw(t,this,f,a,l),t.restore()}}U(xr,"id","arc"),U(xr,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),U(xr,"defaultRoutes",{backgroundColor:"backgroundColor"});function Ff(n,t,e=t){n.lineCap=Z(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Z(e.borderDash,t.borderDash)),n.lineDashOffset=Z(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Z(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Z(e.borderWidth,t.borderWidth),n.strokeStyle=Z(e.borderColor,t.borderColor)}function dw(n,t,e){n.lineTo(e.x,e.y)}function gw(n){return n.stepped?zy:n.tension||n.cubicInterpolationMode==="monotone"?Wy:dw}function Bf(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:l,end:c}=t,u=Math.max(r,l),f=Math.min(a,c),g=r<l&&a<l||r>c&&a>c;return{count:i,start:u,loop:t.loop,ilen:f<u&&!g?i+f-u:f-u}}function pw(n,t,e,i){const{points:r,options:a}=t,{count:l,start:c,loop:u,ilen:f}=Bf(r,e,i),g=gw(a);let{move:p=!0,reverse:_}=i||{},y,w,S;for(y=0;y<=f;++y)w=r[(c+(_?f-y:y))%l],!w.skip&&(p?(n.moveTo(w.x,w.y),p=!1):g(n,S,w,_,a.stepped),S=w);return u&&(w=r[(c+(_?f:0))%l],g(n,S,w,_,a.stepped)),!!u}function mw(n,t,e,i){const r=t.points,{count:a,start:l,ilen:c}=Bf(r,e,i),{move:u=!0,reverse:f}=i||{};let g=0,p=0,_,y,w,S,A,C;const T=B=>(l+(f?c-B:B))%a,I=()=>{S!==A&&(n.lineTo(g,A),n.lineTo(g,S),n.lineTo(g,C))};for(u&&(y=r[T(0)],n.moveTo(y.x,y.y)),_=0;_<=c;++_){if(y=r[T(_)],y.skip)continue;const B=y.x,L=y.y,z=B|0;z===w?(L<S?S=L:L>A&&(A=L),g=(p*g+B)/++p):(I(),n.lineTo(B,L),w=z,p=0,S=A=L),C=L}I()}function Aa(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?mw:pw}function _w(n){return n.stepped?_v:n.tension||n.cubicInterpolationMode==="monotone"?bv:Bn}function bw(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Ff(n,t.options),n.stroke(r)}function xw(n,t,e,i){const{segments:r,options:a}=t,l=Aa(t);for(const c of r)Ff(n,a,c.style),n.beginPath(),l(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const yw=typeof Path2D=="function";function vw(n,t,e,i){yw&&!t.options.segment?bw(n,t,e,i):xw(n,t,e,i)}class pn extends Le{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||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;cv(this._points,i,t,r,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=Mv(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,r=t[e],a=this.points,l=Sf(this,{property:e,start:r,end:r});if(!l.length)return;const c=[],u=_w(i);let f,g;for(f=0,g=l.length;f<g;++f){const{start:p,end:_}=l[f],y=a[p],w=a[_];if(y===w){c.push(y);continue}const S=Math.abs((r-y[e])/(w[e]-y[e])),A=u(y,w,S,i.stepped);A[e]=t[e],c.push(A)}return c.length===1?c[0]:c}pathSegment(t,e,i){return Aa(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=Aa(this);let l=this._loop;e=e||0,i=i||this.points.length-e;for(const c of r)l&=a(t,this,c,{start:e,end:e+i-1});return!!l}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),vw(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}U(pn,"id","line"),U(pn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),U(pn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),U(pn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function vu(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class yr extends Le{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 r=this.options,{x:a,y:l}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return vu(this,t,"x",e)}inYRange(t,e){return vu(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Qi(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,wa(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}U(yr,"id","point"),U(yr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),U(yr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function zf(n,t){const{x:e,y:i,base:r,width:a,height:l}=n.getProps(["x","y","base","width","height"],t);let c,u,f,g,p;return n.horizontal?(p=l/2,c=Math.min(e,r),u=Math.max(e,r),f=i-p,g=i+p):(p=a/2,c=e-p,u=e+p,f=Math.min(i,r),g=Math.max(i,r)),{left:c,top:f,right:u,bottom:g}}function mn(n,t,e,i){return n?0:Wt(t,e,i)}function ww(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=uf(i);return{t:mn(r.top,a.top,0,e),r:mn(r.right,a.right,0,t),b:mn(r.bottom,a.bottom,0,e),l:mn(r.left,a.left,0,t)}}function Sw(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=Nn(r),l=Math.min(t,e),c=n.borderSkipped,u=i||rt(r);return{topLeft:mn(!u||c.top||c.left,a.topLeft,0,l),topRight:mn(!u||c.top||c.right,a.topRight,0,l),bottomLeft:mn(!u||c.bottom||c.left,a.bottomLeft,0,l),bottomRight:mn(!u||c.bottom||c.right,a.bottomRight,0,l)}}function Mw(n){const t=zf(n),e=t.right-t.left,i=t.bottom-t.top,r=ww(n,e/2,i/2),a=Sw(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function pa(n,t,e,i){const r=t===null,a=e===null,c=n&&!(r&&a)&&zf(n,i);return c&&(r||tn(t,c.left,c.right))&&(a||tn(e,c.top,c.bottom))}function Aw(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function kw(n,t){n.rect(t.x,t.y,t.w,t.h)}function ma(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,l=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+l,radius:n.radius}}class vr extends Le{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:r}}=this,{inner:a,outer:l}=Mw(this),c=Aw(l.radius)?ts:kw;t.save(),(l.w!==a.w||l.h!==a.h)&&(t.beginPath(),c(t,ma(l,e,a)),t.clip(),c(t,ma(a,-e,l)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),c(t,ma(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return pa(this,t,e,i)}inXRange(t,e){return pa(this,t,null,e)}inYRange(t,e){return pa(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}U(vr,"id","bar"),U(vr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),U(vr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Pw=Object.freeze({__proto__:null,ArcElement:xr,LineElement:pn,PointElement:yr,BarElement:vr});const ka=["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)"],wu=ka.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Wf(n){return ka[n%ka.length]}function Nf(n){return wu[n%wu.length]}function Cw(n,t){return n.borderColor=Wf(t),n.backgroundColor=Nf(t),++t}function Ow(n,t){return n.backgroundColor=n.data.map(()=>Wf(t++)),t}function Tw(n,t){return n.backgroundColor=n.data.map(()=>Nf(t++)),t}function Dw(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Wn?t=Ow(e,t):r instanceof ji?t=Tw(e,t):r&&(t=Cw(e,t))}}function Su(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}var Lw={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{options:{elements:i},data:{datasets:r}}=n.config;if(!e.forceOverride&&(Su(r)||i&&Su(i)))return;const a=Dw(n);r.forEach(a)}};function Rw(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const l=[],c=(e-2)/(a-2);let u=0;const f=t+e-1;let g=t,p,_,y,w,S;for(l[u++]=n[g],p=0;p<a-2;p++){let A=0,C=0,T;const I=Math.floor((p+1)*c)+1+t,B=Math.min(Math.floor((p+2)*c)+1,e)+t,L=B-I;for(T=I;T<B;T++)A+=n[T].x,C+=n[T].y;A/=L,C/=L;const z=Math.floor(p*c)+1+t,W=Math.min(Math.floor((p+1)*c)+1,e)+t,{x:N,y:Y}=n[g];for(y=w=-1,T=z;T<W;T++)w=.5*Math.abs((N-A)*(n[T].y-Y)-(N-n[T].x)*(C-Y)),w>y&&(y=w,_=n[T],S=T);l[u++]=_,g=S}return l[u++]=n[f],l}function Ew(n,t,e,i){let r=0,a=0,l,c,u,f,g,p,_,y,w,S;const A=[],C=t+e-1,T=n[t].x,B=n[C].x-T;for(l=t;l<t+e;++l){c=n[l],u=(c.x-T)/B*i,f=c.y;const L=u|0;if(L===g)f<w?(w=f,p=l):f>S&&(S=f,_=l),r=(a*r+c.x)/++a;else{const z=l-1;if(!lt(p)&&!lt(_)){const W=Math.min(p,_),N=Math.max(p,_);W!==y&&W!==z&&A.push({...n[W],x:r}),N!==y&&N!==z&&A.push({...n[N],x:r})}l>0&&z!==y&&A.push(n[z]),A.push(c),g=L,a=0,w=S=f,p=_=y=l}}return A}function Hf(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{value:t})}}function Mu(n){n.data.datasets.forEach(t=>{Hf(t)})}function Iw(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:l,max:c,minDefined:u,maxDefined:f}=a.getUserBounds();return u&&(i=Wt(en(t,a.axis,l).lo,0,e-1)),f?r=Wt(en(t,a.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var Fw={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Mu(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:l,indexAxis:c}=r,u=n.getDatasetMeta(a),f=l||r.data;if(Hi([c,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const g=n.scales[u.xAxisID];if(g.type!=="linear"&&g.type!=="time"||n.options.parsing)return;let{start:p,count:_}=Iw(u,f);const y=e.threshold||4*i;if(_<=y){Hf(r);return}lt(l)&&(r._data=f,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(S){this._data=S}}));let w;switch(e.algorithm){case"lttb":w=Rw(f,p,_,i,e);break;case"min-max":w=Ew(f,p,_,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=w})},destroy(n){Mu(n)}};function Bw(n,t,e){const i=n.segments,r=n.points,a=t.points,l=[];for(const c of i){let{start:u,end:f}=c;f=Ga(u,f,r);const g=Pa(e,r[u],r[f],c.loop);if(!t.segments){l.push({source:c,target:g,start:r[u],end:r[f]});continue}const p=Sf(t,g);for(const _ of p){const y=Pa(e,a[_.start],a[_.end],_.loop),w=wf(c,r,y);for(const S of w)l.push({source:S,target:_,start:{[e]:Au(g,y,"start",Math.max)},end:{[e]:Au(g,y,"end",Math.min)}})}}return l}function Pa(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ue(r),a=ue(a)),{property:n,start:r,end:a}}function zw(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:l,end:c})=>{c=Ga(l,c,r);const u=r[l],f=r[c];i!==null?(a.push({x:u.x,y:i}),a.push({x:f.x,y:i})):e!==null&&(a.push({x:e,y:u.y}),a.push({x:e,y:f.y}))}),a}function Ga(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Au(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Vf(n,t){let e=[],i=!1;return vt(n)?(i=!0,e=n):e=zw(n,t),e.length?new pn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ku(n){return n&&n.fill!==!1}function Ww(n,t,e){let r=n[t].fill;const a=[t];let l;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Pt(r))return r;if(l=n[r],!l)return!1;if(l.visible)return r;a.push(r),r=l.fill}return!1}function Nw(n,t,e){const i=$w(n);if(rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Pt(r)&&Math.floor(r)===r?Hw(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Hw(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Vw(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:rt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Uw(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:rt(n)?i=n.value:i=t.getBaseValue(),i}function $w(n){const t=n.options,e=t.fill;let i=Z(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Yw(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,l=i.points,c=Xw(t,e);c.push(Vf({x:null,y:t.bottom},i));for(let u=0;u<a.length;u++){const f=a[u];for(let g=f.start;g<=f.end;g++)Gw(r,l[g],c)}return new pn({points:r,options:{}})}function Xw(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Gw(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:l,last:c,point:u}=Kw(a,t,"x");if(!(!u||l&&c)){if(l)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function Kw(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,l=n.points;let c=!1,u=!1;for(let f=0;f<a.length;f++){const g=a[f],p=l[g.start][e],_=l[g.end][e];if(tn(r,p,_)){c=r===p,u=r===_;break}}return{first:c,last:u,point:i}}class Uf{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:l}=this;return e=e||{start:0,end:wt},t.arc(r,a,l,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function jw(n){const{chart:t,fill:e,line:i}=n;if(Pt(e))return qw(t,e);if(e==="stack")return Yw(n);if(e==="shape")return!0;const r=Zw(n);return r instanceof Uf?r:Vf(r,i)}function qw(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Zw(n){return(n.scale||{}).getPointPositionForValue?Qw(n):Jw(n)}function Jw(n){const{scale:t={},fill:e}=n,i=Vw(e,t);if(Pt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function Qw(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,l=Uw(e,t,a),c=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,a);return new Uf({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(l)})}for(let u=0;u<r;++u)c.push(t.getPointPositionForValue(u,l));return c}function _a(n,t,e){const i=jw(t),{line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,f=c.backgroundColor,{above:g=f,below:p=f}=u||{};i&&r.points.length&&(Lr(n,e),tS(n,{line:r,target:i,above:g,below:p,area:e,scale:a,axis:l}),Rr(n))}function tS(n,t){const{line:e,target:i,above:r,below:a,area:l,scale:c}=t,u=e._loop?"angle":t.axis;n.save(),u==="x"&&a!==r&&(Pu(n,i,l.top),Cu(n,{line:e,target:i,color:r,scale:c,property:u}),n.restore(),n.save(),Pu(n,i,l.bottom)),Cu(n,{line:e,target:i,color:a,scale:c,property:u}),n.restore()}function Pu(n,t,e){const{segments:i,points:r}=t;let a=!0,l=!1;n.beginPath();for(const c of i){const{start:u,end:f}=c,g=r[u],p=r[Ga(u,f,r)];a?(n.moveTo(g.x,g.y),a=!1):(n.lineTo(g.x,e),n.lineTo(g.x,g.y)),l=!!t.pathSegment(n,c,{move:l}),l?n.closePath():n.lineTo(p.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Cu(n,t){const{line:e,target:i,property:r,color:a,scale:l}=t,c=Bw(e,i,r);for(const{source:u,target:f,start:g,end:p}of c){const{style:{backgroundColor:_=a}={}}=u,y=i!==!0;n.save(),n.fillStyle=_,eS(n,l,y&&Pa(r,g,p)),n.beginPath();const w=!!e.pathSegment(n,u);let S;if(y){w?n.closePath():Ou(n,i,p,r);const A=!!i.pathSegment(n,f,{move:w,reverse:!0});S=w&&A,S||Ou(n,i,g,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function eS(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:l,end:c}=e||{};a==="x"&&(n.beginPath(),n.rect(l,i,c-l,r-i),n.clip())}function Ou(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var nS={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,l,c,u;for(l=0;l<i;++l)a=n.getDatasetMeta(l),c=a.dataset,u=null,c&&c.options&&c instanceof pn&&(u={visible:n.isDatasetVisible(l),index:l,fill:Nw(c,l,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:c}),a.$filler=u,r.push(u);for(l=0;l<i;++l)u=r[l],!(!u||u.fill===!1)&&(u.fill=Ww(r,l,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let l=r.length-1;l>=0;--l){const c=r[l].$filler;!c||(c.line.updateControlPoints(a,c.axis),i&&c.fill&&_a(n.ctx,c,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;ku(a)&&_a(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ku(i)||e.drawTime!=="beforeDatasetDraw"||_a(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Tu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},iS=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Du extends Le{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=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=Ft(i.font),a=r.size,l=this._computeTitleHeight(),{boxWidth:c,itemHeight:u}=Tu(i,a);let f,g;e.font=r.string,this.isHorizontal()?(f=this.maxWidth,g=this._fitRows(l,a,c,u)+10):(g=this.maxHeight,f=this._fitCols(l,r,c,u)+10),this.width=Math.min(f,t.maxWidth||this.maxWidth),this.height=Math.min(g,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.lineWidths=[0],g=r+c;let p=t;a.textAlign="left",a.textBaseline="middle";let _=-1,y=-g;return this.legendItems.forEach((w,S)=>{const A=i+e/2+a.measureText(w.text).width;(S===0||f[f.length-1]+A+2*c>l)&&(p+=g,f[f.length-(S>0?0:1)]=0,y+=g,_++),u[S]={left:0,top:y,row:_,width:A,height:r},f[f.length-1]+=A+c}),p}_fitCols(t,e,i,r){const{ctx:a,maxHeight:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.columnSizes=[],g=l-t;let p=c,_=0,y=0,w=0,S=0;return this.legendItems.forEach((A,C)=>{const{itemWidth:T,itemHeight:I}=sS(i,e,a,A,r);C>0&&y+I+2*c>g&&(p+=_+c,f.push({width:_,height:y}),w+=_+c,S++,_=y=0),u[C]={left:w,top:y,col:S,width:T,height:I},_=Math.max(_,T),y+=I+c}),p+=_,f.push({width:_,height:y}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,l=li(a,this.left,this.width);if(this.isHorizontal()){let c=0,u=Yt(i,this.left+r,this.right-this.lineWidths[c]);for(const f of e)c!==f.row&&(c=f.row,u=Yt(i,this.left+r,this.right-this.lineWidths[c])),f.top+=this.top+t+r,f.left=l.leftForLtr(l.x(u),f.width),u+=f.width+r}else{let c=0,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height);for(const f of e)f.col!==c&&(c=f.col,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height)),f.top=u,f.left+=this.left+r,f.left=l.leftForLtr(l.x(f.left),f.width),u+=f.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Lr(t,this),this._draw(),Rr(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:l}=t,c=Dt.color,u=li(t.rtl,this.left,this.width),f=Ft(l.font),{padding:g}=l,p=f.size,_=p/2;let y;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=f.string;const{boxWidth:w,boxHeight:S,itemHeight:A}=Tu(l,p),C=function(z,W,N){if(isNaN(w)||w<=0||isNaN(S)||S<0)return;r.save();const Y=Z(N.lineWidth,1);if(r.fillStyle=Z(N.fillStyle,c),r.lineCap=Z(N.lineCap,"butt"),r.lineDashOffset=Z(N.lineDashOffset,0),r.lineJoin=Z(N.lineJoin,"miter"),r.lineWidth=Y,r.strokeStyle=Z(N.strokeStyle,c),r.setLineDash(Z(N.lineDash,[])),l.usePointStyle){const J={radius:S*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:Y},Q=u.xPlus(z,w/2),at=W+_;hf(r,J,Q,at,l.pointStyleWidth&&w)}else{const J=W+Math.max((p-S)/2,0),Q=u.leftForLtr(z,w),at=Nn(N.borderRadius);r.beginPath(),Object.values(at).some(Rt=>Rt!==0)?ts(r,{x:Q,y:J,w,h:S,radius:at}):r.rect(Q,J,w,S),r.fill(),Y!==0&&r.stroke()}r.restore()},T=function(z,W,N){Un(r,N.text,z,W+A/2,f,{strikethrough:N.hidden,textAlign:u.textAlign(N.textAlign)})},I=this.isHorizontal(),B=this._computeTitleHeight();I?y={x:Yt(a,this.left+g,this.right-i[0]),y:this.top+g+B,line:0}:y={x:this.left+g,y:Yt(a,this.top+B+g,this.bottom-e[0].height),line:0},xf(this.ctx,t.textDirection);const L=A+g;this.legendItems.forEach((z,W)=>{r.strokeStyle=z.fontColor,r.fillStyle=z.fontColor;const N=r.measureText(z.text).width,Y=u.textAlign(z.textAlign||(z.textAlign=l.textAlign)),J=w+_+N;let Q=y.x,at=y.y;u.setWidth(this.width),I?W>0&&Q+J+g>this.right&&(at=y.y+=L,y.line++,Q=y.x=Yt(a,this.left+g,this.right-i[y.line])):W>0&&at+L>this.bottom&&(Q=y.x=Q+e[y.line].width+g,y.line++,at=y.y=Yt(a,this.top+B+g,this.bottom-e[y.line].height));const Rt=u.x(Q);if(C(Rt,at,z),Q=Py(Y,Q+w+_,I?Q+J:this.right,t.rtl),T(u.x(Q),at,z),I)y.x+=J+g;else if(typeof z.text!="string"){const Vt=f.lineHeight;y.y+=$f(z,Vt)}else y.y+=L}),yf(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ft(e.font),r=Gt(e.padding);if(!e.display)return;const a=li(t.rtl,this.left,this.width),l=this.ctx,c=e.position,u=i.size/2,f=r.top+u;let g,p=this.left,_=this.width;if(this.isHorizontal())_=Math.max(...this.lineWidths),g=this.top+f,p=Yt(t.align,p,this.right-_);else{const w=this.columnSizes.reduce((S,A)=>Math.max(S,A.height),0);g=f+Yt(t.align,this.top,this.bottom-w-t.labels.padding-this._computeTitleHeight())}const y=Yt(c,p,p+_);l.textAlign=a.textAlign(Na(c)),l.textBaseline="middle",l.strokeStyle=e.color,l.fillStyle=e.color,l.font=i.string,Un(l,e.text,y,g,i)}_computeTitleHeight(){const t=this.options.title,e=Ft(t.font),i=Gt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if(tn(t,this.left,this.right)&&tn(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],tn(t,r.left,r.left+r.width)&&tn(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!aS(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=iS(r,i);r&&!a&&xt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function sS(n,t,e,i,r){const a=rS(i,n,t,e),l=oS(r,i,t.lineHeight);return{itemWidth:a,itemHeight:l}}function rS(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,l)=>a.length>l.length?a:l)),t+e.size/2+i.measureText(r).width}function oS(n,t,e){let i=n;return typeof t.text!="string"&&(i=$f(t,e)),i}function $f(n,t){const e=n.text?n.text.length+.5:0;return t*e}function aS(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var lS={id:"legend",_element:Du,start(n,t,e){const i=n.legend=new Du({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i)},stop(n){Xt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Xt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:l,borderRadius:c}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const f=u.controller.getStyle(e?0:void 0),g=Gt(f.borderWidth);return{text:t[u.index].label,fillStyle:f.backgroundColor,fontColor:a,hidden:!u.visible,lineCap:f.borderCapStyle,lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:(g.width+g.height)/4,strokeStyle:f.borderColor,pointStyle:i||f.pointStyle,rotation:f.rotation,textAlign:r||f.textAlign,borderRadius:l&&(c||f.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Ka extends Le{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){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=vt(i.text)?i.text.length:1;this._padding=Gt(i.padding);const a=r*Ft(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:l}=this,c=l.align;let u=0,f,g,p;return this.isHorizontal()?(g=Yt(c,i,a),p=e+t,f=a-i):(l.position==="left"?(g=i+t,p=Yt(c,r,e),u=Mt*-.5):(g=a-t,p=Yt(c,e,r),u=Mt*.5),f=r-e),{titleX:g,titleY:p,maxWidth:f,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ft(e.font),a=i.lineHeight/2+this._padding.top,{titleX:l,titleY:c,maxWidth:u,rotation:f}=this._drawArgs(a);Un(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:f,textAlign:Na(e.align),textBaseline:"middle",translation:[l,c]})}}function cS(n,t){const e=new Ka({ctx:n.ctx,options:t,chart:n});Xt.configure(n,e,t),Xt.addBox(n,e),n.titleBlock=e}var hS={id:"title",_element:Ka,start(n,t,e){cS(n,e)},stop(n){const t=n.titleBlock;Xt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Xt.configure(n,i,e),i.options=e},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 lr=new WeakMap;var uS={id:"subtitle",start(n,t,e){const i=new Ka({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i),lr.set(n,i)},stop(n){Xt.removeBox(n,lr.get(n)),lr.delete(n)},beforeUpdate(n,t,e){const i=lr.get(n);Xt.configure(n,i,e),i.options=e},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 Ui={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i+=c.x,r+=c.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,l,c;for(a=0,l=n.length;a<l;++a){const u=n[a].element;if(u&&u.hasValue()){const f=u.getCenterPoint(),g=ya(t,f);g<r&&(r=g,c=u)}}if(c){const u=c.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Be(n,t){return t&&(vt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Je(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
`)>-1?n.split(`
|
|
`):n}function fS(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:l,value:c}=a.getLabelAndValue(r);return{chart:n,label:l,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Lu(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:l,boxHeight:c}=t,u=Ft(t.bodyFont),f=Ft(t.titleFont),g=Ft(t.footerFont),p=a.length,_=r.length,y=i.length,w=Gt(t.padding);let S=w.height,A=0,C=i.reduce((B,L)=>B+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,p&&(S+=p*f.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),C){const B=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;S+=y*B+(C-y)*u.lineHeight+(C-1)*t.bodySpacing}_&&(S+=t.footerMarginTop+_*g.lineHeight+(_-1)*t.footerSpacing);let T=0;const I=function(B){A=Math.max(A,e.measureText(B).width+T)};return e.save(),e.font=f.string,pt(n.title,I),e.font=u.string,pt(n.beforeBody.concat(n.afterBody),I),T=t.displayColors?l+2+t.boxPadding:0,pt(i,B=>{pt(B.before,I),pt(B.lines,I),pt(B.after,I)}),T=0,e.font=g.string,pt(n.footer,I),e.restore(),A+=w.width,{width:A,height:S}}function dS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function gS(n,t,e,i){const{x:r,width:a}=i,l=e.caretSize+e.caretPadding;if(n==="left"&&r+a+l>t.width||n==="right"&&r-a-l<0)return!0}function pS(n,t,e,i){const{x:r,width:a}=e,{width:l,chartArea:{left:c,right:u}}=n;let f="center";return i==="center"?f=r<=(c+u)/2?"left":"right":r<=a/2?f="left":r>=l-a/2&&(f="right"),gS(f,n,t,e)&&(f="center"),f}function Ru(n,t,e){const i=e.yAlign||t.yAlign||dS(n,e);return{xAlign:e.xAlign||t.xAlign||pS(n,t,e,i),yAlign:i}}function mS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function _S(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Eu(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:l}=n,{xAlign:c,yAlign:u}=e,f=r+a,{topLeft:g,topRight:p,bottomLeft:_,bottomRight:y}=Nn(l);let w=mS(t,c);const S=_S(t,u,f);return u==="center"?c==="left"?w+=f:c==="right"&&(w-=f):c==="left"?w-=Math.max(g,_)+r:c==="right"&&(w+=Math.max(p,y)+r),{x:Wt(w,0,i.width-t.width),y:Wt(S,0,i.height-t.height)}}function cr(n,t,e){const i=Gt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Iu(n){return Be([],Je(n))}function bS(n,t,e){return yn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Fu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Yf={beforeTitle:qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:qe,beforeBody:qe,beforeLabel:qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return lt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:qe,afterBody:qe,beforeFooter:qe,footer:qe,afterFooter:qe};function ne(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Yf[t].call(e,i):r}class Ca extends Le{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()),r=i.enabled&&e.options.animation&&i.animations,a=new Mf(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=bS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=ne(i,"beforeTitle",this,t),a=ne(i,"title",this,t),l=ne(i,"afterTitle",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}getBeforeBody(t,e){return Iu(ne(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return pt(t,a=>{const l={before:[],lines:[],after:[]},c=Fu(i,a);Be(l.before,Je(ne(c,"beforeLabel",this,a))),Be(l.lines,ne(c,"label",this,a)),Be(l.after,Je(ne(c,"afterLabel",this,a))),r.push(l)}),r}getAfterBody(t,e){return Iu(ne(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=ne(i,"beforeFooter",this,t),a=ne(i,"footer",this,t),l=ne(i,"afterFooter",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],l=[];let c=[],u,f;for(u=0,f=e.length;u<f;++u)c.push(fS(this.chart,e[u]));return t.filter&&(c=c.filter((g,p,_)=>t.filter(g,p,_,i))),t.itemSort&&(c=c.sort((g,p)=>t.itemSort(g,p,i))),pt(c,g=>{const p=Fu(t.callbacks,g);r.push(ne(p,"labelColor",this,g)),a.push(ne(p,"labelPointStyle",this,g)),l.push(ne(p,"labelTextColor",this,g))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=l,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,l=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const c=Ui[i.position].call(this,r,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const u=this._size=Lu(this,i),f=Object.assign({},c,u),g=Ru(this.chart,i,f),p=Eu(i,f,g,this.chart);this.xAlign=g.xAlign,this.yAlign=g.yAlign,a={opacity:1,x:p.x,y:p.y,width:u.width,height:u.height,caretX:c.x,caretY:c.y}}this._tooltipItems=l,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:l,cornerRadius:c}=i,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=Nn(c),{x:_,y}=t,{width:w,height:S}=e;let A,C,T,I,B,L;return a==="center"?(B=y+S/2,r==="left"?(A=_,C=A-l,I=B+l,L=B-l):(A=_+w,C=A+l,I=B-l,L=B+l),T=A):(r==="left"?C=_+Math.max(u,g)+l:r==="right"?C=_+w-Math.max(f,p)-l:C=this.caretX,a==="top"?(I=y,B=I-l,A=C-l,T=C+l):(I=y+S,B=I+l,A=C+l,T=C-l),L=I),{x1:A,x2:C,x3:T,y1:I,y2:B,y3:L}}drawTitle(t,e,i){const r=this.title,a=r.length;let l,c,u;if(a){const f=li(i.rtl,this.x,this.width);for(t.x=cr(this,i.titleAlign,i),e.textAlign=f.textAlign(i.titleAlign),e.textBaseline="middle",l=Ft(i.titleFont),c=i.titleSpacing,e.fillStyle=i.titleColor,e.font=l.string,u=0;u<a;++u)e.fillText(r[u],f.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+c,u+1===a&&(t.y+=i.titleMarginBottom-c)}}_drawColorBox(t,e,i,r,a){const l=this.labelColors[i],c=this.labelPointStyles[i],{boxHeight:u,boxWidth:f,boxPadding:g}=a,p=Ft(a.bodyFont),_=cr(this,"left",a),y=r.x(_),w=u<p.lineHeight?(p.lineHeight-u)/2:0,S=e.y+w;if(a.usePointStyle){const A={radius:Math.min(f,u)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},C=r.leftForLtr(y,f)+f/2,T=S+u/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,wa(t,A,C,T),t.strokeStyle=l.borderColor,t.fillStyle=l.backgroundColor,wa(t,A,C,T)}else{t.lineWidth=rt(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,t.strokeStyle=l.borderColor,t.setLineDash(l.borderDash||[]),t.lineDashOffset=l.borderDashOffset||0;const A=r.leftForLtr(y,f-g),C=r.leftForLtr(r.xPlus(y,1),f-g-2),T=Nn(l.borderRadius);Object.values(T).some(I=>I!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,ts(t,{x:A,y:S,w:f,h:u,radius:T}),t.fill(),t.stroke(),t.fillStyle=l.backgroundColor,t.beginPath(),ts(t,{x:C,y:S+1,w:f-2,h:u-2,radius:T}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(A,S,f,u),t.strokeRect(A,S,f,u),t.fillStyle=l.backgroundColor,t.fillRect(C,S+1,f-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:l,displayColors:c,boxHeight:u,boxWidth:f,boxPadding:g}=i,p=Ft(i.bodyFont);let _=p.lineHeight,y=0;const w=li(i.rtl,this.x,this.width),S=function(N){e.fillText(N,w.x(t.x+y),t.y+_/2),t.y+=_+a},A=w.textAlign(l);let C,T,I,B,L,z,W;for(e.textAlign=l,e.textBaseline="middle",e.font=p.string,t.x=cr(this,A,i),e.fillStyle=i.bodyColor,pt(this.beforeBody,S),y=c&&A!=="right"?l==="center"?f/2+g:f+2+g:0,B=0,z=r.length;B<z;++B){for(C=r[B],T=this.labelTextColors[B],e.fillStyle=T,pt(C.before,S),I=C.lines,c&&I.length&&(this._drawColorBox(e,t,B,w,i),_=Math.max(p.lineHeight,u)),L=0,W=I.length;L<W;++L)S(I[L]),_=p.lineHeight;pt(C.after,S)}y=0,_=p.lineHeight,pt(this.afterBody,S),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let l,c;if(a){const u=li(i.rtl,this.x,this.width);for(t.x=cr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",l=Ft(i.footerFont),e.fillStyle=i.footerColor,e.font=l.string,c=0;c<a;++c)e.fillText(r[c],u.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:l}=this,{x:c,y:u}=t,{width:f,height:g}=i,{topLeft:p,topRight:_,bottomLeft:y,bottomRight:w}=Nn(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(c+p,u),l==="top"&&this.drawCaret(t,e,i,r),e.lineTo(c+f-_,u),e.quadraticCurveTo(c+f,u,c+f,u+_),l==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(c+f,u+g-w),e.quadraticCurveTo(c+f,u+g,c+f-w,u+g),l==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(c+y,u+g),e.quadraticCurveTo(c,u+g,c,u+g-y),l==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(c,u+p),e.quadraticCurveTo(c,u,c+p,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const l=Ui[t.position].call(this,this._active,this._eventPosition);if(!l)return;const c=this._size=Lu(this,t),u=Object.assign({},l,this._size),f=Ru(e,t,u),g=Eu(t,u,f,e);(r._to!==g.x||a._to!==g.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=c.width,this.height=c.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,g))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=Gt(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),xf(t,e.textDirection),a.y+=l.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),yf(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const f=this.chart.getDatasetMeta(c);if(!f)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:f.data[u],index:u}}),a=!wr(i,r),l=this._positionChanged(r,e);(a||l)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],l=this._getActiveElements(t,a,e,i),c=this._positionChanged(l,t),u=e||!wr(l,a)||c;return u&&(this._active=l,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e;const l=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&l.reverse(),l}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,l=Ui[a.position].call(this,t,e);return l!==!1&&(i!==l.x||r!==l.y)}}U(Ca,"positioners",Ui);var xS={id:"tooltip",_element:Ca,positioners:Ui,afterInit(n,t,e){e&&(n.tooltip=new Ca({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.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:Yf},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},yS=Object.freeze({__proto__:null,Colors:Lw,Decimation:Fw,Filler:nS,Legend:lS,SubTitle:uS,Title:hS,Tooltip:xS});const vS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function wS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return vS(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const SS=(n,t)=>n===null?null:Wt(Math.round(n),0,t);function Bu(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Oa extends $n{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(lt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:wS(i,t,Z(e,t),this._addedLabels),SS(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let l=t;l<=e;l++)r.push({value:l});return r}getLabelForValue(t){return Bu.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?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}}U(Oa,"id","category"),U(Oa,"defaults",{ticks:{callback:Bu}});function MS(n,t){const e=[],{bounds:r,step:a,min:l,max:c,precision:u,count:f,maxTicks:g,maxDigits:p,includeBounds:_}=n,y=a||1,w=g-1,{min:S,max:A}=t,C=!lt(l),T=!lt(c),I=!lt(f),B=(A-S)/(p+1);let L=Eh((A-S)/w/y)*y,z,W,N,Y;if(L<1e-14&&!C&&!T)return[{value:S},{value:A}];Y=Math.ceil(A/L)-Math.floor(S/L),Y>w&&(L=Eh(Y*L/w/y)*y),lt(u)||(z=Math.pow(10,u),L=Math.ceil(L*z)/z),r==="ticks"?(W=Math.floor(S/L)*L,N=Math.ceil(A/L)*L):(W=S,N=A),C&&T&&a&&yy((c-l)/a,L/1e3)?(Y=Math.round(Math.min((c-l)/L,g)),L=(c-l)/Y,W=l,N=c):I?(W=C?l:W,N=T?c:N,Y=f-1,L=(N-W)/Y):(Y=(N-W)/L,Xi(Y,Math.round(Y),L/1e3)?Y=Math.round(Y):Y=Math.ceil(Y));const J=Math.max(Ih(L),Ih(W));z=Math.pow(10,lt(u)?J:u),W=Math.round(W*z)/z,N=Math.round(N*z)/z;let Q=0;for(C&&(_&&W!==l?(e.push({value:l}),W<l&&Q++,Xi(Math.round((W+Q*L)*z)/z,l,zu(l,B,n))&&Q++):W<l&&Q++);Q<Y;++Q)e.push({value:Math.round((W+Q*L)*z)/z});return T&&_&&N!==c?e.length&&Xi(e[e.length-1].value,c,zu(c,B,n))?e[e.length-1].value=c:e.push({value:c}):(!T||N===c)&&e.push({value:N}),e}function zu(n,t,{horizontal:e,minRotation:i}){const r=Te(i),a=(e?Math.sin(r):Math.cos(r))||.001,l=.75*t*(""+n).length;return Math.min(t/a,l)}class Tr extends $n{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 lt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const l=u=>r=e?r:u,c=u=>a=i?a:u;if(t){const u=We(r),f=We(a);u<0&&f<0?c(0):u>0&&f>0&&l(0)}if(r===a){let u=a===0?1:Math.abs(a*.05);c(a+u),t||l(r-u)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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:e.includeBounds!==!1},a=this._range||this,l=MS(r,a);return t.bounds==="ticks"&&Qu(l,this,"value"),t.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return rs(t,this.chart.options.locale,this.options.ticks.format)}}class Ta extends Tr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?t:0,this.max=Pt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Te(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}U(Ta,"id","linear"),U(Ta,"defaults",{ticks:{callback:Dr.formatters.numeric}});const ns=n=>Math.floor(gn(n)),In=(n,t)=>Math.pow(10,ns(n)+t);function Wu(n){return n/Math.pow(10,ns(n))===1}function Nu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function AS(n,t){const e=t-n;let i=ns(e);for(;Nu(n,t,i)>10;)i++;for(;Nu(n,t,i)<10;)i--;return Math.min(i,ns(n))}function kS(n,{min:t,max:e}){t=he(n.min,t);const i=[],r=ns(t);let a=AS(t,e),l=a<0?Math.pow(10,Math.abs(a)):1;const c=Math.pow(10,a),u=r>a?Math.pow(10,r):0,f=Math.round((t-u)*l)/l,g=Math.floor((t-u)/c/10)*c*10;let p=Math.floor((f-g)/Math.pow(10,a)),_=he(n.min,Math.round((u+g+p*Math.pow(10,a))*l)/l);for(;_<e;)i.push({value:_,major:Wu(_),significand:p}),p>=10?p=p<15?15:20:p++,p>=20&&(a++,p=2,l=a>=0?1:l),_=Math.round((u+g+p*Math.pow(10,a))*l)/l;const y=he(n.max,_);return i.push({value:y,major:Wu(y),significand:p}),i}class Da extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Tr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Pt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?Math.max(0,t):null,this.max=Pt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pt(this._userMin)&&(this.min=t===In(this.min,0)?In(this.min,-1):In(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=c=>i=t?i:c,l=c=>r=e?r:c;i===r&&(i<=0?(a(1),l(10)):(a(In(i,-1)),l(In(r,1)))),i<=0&&a(In(r,-1)),r<=0&&l(In(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=kS(e,this);return t.bounds==="ticks"&&Qu(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=gn(t),this._valueRange=gn(this.max)-gn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(gn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}U(Da,"id","logarithmic"),U(Da,"defaults",{ticks:{callback:Dr.formatters.logarithmic,major:{enabled:!0}}});function La(n){const t=n.ticks;if(t.display&&n.display){const e=Gt(t.backdropPadding);return Z(t.font&&t.font.size,Dt.font.size)+e.height}return 0}function PS(n,t,e){return e=vt(e)?e:[e],{w:By(n,t.string,e),h:e.length*t.lineHeight}}function Hu(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function CS(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,l=n.options.pointLabels,c=l.centerPointLabels?Mt/a:0;for(let u=0;u<a;u++){const f=l.setContext(n.getPointLabelContext(u));r[u]=f.padding;const g=n.getPointPosition(u,n.drawingArea+r[u],c),p=Ft(f.font),_=PS(n.ctx,p,n._pointLabels[u]);i[u]=_;const y=ue(n.getIndexAngle(u)+c),w=Math.round(za(y)),S=Hu(w,g.x,_.w,0,180),A=Hu(w,g.y,_.h,90,270);OS(e,t,y,S,A)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=TS(n,i,r)}function OS(n,t,e,i,r){const a=Math.abs(Math.sin(e)),l=Math.abs(Math.cos(e));let c=0,u=0;i.start<t.l?(c=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-c)):i.end>t.r&&(c=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+c)),r.start<t.t?(u=(t.t-r.start)/l,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/l,n.b=Math.max(n.b,t.b+u))}function TS(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,l=La(a)/2,c=n.drawingArea,u=a.pointLabels.centerPointLabels?Mt/r:0;for(let f=0;f<r;f++){const g=n.getPointPosition(f,c+l+e[f],u),p=Math.round(za(ue(g.angle+Ct))),_=t[f],y=RS(g.y,_.h,p),w=DS(p),S=LS(g.x,_.w,w);i.push({x:g.x,y,textAlign:w,left:S,top:y,right:S+_.w,bottom:y+_.h})}return i}function DS(n){return n===0||n===180?"center":n<180?"left":"right"}function LS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function RS(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ES(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=i.setContext(n.getPointLabelContext(r)),l=Ft(a.font),{x:c,y:u,textAlign:f,left:g,top:p,right:_,bottom:y}=n._pointLabelItems[r],{backdropColor:w}=a;if(!lt(w)){const S=Nn(a.borderRadius),A=Gt(a.backdropPadding);e.fillStyle=w;const C=g-A.left,T=p-A.top,I=_-g+A.width,B=y-p+A.height;Object.values(S).some(L=>L!==0)?(e.beginPath(),ts(e,{x:C,y:T,w:I,h:B,radius:S}),e.fill()):e.fillRect(C,T,I,B)}Un(e,n._pointLabels[r],c,u+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function Xf(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,wt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let l=1;l<i;l++)a=n.getPointPosition(l,t),r.lineTo(a.x,a.y)}}function IS(n,t,e,i,r){const a=n.ctx,l=t.circular,{color:c,lineWidth:u}=t;!l&&!i||!c||!u||e<0||(a.save(),a.strokeStyle=c,a.lineWidth=u,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),Xf(n,e,l,i),a.closePath(),a.stroke(),a.restore())}function FS(n,t,e){return yn(n,{label:e,index:t,type:"pointLabel"})}class $i extends Tr{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=Gt(La(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=Pt(t)&&!isNaN(t)?t:0,this.max=Pt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/La(this.options))}generateTickLabels(t){Tr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=xt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?CS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Te(i))}getDistanceFromCenterForValue(t){if(lt(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(lt(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 FS(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Ct+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}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:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Xf(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:r,border:a}=e,l=this._pointLabels.length;let c,u,f;if(e.pointLabels.display&&ES(this,l),r.display&&this.ticks.forEach((g,p)=>{if(p!==0){u=this.getDistanceFromCenterForValue(g.value);const _=this.getContext(p),y=r.setContext(_),w=a.setContext(_);IS(this,y,u,l,w)}}),i.display){for(t.save(),c=l-1;c>=0;c--){const g=i.setContext(this.getPointLabelContext(c)),{color:p,lineWidth:_}=g;!_||!p||(t.lineWidth=_,t.strokeStyle=p,t.setLineDash(g.borderDash),t.lineDashOffset=g.borderDashOffset,u=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),f=this.getPointPosition(c,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(f.x,f.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,l;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((c,u)=>{if(u===0&&!e.reverse)return;const f=i.setContext(this.getContext(u)),g=Ft(f.font);if(a=this.getDistanceFromCenterForValue(this.ticks[u].value),f.showLabelBackdrop){t.font=g.string,l=t.measureText(c.label).width,t.fillStyle=f.backdropColor;const p=Gt(f.backdropPadding);t.fillRect(-l/2-p.left,-a-g.size/2-p.top,l+p.width,g.size+p.height)}Un(t,c.label,0,-a,g,{color:f.color})}),t.restore()}drawTitle(){}}U($i,"id","radialLinear"),U($i,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Dr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),U($i,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),U($i,"descriptors",{angleLines:{_fallback:"grid"}});const Ir={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}},ie=Object.keys(Ir);function BS(n,t){return n-t}function Vu(n,t){if(lt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let l=t;return typeof i=="function"&&(l=i(l)),Pt(l)||(l=typeof i=="string"?e.parse(l,i):e.parse(l)),l===null?null:(r&&(l=r==="week"&&(ci(a)||a===!0)?e.startOf(l,"isoWeek",a):e.startOf(l,r)),+l)}function Uu(n,t,e,i){const r=ie.length;for(let a=ie.indexOf(n);a<r-1;++a){const l=Ir[ie[a]],c=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((e-t)/(c*l.size))<=i)return ie[a]}return ie[r-1]}function zS(n,t,e,i,r){for(let a=ie.length-1;a>=ie.indexOf(e);a--){const l=ie[a];if(Ir[l].common&&n._adapter.diff(r,i,l)>=t-1)return l}return ie[e?ie.indexOf(e):0]}function WS(n){for(let t=ie.indexOf(n)+1,e=ie.length;t<e;++t)if(Ir[ie[t]].common)return ie[t]}function $u(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Wa(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function NS(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),l=t[t.length-1].value;let c,u;for(c=a;c<=l;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function Yu(n,t,e){const i=[],r={},a=t.length;let l,c;for(l=0;l<a;++l)c=t[l],r[c]=l,i.push({value:c,major:!1});return a===0||!e?i:NS(n,i,r,e)}class is extends $n{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={}),r=this._adapter=new Qv._date(t.adapters.date);r.init(e),Yi(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Vu(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:r,max:a,minDefined:l,maxDefined:c}=this.getUserBounds();function u(f){!l&&!isNaN(f.min)&&(r=Math.min(r,f.min)),!c&&!isNaN(f.max)&&(a=Math.max(a,f.max))}(!l||!c)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=Pt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Pt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_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,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,l=this.max,c=My(r,a,l);return this._unit=e.unit||(i.autoSkip?Uu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):zS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:WS(this._unit),this.initOffsets(r),t.reverse&&c.reverse(),Yu(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const l=t.length<3?.5:.25;e=Wt(e,0,l),i=Wt(i,0,l),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,l=a.unit||Uu(a.minUnit,e,i,this._getLabelCapacity(e)),c=Z(r.ticks.stepSize,1),u=l==="week"?a.isoWeekday:!1,f=ci(u)||u===!0,g={};let p=e,_,y;if(f&&(p=+t.startOf(p,"isoWeek",u)),p=+t.startOf(p,f?"day":l),t.diff(i,e,l)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+l);const w=r.ticks.source==="data"&&this.getDataTimestamps();for(_=p,y=0;_<i;_=+t.add(_,c,l),y++)$u(g,_,w);return(_===i||r.bounds==="ticks"||y===1)&&$u(g,_,w),Object.keys(g).sort((S,A)=>S-A).map(S=>+S)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,r){const a=this.options,l=a.ticks.callback;if(l)return xt(l,[t,e,i],this);const c=a.time.displayFormats,u=this._unit,f=this._majorUnit,g=u&&c[u],p=f&&c[f],_=i[e],y=f&&p&&_&&_.major;return this._adapter.format(t,r||(y?p:g))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?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,r=Te(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),l=Math.sin(r),c=this._resolveTickFontOptions(0).size;return{w:i*a+c*l,h:i*l+c*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Yu(this,[t],this._majorUnit),r),l=this._getLabelSize(a),c=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return c>0?c:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Vu(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return nf(t.sort(BS))}}U(is,"id","time"),U(is,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hr(n,t,e){let i=0,r=n.length-1,a,l,c,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=en(n,"pos",t)),{pos:a,time:c}=n[i],{pos:l,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=en(n,"time",t)),{time:a,pos:c}=n[i],{time:l,pos:u}=n[r]);const f=l-a;return f?c+(u-c)*(t-a)/f:c}class Ra extends is{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=hr(e,this.min),this._tableRange=hr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let l,c,u,f,g;for(l=0,c=t.length;l<c;++l)f=t[l],f>=e&&f<=i&&r.push(f);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(l=0,c=r.length;l<c;++l)g=r[l+1],u=r[l-1],f=r[l],Math.round((g+u)/2)!==f&&a.push({time:f,pos:l/(c-1)});return a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(hr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return hr(this._table,i*this._tableRange+this._minPos,!0)}}U(Ra,"id","timeseries"),U(Ra,"defaults",is.defaults);var HS=Object.freeze({__proto__:null,CategoryScale:Oa,LinearScale:Ta,LogarithmicScale:Da,RadialLinearScale:$i,TimeScale:is,TimeSeriesScale:Ra});const qS=[Jv,Pw,yS,HS];export{zn as C,KS as O,YS as R,$S as S,XS as Y,jS as a,GS as j,kh as l,qS as r};
|