PyDIET 0.9.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydiet/__init__.py +12 -0
- pydiet/api_client/__init__.py +6 -0
- pydiet/api_client/client.py +57 -0
- pydiet/cmd/__init__.py +9 -0
- pydiet/cmd/start.py +107 -0
- pydiet/data/data_config.toml +242 -0
- pydiet/data/description.txt +1 -0
- pydiet/data/instruments/description.txt +1 -0
- pydiet/data/instruments/megacam/default +0 -0
- pydiet/data/instruments/megacam/description.txt +1 -0
- pydiet/data/instruments/megacam/detector/description.txt +1 -0
- pydiet/data/instruments/megacam/detector/qe/MegaCam_QE.average.fits +0 -0
- pydiet/data/instruments/megacam/detector/qe/description.txt +2 -0
- pydiet/data/instruments/megacam/filters/CaHK.MP9303.fits +0 -0
- pydiet/data/instruments/megacam/filters/Ha.MP9603.fits +0 -0
- pydiet/data/instruments/megacam/filters/HaOFF.MP9604.fits +0 -0
- pydiet/data/instruments/megacam/filters/M4112.MP9403.fits +0 -0
- pydiet/data/instruments/megacam/filters/M4376.MP9404.fits +0 -0
- pydiet/data/instruments/megacam/filters/OIII.MP9501.fits +0 -0
- pydiet/data/instruments/megacam/filters/OIIIOFF.MP9502.fits +0 -0
- pydiet/data/instruments/megacam/filters/description.txt +1 -0
- pydiet/data/instruments/megacam/filters/g.MP9402.fits +0 -0
- pydiet/data/instruments/megacam/filters/gri.MP9605.fits +0 -0
- pydiet/data/instruments/megacam/filters/i.MP9703.fits +0 -0
- pydiet/data/instruments/megacam/filters/r.MP9602.fits +0 -0
- pydiet/data/instruments/megacam/filters/u.MP9302.fits +0 -0
- pydiet/data/instruments/megacam/filters/z.MP9901.fits +0 -0
- pydiet/data/instruments/megacam/optics/description.txt +2 -0
- pydiet/data/instruments/megacam/optics/transmission/MegaPrime_transmission.fits +0 -0
- pydiet/data/instruments/megacam/optics/transmission/description.txt +2 -0
- pydiet/data/instruments/wircam/description.txt +1 -0
- pydiet/data/instruments/wircam/detector/description.txt +1 -0
- pydiet/data/instruments/wircam/detector/qe/WIRCam_QE.average.fits +0 -0
- pydiet/data/instruments/wircam/detector/qe/description.txt +2 -0
- pydiet/data/instruments/wircam/filters/BrG.WC8305.fits +0 -0
- pydiet/data/instruments/wircam/filters/CH4Off.WC8204.fits +0 -0
- pydiet/data/instruments/wircam/filters/CH4On.WC8203.fits +0 -0
- pydiet/data/instruments/wircam/filters/CO.WC8306.fits +0 -0
- pydiet/data/instruments/wircam/filters/H.WC8201.fits +0 -0
- pydiet/data/instruments/wircam/filters/H.WC8202.fits +0 -0
- pydiet/data/instruments/wircam/filters/H2.WC8304.fits +0 -0
- pydiet/data/instruments/wircam/filters/J.WC8101.fits +0 -0
- pydiet/data/instruments/wircam/filters/J.WC8103.fits +0 -0
- pydiet/data/instruments/wircam/filters/Kcont.WC8303.fits +0 -0
- pydiet/data/instruments/wircam/filters/Ks.WC8301.fits +0 -0
- pydiet/data/instruments/wircam/filters/Ks.WC8302.fits +0 -0
- pydiet/data/instruments/wircam/filters/LowOH1.WC8104.fits +0 -0
- pydiet/data/instruments/wircam/filters/LowOH2.WC8102.fits +0 -0
- pydiet/data/instruments/wircam/filters/W.WC8105.fits +0 -0
- pydiet/data/instruments/wircam/filters/Y.WC8002.fits +0 -0
- pydiet/data/instruments/wircam/filters/description.txt +1 -0
- pydiet/data/instruments/wircam/optics/description.txt +2 -0
- pydiet/data/instruments/wircam/optics/transmission/WIRCam_transmission.fits +0 -0
- pydiet/data/instruments/wircam/optics/transmission/description.txt +2 -0
- pydiet/data/sites/description.txt +1 -0
- pydiet/data/sites/mko/default +0 -0
- pydiet/data/sites/mko/description.txt +2 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.1.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.2.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.3.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.4.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.6.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.7.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.8.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM1.9.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM2.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM2.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.bright.AM3.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.1.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.2.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.3.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.4.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.6.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.7.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.8.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM1.9.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM2.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM2.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.dark.AM3.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.1.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.2.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.3.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.4.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.6.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.7.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.8.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM1.9.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM2.0.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM2.5.fits +0 -0
- pydiet/data/sites/mko/emission/MKO_emission.grey.AM3.0.fits +0 -0
- pydiet/data/sites/mko/emission/description.txt +5 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.0.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.1.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.2.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.3.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.4.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.5.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.6.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.7.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.8.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM1.9.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM2.0.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM2.5.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM3.0.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM3.5.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM4.0.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM4.5.fits +0 -0
- pydiet/data/sites/mko/transmission/MKO_transmission.AM5.0.fits +0 -0
- pydiet/data/sites/mko/transmission/description.txt +5 -0
- pydiet/data/telescopes/cfht/default +0 -0
- pydiet/data/telescopes/cfht/description.txt +1 -0
- pydiet/data/telescopes/cfht/emission/description.txt +2 -0
- pydiet/data/telescopes/cfht/transmission/CFHT_M1_transmission.fits +0 -0
- pydiet/data/telescopes/cfht/transmission/description.txt +1 -0
- pydiet/data/telescopes/description.txt +1 -0
- pydiet/package.py +55 -0
- pydiet/py.typed +0 -0
- pydiet/server/__init__.py +9 -0
- pydiet/server/app.py +369 -0
- pydiet/server/config/__init__.py +51 -0
- pydiet/server/config/config.py +330 -0
- pydiet/server/config/fields.py +49 -0
- pydiet/server/config/settings.py +166 -0
- pydiet/server/data.py +31 -0
- pydiet/server/datafiles.py +367 -0
- pydiet/server/image.py +342 -0
- pydiet/server/models/__init__.py +34 -0
- pydiet/server/models/dataconfig.py +195 -0
- pydiet/server/models/default.py +9 -0
- pydiet/server/models/exceptions.py +9 -0
- pydiet/server/models/instrument.py +314 -0
- pydiet/server/models/query.py +172 -0
- pydiet/server/models/response.py +97 -0
- pydiet/server/models/types.py +35 -0
- pydiet/server/photsys.py +71 -0
- pydiet/server/response.py +237 -0
- pydiet/server/types/__init__.py +8 -0
- pydiet/server/types/quantity.py +532 -0
- pydiet/server/types/string.py +318 -0
- pydiet/templates/common/base.html +80 -0
- pydiet/templates/common/plot_filter.html +17 -0
- pydiet/templates/common/privacy.html +132 -0
- pydiet/templates/common/settings.html +23 -0
- pydiet/templates/common/terms.html +101 -0
- pydiet/templates/megacam/etc_form.html +319 -0
- pydiet/templates/megacam/etc_results.html +190 -0
- pydiet/templates/wircam/etc_form.html +319 -0
- pydiet/templates/wircam/etc_results.html +190 -0
- pydiet/web_client/css/style.css +221 -0
- pydiet/web_client/dist/pydiet.js +31 -0
- pydiet/web_client/images/logo.svg +6 -0
- pydiet/web_client/images/megacam/background.jpg +0 -0
- pydiet/web_client/images/megacam/logo.png +0 -0
- pydiet/web_client/images/wircam/background.jpg +0 -0
- pydiet/web_client/images/wircam/logo.png +0 -0
- pydiet/web_client/js/dom.js +51 -0
- pydiet/web_client/js/etc.js +63 -0
- pydiet/web_client/js/fetch.js +49 -0
- pydiet/web_client/js/instrument.js +62 -0
- pydiet/web_client/js/main.js +15 -0
- pydiet/web_client/js/plot.js +88 -0
- pydiet/web_client/js/settings.js +57 -0
- pydiet/web_client/js/theme.js +43 -0
- pydiet/web_client/js/url.js +12 -0
- pydiet/web_client/jsdoc.json +20 -0
- pydiet/web_client/package.json +83 -0
- pydiet-0.9.3.dist-info/METADATA +118 -0
- pydiet-0.9.3.dist-info/RECORD +177 -0
- pydiet-0.9.3.dist-info/WHEEL +4 -0
- pydiet-0.9.3.dist-info/entry_points.txt +5 -0
- pydiet-0.9.3.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
(()=>{var nu=Object.create;var wr=Object.defineProperty;var iu=Object.getOwnPropertyDescriptor;var su=Object.getOwnPropertyNames;var ru=Object.getPrototypeOf,ou=Object.prototype.hasOwnProperty;var au=(e,t,n)=>t in e?wr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ne=(e,t)=>()=>(e&&(t=e(e=0)),t);var lu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cu=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of su(t))!ou.call(e,r)&&r!==n&&wr(e,r,{get:()=>t[r],enumerable:!(s=iu(t,r))||s.enumerable});return e};var uu=(e,t,n)=>(n=e!=null?nu(ru(e)):{},cu(t||!e||!e.__esModule?wr(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>(au(e,typeof t!="symbol"?t+"":t,n),n);function Tt(e,t,n,s){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(d){try{u(s.next(d))}catch(h){a(h)}}function c(d){try{u(s.throw(d))}catch(h){a(h)}}function u(d){d.done?o(d.value):r(d.value).then(l,c)}u((s=s.apply(e,t||[])).next())})}function Et(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s,r,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(s=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{s=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function qt(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,o;s<r;s++)(o||!(s in t))&&(o||(o=Array.prototype.slice.call(t,0,s)),o[s]=t[s]);return e.concat(o||Array.prototype.slice.call(t))}var Yn=ne(()=>{});var Ki,qn,ke=ne(()=>{Ki=typeof window<"u"?window:void 0,qn=typeof document<"u"?document:void 0});var Sr,fu,Tr,Zi,$t,$n=ne(()=>{Yn();ke();fu=function(e){if(Sr===void 0){var t=e.style.animationName!==void 0,n=e.style.webkitAnimationName!==void 0;Sr=!t&&n?"-webkit-":""}return Sr},Tr=function(e,t,n){var s=t.startsWith("animation")?fu(e):"";e.style.setProperty(s+t,n)},Zi=function(e,t){if(e===void 0&&(e=[]),t!==void 0){var n=Array.isArray(t)?t:[t];return qt(qt([],e,!0),n,!0)}return e},$t=function(e){var t,n,s,r,o,a,l=[],c=[],u=[],d=!1,h,p={},m=[],b=[],y={},x=0,w=!1,E=!1,A,O,k,L=!0,M=!1,P=!0,C,I=!1,z=e,W=[],G=[],nt=[],U=[],B=[],tt=[],vt=[],ct=[],Ut=[],Lt=[],dt=[],Xt=typeof AnimationEffect=="function"||Ki!==void 0&&typeof Ki.AnimationEffect=="function",ht=typeof Element=="function"&&typeof Element.prototype.animate=="function"&&Xt,Qt=function(){return dt},rt=function(T){return B.forEach(function(R){R.destroy(T)}),fe(T),U.length=0,B.length=0,l.length=0,Ue(),d=!1,P=!0,C},fe=function(T){Me(),T&&Ht()},lt=function(){w=!1,E=!1,P=!0,A=void 0,O=void 0,k=void 0,x=0,M=!1,L=!0,I=!1},yt=function(){return x!==0&&!I},We=function(T,R){var j=R.findIndex(function(X){return X.c===T});j>-1&&R.splice(j,1)},je=function(T,R){return nt.push({c:T,o:R}),C},de=function(T,R){var j=R?.oneTimeCallback?G:W;return j.push({c:T,o:R}),C},Ue=function(){return W.length=0,G.length=0,C},Me=function(){ht&&(dt.forEach(function(T){T.cancel()}),dt.length=0)},Ht=function(){tt.forEach(function(T){T?.parentNode&&T.parentNode.removeChild(T)}),tt.length=0},he=function(T){return vt.push(T),C},Li=function(T){return ct.push(T),C},Ii=function(T){return Ut.push(T),C},gn=function(T){return Lt.push(T),C},kt=function(T){return c=Zi(c,T),C},er=function(T){return u=Zi(u,T),C},nr=function(T){return T===void 0&&(T={}),p=T,C},ir=function(T){T===void 0&&(T=[]);for(var R=0,j=T;R<j.length;R++){var X=j[R];p[X]=""}return C},sr=function(T){return m=Zi(m,T),C},rr=function(T){return b=Zi(b,T),C},Ri=function(T){return T===void 0&&(T={}),y=T,C},Ni=function(T){T===void 0&&(T=[]);for(var R=0,j=T;R<j.length;R++){var X=j[R];y[X]=""}return C},mn=function(){return o!==void 0?o:h?h.getFill():"both"},Xe=function(){return A!==void 0?A:a!==void 0?a:h?h.getDirection():"normal"},Pe=function(){return w?"linear":s!==void 0?s:h?h.getEasing():"linear"},Jt=function(){return E?0:O!==void 0?O:n!==void 0?n:h?h.getDuration():0},Hn=function(){return r!==void 0?r:h?h.getIterations():1},Wn=function(){return k!==void 0?k:t!==void 0?t:h?h.getDelay():0},or=function(){return l},ar=function(T){return a=T,wt(!0),C},lr=function(T){return o=T,wt(!0),C},vn=function(T){return t=T,wt(!0),C},cr=function(T){return s=T,wt(!0),C},ur=function(T){return!ht&&T===0&&(T=1),n=T,wt(!0),C},Fi=function(T){return r=T,wt(!0),C},zi=function(T){return h=T,C},jn=function(T){if(T!=null)if(T.nodeType===1)U.push(T);else if(T.length>=0)for(var R=0;R<T.length;R++)U.push(T[R]);else console.error("Invalid addElement value");return C},fr=function(T){if(T!=null)if(Array.isArray(T))for(var R=0,j=T;R<j.length;R++){var X=j[R];X.parent(C),B.push(X)}else T.parent(C),B.push(T);return C},dr=function(T){var R=l!==T;return l=T,R&&hr(l),C},hr=function(T){ht&&Qt().forEach(function(R){var j=R.effect;if(j.setKeyframes)j.setKeyframes(T);else{var X=new KeyframeEffect(j.target,T,j.getTiming());R.effect=X}})},Bi=function(){vt.forEach(function(X){return X()}),ct.forEach(function(X){return X()});var T=c,R=u,j=p;U.forEach(function(X){var Z=X.classList;T.forEach(function(_t){return Z.add(_t)}),R.forEach(function(_t){return Z.remove(_t)});for(var It in j)j.hasOwnProperty(It)&&Tr(X,It,j[It])})},pr=function(){Ut.forEach(function(Z){return Z()}),Lt.forEach(function(Z){return Z()});var T=L?1:0,R=m,j=b,X=y;U.forEach(function(Z){var It=Z.classList;R.forEach(function(Rt){return It.add(Rt)}),j.forEach(function(Rt){return It.remove(Rt)});for(var _t in X)X.hasOwnProperty(_t)&&Tr(Z,_t,X[_t])}),O=void 0,A=void 0,k=void 0,W.forEach(function(Z){return Z.c(T,C)}),G.forEach(function(Z){return Z.c(T,C)}),G.length=0,P=!0,L&&(M=!0),L=!0},bn=function(){x!==0&&(x--,x===0&&(pr(),h&&h.animationFinish()))},gr=function(){U.forEach(function(T){var R=T.animate(l,{id:z,delay:Wn(),duration:Jt(),easing:Pe(),iterations:Hn(),fill:mn(),direction:Xe()});R.pause(),dt.push(R)}),dt.length>0&&(dt[0].onfinish=function(){bn()})},Ye=function(){Bi(),l.length>0&&ht&&gr(),d=!0},qe=function(T){T=Math.min(Math.max(T,0),.9999),ht&&dt.forEach(function(R){R.currentTime=R.effect.getComputedTiming().delay+Jt()*T,R.pause()})},Vi=function(T){dt.forEach(function(R){R.effect.updateTiming({delay:Wn(),duration:Jt(),easing:Pe(),iterations:Hn(),fill:mn(),direction:Xe()})}),T!==void 0&&qe(T)},wt=function(T,R,j){return T===void 0&&(T=!1),R===void 0&&(R=!0),T&&B.forEach(function(X){X.update(T,R,j)}),ht&&Vi(j),C},Un=function(T,R){return T===void 0&&(T=!1),B.forEach(function(j){j.progressStart(T,R)}),Wi(),w=T,d||Ye(),wt(!1,!0,R),C},mr=function(T){return B.forEach(function(R){R.progressStep(T)}),qe(T),C},Hi=function(T,R,j){return w=!1,B.forEach(function(X){X.progressEnd(T,R,j)}),j!==void 0&&(O=j),M=!1,L=!0,T===0?(A=Xe()==="reverse"?"normal":"reverse",A==="reverse"&&(L=!1),ht?(wt(),qe(1-R)):(k=(1-R)*Jt()*-1,wt(!1,!1))):T===1&&(ht?(wt(),qe(R)):(k=R*Jt()*-1,wt(!1,!1))),T!==void 0&&!h&&yn(),C},Wi=function(){d&&(ht?dt.forEach(function(T){T.pause()}):U.forEach(function(T){Tr(T,"animation-play-state","paused")}),I=!0)},ji=function(){return B.forEach(function(T){T.pause()}),Wi(),C},Ui=function(){bn()},Xi=function(){dt.forEach(function(T){T.play()}),(l.length===0||U.length===0)&&bn()},Yi=function(){ht&&(qe(0),Vi())},yn=function(T){return new Promise(function(R){T?.sync&&(E=!0,de(function(){return E=!1},{oneTimeCallback:!0})),d||Ye(),M&&(Yi(),M=!1),P&&(x=B.length+1,P=!1);var j=function(){We(X,G),R()},X=function(){We(j,nt),R()};de(X,{oneTimeCallback:!0}),je(j,{oneTimeCallback:!0}),B.forEach(function(Z){Z.play()}),ht?Xi():Ui(),I=!1})},pe=function(){B.forEach(function(T){T.stop()}),d&&(Me(),d=!1),lt(),nt.forEach(function(T){return T.c(0,C)}),nt.length=0},Ce=function(T,R){var j,X=l[0];return X!==void 0&&(X.offset===void 0||X.offset===0)?X[T]=R:l=qt([(j={offset:0},j[T]=R,j)],l,!0),C},$e=function(T,R){var j,X=l[l.length-1];return X!==void 0&&(X.offset===void 0||X.offset===1)?X[T]=R:l=qt(qt([],l,!0),[(j={offset:1},j[T]=R,j)],!1),C},_n=function(T,R,j){return Ce(T,R).to(T,j)};return C={parentAnimation:h,elements:U,childAnimations:B,id:z,animationFinish:bn,from:Ce,to:$e,fromTo:_n,parent:zi,play:yn,pause:ji,stop:pe,destroy:rt,keyframes:dr,addAnimation:fr,addElement:jn,update:wt,fill:lr,direction:ar,iterations:Fi,duration:ur,easing:cr,delay:vn,getWebAnimations:Qt,getKeyframes:or,getFill:mn,getDirection:Xe,getDelay:Wn,getIterations:Hn,getEasing:Pe,getDuration:Jt,afterAddRead:Ii,afterAddWrite:gn,afterClearStyles:Ni,afterStyles:Ri,afterRemoveClass:rr,afterAddClass:sr,beforeAddRead:he,beforeAddWrite:Li,beforeClearStyles:ir,beforeStyles:nr,beforeRemoveClass:er,beforeAddClass:kt,onFinish:de,isRunning:yt,progressStart:Un,progressStep:mr,progressEnd:Hi}}});function gu(e,t){if(e.isOk){var n=t(e.value);return n instanceof Promise?n.then(function(r){return Er(r)}):Er(n)}if(e.isErr){var s=e.value;return na(s)}throw"should never get here"}var du,hu,pu,Er,na,mu,vu,ia,bu,gm,yu,_u,xu,sa,wu,mm,Mr,vm,Su,bm,Pr,Cr,ra,oa,ea,kr,Tu,ym,Eu,Ge=ne(()=>{du=Object.defineProperty,hu=function(e,t){for(var n in t)du(e,n,{get:t[n],enumerable:!0})},pu={};hu(pu,{err:function(){return na},map:function(){return gu},ok:function(){return Er},unwrap:function(){return mu},unwrapErr:function(){return vu}});Er=function(e){return{isOk:!0,isErr:!1,value:e}},na=function(e){return{isOk:!1,isErr:!0,value:e}};mu=function(e){if(e.isOk)return e.value;throw e.value},vu=function(e){if(e.isErr)return e.value;throw e.value},ia=function(e){return _u(e).D},bu="Capture",gm=new RegExp(bu+"$"),yu=new WeakMap,_u=function(e){return yu.get(e)},xu=function(e,t){return(0,console.error)(e,t)},sa=typeof window<"u"?window:{},wu=sa.document||{head:{}},mm=sa.HTMLElement||function(){function e(){}return e}(),Mr={p:0,t:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,n,s){return e.addEventListener(t,n,s)},rel:function(e,t,n,s){return e.removeEventListener(t,n,s)},ce:function(e,t){return new CustomEvent(e,t)}},vm=function(){var e=!1;try{wu.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){e=!0}}))}catch{}return e}(),Su=function(e){return Promise.resolve(e)},bm=function(){try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1}(),Pr=!1,Cr=[],ra=[],oa=function(e,t){return function(n){e.push(n),Pr||(Pr=!0,t&&Mr.p&4?Tu(kr):Mr.raf(kr))}},ea=function(e){for(var t=0;t<e.length;t++)try{e[t](performance.now())}catch(n){xu(n)}e.length=0},kr=function(){ea(Cr),ea(ra),(Pr=Cr.length>0)&&Mr.raf(kr)},Tu=function(e){return Su().then(e)},ym=oa(Cr,!1),Eu=oa(ra,!0)});var Mu,Gn,Pu,Kn,Ae=ne(()=>{Ge();Mu=function(){function e(){this.m=new Map}return e.prototype.reset=function(t){this.m=new Map(Object.entries(t))},e.prototype.get=function(t,n){var s=this.m.get(t);return s!==void 0?s:n},e.prototype.getBoolean=function(t,n){n===void 0&&(n=!1);var s=this.m.get(t);return s===void 0?n:typeof s=="string"?s==="true":!!s},e.prototype.getNumber=function(t,n){var s=parseFloat(this.m.get(t));return isNaN(s)?n!==void 0?n:NaN:s},e.prototype.set=function(t,n){this.m.set(t,n)},e}(),Gn=new Mu,Kn=function(e){return e&&ia(e)||Pu}});var xn,Ke=ne(()=>{Yn();xn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return console.warn.apply(console,qt(["[Ionic Warning]: ".concat(e)],t,!1))}});var wn,aa,Oe=ne(()=>{wn=function(e,t){e.componentOnReady?e.componentOnReady().then(function(n){return t(n)}):aa(function(){return t(e)})},aa=function(e){return typeof __zone_symbol__requestAnimationFrame=="function"?__zone_symbol__requestAnimationFrame(e):typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e)}});var Zn,Qi,Cu,la,Lm,Ji=ne(()=>{Ae();Ge();Ke();Oe();Zn=function(e){e.tabIndex=-1,e.focus()},Qi=function(e){return e.offsetParent!==null},Cu=function(){var e=function(n){var s=Gn.get("focusManagerPriority",!1);if(s){var r=document.activeElement;r!==null&&n?.contains(r)&&r.setAttribute(la,"true")}},t=function(n){var s=Gn.get("focusManagerPriority",!1);if(Array.isArray(s)&&!n.contains(document.activeElement)){var r=n.querySelector("[".concat(la,"]"));if(r&&Qi(r)){Zn(r);return}for(var o=0,a=s;o<a.length;o++){var l=a[o];switch(l){case"content":var c=n.querySelector('main, [role="main"]');if(c&&Qi(c)){Zn(c);return}break;case"heading":var u=n.querySelector('h1, [role="heading"][aria-level="1"]');if(u&&Qi(u)){Zn(u);return}break;case"banner":var d=n.querySelector('header, [role="banner"]');if(d&&Qi(d)){Zn(d);return}break;default:xn("Unrecognized focus manager priority value ".concat(l));break}}Zn(n)}};return{saveViewFocus:e,setViewFocus:t}},la="ion-last-focus",Lm=Cu()});var ca=ne(()=>{$n();Ji();ke();Ae();Ge();Ke();Oe();});var fa=ne(()=>{$n();Ji();ke();Ae();Ge();Ke();Oe();});var _c=lu((kb,Qs)=>{(function(e,t,n,s){"use strict";var r=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),a="function",l=Math.round,c=Math.abs,u=Date.now;function d(g,v,_){return setTimeout(E(g,_),v)}function h(g,v,_){return Array.isArray(g)?(p(g,_[v],_),!0):!1}function p(g,v,_){var S;if(!!g)if(g.forEach)g.forEach(v,_);else if(g.length!==s)for(S=0;S<g.length;)v.call(_,g[S],S,g),S++;else for(S in g)g.hasOwnProperty(S)&&v.call(_,g[S],S,g)}function m(g,v,_){var S="DEPRECATED METHOD: "+v+`
|
|
2
|
+
`+_+` AT
|
|
3
|
+
`;return function(){var D=new Error("get-stack-trace"),N=D&&D.stack?D.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",$=e.console&&(e.console.warn||e.console.log);return $&&$.call(e.console,S,N),g.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(v){if(v===s||v===null)throw new TypeError("Cannot convert undefined or null to object");for(var _=Object(v),S=1;S<arguments.length;S++){var D=arguments[S];if(D!==s&&D!==null)for(var N in D)D.hasOwnProperty(N)&&(_[N]=D[N])}return _}:b=Object.assign;var y=m(function(v,_,S){for(var D=Object.keys(_),N=0;N<D.length;)(!S||S&&v[D[N]]===s)&&(v[D[N]]=_[D[N]]),N++;return v},"extend","Use `assign`."),x=m(function(v,_){return y(v,_,!0)},"merge","Use `assign`.");function w(g,v,_){var S=v.prototype,D;D=g.prototype=Object.create(S),D.constructor=g,D._super=S,_&&b(D,_)}function E(g,v){return function(){return g.apply(v,arguments)}}function A(g,v){return typeof g==a?g.apply(v&&v[0]||s,v):g}function O(g,v){return g===s?v:g}function k(g,v,_){p(C(v),function(S){g.addEventListener(S,_,!1)})}function L(g,v,_){p(C(v),function(S){g.removeEventListener(S,_,!1)})}function M(g,v){for(;g;){if(g==v)return!0;g=g.parentNode}return!1}function P(g,v){return g.indexOf(v)>-1}function C(g){return g.trim().split(/\s+/g)}function I(g,v,_){if(g.indexOf&&!_)return g.indexOf(v);for(var S=0;S<g.length;){if(_&&g[S][_]==v||!_&&g[S]===v)return S;S++}return-1}function z(g){return Array.prototype.slice.call(g,0)}function W(g,v,_){for(var S=[],D=[],N=0;N<g.length;){var $=v?g[N][v]:g[N];I(D,$)<0&&S.push(g[N]),D[N]=$,N++}return _&&(v?S=S.sort(function(bt,St){return bt[v]>St[v]}):S=S.sort()),S}function G(g,v){for(var _,S,D=v[0].toUpperCase()+v.slice(1),N=0;N<r.length;){if(_=r[N],S=_?_+D:v,S in g)return S;N++}return s}var nt=1;function U(){return nt++}function B(g){var v=g.ownerDocument||g;return v.defaultView||v.parentWindow||e}var tt=/mobile|tablet|ip(ad|hone|od)|android/i,vt="ontouchstart"in e,ct=G(e,"PointerEvent")!==s,Ut=vt&&tt.test(navigator.userAgent),Lt="touch",dt="pen",Xt="mouse",ht="kinect",Qt=25,rt=1,fe=2,lt=4,yt=8,We=1,je=2,de=4,Ue=8,Me=16,Ht=je|de,he=Ue|Me,Li=Ht|he,Ii=["x","y"],gn=["clientX","clientY"];function kt(g,v){var _=this;this.manager=g,this.callback=v,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(S){A(g.options.enable,[g])&&_.handler(S)},this.init()}kt.prototype={handler:function(){},init:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(B(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(B(this.element),this.evWin,this.domHandler)}};function er(g){var v,_=g.options.inputClass;return _?v=_:ct?v=jn:Ut?v=Ye:vt?v=Un:v=vn,new v(g,nr)}function nr(g,v,_){var S=_.pointers.length,D=_.changedPointers.length,N=v&rt&&S-D===0,$=v&(lt|yt)&&S-D===0;_.isFirst=!!N,_.isFinal=!!$,N&&(g.session={}),_.eventType=v,ir(g,_),g.emit("hammer.input",_),g.recognize(_),g.session.prevInput=_}function ir(g,v){var _=g.session,S=v.pointers,D=S.length;_.firstInput||(_.firstInput=Ri(v)),D>1&&!_.firstMultiple?_.firstMultiple=Ri(v):D===1&&(_.firstMultiple=!1);var N=_.firstInput,$=_.firstMultiple,pt=$?$.center:N.center,bt=v.center=Ni(S);v.timeStamp=u(),v.deltaTime=v.timeStamp-N.timeStamp,v.angle=Jt(pt,bt),v.distance=Pe(pt,bt),sr(_,v),v.offsetDirection=Xe(v.deltaX,v.deltaY);var St=mn(v.deltaTime,v.deltaX,v.deltaY);v.overallVelocityX=St.x,v.overallVelocityY=St.y,v.overallVelocity=c(St.x)>c(St.y)?St.x:St.y,v.scale=$?Wn($.pointers,S):1,v.rotation=$?Hn($.pointers,S):0,v.maxPointers=_.prevInput?v.pointers.length>_.prevInput.maxPointers?v.pointers.length:_.prevInput.maxPointers:v.pointers.length,rr(_,v);var ee=g.element;M(v.srcEvent.target,ee)&&(ee=v.srcEvent.target),v.target=ee}function sr(g,v){var _=v.center,S=g.offsetDelta||{},D=g.prevDelta||{},N=g.prevInput||{};(v.eventType===rt||N.eventType===lt)&&(D=g.prevDelta={x:N.deltaX||0,y:N.deltaY||0},S=g.offsetDelta={x:_.x,y:_.y}),v.deltaX=D.x+(_.x-S.x),v.deltaY=D.y+(_.y-S.y)}function rr(g,v){var _=g.lastInterval||v,S=v.timeStamp-_.timeStamp,D,N,$,pt;if(v.eventType!=yt&&(S>Qt||_.velocity===s)){var bt=v.deltaX-_.deltaX,St=v.deltaY-_.deltaY,ee=mn(S,bt,St);N=ee.x,$=ee.y,D=c(ee.x)>c(ee.y)?ee.x:ee.y,pt=Xe(bt,St),g.lastInterval=v}else D=_.velocity,N=_.velocityX,$=_.velocityY,pt=_.direction;v.velocity=D,v.velocityX=N,v.velocityY=$,v.direction=pt}function Ri(g){for(var v=[],_=0;_<g.pointers.length;)v[_]={clientX:l(g.pointers[_].clientX),clientY:l(g.pointers[_].clientY)},_++;return{timeStamp:u(),pointers:v,center:Ni(v),deltaX:g.deltaX,deltaY:g.deltaY}}function Ni(g){var v=g.length;if(v===1)return{x:l(g[0].clientX),y:l(g[0].clientY)};for(var _=0,S=0,D=0;D<v;)_+=g[D].clientX,S+=g[D].clientY,D++;return{x:l(_/v),y:l(S/v)}}function mn(g,v,_){return{x:v/g||0,y:_/g||0}}function Xe(g,v){return g===v?We:c(g)>=c(v)?g<0?je:de:v<0?Ue:Me}function Pe(g,v,_){_||(_=Ii);var S=v[_[0]]-g[_[0]],D=v[_[1]]-g[_[1]];return Math.sqrt(S*S+D*D)}function Jt(g,v,_){_||(_=Ii);var S=v[_[0]]-g[_[0]],D=v[_[1]]-g[_[1]];return Math.atan2(D,S)*180/Math.PI}function Hn(g,v){return Jt(v[1],v[0],gn)+Jt(g[1],g[0],gn)}function Wn(g,v){return Pe(v[0],v[1],gn)/Pe(g[0],g[1],gn)}var or={mousedown:rt,mousemove:fe,mouseup:lt},ar="mousedown",lr="mousemove mouseup";function vn(){this.evEl=ar,this.evWin=lr,this.pressed=!1,kt.apply(this,arguments)}w(vn,kt,{handler:function(v){var _=or[v.type];_&rt&&v.button===0&&(this.pressed=!0),_&fe&&v.which!==1&&(_=lt),this.pressed&&(_<&&(this.pressed=!1),this.callback(this.manager,_,{pointers:[v],changedPointers:[v],pointerType:Xt,srcEvent:v}))}});var cr={pointerdown:rt,pointermove:fe,pointerup:lt,pointercancel:yt,pointerout:yt},ur={2:Lt,3:dt,4:Xt,5:ht},Fi="pointerdown",zi="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Fi="MSPointerDown",zi="MSPointerMove MSPointerUp MSPointerCancel");function jn(){this.evEl=Fi,this.evWin=zi,kt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(jn,kt,{handler:function(v){var _=this.store,S=!1,D=v.type.toLowerCase().replace("ms",""),N=cr[D],$=ur[v.pointerType]||v.pointerType,pt=$==Lt,bt=I(_,v.pointerId,"pointerId");N&rt&&(v.button===0||pt)?bt<0&&(_.push(v),bt=_.length-1):N&(lt|yt)&&(S=!0),!(bt<0)&&(_[bt]=v,this.callback(this.manager,N,{pointers:_,changedPointers:[v],pointerType:$,srcEvent:v}),S&&_.splice(bt,1))}});var fr={touchstart:rt,touchmove:fe,touchend:lt,touchcancel:yt},dr="touchstart",hr="touchstart touchmove touchend touchcancel";function Bi(){this.evTarget=dr,this.evWin=hr,this.started=!1,kt.apply(this,arguments)}w(Bi,kt,{handler:function(v){var _=fr[v.type];if(_===rt&&(this.started=!0),!!this.started){var S=pr.call(this,v,_);_&(lt|yt)&&S[0].length-S[1].length===0&&(this.started=!1),this.callback(this.manager,_,{pointers:S[0],changedPointers:S[1],pointerType:Lt,srcEvent:v})}}});function pr(g,v){var _=z(g.touches),S=z(g.changedTouches);return v&(lt|yt)&&(_=W(_.concat(S),"identifier",!0)),[_,S]}var bn={touchstart:rt,touchmove:fe,touchend:lt,touchcancel:yt},gr="touchstart touchmove touchend touchcancel";function Ye(){this.evTarget=gr,this.targetIds={},kt.apply(this,arguments)}w(Ye,kt,{handler:function(v){var _=bn[v.type],S=qe.call(this,v,_);!S||this.callback(this.manager,_,{pointers:S[0],changedPointers:S[1],pointerType:Lt,srcEvent:v})}});function qe(g,v){var _=z(g.touches),S=this.targetIds;if(v&(rt|fe)&&_.length===1)return S[_[0].identifier]=!0,[_,_];var D,N,$=z(g.changedTouches),pt=[],bt=this.target;if(N=_.filter(function(St){return M(St.target,bt)}),v===rt)for(D=0;D<N.length;)S[N[D].identifier]=!0,D++;for(D=0;D<$.length;)S[$[D].identifier]&&pt.push($[D]),v&(lt|yt)&&delete S[$[D].identifier],D++;if(!!pt.length)return[W(N.concat(pt),"identifier",!0),pt]}var Vi=2500,wt=25;function Un(){kt.apply(this,arguments);var g=E(this.handler,this);this.touch=new Ye(this.manager,g),this.mouse=new vn(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}w(Un,kt,{handler:function(v,_,S){var D=S.pointerType==Lt,N=S.pointerType==Xt;if(!(N&&S.sourceCapabilities&&S.sourceCapabilities.firesTouchEvents)){if(D)mr.call(this,_,S);else if(N&&Wi.call(this,S))return;this.callback(v,_,S)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function mr(g,v){g&rt?(this.primaryTouch=v.changedPointers[0].identifier,Hi.call(this,v)):g&(lt|yt)&&Hi.call(this,v)}function Hi(g){var v=g.changedPointers[0];if(v.identifier===this.primaryTouch){var _={x:v.clientX,y:v.clientY};this.lastTouches.push(_);var S=this.lastTouches,D=function(){var N=S.indexOf(_);N>-1&&S.splice(N,1)};setTimeout(D,Vi)}}function Wi(g){for(var v=g.srcEvent.clientX,_=g.srcEvent.clientY,S=0;S<this.lastTouches.length;S++){var D=this.lastTouches[S],N=Math.abs(v-D.x),$=Math.abs(_-D.y);if(N<=wt&&$<=wt)return!0}return!1}var ji=G(o.style,"touchAction"),Ui=ji!==s,Xi="compute",Yi="auto",yn="manipulation",pe="none",Ce="pan-x",$e="pan-y",_n=j();function T(g,v){this.manager=g,this.set(v)}T.prototype={set:function(g){g==Xi&&(g=this.compute()),Ui&&this.manager.element.style&&_n[g]&&(this.manager.element.style[ji]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return p(this.manager.recognizers,function(v){A(v.options.enable,[v])&&(g=g.concat(v.getTouchAction()))}),R(g.join(" "))},preventDefaults:function(g){var v=g.srcEvent,_=g.offsetDirection;if(this.manager.session.prevented){v.preventDefault();return}var S=this.actions,D=P(S,pe)&&!_n[pe],N=P(S,$e)&&!_n[$e],$=P(S,Ce)&&!_n[Ce];if(D){var pt=g.pointers.length===1,bt=g.distance<2,St=g.deltaTime<250;if(pt&&bt&&St)return}if(!($&&N)&&(D||N&&_&Ht||$&&_&he))return this.preventSrc(v)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function R(g){if(P(g,pe))return pe;var v=P(g,Ce),_=P(g,$e);return v&&_?pe:v||_?v?Ce:$e:P(g,yn)?yn:Yi}function j(){if(!Ui)return!1;var g={},v=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(_){g[_]=v?e.CSS.supports("touch-action",_):!0}),g}var X=1,Z=2,It=4,_t=8,Rt=_t,Xn=16,te=32;function ge(g){this.options=b({},this.defaults,g||{}),this.id=U(),this.manager=null,this.options.enable=O(this.options.enable,!0),this.state=X,this.simultaneous={},this.requireFail=[]}ge.prototype={defaults:{},set:function(g){return b(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(h(g,"recognizeWith",this))return this;var v=this.simultaneous;return g=qi(g,this),v[g.id]||(v[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return h(g,"dropRecognizeWith",this)?this:(g=qi(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(h(g,"requireFailure",this))return this;var v=this.requireFail;return g=qi(g,this),I(v,g)===-1&&(v.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(h(g,"dropRequireFailure",this))return this;g=qi(g,this);var v=I(this.requireFail,g);return v>-1&&this.requireFail.splice(v,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var v=this,_=this.state;function S(D){v.manager.emit(D,g)}_<_t&&S(v.options.event+Zo(_)),S(v.options.event),g.additionalEvent&&S(g.additionalEvent),_>=_t&&S(v.options.event+Zo(_))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=te},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(te|X)))return!1;g++}return!0},recognize:function(g){var v=b({},g);if(!A(this.options.enable,[this,v])){this.reset(),this.state=te;return}this.state&(Rt|Xn|te)&&(this.state=X),this.state=this.process(v),this.state&(Z|It|_t|Xn)&&this.tryEmit(v)},process:function(g){},getTouchAction:function(){},reset:function(){}};function Zo(g){return g&Xn?"cancel":g&_t?"end":g&It?"move":g&Z?"start":""}function Qo(g){return g==Me?"down":g==Ue?"up":g==je?"left":g==de?"right":""}function qi(g,v){var _=v.manager;return _?_.get(g):g}function Yt(){ge.apply(this,arguments)}w(Yt,ge,{defaults:{pointers:1},attrTest:function(g){var v=this.options.pointers;return v===0||g.pointers.length===v},process:function(g){var v=this.state,_=g.eventType,S=v&(Z|It),D=this.attrTest(g);return S&&(_&yt||!D)?v|Xn:S||D?_<?v|_t:v&Z?v|It:Z:te}});function $i(){Yt.apply(this,arguments),this.pX=null,this.pY=null}w($i,Yt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Li},getTouchAction:function(){var g=this.options.direction,v=[];return g&Ht&&v.push($e),g&he&&v.push(Ce),v},directionTest:function(g){var v=this.options,_=!0,S=g.distance,D=g.direction,N=g.deltaX,$=g.deltaY;return D&v.direction||(v.direction&Ht?(D=N===0?We:N<0?je:de,_=N!=this.pX,S=Math.abs(g.deltaX)):(D=$===0?We:$<0?Ue:Me,_=$!=this.pY,S=Math.abs(g.deltaY))),g.direction=D,_&&S>v.threshold&&D&v.direction},attrTest:function(g){return Yt.prototype.attrTest.call(this,g)&&(this.state&Z||!(this.state&Z)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var v=Qo(g.direction);v&&(g.additionalEvent=this.options.event+v),this._super.emit.call(this,g)}});function vr(){Yt.apply(this,arguments)}w(vr,Yt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&Z)},emit:function(g){if(g.scale!==1){var v=g.scale<1?"in":"out";g.additionalEvent=this.options.event+v}this._super.emit.call(this,g)}});function br(){ge.apply(this,arguments),this._timer=null,this._input=null}w(br,ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Yi]},process:function(g){var v=this.options,_=g.pointers.length===v.pointers,S=g.distance<v.threshold,D=g.deltaTime>v.time;if(this._input=g,!S||!_||g.eventType&(lt|yt)&&!D)this.reset();else if(g.eventType&rt)this.reset(),this._timer=d(function(){this.state=Rt,this.tryEmit()},v.time,this);else if(g.eventType<)return Rt;return te},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===Rt&&(g&&g.eventType<?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function yr(){Yt.apply(this,arguments)}w(yr,Yt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&Z)}});function _r(){Yt.apply(this,arguments)}w(_r,Yt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ht|he,pointers:1},getTouchAction:function(){return $i.prototype.getTouchAction.call(this)},attrTest:function(g){var v=this.options.direction,_;return v&(Ht|he)?_=g.overallVelocity:v&Ht?_=g.overallVelocityX:v&he&&(_=g.overallVelocityY),this._super.attrTest.call(this,g)&&v&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(_)>this.options.velocity&&g.eventType<},emit:function(g){var v=Qo(g.offsetDirection);v&&this.manager.emit(this.options.event+v,g),this.manager.emit(this.options.event,g)}});function Gi(){ge.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(Gi,ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[yn]},process:function(g){var v=this.options,_=g.pointers.length===v.pointers,S=g.distance<v.threshold,D=g.deltaTime<v.time;if(this.reset(),g.eventType&rt&&this.count===0)return this.failTimeout();if(S&&D&&_){if(g.eventType!=lt)return this.failTimeout();var N=this.pTime?g.timeStamp-this.pTime<v.interval:!0,$=!this.pCenter||Pe(this.pCenter,g.center)<v.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!$||!N?this.count=1:this.count+=1,this._input=g;var pt=this.count%v.taps;if(pt===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Rt,this.tryEmit()},v.interval,this),Z):Rt}return te},failTimeout:function(){return this._timer=d(function(){this.state=te},this.options.interval,this),te},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Rt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function me(g,v){return v=v||{},v.recognizers=O(v.recognizers,me.defaults.preset),new xr(g,v)}me.VERSION="2.0.7",me.defaults={domEvents:!1,touchAction:Xi,enable:!0,inputTarget:null,inputClass:null,preset:[[yr,{enable:!1}],[vr,{enable:!1},["rotate"]],[_r,{direction:Ht}],[$i,{direction:Ht},["swipe"]],[Gi],[Gi,{event:"doubletap",taps:2},["tap"]],[br]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Jc=1,Jo=2;function xr(g,v){this.options=b({},me.defaults,v||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=er(this),this.touchAction=new T(this,this.options.touchAction),ta(this,!0),p(this.options.recognizers,function(_){var S=this.add(new _[0](_[1]));_[2]&&S.recognizeWith(_[2]),_[3]&&S.requireFailure(_[3])},this)}xr.prototype={set:function(g){return b(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?Jo:Jc},recognize:function(g){var v=this.session;if(!v.stopped){this.touchAction.preventDefaults(g);var _,S=this.recognizers,D=v.curRecognizer;(!D||D&&D.state&Rt)&&(D=v.curRecognizer=null);for(var N=0;N<S.length;)_=S[N],v.stopped!==Jo&&(!D||_==D||_.canRecognizeWith(D))?_.recognize(g):_.reset(),!D&&_.state&(Z|It|_t)&&(D=v.curRecognizer=_),N++}},get:function(g){if(g instanceof ge)return g;for(var v=this.recognizers,_=0;_<v.length;_++)if(v[_].options.event==g)return v[_];return null},add:function(g){if(h(g,"add",this))return this;var v=this.get(g.options.event);return v&&this.remove(v),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(h(g,"remove",this))return this;if(g=this.get(g),g){var v=this.recognizers,_=I(v,g);_!==-1&&(v.splice(_,1),this.touchAction.update())}return this},on:function(g,v){if(g!==s&&v!==s){var _=this.handlers;return p(C(g),function(S){_[S]=_[S]||[],_[S].push(v)}),this}},off:function(g,v){if(g!==s){var _=this.handlers;return p(C(g),function(S){v?_[S]&&_[S].splice(I(_[S],v),1):delete _[S]}),this}},emit:function(g,v){this.options.domEvents&&tu(g,v);var _=this.handlers[g]&&this.handlers[g].slice();if(!(!_||!_.length)){v.type=g,v.preventDefault=function(){v.srcEvent.preventDefault()};for(var S=0;S<_.length;)_[S](v),S++}},destroy:function(){this.element&&ta(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function ta(g,v){var _=g.element;if(!!_.style){var S;p(g.options.cssProps,function(D,N){S=G(_.style,N),v?(g.oldCssProps[S]=_.style[S],_.style[S]=D):_.style[S]=g.oldCssProps[S]||""}),v||(g.oldCssProps={})}}function tu(g,v){var _=t.createEvent("Event");_.initEvent(g,!0,!0),_.gesture=v,v.target.dispatchEvent(_)}b(me,{INPUT_START:rt,INPUT_MOVE:fe,INPUT_END:lt,INPUT_CANCEL:yt,STATE_POSSIBLE:X,STATE_BEGAN:Z,STATE_CHANGED:It,STATE_ENDED:_t,STATE_RECOGNIZED:Rt,STATE_CANCELLED:Xn,STATE_FAILED:te,DIRECTION_NONE:We,DIRECTION_LEFT:je,DIRECTION_RIGHT:de,DIRECTION_UP:Ue,DIRECTION_DOWN:Me,DIRECTION_HORIZONTAL:Ht,DIRECTION_VERTICAL:he,DIRECTION_ALL:Li,Manager:xr,Input:kt,TouchAction:T,TouchInput:Ye,MouseInput:vn,PointerEventInput:jn,TouchMouseInput:Un,SingleTouchInput:Bi,Recognizer:ge,AttrRecognizer:Yt,Tap:Gi,Pan:$i,Swipe:_r,Pinch:vr,Rotate:yr,Press:br,on:k,off:L,each:p,merge:x,extend:y,assign:b,inherit:w,bindFn:E,prefixed:G});var eu=typeof e<"u"?e:typeof self<"u"?self:{};eu.Hammer=me,typeof define=="function"&&define.amd?define(function(){return me}):typeof Qs<"u"&&Qs.exports?Qs.exports=me:e[n]=me})(window,document,"Hammer")});$n();Ji();ca();fa();var ku=function(){function e(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}return e.prototype.createGesture=function(t){var n;return new Au(this,this.newID(),t.name,(n=t.priority)!==null&&n!==void 0?n:0,!!t.disableScroll)},e.prototype.createBlocker=function(t){return t===void 0&&(t={}),new Ou(this,this.newID(),t.disable,!!t.disableScroll)},e.prototype.start=function(t,n,s){return this.canStart(t)?(this.requestedStart.set(n,s),!0):(this.requestedStart.delete(n),!1)},e.prototype.capture=function(t,n,s){if(!this.start(t,n,s))return!1;var r=this.requestedStart,o=-1e4;if(r.forEach(function(l){o=Math.max(o,l)}),o===s){this.capturedId=n,r.clear();var a=new CustomEvent("ionGestureCaptured",{detail:{gestureName:t}});return document.dispatchEvent(a),!0}return r.delete(n),!1},e.prototype.release=function(t){this.requestedStart.delete(t),this.capturedId===t&&(this.capturedId=void 0)},e.prototype.disableGesture=function(t,n){var s=this.disabledGestures.get(t);s===void 0&&(s=new Set,this.disabledGestures.set(t,s)),s.add(n)},e.prototype.enableGesture=function(t,n){var s=this.disabledGestures.get(t);s!==void 0&&s.delete(n)},e.prototype.disableScroll=function(t){this.disabledScroll.add(t),this.disabledScroll.size===1&&document.body.classList.add(Ar)},e.prototype.enableScroll=function(t){this.disabledScroll.delete(t),this.disabledScroll.size===0&&document.body.classList.remove(Ar)},e.prototype.canStart=function(t){return!(this.capturedId!==void 0||this.isDisabled(t))},e.prototype.isCaptured=function(){return this.capturedId!==void 0},e.prototype.isScrollDisabled=function(){return this.disabledScroll.size>0},e.prototype.isDisabled=function(t){var n=this.disabledGestures.get(t);return!!(n&&n.size>0)},e.prototype.newID=function(){return this.gestureId++,this.gestureId},e}(),Au=function(){function e(t,n,s,r,o){this.id=n,this.name=s,this.disableScroll=o,this.priority=r*1e6+n,this.ctrl=t}return e.prototype.canStart=function(){return this.ctrl?this.ctrl.canStart(this.name):!1},e.prototype.start=function(){return this.ctrl?this.ctrl.start(this.name,this.id,this.priority):!1},e.prototype.capture=function(){if(!this.ctrl)return!1;var t=this.ctrl.capture(this.name,this.id,this.priority);return t&&this.disableScroll&&this.ctrl.disableScroll(this.id),t},e.prototype.release=function(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))},e.prototype.destroy=function(){this.release(),this.ctrl=void 0},e}(),Ou=function(){function e(t,n,s,r){this.id=n,this.disable=s,this.disableScroll=r,this.ctrl=t}return e.prototype.block=function(){if(!!this.ctrl){if(this.disable)for(var t=0,n=this.disable;t<n.length;t++){var s=n[t];this.ctrl.disableGesture(s,this.id)}this.disableScroll&&this.ctrl.disableScroll(this.id)}},e.prototype.unblock=function(){if(!!this.ctrl){if(this.disable)for(var t=0,n=this.disable;t<n.length;t++){var s=n[t];this.ctrl.enableGesture(s,this.id)}this.disableScroll&&this.ctrl.enableScroll(this.id)}},e.prototype.destroy=function(){this.unblock(),this.ctrl=void 0},e}(),Ar="backdrop-no-scroll",da=new ku;Ae();Oe();var Du=function(){function e(t){this.value=t}return e}();Yn();ke();ke();Ae();Ge();var ha=99;Ke();Oe();Ae();$n();var Or=function(e){return $t().duration(e?400:300)},Lu=function(e){var t,n,s=e.width+8,r=$t(),o=$t();e.isEndSide?(t=s+"px",n="0px"):(t=-s+"px",n="0px"),r.addElement(e.menuInnerEl).fromTo("transform","translateX(".concat(t,")"),"translateX(".concat(n,")"));var a=Kn(e),l=a==="ios",c=l?.2:.25;return o.addElement(e.backdropEl).fromTo("opacity",.01,c),Or(l).addAnimation([r,o])},Iu=function(e){var t,n,s=Kn(e),r=e.width;e.isEndSide?(t=-r+"px",n=r+"px"):(t=r+"px",n=-r+"px");var o=$t().addElement(e.menuInnerEl).fromTo("transform","translateX(".concat(n,")"),"translateX(0px)"),a=$t().addElement(e.contentEl).fromTo("transform","translateX(0px)","translateX(".concat(t,")")),l=$t().addElement(e.backdropEl).fromTo("opacity",.01,.32);return Or(s==="ios").addAnimation([o,a,l])},Ru=function(e){var t=Kn(e),n=e.width*(e.isEndSide?-1:1)+"px",s=$t().addElement(e.contentEl).fromTo("transform","translateX(0px)","translateX(".concat(n,")"));return Or(t==="ios").addAnimation(s)},Nu=function(){var e=new Map,t=[],n=function(M){return Tt(void 0,void 0,void 0,function(){var P;return Et(this,function(C){switch(C.label){case 0:return[4,u(M,!0)];case 1:return P=C.sent(),P?[2,P.open()]:[2,!1]}})})},s=function(M){return Tt(void 0,void 0,void 0,function(){var P;return Et(this,function(C){switch(C.label){case 0:return[4,M!==void 0?u(M,!0):d()];case 1:return P=C.sent(),P!==void 0?[2,P.close()]:[2,!1]}})})},r=function(M){return Tt(void 0,void 0,void 0,function(){var P;return Et(this,function(C){switch(C.label){case 0:return[4,u(M,!0)];case 1:return P=C.sent(),P?[2,P.toggle()]:[2,!1]}})})},o=function(M,P){return Tt(void 0,void 0,void 0,function(){var C;return Et(this,function(I){switch(I.label){case 0:return[4,u(P)];case 1:return C=I.sent(),C&&(C.disabled=!M),[2,C]}})})},a=function(M,P){return Tt(void 0,void 0,void 0,function(){var C;return Et(this,function(I){switch(I.label){case 0:return[4,u(P)];case 1:return C=I.sent(),C&&(C.swipeGesture=M),[2,C]}})})},l=function(M){return Tt(void 0,void 0,void 0,function(){var P,P;return Et(this,function(C){switch(C.label){case 0:return M==null?[3,2]:[4,u(M)];case 1:return P=C.sent(),[2,P!==void 0&&P.isOpen()];case 2:return[4,d()];case 3:return P=C.sent(),[2,P!==void 0]}})})},c=function(M){return Tt(void 0,void 0,void 0,function(){var P;return Et(this,function(C){switch(C.label){case 0:return[4,u(M)];case 1:return P=C.sent(),P?[2,!P.disabled]:[2,!1]}})})},u=function(M){for(var P=[],C=1;C<arguments.length;C++)P[C-1]=arguments[C];return Tt(void 0,qt([M],P,!0),void 0,function(I,z){var W,G,nt;return z===void 0&&(z=!1),Et(this,function(U){switch(U.label){case 0:return[4,L()];case 1:if(U.sent(),I==="start"||I==="end"){if(W=t.filter(function(B){return B.side===I&&!B.disabled}),W.length>=1)return W.length>1&&z&&xn('menuController queried for a menu on the "'.concat(I,'" side, but ').concat(W.length," menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side."),W.map(function(B){return B.el})),[2,W[0].el];if(G=t.filter(function(B){return B.side===I}),G.length>=1)return G.length>1&&z&&xn('menuController queried for a menu on the "'.concat(I,'" side, but ').concat(G.length," menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side."),G.map(function(B){return B.el})),[2,G[0].el]}else if(I!=null)return[2,k(function(B){return B.menuId===I})];return nt=k(function(B){return!B.disabled}),nt?[2,nt]:[2,t.length>0?t[0].el:void 0]}})})},d=function(){return Tt(void 0,void 0,void 0,function(){return Et(this,function(M){switch(M.label){case 0:return[4,L()];case 1:return M.sent(),[2,E()]}})})},h=function(){return Tt(void 0,void 0,void 0,function(){return Et(this,function(M){switch(M.label){case 0:return[4,L()];case 1:return M.sent(),[2,A()]}})})},p=function(){return Tt(void 0,void 0,void 0,function(){return Et(this,function(M){switch(M.label){case 0:return[4,L()];case 1:return M.sent(),[2,O()]}})})},m=function(M,P){e.set(M,P)},b=function(M){t.indexOf(M)<0&&t.push(M)},y=function(M){var P=t.indexOf(M);P>-1&&t.splice(P,1)},x=function(M,P,C){return Tt(void 0,void 0,void 0,function(){var I;return Et(this,function(z){switch(z.label){case 0:return O()?[2,!1]:P?[4,d()]:[3,3];case 1:return I=z.sent(),I&&M.el!==I?[4,I.setOpen(!1,!1)]:[3,3];case 2:z.sent(),z.label=3;case 3:return[2,M._setOpen(P,C)]}})})},w=function(M,P){var C=e.get(M);if(!C)throw new Error("animation not registered");var I=C(P);return I},E=function(){return k(function(M){return M._isOpen})},A=function(){return t.map(function(M){return M.el})},O=function(){return t.some(function(M){return M.isAnimating})},k=function(M){var P=t.find(M);if(P!==void 0)return P.el},L=function(){return Promise.all(Array.from(document.querySelectorAll("ion-menu")).map(function(M){return new Promise(function(P){return wn(M,P)})}))};return m("reveal",Ru),m("push",Iu),m("overlay",Lu),qn===null||qn===void 0||qn.addEventListener("ionBackButton",function(M){var P=E();P&&M.detail.register(ha,function(){return P.close()})}),{registerAnimation:m,get:u,getMenus:h,getOpen:d,isEnabled:c,swipeGesture:a,isAnimating:p,isOpen:l,enable:o,toggle:r,close:s,open:n,_getOpenSync:E,_createAnimation:w,_register:b,_unregister:y,_setOpen:x}},Fu=Nu();Yn();ke();Oe();Ae();Oe();Ke();var Ze=function(e){return{create:function(t){return Uu(e,t)},dismiss:function(t,n,s){return Yu(document,t,n,e,s)},getTop:function(){return Tt(this,void 0,void 0,function(){return Et(this,function(t){return[2,pa(document,e)]})})}}},zu=Ze("ion-alert"),Bu=Ze("ion-action-sheet"),Dr=Ze("ion-loading"),Vu=Ze("ion-modal"),Hu=Ze("ion-picker-legacy"),Wu=Ze("ion-popover"),ju=Ze("ion-toast");var Uu=function(e,t){return typeof window<"u"&&typeof window.customElements<"u"?window.customElements.whenDefined(e).then(function(){var n=document.createElement(e);return n.classList.add("overlay-hidden"),Object.assign(n,Object.assign(Object.assign({},t),{hasController:!0})),Gu(document).appendChild(n),new Promise(function(s){return wn(n,s)})}):Promise.resolve()},Xu=function(e){return e.classList.contains("overlay-hidden")};var Yu=function(e,t,n,s,r){var o=pa(e,s,r);return o?o.dismiss(t,n):Promise.reject("overlay does not exist")},qu=function(e,t){return t===void 0&&(t="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast"),Array.from(e.querySelectorAll(t)).filter(function(n){return n.overlayIndex>0})},$u=function(e,t){return qu(e,t).filter(function(n){return!Xu(n)})},pa=function(e,t,n){var s=$u(e,t);return n===void 0?s[s.length-1]:s.find(function(r){return r.id===n})};var Gu=function(e){return e.querySelector("ion-app")||e.body};ke();Ge();Ke();var Ku=document.querySelector("#root_path").content,ga=Ku,ma=ga+"/api",ts=ga+"/ui",mb=ts+"/auth";function va(e,t){parent=document.querySelector(e),parent.firstElementChild&&(parent.firstElementChild.remove(),parent.innerHTML=""),parent.insertAdjacentHTML("beforeend",t),parent.querySelectorAll("script").forEach(s=>{let r=document.createElement("script");for(let{name:o,value:a}of s.attributes)r.setAttribute(o,a);s.src?r.src=s.src:r.textContent=s.textContent,s.replaceWith(r)})}async function ba(e){return await fetch(e,{credentials:"include"}).then(t=>{if(!t.ok)throw new Error("Unauthorized API endpoint:"+t.url);return t.json()}).catch(t=>!1)}async function Lr(e,t,{method:n="get",data:s}={}){return await(n=="get"?fetch(s?t+"?"+new URLSearchParams(s):t,{credentials:"include"}):fetch(t,{method:"post",body:s,credentials:"include"})).then(r=>{if(!r.ok)throw new Error("Unauthorized API endpoint:"+r.url);return r.text()}).then(r=>(va(e,r),!0)).catch(r=>!1)}function Jn(e){return e+.5|0}var De=(e,t,n)=>Math.max(Math.min(e,n),t);function Qn(e){return De(Jn(e*2.55),0,255)}function Le(e){return De(Jn(e*255),0,255)}function ve(e){return De(Jn(e/2.55)/100,0,1)}function ya(e){return De(Jn(e*100),0,100)}var Wt={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},Rr=[..."0123456789ABCDEF"],Zu=e=>Rr[e&15],Qu=e=>Rr[(e&240)>>4]+Rr[e&15],es=e=>(e&240)>>4===(e&15),Ju=e=>es(e.r)&&es(e.g)&&es(e.b)&&es(e.a);function tf(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Wt[e[1]]*17,g:255&Wt[e[2]]*17,b:255&Wt[e[3]]*17,a:t===5?Wt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Wt[e[1]]<<4|Wt[e[2]],g:Wt[e[3]]<<4|Wt[e[4]],b:Wt[e[5]]<<4|Wt[e[6]],a:t===9?Wt[e[7]]<<4|Wt[e[8]]:255})),n}var ef=(e,t)=>e<255?t(e):"";function nf(e){var t=Ju(e)?Zu:Qu;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ef(e.a,t):void 0}var sf=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sa(e,t,n){let s=t*Math.min(n,1-n),r=(o,a=(o+e/30)%12)=>n-s*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function rf(e,t,n){let s=(r,o=(r+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function of(e,t,n){let s=Sa(e,1,.5),r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)s[r]*=1-t-n,s[r]+=t;return s}function af(e,t,n,s,r){return e===r?(t-n)/s+(t<n?6:0):t===r?(n-e)/s+2:(e-t)/s+4}function Nr(e){let n=e.r/255,s=e.g/255,r=e.b/255,o=Math.max(n,s,r),a=Math.min(n,s,r),l=(o+a)/2,c,u,d;return o!==a&&(d=o-a,u=l>.5?d/(2-o-a):d/(o+a),c=af(n,s,r,d,o),c=c*60+.5),[c|0,u||0,l]}function Fr(e,t,n,s){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,s)).map(Le)}function zr(e,t,n){return Fr(Sa,e,t,n)}function lf(e,t,n){return Fr(of,e,t,n)}function cf(e,t,n){return Fr(rf,e,t,n)}function Ta(e){return(e%360+360)%360}function uf(e){let t=sf.exec(e),n=255,s;if(!t)return;t[5]!==s&&(n=t[6]?Qn(+t[5]):Le(+t[5]));let r=Ta(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=lf(r,o,a):t[1]==="hsv"?s=cf(r,o,a):s=zr(r,o,a),{r:s[0],g:s[1],b:s[2],a:n}}function ff(e,t){var n=Nr(e);n[0]=Ta(n[0]+t),n=zr(n),e.r=n[0],e.g=n[1],e.b=n[2]}function df(e){if(!e)return;let t=Nr(e),n=t[0],s=ya(t[1]),r=ya(t[2]);return e.a<255?`hsla(${n}, ${s}%, ${r}%, ${ve(e.a)})`:`hsl(${n}, ${s}%, ${r}%)`}var _a={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"},xa={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 hf(){let e={},t=Object.keys(xa),n=Object.keys(_a),s,r,o,a,l;for(s=0;s<t.length;s++){for(a=l=t[s],r=0;r<n.length;r++)o=n[r],l=l.replace(o,_a[o]);o=parseInt(xa[a],16),e[l]=[o>>16&255,o>>8&255,o&255]}return e}var ns;function pf(e){ns||(ns=hf(),ns.transparent=[0,0,0,0]);let t=ns[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var gf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mf(e){let t=gf.exec(e),n=255,s,r,o;if(!!t){if(t[7]!==s){let a=+t[7];n=t[8]?Qn(a):De(a*255,0,255)}return s=+t[1],r=+t[3],o=+t[5],s=255&(t[2]?Qn(s):De(s,0,255)),r=255&(t[4]?Qn(r):De(r,0,255)),o=255&(t[6]?Qn(o):De(o,0,255)),{r:s,g:r,b:o,a:n}}}function vf(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ve(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Ir=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Sn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function bf(e,t,n){let s=Sn(ve(e.r)),r=Sn(ve(e.g)),o=Sn(ve(e.b));return{r:Le(Ir(s+n*(Sn(ve(t.r))-s))),g:Le(Ir(r+n*(Sn(ve(t.g))-r))),b:Le(Ir(o+n*(Sn(ve(t.b))-o))),a:e.a+n*(t.a-e.a)}}function is(e,t,n){if(e){let s=Nr(e);s[t]=Math.max(0,Math.min(s[t]+s[t]*n,t===0?360:1)),s=zr(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function Ea(e,t){return e&&Object.assign(t||{},e)}function wa(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Le(e[3]))):(t=Ea(e,{r:0,g:0,b:0,a:1}),t.a=Le(t.a)),t}function yf(e){return e.charAt(0)==="r"?mf(e):uf(e)}var Ie=class{constructor(t){if(t instanceof Ie)return t;let n=typeof t,s;n==="object"?s=wa(t):n==="string"&&(s=tf(t)||pf(t)||yf(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Ea(this._rgb);return t&&(t.a=ve(t.a)),t}set rgb(t){this._rgb=wa(t)}rgbString(){return this._valid?vf(this._rgb):void 0}hexString(){return this._valid?nf(this._rgb):void 0}hslString(){return this._valid?df(this._rgb):void 0}mix(t,n){if(t){let s=this.rgb,r=t.rgb,o,a=n===o?.5:n,l=2*a-1,c=s.a-r.a,u=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-u,s.r=255&u*s.r+o*r.r+.5,s.g=255&u*s.g+o*r.g+.5,s.b=255&u*s.b+o*r.b+.5,s.a=a*s.a+(1-a)*r.a,this.rgb=s}return this}interpolate(t,n){return t&&(this._rgb=bf(this._rgb,t._rgb,n)),this}clone(){return new Ie(this.rgb)}alpha(t){return this._rgb.a=Le(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=Jn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return is(this._rgb,2,t),this}darken(t){return is(this._rgb,2,-t),this}saturate(t){return is(this._rgb,1,t),this}desaturate(t){return is(this._rgb,1,-t),this}rotate(t){return ff(this._rgb,t),this}};function Kt(){}var Wr=(()=>{let e=0;return()=>e++})();function K(e){return e===null||typeof e>"u"}function Q(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function q(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function st(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ct(e,t){return st(e)?e:t}function H(e,t){return typeof e>"u"?t:e}var jr=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,cs=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function V(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Y(e,t,n,s){let r,o,a;if(Q(e))if(o=e.length,s)for(r=o-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;r<o;r++)t.call(n,e[r],r);else if(q(e))for(a=Object.keys(e),o=a.length,r=0;r<o;r++)t.call(n,e[a[r]],a[r])}function Mn(e,t){let n,s,r,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,s=e.length;n<s;++n)if(r=e[n],o=t[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function ei(e){if(Q(e))return e.map(ei);if(q(e)){let t=Object.create(null),n=Object.keys(e),s=n.length,r=0;for(;r<s;++r)t[n[r]]=ei(e[n[r]]);return t}return e}function Ra(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Na(e,t,n,s){if(!Ra(e))return;let r=t[e],o=n[e];q(r)&&q(o)?tn(r,o,s):t[e]=ei(o)}function tn(e,t,n){let s=Q(t)?t:[t],r=s.length;if(!q(e))return e;n=n||{};let o=n.merger||Na,a;for(let l=0;l<r;++l){if(a=s[l],!q(a))continue;let c=Object.keys(a);for(let u=0,d=c.length;u<d;++u)o(c[u],e,a,n)}return e}function en(e,t){return tn(e,t,{merger:Fa})}function Fa(e,t,n){if(!Ra(e))return;let s=t[e],r=n[e];q(s)&&q(r)?en(s,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ei(r))}var Ma={"":e=>e,x:e=>e.x,y:e=>e.y};function za(e){let t=e.split("."),n=[],s="";for(let r of t)s+=r,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function _f(e){let t=za(e);return n=>{for(let s of t){if(s==="")break;n=n&&n[s]}return n}}function re(e,t){return(Ma[t]||(Ma[t]=_f(t)))(e)}function si(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nn=e=>typeof e<"u",ie=e=>typeof e=="function",us=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ur(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var et=Math.PI,J=2*et,Ba=J+et,ni=Number.POSITIVE_INFINITY,Va=et/180,it=et/2,Re=et/4,Vr=et*2/3,se=Math.log10,Pt=Math.sign;function oe(e,t,n){return Math.abs(e-t)<n}function fs(e){let t=Math.round(e);e=oe(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(se(e))),s=e/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function Xr(e){let t=[],n=Math.sqrt(e),s;for(s=1;s<n;s++)e%s===0&&(t.push(s),t.push(e/s));return n===(n|0)&&t.push(n),t.sort((r,o)=>r-o).pop(),t}function Fe(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Yr(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function ds(e,t,n){let s,r,o;for(s=0,r=e.length;s<r;s++)o=e[s][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ft(e){return e*(et/180)}function ri(e){return e*(180/et)}function hs(e){if(!st(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ps(e,t){let n=t.x-e.x,s=t.y-e.y,r=Math.sqrt(n*n+s*s),o=Math.atan2(s,n);return o<-.5*et&&(o+=J),{angle:o,distance:r}}function ii(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ha(e,t){return(e-t+Ba)%J-et}function Mt(e){return(e%J+J)%J}function sn(e,t,n,s){let r=Mt(e),o=Mt(t),a=Mt(n),l=Mt(o-r),c=Mt(a-r),u=Mt(r-o),d=Mt(r-a);return r===o||r===a||s&&o===a||l>c&&u<d}function ft(e,t,n){return Math.max(t,Math.min(n,e))}function qr(e){return ft(e,-32768,32767)}function Zt(e,t,n,s=1e-6){return e>=Math.min(t,n)-s&&e<=Math.max(t,n)+s}function oi(e,t,n){n=n||(a=>e[a]<t);let s=e.length-1,r=0,o;for(;s-r>1;)o=r+s>>1,n(o)?r=o:s=o;return{lo:r,hi:s}}var Gt=(e,t,n,s)=>oi(e,n,s?r=>{let o=e[r][t];return o<n||o===n&&e[r+1][t]===n}:r=>e[r][t]<n),$r=(e,t,n)=>oi(e,n,s=>e[s][t]>=n);function Gr(e,t,n){let s=0,r=e.length;for(;s<r&&e[s]<t;)s++;for(;r>s&&e[r-1]>n;)r--;return s>0||r<e.length?e.slice(s,r):e}var Wa=["push","pop","shift","splice","unshift"];function Kr(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Wa.forEach(n=>{let s="_onData"+si(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let a=r.apply(this,o);return e._chartjs.listeners.forEach(l=>{typeof l[s]=="function"&&l[s](...o)}),a}})})}function gs(e,t){let n=e._chartjs;if(!n)return;let s=n.listeners,r=s.indexOf(t);r!==-1&&s.splice(r,1),!(s.length>0)&&(Wa.forEach(o=>{delete e[o]}),delete e._chartjs)}function ms(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vs=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function bs(e,t){let n=[],s=!1;return function(...r){n=r,s||(s=!0,vs.call(window,()=>{s=!1,e.apply(t,n)}))}}function Zr(e,t){let n;return function(...s){return t?(clearTimeout(n),n=setTimeout(e,t,s)):e.apply(this,s),t}}var ai=e=>e==="start"?"left":e==="end"?"right":"center",gt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Qr=(e,t,n,s)=>e===(s?"left":"right")?n:e==="center"?(t+n)/2:t;function ys(e,t,n){let s=t.length,r=0,o=s;if(e._sorted){let{iScale:a,_parsed:l}=e,c=a.axis,{min:u,max:d,minDefined:h,maxDefined:p}=a.getUserBounds();h&&(r=ft(Math.min(Gt(l,a.axis,u).lo,n?s:Gt(t,c,a.getPixelForValue(u)).lo),0,s-1)),p?o=ft(Math.max(Gt(l,a.axis,d,!0).hi+1,n?0:Gt(t,c,a.getPixelForValue(d),!0).hi+1),r,s)-r:o=s-r}return{start:r,count:o}}function _s(e){let{xScale:t,yScale:n,_scaleRanges:s}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!s)return e._scaleRanges=r,!0;let o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,r),o}var ss=e=>e===0||e===1,Pa=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*J/n)),Ca=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*J/n)+1,Qe={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*it)+1,easeOutSine:e=>Math.sin(e*it),easeInOutSine:e=>-.5*(Math.cos(et*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ss(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ss(e)?e:Pa(e,.075,.3),easeOutElastic:e=>ss(e)?e:Ca(e,.075,.3),easeInOutElastic(e){return ss(e)?e:e<.5?.5*Pa(e*2,.1125,.45):.5+.5*Ca(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Qe.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Qe.easeInBounce(e*2)*.5:Qe.easeOutBounce(e*2-1)*.5+.5};function xs(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ws(e){return xs(e)?e:new Ie(e)}function as(e){return xs(e)?e:new Ie(e).saturate(.5).darken(.1).hexString()}var xf=["x","y","borderWidth","radius","tension"],wf=["color","borderColor","backgroundColor"];function Sf(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:wf},numbers:{type:"number",properties:xf}}),e.describe("animations",{_fallback:"animation"}),e.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 Tf(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ka=new Map;function Ef(e,t){t=t||{};let n=e+JSON.stringify(t),s=ka.get(n);return s||(s=new Intl.NumberFormat(e,t),ka.set(n,s)),s}function rn(e,t,n){return Ef(t,n).format(e)}var ja={values(e){return Q(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let s=this.chart.options.locale,r,o=e;if(n.length>1){let u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),o=Mf(e,n)}let a=se(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),rn(e,s,c)},logarithmic(e,t,n){if(e===0)return"0";let s=n[t].significand||e/Math.pow(10,Math.floor(se(e)));return[1,2,3,5,10,15].includes(s)||t>.8*n.length?ja.numeric.call(this,e,t,n):""}};function Mf(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var li={formatters:ja};function Pf(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:li.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var ze=Object.create(null),Ss=Object.create(null);function ti(e,t){if(!t)return e;let n=t.split(".");for(let s=0,r=n.length;s<r;++s){let o=n[s];e=e[o]||(e[o]=Object.create(null))}return e}function Br(e,t,n){return typeof t=="string"?tn(ti(e,t),n):tn(ti(e,""),t)}var Hr=class{constructor(t,n){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=s=>s.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=(s,r)=>as(r.backgroundColor),this.hoverBorderColor=(s,r)=>as(r.borderColor),this.hoverColor=(s,r)=>as(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(n)}set(t,n){return Br(this,t,n)}get(t){return ti(this,t)}describe(t,n){return Br(Ss,t,n)}override(t,n){return Br(ze,t,n)}route(t,n,s,r){let o=ti(this,t),a=ti(this,s),l="_"+n;Object.defineProperties(o,{[l]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let c=this[l],u=a[r];return q(c)?Object.assign({},u,c):H(c,u)},set(c){this[l]=c}}})}apply(t){t.forEach(n=>n(this))}},ot=new Hr({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Sf,Tf,Pf]);function Ua(e){return!e||K(e.size)||K(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Tn(e,t,n,s,r){let o=t[r];return o||(o=t[r]=e.measureText(r).width,n.push(r)),o>s&&(s=o),s}function Jr(e,t,n,s){s=s||{};let r=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(r=s.data={},o=s.garbageCollect=[],s.font=t),e.save(),e.font=t;let a=0,l=n.length,c,u,d,h,p;for(c=0;c<l;c++)if(h=n[c],h!=null&&!Q(h))a=Tn(e,r,o,a,h);else if(Q(h))for(u=0,d=h.length;u<d;u++)p=h[u],p!=null&&!Q(p)&&(a=Tn(e,r,o,a,p));e.restore();let m=o.length/2;if(m>n.length){for(c=0;c<m;c++)delete r[o[c]];o.splice(0,m)}return a}function ye(e,t,n){let s=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*s)/s+r}function Ts(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ci(e,t,n,s){Es(e,t,n,s,null)}function Es(e,t,n,s,r){let o,a,l,c,u,d,h,p,m=t.pointStyle,b=t.rotation,y=t.radius,x=(b||0)*Va;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,s),e.rotate(x),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),m){default:r?e.ellipse(n,s,r/2,y,0,0,J):e.arc(n,s,y,0,J),e.closePath();break;case"triangle":d=r?r/2:y,e.moveTo(n+Math.sin(x)*d,s-Math.cos(x)*y),x+=Vr,e.lineTo(n+Math.sin(x)*d,s-Math.cos(x)*y),x+=Vr,e.lineTo(n+Math.sin(x)*d,s-Math.cos(x)*y),e.closePath();break;case"rectRounded":u=y*.516,c=y-u,a=Math.cos(x+Re)*c,h=Math.cos(x+Re)*(r?r/2-u:c),l=Math.sin(x+Re)*c,p=Math.sin(x+Re)*(r?r/2-u:c),e.arc(n-h,s-l,u,x-et,x-it),e.arc(n+p,s-a,u,x-it,x),e.arc(n+h,s+l,u,x,x+it),e.arc(n-p,s+a,u,x+it,x+et),e.closePath();break;case"rect":if(!b){c=Math.SQRT1_2*y,d=r?r/2:c,e.rect(n-d,s-c,2*d,2*c);break}x+=Re;case"rectRot":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,l=Math.sin(x)*y,p=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,s-l),e.lineTo(n+p,s-a),e.lineTo(n+h,s+l),e.lineTo(n-p,s+a),e.closePath();break;case"crossRot":x+=Re;case"cross":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,l=Math.sin(x)*y,p=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,s-l),e.lineTo(n+h,s+l),e.moveTo(n+p,s-a),e.lineTo(n-p,s+a);break;case"star":h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,l=Math.sin(x)*y,p=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,s-l),e.lineTo(n+h,s+l),e.moveTo(n+p,s-a),e.lineTo(n-p,s+a),x+=Re,h=Math.cos(x)*(r?r/2:y),a=Math.cos(x)*y,l=Math.sin(x)*y,p=Math.sin(x)*(r?r/2:y),e.moveTo(n-h,s-l),e.lineTo(n+h,s+l),e.moveTo(n+p,s-a),e.lineTo(n-p,s+a);break;case"line":a=r?r/2:Math.cos(x)*y,l=Math.sin(x)*y,e.moveTo(n-a,s-l),e.lineTo(n+a,s+l);break;case"dash":e.moveTo(n,s),e.lineTo(n+Math.cos(x)*(r?r/2:y),s+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Nt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Pn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Cn(e){e.restore()}function to(e,t,n,s,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else r==="after"!=!!s?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function eo(e,t,n,s){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?n.cp2x:n.cp1x,s?n.cp2y:n.cp1y,n.x,n.y)}function Cf(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),K(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function kf(e,t,n,s,r){if(r.strikethrough||r.underline){let o=e.measureText(s),a=t-o.actualBoundingBoxLeft,l=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,u=n+o.actualBoundingBoxDescent,d=r.strikethrough?(c+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,d),e.lineTo(l,d),e.stroke()}}function Af(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function _e(e,t,n,s,r,o={}){let a=Q(t)?t:[t],l=o.strokeWidth>0&&o.strokeColor!=="",c,u;for(e.save(),e.font=r.string,Cf(e,o),c=0;c<a.length;++c)u=a[c],o.backdrop&&Af(e,o.backdrop),l&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),K(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(u,n,s,o.maxWidth)),e.fillText(u,n,s,o.maxWidth),kf(e,n,s,u,o),s+=Number(r.lineHeight);e.restore()}function on(e,t){let{x:n,y:s,w:r,h:o,radius:a}=t;e.arc(n+a.topLeft,s+a.topLeft,a.topLeft,-it,et,!0),e.lineTo(n,s+o-a.bottomLeft),e.arc(n+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,et,it,!0),e.lineTo(n+r-a.bottomRight,s+o),e.arc(n+r-a.bottomRight,s+o-a.bottomRight,a.bottomRight,it,0,!0),e.lineTo(n+r,s+a.topRight),e.arc(n+r-a.topRight,s+a.topRight,a.topRight,0,-it,!0),e.lineTo(n+a.topLeft,s)}var Of=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Df=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Xa(e,t){let n=(""+e).match(Of);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}var Lf=e=>+e||0;function ui(e,t){let n={},s=q(t),r=s?Object.keys(t):t,o=q(e)?s?a=>H(e[a],e[t[a]]):a=>e[a]:()=>e;for(let a of r)n[a]=Lf(o(a));return n}function Ms(e){return ui(e,{top:"y",right:"x",bottom:"y",left:"x"})}function xe(e){return ui(e,["topLeft","topRight","bottomLeft","bottomRight"])}function mt(e){let t=Ms(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ut(e,t){e=e||{},t=t||ot.font;let n=H(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let s=H(e.style,t.style);s&&!(""+s).match(Df)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let r={family:H(e.family,t.family),lineHeight:Xa(H(e.lineHeight,t.lineHeight),n),size:n,style:s,weight:H(e.weight,t.weight),string:""};return r.string=Ua(r),r}function an(e,t,n,s){let r=!0,o,a,l;for(o=0,a=e.length;o<a;++o)if(l=e[o],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),r=!1),n!==void 0&&Q(l)&&(l=l[n%l.length],r=!1),l!==void 0))return s&&!r&&(s.cacheable=!1),l}function no(e,t,n){let{min:s,max:r}=e,o=cs(t,(r-s)/2),a=(l,c)=>n&&l===0?0:l+c;return{min:a(s,-Math.abs(o)),max:a(r,o)}}function ae(e,t){return Object.assign(Object.create(e),t)}function fi(e,t=[""],n,s,r=()=>e[0]){let o=n||e;typeof s>"u"&&(s=$a("_fallback",e));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:r,override:l=>fi([l,...e],t,o,s)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return Ya(l,c,()=>Hf(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return Oa(l).includes(c)},ownKeys(l){return Oa(l)},set(l,c,u){let d=l._storage||(l._storage=r());return l[c]=d[c]=u,delete l._keys,!0}})}function Ne(e,t,n,s){let r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Ps(e,s),setContext:o=>Ne(e,o,n,s),override:o=>Ne(e.override(o),t,n,s)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,l){return Ya(o,a,()=>Rf(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,l){return e[a]=l,delete o[a],!0}})}function Ps(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:s=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:s,isScriptable:ie(n)?n:()=>n,isIndexable:ie(s)?s:()=>s}}var If=(e,t)=>e?e+si(t):t,io=(e,t)=>q(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ya(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let s=n();return e[t]=s,s}function Rf(e,t,n){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e,l=s[t];return ie(l)&&a.isScriptable(t)&&(l=Nf(t,l,e,n)),Q(l)&&l.length&&(l=Ff(t,l,e,a.isIndexable)),io(t,l)&&(l=Ne(l,r,o&&o[t],a)),l}function Nf(e,t,n,s){let{_proxy:r,_context:o,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(o,a||s);return l.delete(e),io(e,c)&&(c=so(r._scopes,r,e,c)),c}function Ff(e,t,n,s){let{_proxy:r,_context:o,_subProxy:a,_descriptors:l}=n;if(typeof o.index<"u"&&s(e))return t[o.index%t.length];if(q(t[0])){let c=t,u=r._scopes.filter(d=>d!==c);t=[];for(let d of c){let h=so(u,r,e,d);t.push(Ne(h,o,a&&a[e],l))}}return t}function qa(e,t,n){return ie(e)?e(t,n):e}var zf=(e,t)=>e===!0?t:typeof e=="string"?re(t,e):void 0;function Bf(e,t,n,s,r){for(let o of t){let a=zf(n,o);if(a){e.add(a);let l=qa(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==s)return l}else if(a===!1&&typeof s<"u"&&n!==s)return null}return!1}function so(e,t,n,s){let r=t._rootScopes,o=qa(t._fallback,n,s),a=[...e,...r],l=new Set;l.add(s);let c=Aa(l,a,n,o||n,s);return c===null||typeof o<"u"&&o!==n&&(c=Aa(l,a,o,c,s),c===null)?!1:fi(Array.from(l),[""],r,o,()=>Vf(t,n,s))}function Aa(e,t,n,s,r){for(;n;)n=Bf(e,t,n,s,r);return n}function Vf(e,t,n){let s=e._getTarget();t in s||(s[t]={});let r=s[t];return Q(r)&&q(n)?n:r||{}}function Hf(e,t,n,s){let r;for(let o of t)if(r=$a(If(o,e),n),typeof r<"u")return io(e,r)?so(n,s,e,r):r}function $a(e,t){for(let n of t){if(!n)continue;let s=n[e];if(typeof s<"u")return s}}function Oa(e){let t=e._keys;return t||(t=e._keys=Wf(e._scopes)),t}function Wf(e){let t=new Set;for(let n of e)for(let s of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(s);return Array.from(t)}function Cs(e,t,n,s){let{iScale:r}=e,{key:o="r"}=this._parsing,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+n,d=t[u],a[l]={r:r.parse(re(d,o),u)};return a}var jf=Number.EPSILON||1e-14,En=(e,t)=>t<e.length&&!e[t].skip&&e[t],Ga=e=>e==="x"?"y":"x";function Ka(e,t,n,s){let r=e.skip?t:e,o=t,a=n.skip?t:n,l=ii(o,r),c=ii(a,o),u=l/(l+c),d=c/(l+c);u=isNaN(u)?0:u,d=isNaN(d)?0:d;let h=s*u,p=s*d;return{previous:{x:o.x-h*(a.x-r.x),y:o.y-h*(a.y-r.y)},next:{x:o.x+p*(a.x-r.x),y:o.y+p*(a.y-r.y)}}}function Uf(e,t,n){let s=e.length,r,o,a,l,c,u=En(e,0);for(let d=0;d<s-1;++d)if(c=u,u=En(e,d+1),!(!c||!u)){if(oe(t[d],0,jf)){n[d]=n[d+1]=0;continue}r=n[d]/t[d],o=n[d+1]/t[d],l=Math.pow(r,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),n[d]=r*a*t[d],n[d+1]=o*a*t[d])}}function Xf(e,t,n="x"){let s=Ga(n),r=e.length,o,a,l,c=En(e,0);for(let u=0;u<r;++u){if(a=l,l=c,c=En(e,u+1),!l)continue;let d=l[n],h=l[s];a&&(o=(d-a[n])/3,l[`cp1${n}`]=d-o,l[`cp1${s}`]=h-o*t[u]),c&&(o=(c[n]-d)/3,l[`cp2${n}`]=d+o,l[`cp2${s}`]=h+o*t[u])}}function Za(e,t="x"){let n=Ga(t),s=e.length,r=Array(s).fill(0),o=Array(s),a,l,c,u=En(e,0);for(a=0;a<s;++a)if(l=c,c=u,u=En(e,a+1),!!c){if(u){let d=u[t]-c[t];r[a]=d!==0?(u[n]-c[n])/d:0}o[a]=l?u?Pt(r[a-1])!==Pt(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Uf(e,r,o),Xf(e,o,t)}function rs(e,t,n){return Math.max(Math.min(e,n),t)}function Yf(e,t){let n,s,r,o,a,l=Nt(e[0],t);for(n=0,s=e.length;n<s;++n)a=o,o=l,l=n<s-1&&Nt(e[n+1],t),o&&(r=e[n],a&&(r.cp1x=rs(r.cp1x,t.left,t.right),r.cp1y=rs(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=rs(r.cp2x,t.left,t.right),r.cp2y=rs(r.cp2y,t.top,t.bottom)))}function ro(e,t,n,s,r){let o,a,l,c;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")Za(e,r);else{let u=s?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)l=e[o],c=Ka(u,l,e[Math.min(o+1,a-(s?0:1))%a],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,u=l}t.capBezierPoints&&Yf(e,n)}function ks(){return typeof window<"u"&&typeof document<"u"}function di(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ls(e,t,n){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*t.parentNode[n])):s=e,s}var As=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Qa(e,t){return As(e).getPropertyValue(t)}var qf=["top","right","bottom","left"];function Je(e,t,n){let s={};n=n?"-"+n:"";for(let r=0;r<4;r++){let o=qf[r];s[o]=parseFloat(e[t+"-"+o+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var $f=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Gf(e,t){let n=e.touches,s=n&&n.length?n[0]:e,{offsetX:r,offsetY:o}=s,a=!1,l,c;if($f(r,o,e.target))l=r,c=o;else{let u=t.getBoundingClientRect();l=s.clientX-u.left,c=s.clientY-u.top,a=!0}return{x:l,y:c,box:a}}function zt(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:s}=t,r=As(n),o=r.boxSizing==="border-box",a=Je(r,"padding"),l=Je(r,"border","width"),{x:c,y:u,box:d}=Gf(e,n),h=a.left+(d&&l.left),p=a.top+(d&&l.top),{width:m,height:b}=t;return o&&(m-=a.width+l.width,b-=a.height+l.height),{x:Math.round((c-h)/m*n.width/s),y:Math.round((u-p)/b*n.height/s)}}function Kf(e,t,n){let s,r;if(t===void 0||n===void 0){let o=di(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let a=o.getBoundingClientRect(),l=As(o),c=Je(l,"border","width"),u=Je(l,"padding");t=a.width-u.width-c.width,n=a.height-u.height-c.height,s=ls(l.maxWidth,o,"clientWidth"),r=ls(l.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:s||ni,maxHeight:r||ni}}var os=e=>Math.round(e*10)/10;function oo(e,t,n,s){let r=As(e),o=Je(r,"margin"),a=ls(r.maxWidth,e,"clientWidth")||ni,l=ls(r.maxHeight,e,"clientHeight")||ni,c=Kf(e,t,n),{width:u,height:d}=c;if(r.boxSizing==="content-box"){let p=Je(r,"border","width"),m=Je(r,"padding");u-=m.width+p.width,d-=m.height+p.height}return u=Math.max(0,u-o.width),d=Math.max(0,s?u/s:d-o.height),u=os(Math.min(u,a,c.maxWidth)),d=os(Math.min(d,l,c.maxHeight)),u&&!d&&(d=os(u/2)),(t!==void 0||n!==void 0)&&s&&c.height&&d>c.height&&(d=c.height,u=os(Math.floor(d*s))),{width:u,height:d}}function Os(e,t,n){let s=t||1,r=Math.floor(e.height*s),o=Math.floor(e.width*s);e.height=Math.floor(e.height),e.width=Math.floor(e.width);let a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||a.height!==r||a.width!==o?(e.currentDevicePixelRatio=s,a.height=r,a.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}var ao=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function Ds(e,t){let n=Qa(e,t),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function be(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function lo(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:s==="middle"?n<.5?e.y:t.y:s==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function co(e,t,n,s){let r={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=be(e,r,n),l=be(r,o,n),c=be(o,t,n),u=be(a,l,n),d=be(l,c,n);return be(u,d,n)}var Zf=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},Qf=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Be(e,t,n){return e?Zf(t,n):Qf()}function Ls(e,t){let n,s;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=s)}function Is(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Ja(e){return e==="angle"?{between:sn,compare:Ha,normalize:Mt}:{between:Zt,compare:(t,n)=>t-n,normalize:t=>t}}function Da({start:e,end:t,count:n,loop:s,style:r}){return{start:e%n,end:t%n,loop:s&&(t-e+1)%n===0,style:r}}function Jf(e,t,n){let{property:s,start:r,end:o}=n,{between:a,normalize:l}=Ja(s),c=t.length,{start:u,end:d,loop:h}=e,p,m;if(h){for(u+=c,d+=c,p=0,m=c;p<m&&a(l(t[u%c][s]),r,o);++p)u--,d--;u%=c,d%=c}return d<u&&(d+=c),{start:u,end:d,loop:h,style:e.style}}function Rs(e,t,n){if(!n)return[e];let{property:s,start:r,end:o}=n,a=t.length,{compare:l,between:c,normalize:u}=Ja(s),{start:d,end:h,loop:p,style:m}=Jf(e,t,n),b=[],y=!1,x=null,w,E,A,O=()=>c(r,A,w)&&l(r,A)!==0,k=()=>l(o,w)===0||c(o,A,w),L=()=>y||O(),M=()=>!y||k();for(let P=d,C=d;P<=h;++P)E=t[P%a],!E.skip&&(w=u(E[s]),w!==A&&(y=c(w,r,o),x===null&&L()&&(x=l(w,r)===0?P:C),x!==null&&M()&&(b.push(Da({start:x,end:P,loop:p,count:a,style:m})),x=null),C=P,A=w));return x!==null&&b.push(Da({start:x,end:h,loop:p,count:a,style:m})),b}function Ns(e,t){let n=[],s=e.segments;for(let r=0;r<s.length;r++){let o=Rs(s[r],e.points,t);o.length&&n.push(...o)}return n}function td(e,t,n,s){let r=0,o=t-1;if(n&&!s)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(o+=r);o>r&&e[o%t].skip;)o--;return o%=t,{start:r,end:o}}function ed(e,t,n,s){let r=e.length,o=[],a=t,l=e[t],c;for(c=t+1;c<=n;++c){let u=e[c%r];u.skip||u.stop?l.skip||(s=!1,o.push({start:t%r,end:(c-1)%r,loop:s}),t=a=u.stop?c:null):(a=c,l.skip&&(t=c)),l=u}return a!==null&&o.push({start:t%r,end:a%r,loop:s}),o}function uo(e,t){let n=e.points,s=e.options.spanGaps,r=n.length;if(!r)return[];let o=!!e._loop,{start:a,end:l}=td(n,r,o,s);if(s===!0)return La(e,[{start:a,end:l,loop:o}],n,t);let c=l<a?l+r:l,u=!!e._fullLoop&&a===0&&l===r-1;return La(e,ed(n,a,c,u),n,t)}function La(e,t,n,s){return!s||!s.setContext||!n?t:nd(e,t,n,s)}function nd(e,t,n,s){let r=e._chart.getContext(),o=Ia(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,c=n.length,u=[],d=o,h=t[0].start,p=h;function m(b,y,x,w){let E=l?-1:1;if(b!==y){for(b+=c;n[b%c].skip;)b-=E;for(;n[y%c].skip;)y+=E;b%c!==y%c&&(u.push({start:b%c,end:y%c,loop:x,style:w}),d=w,h=y%c)}}for(let b of t){h=l?h:b.start;let y=n[h%c],x;for(p=h+1;p<=b.end;p++){let w=n[p%c];x=Ia(s.setContext(ae(r,{type:"segment",p0:y,p1:w,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:a}))),id(x,d)&&m(h,p-1,b.loop,d),y=w,d=x}h<p-1&&m(h,p-1,b.loop,d)}return u}function Ia(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function id(e,t){if(!t)return!1;let n=[],s=function(r,o){return xs(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,s)!==JSON.stringify(t,s)}var xo=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,s,r){let o=n.listeners[r],a=n.duration;o.forEach(l=>l({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(s-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=vs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((s,r)=>{if(!s.running||!s.items.length)return;let o=s.items,a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),l=!0):(o[a]=o[o.length-1],o.pop());l&&(r.draw(),this._notify(r,s,t,"progress")),o.length||(s.running=!1,this._notify(r,s,t,"complete"),s.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){let n=this._charts,s=n.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,s)),s}listen(t,n,s){this._getAnims(t).listeners[n].push(s)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){let n=this._charts.get(t);!n||(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,r)=>Math.max(s,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let s=n.items,r=s.length-1;for(;r>=0;--r)s[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},we=new xo,tl="transparent",sd={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let s=ws(e||tl),r=s.valid&&ws(t||tl);return r&&r.valid?r.mix(s,n).hexString():t},number(e,t,n){return e+(t-e)*n}},wo=class{constructor(t,n,s,r){let o=n[s];r=an([t.to,r,o,t.from]);let a=an([t.from,o,r]);this._active=!0,this._fn=t.fn||sd[t.type||typeof a],this._easing=Qe[t.easing]||Qe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=s,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,s){if(this._active){this._notify(!1);let r=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=an([t.to,n,r,t.from]),this._from=an([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,s=this._duration,r=this._prop,o=this._from,a=this._loop,l=this._to,c;if(this._active=o!==l&&(a||n<s),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=o;return}c=n/s%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(o,l,c)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,s)=>{t.push({res:n,rej:s})})}_notify(t){let n=t?"res":"rej",s=this._promises||[];for(let r=0;r<s.length;r++)s[r][n]()}},Xs=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!q(t))return;let n=Object.keys(ot.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{let o=t[r];if(!q(o))return;let a={};for(let l of n)a[l]=o[l];(Q(o.properties)&&o.properties||[r]).forEach(l=>{(l===r||!s.has(l))&&s.set(l,a)})})}_animateOptions(t,n){let s=n.options,r=od(t,s);if(!r)return[];let o=this._createAnimations(r,s);return s.$shared&&rd(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,n){let s=this._properties,r=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),l=Date.now(),c;for(c=a.length-1;c>=0;--c){let u=a[c];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(t,n));continue}let d=n[u],h=o[u],p=s.get(u);if(h)if(p&&h.active()){h.update(p,d,l);continue}else h.cancel();if(!p||!p.duration){t[u]=d;continue}o[u]=h=new wo(p,t,u,d),r.push(h)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let s=this._createAnimations(t,n);if(s.length)return we.add(this._chart,s),!0}};function rd(e,t){let n=[],s=Object.keys(t);for(let r=0;r<s.length;r++){let o=e[s[r]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function od(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function el(e,t){let n=e&&e.options||{},s=n.reverse,r=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:s?o:r,end:s?r:o}}function ad(e,t,n){if(n===!1)return!1;let s=el(e,n),r=el(t,n);return{top:r.end,right:s.end,bottom:r.start,left:s.start}}function ld(e){let t,n,s,r;return q(e)?(t=e.top,n=e.right,s=e.bottom,r=e.left):t=n=s=r=e,{top:t,right:n,bottom:s,left:r,disabled:e===!1}}function Jl(e,t){let n=[],s=e._getSortedDatasetMetas(t),r,o;for(r=0,o=s.length;r<o;++r)n.push(s[r].index);return n}function nl(e,t,n,s={}){let r=e.keys,o=s.mode==="single",a,l,c,u;if(t!==null){for(a=0,l=r.length;a<l;++a){if(c=+r[a],c===n){if(s.all)continue;break}u=e.values[c],st(u)&&(o||t===0||Pt(t)===Pt(u))&&(t+=u)}return t}}function cd(e){let t=Object.keys(e),n=new Array(t.length),s,r,o;for(s=0,r=t.length;s<r;++s)o=t[s],n[s]={x:o,y:e[o]};return n}function il(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function ud(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function fd(e){let{min:t,max:n,minDefined:s,maxDefined:r}=e.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function dd(e,t,n){let s=e[t]||(e[t]={});return s[n]||(s[n]={})}function sl(e,t,n,s){for(let r of t.getMatchingVisibleMetas(s).reverse()){let o=e[r.index];if(n&&o>0||!n&&o<0)return r.index}return null}function rl(e,t){let{chart:n,_cachedMeta:s}=e,r=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:l}=s,c=o.axis,u=a.axis,d=ud(o,a,s),h=t.length,p;for(let m=0;m<h;++m){let b=t[m],{[c]:y,[u]:x}=b,w=b._stacks||(b._stacks={});p=w[u]=dd(r,d,y),p[l]=x,p._top=sl(p,a,!0,s.type),p._bottom=sl(p,a,!1,s.type);let E=p._visualValues||(p._visualValues={});E[l]=x}}function fo(e,t){let n=e.scales;return Object.keys(n).filter(s=>n[s].axis===t).shift()}function hd(e,t){return ae(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pd(e,t,n){return ae(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hi(e,t){let n=e.controller.index,s=e.vScale&&e.vScale.axis;if(!!s){t=t||e._parsed;for(let r of t){let o=r._stacks;if(!o||o[s]===void 0||o[s][n]===void 0)return;delete o[s][n],o[s]._visualValues!==void 0&&o[s]._visualValues[n]!==void 0&&delete o[s]._visualValues[n]}}}var ho=e=>e==="reset"||e==="none",ol=(e,t)=>t?e:Object.assign({},e),gd=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Jl(n,!0),values:null},Bt=class{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=il(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&&hi(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,s=this.getDataset(),r=(h,p,m,b)=>h==="x"?p:h==="r"?b:m,o=n.xAxisID=H(s.xAxisID,fo(t,"x")),a=n.yAxisID=H(s.yAxisID,fo(t,"y")),l=n.rAxisID=H(s.rAxisID,fo(t,"r")),c=n.indexAxis,u=n.iAxisID=r(c,o,a,l),d=n.vAxisID=r(c,a,o,l);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&gs(this._data,this),t._stacked&&hi(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(q(n))this._data=cd(n);else if(s!==n){if(s){gs(s,this);let r=this._cachedMeta;hi(r),r._parsed=[]}n&&Object.isExtensible(n)&&Kr(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,s=this.getDataset(),r=!1;this._dataCheck();let o=n._stacked;n._stacked=il(n.vScale,n),n.stack!==s.stack&&(r=!0,hi(n),n.stack=s.stack),this._resyncElements(t),(r||o!==n._stacked)&&rl(this,n._parsed)}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:s,_data:r}=this,{iScale:o,_stacked:a}=s,l=o.axis,c=t===0&&n===r.length?!0:s._sorted,u=t>0&&s._parsed[t-1],d,h,p;if(this._parsing===!1)s._parsed=r,s._sorted=!0,p=r;else{Q(r[t])?p=this.parseArrayData(s,r,t,n):q(r[t])?p=this.parseObjectData(s,r,t,n):p=this.parsePrimitiveData(s,r,t,n);let m=()=>h[l]===null||u&&h[l]<u[l];for(d=0;d<n;++d)s._parsed[d+t]=h=p[d],c&&(m()&&(c=!1),u=h);s._sorted=c}a&&rl(this,p)}parsePrimitiveData(t,n,s,r){let{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,u=o.getLabels(),d=o===a,h=new Array(r),p,m,b;for(p=0,m=r;p<m;++p)b=p+s,h[p]={[l]:d||o.parse(u[b],b),[c]:a.parse(n[b],b)};return h}parseArrayData(t,n,s,r){let{xScale:o,yScale:a}=t,l=new Array(r),c,u,d,h;for(c=0,u=r;c<u;++c)d=c+s,h=n[d],l[c]={x:o.parse(h[0],d),y:a.parse(h[1],d)};return l}parseObjectData(t,n,s,r){let{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=new Array(r),d,h,p,m;for(d=0,h=r;d<h;++d)p=d+s,m=n[p],u[d]={x:o.parse(re(m,l),p),y:a.parse(re(m,c),p)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,s){let r=this.chart,o=this._cachedMeta,a=n[t.axis],l={keys:Jl(r,!0),values:n._stacks[t.axis]._visualValues};return nl(l,a,o.index,{mode:s})}updateRangeFromParsed(t,n,s,r){let o=s[n.axis],a=o===null?NaN:o,l=r&&s._stacks[n.axis];r&&l&&(r.values=l,a=nl(r,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){let s=this._cachedMeta,r=s._parsed,o=s._sorted&&t===s.iScale,a=r.length,l=this._getOtherScale(t),c=gd(n,s,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=fd(l),p,m;function b(){m=r[p];let y=m[l.axis];return!st(m[t.axis])||d>y||h<y}for(p=0;p<a&&!(!b()&&(this.updateRangeFromParsed(u,t,m,c),o));++p);if(o){for(p=a-1;p>=0;--p)if(!b()){this.updateRangeFromParsed(u,t,m,c);break}}return u}getAllParsedValues(t){let n=this._cachedMeta._parsed,s=[],r,o,a;for(r=0,o=n.length;r<o;++r)a=n[r][t.axis],st(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,s=n.iScale,r=n.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=ld(H(this.options.clip,ad(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,s=this._cachedMeta,r=s.data||[],o=n.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||r.length-l,u=this.options.drawActiveElementsOnTop,d;for(s.dataset&&s.dataset.draw(t,o,l,c),d=l;d<l+c;++d){let h=r[d];h.hidden||(h.active&&u?a.push(h):h.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,n){let s=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,n,s){let r=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=pd(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=r.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=hd(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",s){let r=n==="active",o=this._cachedDataOpts,a=t+"-"+n,l=o[a],c=this.enableOptionSharing&&nn(s);if(l)return ol(l,c);let u=this.chart.config,d=u.datasetElementScopeKeys(this._type,t),h=r?[`${t}Hover`,"hover",t,""]:[t,""],p=u.getOptionScopes(this.getDataset(),d),m=Object.keys(ot.elements[t]),b=()=>this.getContext(s,r,n),y=u.resolveNamedOptions(p,m,b,h);return y.$shared&&(y.$shared=c,o[a]=Object.freeze(ol(y,c))),y}_resolveAnimations(t,n,s){let r=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,l=o[a];if(l)return l;let c;if(r.options.animation!==!1){let d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),p=d.getOptionScopes(this.getDataset(),h);c=d.createResolver(p,this.getContext(t,s,n))}let u=new Xs(r,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ho(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let s=this.resolveDataElementOptions(t,n),r=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(n,o)||o!==r;return this.updateSharedOptions(o,n,s),{sharedOptions:o,includeOptions:a}}updateElement(t,n,s,r){ho(r)?Object.assign(t,s):this._resolveAnimations(n,r).update(t,s)}updateSharedOptions(t,n,s){t&&!ho(n)&&this._resolveAnimations(void 0,n).update(t,s)}_setStyle(t,n,s,r){t.active=r;let o=this.getStyle(n,r);this._resolveAnimations(n,s,r).update(t,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,n,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,s=this._cachedMeta.data;for(let[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];let r=s.length,o=n.length,a=Math.min(o,r);a&&this.parse(0,a),o>r?this._insertElements(r,o-r,t):o<r&&this._removeElements(o,r-o)}_insertElements(t,n,s=!0){let r=this._cachedMeta,o=r.data,a=t+n,l,c=u=>{for(u.length+=n,l=u.length-1;l>=a;l--)u[l]=u[l-n]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,n),s&&this.updateElements(o,t,n,"reset")}updateElements(t,n,s,r){}_removeElements(t,n){let s=this._cachedMeta;if(this._parsing){let r=s._parsed.splice(t,n);s._stacked&&hi(s,r)}s.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,s,r]=t;this[n](s,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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,n){n&&this._sync(["_removeElements",t,n]);let s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(Bt,"defaults",{}),F(Bt,"datasetElementType",null),F(Bt,"dataElementType",null);function md(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),s=[];for(let r=0,o=n.length;r<o;r++)s=s.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=ms(s.sort((r,o)=>r-o))}return e._cache.$bar}function vd(e){let t=e.iScale,n=md(t,e.type),s=t._length,r,o,a,l,c=()=>{a===32767||a===-32768||(nn(l)&&(s=Math.min(s,Math.abs(a-l)||s)),l=a)};for(r=0,o=n.length;r<o;++r)a=t.getPixelForValue(n[r]),c();for(l=void 0,r=0,o=t.ticks.length;r<o;++r)a=t.getPixelForTick(r),c();return s}function bd(e,t,n,s){let r=n.barThickness,o,a;return K(r)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=r*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[e]-o/2}}function yd(e,t,n,s){let r=t.pixels,o=r[e],a=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null,c=n.categoryPercentage;a===null&&(a=o-(l===null?t.end-t.start:l-o)),l===null&&(l=o+o-a);let u=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/s,ratio:n.barPercentage,start:u}}function _d(e,t,n,s){let r=n.parse(e[0],s),o=n.parse(e[1],s),a=Math.min(r,o),l=Math.max(r,o),c=a,u=l;Math.abs(a)>Math.abs(l)&&(c=l,u=a),t[n.axis]=u,t._custom={barStart:c,barEnd:u,start:r,end:o,min:a,max:l}}function tc(e,t,n,s){return Q(e)?_d(e,t,n,s):t[n.axis]=n.parse(e,s),t}function al(e,t,n,s){let r=e.iScale,o=e.vScale,a=r.getLabels(),l=r===o,c=[],u,d,h,p;for(u=n,d=n+s;u<d;++u)p=t[u],h={},h[r.axis]=l||r.parse(a[u],u),c.push(tc(p,h,o,u));return c}function po(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function xd(e,t,n){return e!==0?Pt(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function wd(e){let t,n,s,r,o;return e.horizontal?(t=e.base>e.x,n="left",s="right"):(t=e.base<e.y,n="bottom",s="top"),t?(r="end",o="start"):(r="start",o="end"),{start:n,end:s,reverse:t,top:r,bottom:o}}function Sd(e,t,n,s){let r=t.borderSkipped,o={};if(!r){e.borderSkipped=o;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:a,end:l,reverse:c,top:u,bottom:d}=wd(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===s?r=u:(n._bottom||0)===s?r=d:(o[ll(d,a,l,c)]=!0,r=u)),o[ll(r,a,l,c)]=!0,e.borderSkipped=o}function ll(e,t,n,s){return s?(e=Td(e,t,n),e=cl(e,n,t)):e=cl(e,t,n),e}function Td(e,t,n){return e===t?n:e===n?t:e}function cl(e,t,n){return e==="start"?t:e==="end"?n:e}function Ed(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}var An=class extends Bt{parsePrimitiveData(t,n,s,r){return al(t,n,s,r)}parseArrayData(t,n,s,r){return al(t,n,s,r)}parseObjectData(t,n,s,r){let{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=o.axis==="x"?l:c,d=a.axis==="x"?l:c,h=[],p,m,b,y;for(p=s,m=s+r;p<m;++p)y=n[p],b={},b[o.axis]=o.parse(re(y,u),p),h.push(tc(re(y,d),b,a,p));return h}updateRangeFromParsed(t,n,s,r){super.updateRangeFromParsed(t,n,s,r);let o=s._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let n=this._cachedMeta,{iScale:s,vScale:r}=n,o=this.getParsed(t),a=o._custom,l=po(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,s,r){let o=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),u=l.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:p}=this._getSharedOptions(n,r);for(let m=n;m<n+s;m++){let b=this.getParsed(m),y=o||K(b[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,d),w=(b._stacks||{})[l.axis],E={horizontal:u,base:y.base,enableBorderRadius:!w||po(b._custom)||a===w._top||a===w._bottom,x:u?y.head:x.center,y:u?x.center:y.head,height:u?x.size:Math.abs(y.size),width:u?Math.abs(y.size):x.size};p&&(E.options=h||this.resolveDataElementOptions(m,t[m].active?"active":r));let A=E.options||t[m].options;Sd(E,A,w,a),Ed(E,A,d.ratio),this.updateElement(t[m],m,E,r)}}_getStacks(t,n){let{iScale:s}=this._cachedMeta,r=s.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=s.options.stacked,a=[],l=c=>{let u=c.controller.getParsed(n),d=u&&u[c.vScale.axis];if(K(d)||isNaN(d))return!0};for(let c of r)if(!(n!==void 0&&l(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,s){let r=this._getStacks(t,s),o=n!==void 0?r.indexOf(n):-1;return o===-1?r.length-1:o}_getRuler(){let t=this.options,n=this._cachedMeta,s=n.iScale,r=[],o,a;for(o=0,a=n.data.length;o<a;++o)r.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));let l=t.barThickness;return{min:l||vd(n),pixels:r,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:n,_stacked:s,index:r},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),u=c._custom,d=po(u),h=c[n.axis],p=0,m=s?this.applyStack(n,c,s):h,b,y;m!==h&&(p=m-h,m=h),d&&(h=u.barStart,m=u.barEnd-u.barStart,h!==0&&Pt(h)!==Pt(u.barEnd)&&(p=0),p+=h);let x=!K(o)&&!d?o:p,w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?b=n.getPixelForValue(p+m):b=w,y=b-w,Math.abs(y)<a){y=xd(y,n,l)*a,h===l&&(w-=y/2);let E=n.getPixelForDecimal(0),A=n.getPixelForDecimal(1),O=Math.min(E,A),k=Math.max(E,A);w=Math.max(Math.min(w,k),O),b=w+y,s&&!d&&(c._stacks[n.axis]._visualValues[r]=n.getValueForPixel(b)-n.getValueForPixel(w))}if(w===n.getPixelForValue(l)){let E=Pt(y)*n.getLineWidthForValue(l)/2;w+=E,y-=E}return{size:y,base:w,head:b,center:b+y/2}}_calculateBarIndexPixels(t,n){let s=n.scale,r=this.options,o=r.skipNull,a=H(r.maxBarThickness,1/0),l,c;if(n.grouped){let u=o?this._getStackCount(t):n.stackCount,d=r.barThickness==="flex"?yd(t,n,r,u):bd(t,n,r,u),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=d.start+d.chunk*h+d.chunk/2,c=Math.min(a,d.chunk*d.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(a,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,n=t.vScale,s=t.data,r=s.length,o=0;for(;o<r;++o)this.getParsed(o)[n.axis]!==null&&s[o].draw(this._ctx)}};F(An,"id","bar"),F(An,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),F(An,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var On=class extends Bt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,s,r){let o=super.parsePrimitiveData(t,n,s,r);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,n,s,r){let o=super.parseArrayData(t,n,s,r);for(let a=0;a<o.length;a++){let l=n[s+a];o[a]._custom=H(l[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,n,s,r){let o=super.parseObjectData(t,n,s,r);for(let a=0;a<o.length;a++){let l=n[s+a];o[a]._custom=H(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,n=0;for(let s=t.length-1;s>=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:r,yScale:o}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),c=o.getLabelForValue(a.y),u=a._custom;return{label:s[t]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(t){let n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,s,r){let o=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(n,r),d=a.axis,h=l.axis;for(let p=n;p<n+s;p++){let m=t[p],b=!o&&this.getParsed(p),y={},x=y[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(b[d]),w=y[h]=o?l.getBasePixel():l.getPixelForValue(b[h]);y.skip=isNaN(x)||isNaN(w),u&&(y.options=c||this.resolveDataElementOptions(p,m.active?"active":r),o&&(y.options.radius=0)),this.updateElement(m,p,y,r)}}resolveDataElementOptions(t,n){let s=this.getParsed(t),r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));let o=r.radius;return n!=="active"&&(r.radius=0),r.radius+=H(s&&s._custom,o),r}};F(On,"id","bubble"),F(On,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),F(On,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Md(e,t,n){let s=1,r=1,o=0,a=0;if(t<J){let l=e,c=l+t,u=Math.cos(l),d=Math.sin(l),h=Math.cos(c),p=Math.sin(c),m=(A,O,k)=>sn(A,l,c,!0)?1:Math.max(O,O*n,k,k*n),b=(A,O,k)=>sn(A,l,c,!0)?-1:Math.min(O,O*n,k,k*n),y=m(0,u,h),x=m(it,d,p),w=b(et,u,h),E=b(et+it,d,p);s=(y-w)/2,r=(x-E)/2,o=-(y+w)/2,a=-(x+E)/2}return{ratioX:s,ratioY:r,offsetX:o,offsetY:a}}var Te=class extends Bt{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){let s=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=s;else{let o=c=>+s[c];if(q(s[t])){let{key:c="value"}=this._parsing;o=u=>+re(s[u],c)}let a,l;for(a=t,l=t+n;a<l;++a)r._parsed[a]=o(a)}}_getRotation(){return Ft(this.options.rotation-90)}_getCircumference(){return Ft(this.options.circumference)}_getRotationExtents(){let t=J,n=-J;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){let r=this.chart.getDatasetMeta(s).controller,o=r._getRotation(),a=r._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){let n=this.chart,{chartArea:s}=n,r=this._cachedMeta,o=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min(jr(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:b,offsetY:y}=Md(h,d,c),x=(s.width-a)/p,w=(s.height-a)/m,E=Math.max(Math.min(x,w)/2,0),A=cs(this.options.radius,E),O=Math.max(A*c,0),k=(A-O)/this._getVisibleDatasetWeightTotal();this.offsetX=b*A,this.offsetY=y*A,r.total=this.calculateTotal(),this.outerRadius=A-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*u,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){let s=this.options,r=this._cachedMeta,o=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*o/J)}updateElements(t,n,s,r){let o=r==="reset",a=this.chart,l=a.chartArea,u=a.options.animation,d=(l.left+l.right)/2,h=(l.top+l.bottom)/2,p=o&&u.animateScale,m=p?0:this.innerRadius,b=p?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,r),w=this._getRotation(),E;for(E=0;E<n;++E)w+=this._circumference(E,o);for(E=n;E<n+s;++E){let A=this._circumference(E,o),O=t[E],k={x:d+this.offsetX,y:h+this.offsetY,startAngle:w,endAngle:w+A,circumference:A,outerRadius:b,innerRadius:m};x&&(k.options=y||this.resolveDataElementOptions(E,O.active?"active":r)),w+=A,this.updateElement(O,E,k,r)}}calculateTotal(){let t=this._cachedMeta,n=t.data,s=0,r;for(r=0;r<n.length;r++){let o=t._parsed[r];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){let n=this._cachedMeta.total;return n>0&&!isNaN(t)?J*(Math.abs(t)/n):0}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,r=s.data.labels||[],o=rn(n._parsed[t],s.options.locale);return{label:r[t]||"",value:o}}getMaxBorderWidth(t){let n=0,s=this.chart,r,o,a,l,c;if(!t){for(r=0,o=s.data.datasets.length;r<o;++r)if(s.isDatasetVisible(r)){a=s.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,o=t.length;r<o;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let s=0,r=t.length;s<r;++s){let o=this.resolveDataElementOptions(s);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n}_getRingWeight(t){return Math.max(H(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};F(Te,"id","doughnut"),F(Te,"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"}),F(Te,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),F(Te,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:s,color:r}}=t.legend.options;return n.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}}});var Dn=class extends Bt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:s,data:r=[],_dataset:o}=n,a=this.chart._animationsDisabled,{start:l,count:c}=ys(n,r,a);this._drawStart=l,this._drawCount=c,_s(n)&&(l=0,c=r.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=r;let u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:u},t),this.updateElements(r,l,c,t)}updateElements(t,n,s,r){let o=r==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,r),p=a.axis,m=l.axis,{spanGaps:b,segment:y}=this.options,x=Fe(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||r==="none",E=n+s,A=t.length,O=n>0&&this.getParsed(n-1);for(let k=0;k<A;++k){let L=t[k],M=w?L:{};if(k<n||k>=E){M.skip=!0;continue}let P=this.getParsed(k),C=K(P[m]),I=M[p]=a.getPixelForValue(P[p],k),z=M[m]=o||C?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,P,c):P[m],k);M.skip=isNaN(I)||isNaN(z)||C,M.stop=k>0&&Math.abs(P[p]-O[p])>x,y&&(M.parsed=P,M.raw=u.data[k]),h&&(M.options=d||this.resolveDataElementOptions(k,L.active?"active":r)),w||this.updateElement(L,k,M,r),O=P}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return s;let o=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(s,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(Dn,"id","line"),F(Dn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Dn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var dn=class extends Bt{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,r=s.data.labels||[],o=rn(n._parsed[t].r,s.options.locale);return{label:r[t]||"",value:o}}parseObjectData(t,n,s,r){return Cs.bind(this)(t,n,s,r)}update(t){let n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){let t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,r)=>{let o=this.getParsed(r).r;!isNaN(o)&&this.chart.getDataVisibility(r)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){let t=this.chart,n=t.chartArea,s=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(r/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,s,r){let o=r==="reset",a=this.chart,c=a.options.animation,u=this._cachedMeta.rScale,d=u.xCenter,h=u.yCenter,p=u.getIndexAngle(0)-.5*et,m=p,b,y=360/this.countVisibleElements();for(b=0;b<n;++b)m+=this._computeAngle(b,r,y);for(b=n;b<n+s;b++){let x=t[b],w=m,E=m+this._computeAngle(b,r,y),A=a.getDataVisibility(b)?u.getDistanceFromCenterForValue(this.getParsed(b).r):0;m=E,o&&(c.animateScale&&(A=0),c.animateRotate&&(w=E=p));let O={x:d,y:h,innerRadius:0,outerRadius:A,startAngle:w,endAngle:E,options:this.resolveDataElementOptions(b,x.active?"active":r)};this.updateElement(x,b,O,r)}}countVisibleElements(){let t=this._cachedMeta,n=0;return t.data.forEach((s,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?Ft(this.resolveDataElementOptions(t,n).angle||s):0}};F(dn,"id","polarArea"),F(dn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),F(dn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:s,color:r}}=t.legend.options;return n.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var bi=class extends Te{};F(bi,"id","pie"),F(bi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var Ln=class extends Bt{getLabelAndValue(t){let n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])}}parseObjectData(t,n,s,r){return Cs.bind(this)(t,n,s,r)}update(t){let n=this._cachedMeta,s=n.dataset,r=n.data||[],o=n.iScale.getLabels();if(s.points=r,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:o.length===r.length,options:a};this.updateElement(s,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,s,r){let o=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l<n+s;l++){let c=t[l],u=this.resolveDataElementOptions(l,c.active?"active":r),d=o.getPointPositionForValue(l,this.getParsed(l).r),h=a?o.xCenter:d.x,p=a?o.yCenter:d.y,m={x:h,y:p,angle:d.angle,skip:isNaN(h)||isNaN(p),options:u};this.updateElement(c,l,m,r)}}};F(Ln,"id","radar"),F(Ln,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),F(Ln,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var In=class extends Bt{getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:r,yScale:o}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+l+", "+c+")"}}update(t){let n=this._cachedMeta,{data:s=[]}=n,r=this.chart._animationsDisabled,{start:o,count:a}=ys(n,s,r);if(this._drawStart=o,this._drawCount=a,_s(n)&&(o=0,a=s.length),this.options.showLine){let{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;let u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:u},t)}this.updateElements(s,o,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,s,r){let o=r==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,d=this.resolveDataElementOptions(n,r),h=this.getSharedOptions(d),p=this.includeOptions(r,h),m=a.axis,b=l.axis,{spanGaps:y,segment:x}=this.options,w=Fe(y)?y:Number.POSITIVE_INFINITY,E=this.chart._animationsDisabled||o||r==="none",A=n>0&&this.getParsed(n-1);for(let O=n;O<n+s;++O){let k=t[O],L=this.getParsed(O),M=E?k:{},P=K(L[b]),C=M[m]=a.getPixelForValue(L[m],O),I=M[b]=o||P?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,L,c):L[b],O);M.skip=isNaN(C)||isNaN(I)||P,M.stop=O>0&&Math.abs(L[m]-A[m])>w,x&&(M.parsed=L,M.raw=u.data[O]),p&&(M.options=h||this.resolveDataElementOptions(O,k.active?"active":r)),E||this.updateElement(k,O,M,r),A=L}this.updateSharedOptions(h,r,d)}getMaxOverflow(){let t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let s=t.dataset,r=s.options&&s.options.borderWidth||0;if(!n.length)return r;let o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,o,a)/2}};F(In,"id","scatter"),F(In,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),F(In,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Pd=Object.freeze({__proto__:null,BarController:An,BubbleController:On,DoughnutController:Te,LineController:Dn,PieController:bi,PolarAreaController:dn,RadarController:Ln,ScatterController:In});function ln(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Mi=class{static override(t){Object.assign(Mi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ln()}parse(){return ln()}format(){return ln()}add(){return ln()}diff(){return ln()}startOf(){return ln()}endOf(){return ln()}},Cd={_date:Mi};function kd(e,t,n,s){let{controller:r,data:o,_sorted:a}=e,l=r._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&o.length){let c=l._reversePixels?$r:Gt;if(s){if(r._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let h=c(o,t,n-d),p=c(o,t,n+d);return{lo:h.lo,hi:p.hi}}}}else return c(o,t,n)}return{lo:0,hi:o.length-1}}function Ai(e,t,n,s,r){let o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,c=o.length;l<c;++l){let{index:u,data:d}=o[l],{lo:h,hi:p}=kd(o[l],t,a,r);for(let m=h;m<=p;++m){let b=d[m];b.skip||s(b,u,m)}}}function Ad(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(s,r){let o=t?Math.abs(s.x-r.x):0,a=n?Math.abs(s.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function go(e,t,n,s,r){let o=[];return!r&&!e.isPointInArea(t)||Ai(e,n,t,function(l,c,u){!r&&!Nt(l,e.chartArea,0)||l.inRange(t.x,t.y,s)&&o.push({element:l,datasetIndex:c,index:u})},!0),o}function Od(e,t,n,s){let r=[];function o(a,l,c){let{startAngle:u,endAngle:d}=a.getProps(["startAngle","endAngle"],s),{angle:h}=ps(a,{x:t.x,y:t.y});sn(h,u,d)&&r.push({element:a,datasetIndex:l,index:c})}return Ai(e,n,t,o),r}function Dd(e,t,n,s,r,o){let a=[],l=Ad(n),c=Number.POSITIVE_INFINITY;function u(d,h,p){let m=d.inRange(t.x,t.y,r);if(s&&!m)return;let b=d.getCenterPoint(r);if(!(!!o||e.isPointInArea(b))&&!m)return;let x=l(t,b);x<c?(a=[{element:d,datasetIndex:h,index:p}],c=x):x===c&&a.push({element:d,datasetIndex:h,index:p})}return Ai(e,n,t,u),a}function mo(e,t,n,s,r,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!s?Od(e,t,n,r):Dd(e,t,n,s,r,o)}function ul(e,t,n,s,r){let o=[],a=n==="x"?"inXRange":"inYRange",l=!1;return Ai(e,n,t,(c,u,d)=>{c[a](t[n],r)&&(o.push({element:c,datasetIndex:u,index:d}),l=l||c.inRange(t.x,t.y,r))}),s&&!l?[]:o}var Ld={evaluateInteractionItems:Ai,modes:{index(e,t,n,s){let r=zt(t,e),o=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?go(e,r,o,s,a):mo(e,r,o,!1,s,a),c=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{let d=l[0].index,h=u.data[d];h&&!h.skip&&c.push({element:h,datasetIndex:u.index,index:d})}),c):[]},dataset(e,t,n,s){let r=zt(t,e),o=n.axis||"xy",a=n.includeInvisible||!1,l=n.intersect?go(e,r,o,s,a):mo(e,r,o,!1,s,a);if(l.length>0){let c=l[0].datasetIndex,u=e.getDatasetMeta(c).data;l=[];for(let d=0;d<u.length;++d)l.push({element:u[d],datasetIndex:c,index:d})}return l},point(e,t,n,s){let r=zt(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return go(e,r,o,s,a)},nearest(e,t,n,s){let r=zt(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return mo(e,r,o,n.intersect,s,a)},x(e,t,n,s){let r=zt(t,e);return ul(e,r,"x",n.intersect,s)},y(e,t,n,s){let r=zt(t,e);return ul(e,r,"y",n.intersect,s)}}},ec=["left","top","right","bottom"];function pi(e,t){return e.filter(n=>n.pos===t)}function fl(e,t){return e.filter(n=>ec.indexOf(n.pos)===-1&&n.box.axis===t)}function gi(e,t){return e.sort((n,s)=>{let r=t?s:n,o=t?n:s;return r.weight===o.weight?r.index-o.index:r.weight-o.weight})}function Id(e){let t=[],n,s,r,o,a,l;for(n=0,s=(e||[]).length;n<s;++n)r=e[n],{position:o,options:{stack:a,stackWeight:l=1}}=r,t.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:l});return t}function Rd(e){let t={};for(let n of e){let{stack:s,pos:r,stackWeight:o}=n;if(!s||!ec.includes(r))continue;let a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Nd(e,t){let n=Rd(e),{vBoxMaxWidth:s,hBoxMaxHeight:r}=t,o,a,l;for(o=0,a=e.length;o<a;++o){l=e[o];let{fullSize:c}=l.box,u=n[l.stack],d=u&&l.stackWeight/u.weight;l.horizontal?(l.width=d?d*s:c&&t.availableWidth,l.height=r):(l.width=s,l.height=d?d*r:c&&t.availableHeight)}return n}function Fd(e){let t=Id(e),n=gi(t.filter(u=>u.box.fullSize),!0),s=gi(pi(t,"left"),!0),r=gi(pi(t,"right")),o=gi(pi(t,"top"),!0),a=gi(pi(t,"bottom")),l=fl(t,"x"),c=fl(t,"y");return{fullSize:n,leftAndTop:s.concat(o),rightAndBottom:r.concat(c).concat(a).concat(l),chartArea:pi(t,"chartArea"),vertical:s.concat(r).concat(c),horizontal:o.concat(a).concat(l)}}function dl(e,t,n,s){return Math.max(e[n],t[n])+Math.max(e[s],t[s])}function nc(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function zd(e,t,n,s){let{pos:r,box:o}=n,a=e.maxPadding;if(!q(r)){n.size&&(e[r]-=n.size);let h=s[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[r]+=n.size}o.getPadding&&nc(a,o.getPadding());let l=Math.max(0,t.outerWidth-dl(a,e,"left","right")),c=Math.max(0,t.outerHeight-dl(a,e,"top","bottom")),u=l!==e.w,d=c!==e.h;return e.w=l,e.h=c,n.horizontal?{same:u,other:d}:{same:d,other:u}}function Bd(e){let t=e.maxPadding;function n(s){let r=Math.max(t[s]-e[s],0);return e[s]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Vd(e,t){let n=t.maxPadding;function s(r){let o={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return s(e?["left","right"]:["top","bottom"])}function yi(e,t,n,s){let r=[],o,a,l,c,u,d;for(o=0,a=e.length,u=0;o<a;++o){l=e[o],c=l.box,c.update(l.width||t.w,l.height||t.h,Vd(l.horizontal,t));let{same:h,other:p}=zd(t,n,l,s);u|=h&&r.length,d=d||p,c.fullSize||r.push(l)}return u&&yi(r,t,n,s)||d}function Fs(e,t,n,s,r){e.top=n,e.left=t,e.right=t+s,e.bottom=n+r,e.width=s,e.height=r}function hl(e,t,n,s){let r=n.padding,{x:o,y:a}=t;for(let l of e){let c=l.box,u=s[l.stack]||{count:1,placed:0,weight:1},d=l.stackWeight/u.weight||1;if(l.horizontal){let h=t.w*d,p=u.size||c.height;nn(u.start)&&(a=u.start),c.fullSize?Fs(c,r.left,a,n.outerWidth-r.right-r.left,p):Fs(c,t.left+u.placed,a,h,p),u.start=a,u.placed+=h,a=c.bottom}else{let h=t.h*d,p=u.size||c.width;nn(u.start)&&(o=u.start),c.fullSize?Fs(c,o,r.top,p,n.outerHeight-r.bottom-r.top):Fs(c,o,t.top+u.placed,p,h),u.start=o,u.placed+=h,o=c.right}}t.x=o,t.y=a}var xt={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,s){if(!e)return;let r=mt(e.options.layout.padding),o=Math.max(t-r.width,0),a=Math.max(n-r.height,0),l=Fd(e.boxes),c=l.vertical,u=l.horizontal;Y(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});let d=c.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),p=Object.assign({},r);nc(p,mt(s));let m=Object.assign({maxPadding:p,w:o,h:a,x:r.left,y:r.top},r),b=Nd(c.concat(u),h);yi(l.fullSize,m,h,b),yi(c,m,h,b),yi(u,m,h,b)&&yi(c,m,h,b),Bd(m),hl(l.leftAndTop,m,h,b),m.x+=m.w,m.y+=m.h,hl(l.rightAndBottom,m,h,b),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Y(l.chartArea,y=>{let x=y.box;Object.assign(x,e.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}},Ys=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,s){}removeEventListener(t,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,s,r){return n=Math.max(0,n||t.width),s=s||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):s)}}isAttached(t){return!0}updateConfig(t){}},So=class extends Ys{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},js="$chartjs",Hd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pl=e=>e===null||e==="";function Wd(e,t){let n=e.style,s=e.getAttribute("height"),r=e.getAttribute("width");if(e[js]={initial:{height:s,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",pl(r)){let o=Ds(e,"width");o!==void 0&&(e.width=o)}if(pl(s))if(e.style.height==="")e.height=e.width/(t||2);else{let o=Ds(e,"height");o!==void 0&&(e.height=o)}return e}var ic=ao?{passive:!0}:!1;function jd(e,t,n){e.addEventListener(t,n,ic)}function Ud(e,t,n){e.canvas.removeEventListener(t,n,ic)}function Xd(e,t){let n=Hd[e.type]||e.type,{x:s,y:r}=zt(e,t);return{type:n,chart:t,native:e,x:s!==void 0?s:null,y:r!==void 0?r:null}}function qs(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Yd(e,t,n){let s=e.canvas,r=new MutationObserver(o=>{let a=!1;for(let l of o)a=a||qs(l.addedNodes,s),a=a&&!qs(l.removedNodes,s);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function qd(e,t,n){let s=e.canvas,r=new MutationObserver(o=>{let a=!1;for(let l of o)a=a||qs(l.removedNodes,s),a=a&&!qs(l.addedNodes,s);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}var Pi=new Map,gl=0;function sc(){let e=window.devicePixelRatio;e!==gl&&(gl=e,Pi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function $d(e,t){Pi.size||window.addEventListener("resize",sc),Pi.set(e,t)}function Gd(e){Pi.delete(e),Pi.size||window.removeEventListener("resize",sc)}function Kd(e,t,n){let s=e.canvas,r=s&&di(s);if(!r)return;let o=bs((l,c)=>{let u=r.clientWidth;n(l,c),u<r.clientWidth&&n()},window),a=new ResizeObserver(l=>{let c=l[0],u=c.contentRect.width,d=c.contentRect.height;u===0&&d===0||o(u,d)});return a.observe(r),$d(e,o),a}function vo(e,t,n){n&&n.disconnect(),t==="resize"&&Gd(e)}function Zd(e,t,n){let s=e.canvas,r=bs(o=>{e.ctx!==null&&n(Xd(o,e))},e);return jd(s,t,r),r}var To=class extends Ys{acquireContext(t,n){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Wd(t,n),s):null}releaseContext(t){let n=t.canvas;if(!n[js])return!1;let s=n[js].initial;["height","width"].forEach(o=>{let a=s[o];K(a)?n.removeAttribute(o):n.setAttribute(o,a)});let r=s.style||{};return Object.keys(r).forEach(o=>{n.style[o]=r[o]}),n.width=n.width,delete n[js],!0}addEventListener(t,n,s){this.removeEventListener(t,n);let r=t.$proxies||(t.$proxies={}),a={attach:Yd,detach:qd,resize:Kd}[n]||Zd;r[n]=a(t,n,s)}removeEventListener(t,n){let s=t.$proxies||(t.$proxies={}),r=s[n];if(!r)return;({attach:vo,detach:vo,resize:vo}[n]||Ud)(t,n,r),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,s,r){return oo(t,n,s,r)}isAttached(t){let n=di(t);return!!(n&&n.isConnected)}};function Qd(e){return!ks()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?So:To}var Vt=class{x;y;active=!1;options;$animations;tooltipPosition(t){let{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}hasValue(){return Fe(this.x)&&Fe(this.y)}getProps(t,n){let s=this.$animations;if(!n||!s)return this;let r={};return t.forEach(o=>{r[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),r}};F(Vt,"defaults",{}),F(Vt,"defaultRoutes");function Jd(e,t){let n=e.options.ticks,s=th(e),r=Math.min(n.maxTicksLimit||s,s),o=n.major.enabled?nh(t):[],a=o.length,l=o[0],c=o[a-1],u=[];if(a>r)return ih(t,u,o,a/r),u;let d=eh(o,t,r);if(a>0){let h,p,m=a>1?Math.round((c-l)/(a-1)):null;for(zs(t,u,d,K(m)?0:l-m,l),h=0,p=a-1;h<p;h++)zs(t,u,d,o[h],o[h+1]);return zs(t,u,d,c,K(m)?t.length:c+m),u}return zs(t,u,d),u}function th(e){let t=e.options.offset,n=e._tickSize(),s=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(s,r))}function eh(e,t,n){let s=sh(e),r=t.length/n;if(!s)return Math.max(r,1);let o=Xr(s);for(let a=0,l=o.length-1;a<l;a++){let c=o[a];if(c>r)return c}return Math.max(r,1)}function nh(e){let t=[],n,s;for(n=0,s=e.length;n<s;n++)e[n].major&&t.push(n);return t}function ih(e,t,n,s){let r=0,o=n[0],a;for(s=Math.ceil(s),a=0;a<e.length;a++)a===o&&(t.push(e[a]),r++,o=n[r*s])}function zs(e,t,n,s,r){let o=H(s,0),a=Math.min(H(r,e.length),e.length),l=0,c,u,d;for(n=Math.ceil(n),r&&(c=r-s,n=c/Math.floor(c/n)),d=o;d<0;)l++,d=Math.round(o+l*n);for(u=Math.max(o,0);u<a;u++)u===d&&(t.push(e[u]),l++,d=Math.round(o+l*n))}function sh(e){let t=e.length,n,s;if(t<2)return!1;for(s=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==s)return!1;return s}var rh=e=>e==="left"?"right":e==="right"?"left":e,ml=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,vl=(e,t)=>Math.min(t||e,e);function bl(e,t){let n=[],s=e.length/t,r=e.length,o=0;for(;o<r;o+=s)n.push(e[Math.floor(o)]);return n}function oh(e,t,n){let s=e.ticks.length,r=Math.min(t,s-1),o=e._startPixel,a=e._endPixel,l=1e-6,c=e.getPixelForTick(r),u;if(!(n&&(s===1?u=Math.max(c-o,a-c):t===0?u=(e.getPixelForTick(1)-c)/2:u=(c-e.getPixelForTick(r-1))/2,c+=r<t?u:-u,c<o-l||c>a+l)))return c}function ah(e,t){Y(e,n=>{let s=n.gc,r=s.length/2,o;if(r>t){for(o=0;o<r;++o)delete n.data[s[o]];s.splice(0,r)}})}function mi(e){return e.drawTicks?e.tickLength:0}function yl(e,t){if(!e.display)return 0;let n=ut(e.font,t),s=mt(e.padding);return(Q(e.text)?e.text.length:1)*n.lineHeight+s.height}function lh(e,t){return ae(e,{scale:t,type:"scale"})}function ch(e,t,n){return ae(e,{tick:n,index:t,type:"tick"})}function uh(e,t,n){let s=ai(e);return(n&&t!=="right"||!n&&t==="right")&&(s=rh(s)),s}function fh(e,t,n,s){let{top:r,left:o,bottom:a,right:l,chart:c}=e,{chartArea:u,scales:d}=c,h=0,p,m,b,y=a-r,x=l-o;if(e.isHorizontal()){if(m=gt(s,o,l),q(n)){let w=Object.keys(n)[0],E=n[w];b=d[w].getPixelForValue(E)+y-t}else n==="center"?b=(u.bottom+u.top)/2+y-t:b=ml(e,n,t);p=l-o}else{if(q(n)){let w=Object.keys(n)[0],E=n[w];m=d[w].getPixelForValue(E)-x+t}else n==="center"?m=(u.left+u.right)/2-x+t:m=ml(e,n,t);b=gt(s,a,r),h=n==="left"?-it:it}return{titleX:m,titleY:b,maxWidth:p,rotation:h}}var Ee=class extends Vt{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:s,_suggestedMax:r}=this;return t=Ct(t,Number.POSITIVE_INFINITY),n=Ct(n,Number.NEGATIVE_INFINITY),s=Ct(s,Number.POSITIVE_INFINITY),r=Ct(r,Number.NEGATIVE_INFINITY),{min:Ct(t,s),max:Ct(n,r),minDefined:st(t),maxDefined:st(n)}}getMinMax(t){let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds(),a;if(r&&o)return{min:n,max:s};let l=this.getMatchingVisibleMetas();for(let c=0,u=l.length;c<u;++c)a=l[c].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),o||(s=Math.max(s,a.max));return n=o&&n>s?s:n,s=r&&n>s?n:s,{min:Ct(n,Ct(s,n)),max:Ct(s,Ct(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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(){V(this.options.beforeUpdate,[this])}update(t,n,s){let{beginAtZero:r,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=no(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=l<this.ticks.length;this._convertTicksToLabels(c?bl(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jd(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,t=!t),this._startPixel=n,this._endPixel=s,this._reversePixels=t,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){V(this.options.afterUpdate,[this])}beforeSetDimensions(){V(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(){V(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),V(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){V(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,s,r,o;for(s=0,r=t.length;s<r;s++)o=t[s],o.label=V(n.callback,[o.value,s,t],this)}afterTickToLabelConversion(){V(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){V(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,s=vl(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,o=n.maxRotation,a=r,l,c,u;if(!this._isVisible()||!n.display||r>=o||s<=1||!this.isHorizontal()){this.labelRotation=r;return}let d=this._getLabelSizes(),h=d.widest.width,p=d.highest.height,m=ft(this.chart.width-h,0,this.maxWidth);l=t.offset?this.maxWidth/s:m/(s-1),h+6>l&&(l=m/(s-(t.offset?.5:1)),c=this.maxHeight-mi(t.grid)-n.padding-yl(t.title,this.chart.options.font),u=Math.sqrt(h*h+p*p),a=ri(Math.min(Math.asin(ft((d.highest.height+6)/l,-1,1)),Math.asin(ft(c/u,-1,1))-Math.asin(ft(p/u,-1,1)))),a=Math.max(r,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){V(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){V(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:s,title:r,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){let c=yl(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=mi(o)+c):(t.height=this.maxHeight,t.width=mi(o)+c),s.display&&this.ticks.length){let{first:u,last:d,widest:h,highest:p}=this._getLabelSizes(),m=s.padding*2,b=Ft(this.labelRotation),y=Math.cos(b),x=Math.sin(b);if(l){let w=s.mirror?0:x*h.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+w+m)}else{let w=s.mirror?0:y*h.width+x*p.height;t.width=Math.min(this.maxWidth,t.width+w+m)}this._calculatePadding(u,d,x,y)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,s,r){let{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),p=0,m=0;c?u?(p=r*t.width,m=s*n.height):(p=s*t.height,m=r*n.width):o==="start"?m=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,m=n.width/2),this.paddingLeft=Math.max((p-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=n.height,h=0),this.paddingTop=d+a,this.paddingBottom=h+a}}_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(){V(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,s;for(n=0,s=t.length;n<s;n++)K(t[n].label)&&(t.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,s=this.ticks;n<s.length&&(s=bl(s,n)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,s){let{ctx:r,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(n/vl(n,s)),u=0,d=0,h,p,m,b,y,x,w,E,A,O,k;for(h=0;h<n;h+=c){if(b=t[h].label,y=this._resolveTickFontOptions(h),r.font=x=y.string,w=o[x]=o[x]||{data:{},gc:[]},E=y.lineHeight,A=O=0,!K(b)&&!Q(b))A=Tn(r,w.data,w.gc,A,b),O=E;else if(Q(b))for(p=0,m=b.length;p<m;++p)k=b[p],!K(k)&&!Q(k)&&(A=Tn(r,w.data,w.gc,A,k),O+=E);a.push(A),l.push(O),u=Math.max(A,u),d=Math.max(O,d)}ah(o,n);let L=a.indexOf(u),M=l.indexOf(d),P=C=>({width:a[C]||0,height:l[C]||0});return{first:P(0),last:P(n-1),widest:P(L),highest:P(M),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return qr(this._alignToPixels?ye(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let s=n[t];return s.$context||(s.$context=ch(this.getContext(),t,s))}return this.$context||(this.$context=lh(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Ft(this.labelRotation),s=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*s>l*r?l/s:c/r:c*r<l*s?c/s:l/r}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,s=this.chart,r=this.options,{grid:o,position:a,border:l}=r,c=o.offset,u=this.isHorizontal(),h=this.ticks.length+(c?1:0),p=mi(o),m=[],b=l.setContext(this.getContext()),y=b.display?b.width:0,x=y/2,w=function(B){return ye(s,B,y)},E,A,O,k,L,M,P,C,I,z,W,G;if(a==="top")E=w(this.bottom),M=this.bottom-p,C=E-x,z=w(t.top)+x,G=t.bottom;else if(a==="bottom")E=w(this.top),z=t.top,G=w(t.bottom)-x,M=E+x,C=this.top+p;else if(a==="left")E=w(this.right),L=this.right-p,P=E-x,I=w(t.left)+x,W=t.right;else if(a==="right")E=w(this.left),I=t.left,W=w(t.right)-x,L=E+x,P=this.left+p;else if(n==="x"){if(a==="center")E=w((t.top+t.bottom)/2+.5);else if(q(a)){let B=Object.keys(a)[0],tt=a[B];E=w(this.chart.scales[B].getPixelForValue(tt))}z=t.top,G=t.bottom,M=E+x,C=M+p}else if(n==="y"){if(a==="center")E=w((t.left+t.right)/2);else if(q(a)){let B=Object.keys(a)[0],tt=a[B];E=w(this.chart.scales[B].getPixelForValue(tt))}L=E-x,P=L-p,I=t.left,W=t.right}let nt=H(r.ticks.maxTicksLimit,h),U=Math.max(1,Math.ceil(h/nt));for(A=0;A<h;A+=U){let B=this.getContext(A),tt=o.setContext(B),vt=l.setContext(B),ct=tt.lineWidth,Ut=tt.color,Lt=vt.dash||[],dt=vt.dashOffset,Xt=tt.tickWidth,ht=tt.tickColor,Qt=tt.tickBorderDash||[],rt=tt.tickBorderDashOffset;O=oh(this,A,c),O!==void 0&&(k=ye(s,O,ct),u?L=P=I=W=k:M=C=z=G=k,m.push({tx1:L,ty1:M,tx2:P,ty2:C,x1:I,y1:z,x2:W,y2:G,width:ct,color:Ut,borderDash:Lt,borderDashOffset:dt,tickWidth:Xt,tickColor:ht,tickBorderDash:Qt,tickBorderDashOffset:rt}))}return this._ticksLength=h,this._borderValue=E,m}_computeLabelItems(t){let n=this.axis,s=this.options,{position:r,ticks:o}=s,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:u,padding:d,mirror:h}=o,p=mi(s.grid),m=p+d,b=h?-d:m,y=-Ft(this.labelRotation),x=[],w,E,A,O,k,L,M,P,C,I,z,W,G="middle";if(r==="top")L=this.bottom-b,M=this._getXAxisLabelAlignment();else if(r==="bottom")L=this.top+b,M=this._getXAxisLabelAlignment();else if(r==="left"){let U=this._getYAxisLabelAlignment(p);M=U.textAlign,k=U.x}else if(r==="right"){let U=this._getYAxisLabelAlignment(p);M=U.textAlign,k=U.x}else if(n==="x"){if(r==="center")L=(t.top+t.bottom)/2+m;else if(q(r)){let U=Object.keys(r)[0],B=r[U];L=this.chart.scales[U].getPixelForValue(B)+m}M=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")k=(t.left+t.right)/2-m;else if(q(r)){let U=Object.keys(r)[0],B=r[U];k=this.chart.scales[U].getPixelForValue(B)}M=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?G="top":c==="end"&&(G="bottom"));let nt=this._getLabelSizes();for(w=0,E=l.length;w<E;++w){A=l[w],O=A.label;let U=o.setContext(this.getContext(w));P=this.getPixelForTick(w)+o.labelOffset,C=this._resolveTickFontOptions(w),I=C.lineHeight,z=Q(O)?O.length:1;let B=z/2,tt=U.color,vt=U.textStrokeColor,ct=U.textStrokeWidth,Ut=M;a?(k=P,M==="inner"&&(w===E-1?Ut=this.options.reverse?"left":"right":w===0?Ut=this.options.reverse?"right":"left":Ut="center"),r==="top"?u==="near"||y!==0?W=-z*I+I/2:u==="center"?W=-nt.highest.height/2-B*I+I:W=-nt.highest.height+I/2:u==="near"||y!==0?W=I/2:u==="center"?W=nt.highest.height/2-B*I:W=nt.highest.height-z*I,h&&(W*=-1),y!==0&&!U.showLabelBackdrop&&(k+=I/2*Math.sin(y))):(L=P,W=(1-z)*I/2);let Lt;if(U.showLabelBackdrop){let dt=mt(U.backdropPadding),Xt=nt.heights[w],ht=nt.widths[w],Qt=W-dt.top,rt=0-dt.left;switch(G){case"middle":Qt-=Xt/2;break;case"bottom":Qt-=Xt;break}switch(M){case"center":rt-=ht/2;break;case"right":rt-=ht;break}Lt={left:rt,top:Qt,width:ht+dt.width,height:Xt+dt.height,color:U.backdropColor}}x.push({label:O,font:C,textOffset:W,options:{rotation:y,color:tt,strokeColor:vt,strokeWidth:ct,textAlign:Ut,textBaseline:G,translation:[k,L],backdrop:Lt}})}return x}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Ft(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:s,mirror:r,padding:o}}=this.options,a=this._getLabelSizes(),l=t+o,c=a.widest.width,u,d;return n==="left"?r?(d=this.right+o,s==="near"?u="left":s==="center"?(u="center",d+=c/2):(u="right",d+=c)):(d=this.right-l,s==="near"?u="right":s==="center"?(u="center",d-=c/2):(u="left",d=this.left)):n==="right"?r?(d=this.left+o,s==="near"?u="right":s==="center"?(u="center",d-=c/2):(u="left",d-=c)):(d=this.left+l,s==="near"?u="left":s==="center"?(u="center",d+=c/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:s,top:r,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(s,r,o,a),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let r=this.ticks.findIndex(o=>o.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){let n=this.options.grid,s=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,a,l=(c,u,d)=>{!d.width||!d.color||(s.save(),s.lineWidth=d.width,s.strokeStyle=d.color,s.setLineDash(d.borderDash||[]),s.lineDashOffset=d.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(u.x,u.y),s.stroke(),s.restore())};if(n.display)for(o=0,a=r.length;o<a;++o){let c=r[o];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:s,grid:r}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;let l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue,u,d,h,p;this.isHorizontal()?(u=ye(t,this.left,a)-a/2,d=ye(t,this.right,l)+l/2,h=p=c):(h=ye(t,this.top,a)-a/2,p=ye(t,this.bottom,l)+l/2,u=d=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let s=this.ctx,r=this._computeLabelArea();r&&Pn(s,r);let o=this.getLabelItems(t);for(let a of o){let l=a.options,c=a.font,u=a.label,d=a.textOffset;_e(s,u,0,d,c,l)}r&&Cn(s)}drawTitle(){let{ctx:t,options:{position:n,title:s,reverse:r}}=this;if(!s.display)return;let o=ut(s.font),a=mt(s.padding),l=s.align,c=o.lineHeight/2;n==="bottom"||n==="center"||q(n)?(c+=a.bottom,Q(s.text)&&(c+=o.lineHeight*(s.text.length-1))):c+=a.top;let{titleX:u,titleY:d,maxWidth:h,rotation:p}=fh(this,c,n,l);_e(t,s.text,0,0,o,{color:s.color,maxWidth:h,rotation:p,textAlign:uh(l,n,r),textBaseline:"middle",translation:[u,d]})}draw(t){!this._isVisible()||(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,s=H(t.grid&&t.grid.z,-1),r=H(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ee.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",r=[],o,a;for(o=0,a=n.length;o<a;++o){let l=n[o];l[s]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return ut(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Fn=class{constructor(t,n,s){this.type=t,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),s;ph(n)&&(s=this.register(n));let r=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in r||(r[o]=t,dh(t,a,s),this.override&&ot.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let n=this.items,s=t.id,r=this.scope;s in n&&delete n[s],r&&s in ot[r]&&(delete ot[r][s],this.override&&delete ze[s])}};function dh(e,t,n){let s=tn(Object.create(null),[n?ot.get(n):{},ot.get(t),e.defaults]);ot.set(t,s),e.defaultRoutes&&hh(t,e.defaultRoutes),e.descriptors&&ot.describe(t,e.descriptors)}function hh(e,t){Object.keys(t).forEach(n=>{let s=n.split("."),r=s.pop(),o=[e].concat(s).join("."),a=t[n].split("."),l=a.pop(),c=a.join(".");ot.route(o,r,c,l)})}function ph(e){return"id"in e&&"defaults"in e}var Eo=class{constructor(){this.controllers=new Fn(Bt,"datasets",!0),this.elements=new Fn(Vt,"elements"),this.plugins=new Fn(Object,"plugins"),this.scales=new Fn(Ee,"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,n,s){[...n].forEach(r=>{let o=s||this._getRegistryForType(r);s||o.isForType(r)||o===this.plugins&&r.id?this._exec(t,o,r):Y(r,a=>{let l=s||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,s){let r=si(t);V(s["before"+r],[],s),n[t](s),V(s["after"+r],[],s)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let s=this._typedRegistries[n];if(s.isForType(t))return s}return this.plugins}_get(t,n,s){let r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return r}},ce=new Eo,Mo=class{constructor(){this._init=[]}notify(t,n,s,r){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let o=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(o,t,n,s);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,s,r){r=r||{};for(let o of t){let a=o.plugin,l=a[s],c=[n,r,o.options];if(V(l,c,a)===!1&&r.cancelable)return!1}return!0}invalidate(){K(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let s=t&&t.config,r=H(s.options&&s.options.plugins,{}),o=gh(s);return r===!1&&!n?[]:vh(t,o,r,n)}_notifyStateChanges(t){let n=this._oldCache||[],s=this._cache,r=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(r(n,s),t,"stop"),this._notify(r(s,n),t,"start")}};function gh(e){let t={},n=[],s=Object.keys(ce.plugins.items);for(let o=0;o<s.length;o++)n.push(ce.getPlugin(s[o]));let r=e.plugins||[];for(let o=0;o<r.length;o++){let a=r[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function mh(e,t){return!t&&e===!1?null:e===!0?{}:e}function vh(e,{plugins:t,localIds:n},s,r){let o=[],a=e.getContext();for(let l of t){let c=l.id,u=mh(s[c],r);u!==null&&o.push({plugin:l,options:bh(e.config,{plugin:l,local:n[c]},u,a)})}return o}function bh(e,{plugin:t,local:n},s,r){let o=e.pluginScopeKeys(t),a=e.getOptionScopes(s,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Po(e,t){let n=ot.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function yh(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function _h(e,t){return e===t?"_index_":"_value_"}function _l(e){if(e==="x"||e==="y"||e==="r")return e}function xh(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Co(e,...t){if(_l(e))return e;for(let n of t){let s=n.axis||xh(n.position)||e.length>1&&_l(e[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function xl(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function wh(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(n.length)return xl(e,"x",n[0])||xl(e,"y",n[0])}return{}}function Sh(e,t){let n=ze[e.type]||{scales:{}},s=t.scales||{},r=Po(e.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{let l=s[a];if(!q(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=Co(a,l,wh(a,e),ot.scales[l.type]),u=_h(c,r),d=n.scales||{};o[a]=en(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(a=>{let l=a.type||e.type,c=a.indexAxis||Po(l,t),d=(ze[l]||{}).scales||{};Object.keys(d).forEach(h=>{let p=yh(h,c),m=a[p+"AxisID"]||p;o[m]=o[m]||Object.create(null),en(o[m],[{axis:p},s[m],d[h]])})}),Object.keys(o).forEach(a=>{let l=o[a];en(l,[ot.scales[l.type],ot.scale])}),o}function rc(e){let t=e.options||(e.options={});t.plugins=H(t.plugins,{}),t.scales=Sh(e,t)}function oc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Th(e){return e=e||{},e.data=oc(e.data),rc(e),e}var wl=new Map,ac=new Set;function Bs(e,t){let n=wl.get(e);return n||(n=t(),wl.set(e,n),ac.add(n)),n}var vi=(e,t,n)=>{let s=re(t,n);s!==void 0&&e.add(s)},ko=class{constructor(t){this._config=Th(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=oc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bs(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Bs(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Bs(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){let n=t.id,s=this.type;return Bs(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let s=this._scopeCache,r=s.get(t);return(!r||n)&&(r=new Map,s.set(t,r)),r}getOptionScopes(t,n,s){let{options:r,type:o}=this,a=this._cachedScopes(t,s),l=a.get(n);if(l)return l;let c=new Set;n.forEach(d=>{t&&(c.add(t),d.forEach(h=>vi(c,t,h))),d.forEach(h=>vi(c,r,h)),d.forEach(h=>vi(c,ze[o]||{},h)),d.forEach(h=>vi(c,ot,h)),d.forEach(h=>vi(c,Ss,h))});let u=Array.from(c);return u.length===0&&u.push(Object.create(null)),ac.has(n)&&a.set(n,u),u}chartOptionScopes(){let{options:t,type:n}=this;return[t,ze[n]||{},ot.datasets[n]||{},{type:n},ot,Ss]}resolveNamedOptions(t,n,s,r=[""]){let o={$shared:!0},{resolver:a,subPrefixes:l}=Sl(this._resolverCache,t,r),c=a;if(Mh(a,n)){o.$shared=!1,s=ie(s)?s():s;let u=this.createResolver(t,s,l);c=Ne(a,s,u)}for(let u of n)o[u]=c[u];return o}createResolver(t,n,s=[""],r){let{resolver:o}=Sl(this._resolverCache,t,s);return q(n)?Ne(o,n,void 0,r):o}};function Sl(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));let r=n.join(),o=s.get(r);return o||(o={resolver:fi(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},s.set(r,o)),o}var Eh=e=>q(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||ie(e[n]),!1);function Mh(e,t){let{isScriptable:n,isIndexable:s}=Ps(e);for(let r of t){let o=n(r),a=s(r),l=(a||o)&&e[r];if(o&&(ie(l)||Eh(l))||a&&Q(l))return!0}return!1}var Ph="4.3.0",Ch=["top","bottom","left","right","chartArea"];function Tl(e,t){return e==="top"||e==="bottom"||Ch.indexOf(e)===-1&&t==="x"}function El(e,t){return function(n,s){return n[e]===s[e]?n[t]-s[t]:n[e]-s[e]}}function Ml(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),V(n&&n.onComplete,[e],t)}function kh(e){let t=e.chart,n=t.options.animation;V(n&&n.onProgress,[e],t)}function lc(e){return ks()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Us={},Pl=e=>{let t=lc(e);return Object.values(Us).filter(n=>n.canvas===t).pop()};function Ah(e,t,n){let s=Object.keys(e);for(let r of s){let o=+r;if(o>=t){let a=e[r];delete e[r],(n>0||o>t)&&(e[o+n]=a)}}}function Oh(e,t,n,s){return!n||e.type==="mouseout"?null:s?t:e}function Dh(e){let{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}var jt=class{static register(...t){ce.add(...t),Cl()}static unregister(...t){ce.remove(...t),Cl()}constructor(t,n){let s=this.config=new ko(n),r=lc(t),o=Pl(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Qd(r)),this.platform.updateConfig(s);let l=this.platform.acquireContext(r,a.aspectRatio),c=l&&l.canvas,u=c&&c.height,d=c&&c.width;if(this.id=Wr(),this.ctx=l,this.canvas=c,this.width=d,this.height=u,this._options=a,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 Mo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Zr(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Us[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}we.listen(this,"complete",Ml),we.listen(this,"progress",kh),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:r,_aspectRatio:o}=this;return K(t)?n&&o?o:r?s/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 ce}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Os(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ts(this.canvas,this.ctx),this}stop(){return we.stop(this),this}resize(t,n){we.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let s=this.options,r=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,o),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Os(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),V(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};Y(n,(s,r)=>{s.id=r})}buildOrUpdateScales(){let t=this.options,n=t.scales,s=this.scales,r=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{}),o=[];n&&(o=o.concat(Object.keys(n).map(a=>{let l=n[a],c=Co(a,l),u=c==="r",d=c==="x";return{options:l,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),Y(o,a=>{let l=a.options,c=l.id,u=Co(c,l),d=H(l.type,a.dtype);(l.position===void 0||Tl(l.position,u)!==Tl(a.dposition))&&(l.position=a.dposition),r[c]=!0;let h=null;if(c in s&&s[c].type===d)h=s[c];else{let p=ce.getScale(d);h=new p({id:c,type:d,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(l,t)}),Y(r,(a,l)=>{a||delete s[l]}),Y(s,a=>{xt.configure(this,a,a.options),xt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((r,o)=>r.index-o.index),s>n){for(let r=n;r<s;++r)this._destroyDatasetMeta(r);t.splice(n,s-n)}this._sortedMetasets=t.slice(0).sort(El("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((s,r)=>{n.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,s,r;for(this._removeUnreferencedMetasets(),s=0,r=n.length;s<r;s++){let o=n[s],a=this.getDatasetMeta(s),l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=o.indexAxis||Po(l,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{let c=ce.getController(l),{datasetElementType:u,dataElementType:d}=ot.datasets[l];Object.assign(c,{dataElementType:ce.getElement(d),datasetElementType:u&&ce.getElement(u)}),a.controller=new c(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Y(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,d=this.data.datasets.length;u<d;u++){let{controller:h}=this.getDatasetMeta(u),p=!r&&o.indexOf(h)===-1;h.buildOrUpdateElements(p),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),r||Y(o,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(El("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Y(this.scales,t=>{xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!us(n,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:s,start:r,count:o}of n){let a=s==="_removeElements"?-o:o;Ah(t,r,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),r=s(0);for(let o=1;o<n;o++)if(!us(r,s(o)))return;return Array.from(r).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,t);let n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],Y(this.boxes,r=>{s&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,o)=>{r._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,ie(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let s=this.getDatasetMeta(t),r={meta:s,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(s.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(we.has(this)?this.attached&&!we.running(this)&&we.start(this):(this.draw(),Ml({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:s,height:r}=this._resizeBeforeDraw;this._resize(s,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,s=[],r,o;for(r=0,o=n.length;r<o;++r){let a=n[r];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,s=t._clip,r=!s.disabled,o=Dh(t)||this.chartArea,a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Pn(n,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),r&&Cn(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Nt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,s,r){let o=Ld.modes[n];return typeof o=="function"?o(this,t,s,r):[]}getDatasetMeta(t){let n=this.data.datasets[t],s=this._metasets,r=s.filter(o=>o&&o._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},s.push(r)),r}getContext(){return this.$context||(this.$context=ae(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(t,n){let s=this.getDatasetMeta(t);s.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,s){let r=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,r);nn(n)?(o.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),we.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ts(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Us[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,s=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},r=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Y(this.options.events,o=>s(o,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,s=(c,u)=>{n.addEventListener(this,c,u),t[c]=u},r=(c,u)=>{t[c]&&(n.removeEventListener(this,c,u),delete t[c])},o=(c,u)=>{this.canvas&&this.resize(c,u)},a,l=()=>{r("attach",l),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),s("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){Y(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Y(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,s){let r=s?"set":"remove",o,a,l,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];let u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{let l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!Mn(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(t,n,s){return this._plugins.notify(this,t,n,s)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,s){let r=this.options.hover,o=(c,u)=>c.filter(d=>!u.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),a=o(n,t),l=s?t:o(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){let s={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,r)===!1)return;let o=this._handleEvent(t,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,r),(o||s.changed)&&this.render(),this}_handleEvent(t,n,s){let{_active:r=[],options:o}=this,a=n,l=this._getActiveElements(t,r,s,a),c=Ur(t),u=Oh(t,this._lastEvent,s,c);s&&(this._lastEvent=null,V(o.onHover,[t,l,this],this),c&&V(o.onClick,[t,l,this],this));let d=!Mn(l,r);return(d||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=u,d}_getActiveElements(t,n,s,r){if(t.type==="mouseout")return[];if(!s)return n;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,r)}};F(jt,"defaults",ot),F(jt,"instances",Us),F(jt,"overrides",ze),F(jt,"registry",ce),F(jt,"version",Ph),F(jt,"getChart",Pl);function Cl(){return Y(jt.instances,e=>e._plugins.invalidate())}function Lh(e,t,n){let{startAngle:s,pixelMargin:r,x:o,y:a,outerRadius:l,innerRadius:c}=t,u=r/l;e.beginPath(),e.arc(o,a,l,s-u,n+u),c>r?(u=r/c,e.arc(o,a,c,n+u,s-u,!0)):e.arc(o,a,r,n+it,s-it),e.closePath(),e.clip()}function Ih(e){return ui(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Rh(e,t,n,s){let r=Ih(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,s*t/2),l=c=>{let u=(n-Math.min(o,c))*s/2;return ft(c,0,Math.min(o,u))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:ft(r.innerStart,0,a),innerEnd:ft(r.innerEnd,0,a)}}function kn(e,t,n,s){return{x:n+e*Math.cos(t),y:s+e*Math.sin(t)}}function $s(e,t,n,s,r,o){let{x:a,y:l,startAngle:c,pixelMargin:u,innerRadius:d}=t,h=Math.max(t.outerRadius+s+n-u,0),p=d>0?d+s+n+u:0,m=0,b=r-c;if(s){let U=d>0?d-s:0,B=h>0?h-s:0,tt=(U+B)/2,vt=tt!==0?b*tt/(tt+s):b;m=(b-vt)/2}let y=Math.max(.001,b*h-n/et)/h,x=(b-y)/2,w=c+x+m,E=r-x-m,{outerStart:A,outerEnd:O,innerStart:k,innerEnd:L}=Rh(t,p,h,E-w),M=h-A,P=h-O,C=w+A/M,I=E-O/P,z=p+k,W=p+L,G=w+k/z,nt=E-L/W;if(e.beginPath(),o){let U=(C+I)/2;if(e.arc(a,l,h,C,U),e.arc(a,l,h,U,I),O>0){let ct=kn(P,I,a,l);e.arc(ct.x,ct.y,O,I,E+it)}let B=kn(W,E,a,l);if(e.lineTo(B.x,B.y),L>0){let ct=kn(W,nt,a,l);e.arc(ct.x,ct.y,L,E+it,nt+Math.PI)}let tt=(E-L/p+(w+k/p))/2;if(e.arc(a,l,p,E-L/p,tt,!0),e.arc(a,l,p,tt,w+k/p,!0),k>0){let ct=kn(z,G,a,l);e.arc(ct.x,ct.y,k,G+Math.PI,w-it)}let vt=kn(M,w,a,l);if(e.lineTo(vt.x,vt.y),A>0){let ct=kn(M,C,a,l);e.arc(ct.x,ct.y,A,w-it,C)}}else{e.moveTo(a,l);let U=Math.cos(C)*h+a,B=Math.sin(C)*h+l;e.lineTo(U,B);let tt=Math.cos(I)*h+a,vt=Math.sin(I)*h+l;e.lineTo(tt,vt)}e.closePath()}function Nh(e,t,n,s,r){let{fullCircles:o,startAngle:a,circumference:l}=t,c=t.endAngle;if(o){$s(e,t,n,s,c,r);for(let u=0;u<o;++u)e.fill();isNaN(l)||(c=a+(l%J||J))}return $s(e,t,n,s,c,r),e.fill(),c}function Fh(e,t,n,s,r){let{fullCircles:o,startAngle:a,circumference:l,options:c}=t,{borderWidth:u,borderJoinStyle:d,borderDash:h,borderDashOffset:p}=c,m=c.borderAlign==="inner";if(!u)return;e.setLineDash(h||[]),e.lineDashOffset=p,m?(e.lineWidth=u*2,e.lineJoin=d||"round"):(e.lineWidth=u,e.lineJoin=d||"bevel");let b=t.endAngle;if(o){$s(e,t,n,s,b,r);for(let y=0;y<o;++y)e.stroke();isNaN(l)||(b=a+(l%J||J))}m&&Lh(e,t,b),o||($s(e,t,n,s,b,r),e.stroke())}var un=class extends Vt{circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;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,n,s){let r=this.getProps(["x","y"],s),{angle:o,distance:a}=ps(r,{x:t,y:n}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,b=H(h,c-l)>=J||sn(o,l,c),y=Zt(a,u+p,d+p);return b&&y}getCenterPoint(t){let{x:n,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:n+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:n,circumference:s}=this,r=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>J?Math.floor(s/J):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);let c=1-Math.sin(Math.min(et,s||0)),u=r*c;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Nh(t,this,u,o,a),Fh(t,this,u,o,a),t.restore()}};F(un,"id","arc"),F(un,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),F(un,"defaultRoutes",{backgroundColor:"backgroundColor"}),F(un,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function cc(e,t,n=t){e.lineCap=H(n.borderCapStyle,t.borderCapStyle),e.setLineDash(H(n.borderDash,t.borderDash)),e.lineDashOffset=H(n.borderDashOffset,t.borderDashOffset),e.lineJoin=H(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=H(n.borderWidth,t.borderWidth),e.strokeStyle=H(n.borderColor,t.borderColor)}function zh(e,t,n){e.lineTo(n.x,n.y)}function Bh(e){return e.stepped?to:e.tension||e.cubicInterpolationMode==="monotone"?eo:zh}function uc(e,t,n={}){let s=e.length,{start:r=0,end:o=s-1}=n,{start:a,end:l}=t,c=Math.max(r,a),u=Math.min(o,l),d=r<a&&o<a||r>l&&o>l;return{count:s,start:c,loop:t.loop,ilen:u<c&&!d?s+u-c:u-c}}function Vh(e,t,n,s){let{points:r,options:o}=t,{count:a,start:l,loop:c,ilen:u}=uc(r,n,s),d=Bh(o),{move:h=!0,reverse:p}=s||{},m,b,y;for(m=0;m<=u;++m)b=r[(l+(p?u-m:m))%a],!b.skip&&(h?(e.moveTo(b.x,b.y),h=!1):d(e,y,b,p,o.stepped),y=b);return c&&(b=r[(l+(p?u:0))%a],d(e,y,b,p,o.stepped)),!!c}function Hh(e,t,n,s){let r=t.points,{count:o,start:a,ilen:l}=uc(r,n,s),{move:c=!0,reverse:u}=s||{},d=0,h=0,p,m,b,y,x,w,E=O=>(a+(u?l-O:O))%o,A=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(c&&(m=r[E(0)],e.moveTo(m.x,m.y)),p=0;p<=l;++p){if(m=r[E(p)],m.skip)continue;let O=m.x,k=m.y,L=O|0;L===b?(k<y?y=k:k>x&&(x=k),d=(h*d+O)/++h):(A(),e.lineTo(O,k),b=L,h=0,y=x=k),w=k}A()}function Ao(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Hh:Vh}function Wh(e){return e.stepped?lo:e.tension||e.cubicInterpolationMode==="monotone"?co:be}function jh(e,t,n,s){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,s)&&r.closePath()),cc(e,t.options),e.stroke(r)}function Uh(e,t,n,s){let{segments:r,options:o}=t,a=Ao(t);for(let l of r)cc(e,o,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+s-1})&&e.closePath(),e.stroke()}var Xh=typeof Path2D=="function";function Yh(e,t,n,s){Xh&&!t.options.segment?jh(e,t,n,s):Uh(e,t,n,s)}var ue=class extends Vt{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,n){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let r=s.spanGaps?this._loop:this._fullLoop;ro(this._points,s,t,r,n),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=uo(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,s=t.length;return s&&n[t[s-1].end]}interpolate(t,n){let s=this.options,r=t[n],o=this.points,a=Ns(this,{property:n,start:r,end:r});if(!a.length)return;let l=[],c=Wh(s),u,d;for(u=0,d=a.length;u<d;++u){let{start:h,end:p}=a[u],m=o[h],b=o[p];if(m===b){l.push(m);continue}let y=Math.abs((r-m[n])/(b[n]-m[n])),x=c(m,b,y,s.stepped);x[n]=t[n],l.push(x)}return l.length===1?l[0]:l}pathSegment(t,n,s){return Ao(this)(t,this,n,s)}path(t,n,s){let r=this.segments,o=Ao(this),a=this._loop;n=n||0,s=s||this.points.length-n;for(let l of r)a&=o(t,this,l,{start:n,end:n+s-1});return!!a}draw(t,n,s,r){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Yh(t,this,s,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(ue,"id","line"),F(ue,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(ue,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(ue,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function kl(e,t,n,s){let r=e.options,{[n]:o}=e.getProps([n],s);return Math.abs(t-o)<r.radius+r.hitRadius}var Rn=class extends Vt{parsed;skip;stop;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,n,s){let r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return kl(this,t,"x",n)}inYRange(t,n){return kl(this,t,"y",n)}getCenterPoint(t){let{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);let s=n&&t.borderWidth||0;return(n+s)*2}draw(t,n){let s=this.options;this.skip||s.radius<.1||!Nt(this,n,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,ci(t,s,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};F(Rn,"id","point"),F(Rn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function fc(e,t){let{x:n,y:s,base:r,width:o,height:a}=e.getProps(["x","y","base","width","height"],t),l,c,u,d,h;return e.horizontal?(h=a/2,l=Math.min(n,r),c=Math.max(n,r),u=s-h,d=s+h):(h=o/2,l=n-h,c=n+h,u=Math.min(s,r),d=Math.max(s,r)),{left:l,top:u,right:c,bottom:d}}function Ve(e,t,n,s){return e?0:ft(t,n,s)}function qh(e,t,n){let s=e.options.borderWidth,r=e.borderSkipped,o=Ms(s);return{t:Ve(r.top,o.top,0,n),r:Ve(r.right,o.right,0,t),b:Ve(r.bottom,o.bottom,0,n),l:Ve(r.left,o.left,0,t)}}function $h(e,t,n){let{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,o=xe(r),a=Math.min(t,n),l=e.borderSkipped,c=s||q(r);return{topLeft:Ve(!c||l.top||l.left,o.topLeft,0,a),topRight:Ve(!c||l.top||l.right,o.topRight,0,a),bottomLeft:Ve(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:Ve(!c||l.bottom||l.right,o.bottomRight,0,a)}}function Gh(e){let t=fc(e),n=t.right-t.left,s=t.bottom-t.top,r=qh(e,n/2,s/2),o=$h(e,n/2,s/2);return{outer:{x:t.left,y:t.top,w:n,h:s,radius:o},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:s-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}function bo(e,t,n,s){let r=t===null,o=n===null,l=e&&!(r&&o)&&fc(e,s);return l&&(r||Zt(t,l.left,l.right))&&(o||Zt(n,l.top,l.bottom))}function Kh(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Zh(e,t){e.rect(t.x,t.y,t.w,t.h)}function yo(e,t,n={}){let s=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-s,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+s,y:e.y+r,w:e.w+o,h:e.h+a,radius:e.radius}}var Nn=class extends Vt{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){let{inflateAmount:n,options:{borderColor:s,backgroundColor:r}}=this,{inner:o,outer:a}=Gh(this),l=Kh(a.radius)?on:Zh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),l(t,yo(a,n,o)),t.clip(),l(t,yo(o,-n,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),l(t,yo(o,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,s){return bo(this,t,n,s)}inXRange(t,n){return bo(this,t,null,n)}inYRange(t,n){return bo(this,null,t,n)}getCenterPoint(t){let{x:n,y:s,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+r)/2:n,y:o?s:(s+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};F(Nn,"id","bar"),F(Nn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),F(Nn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Qh=Object.freeze({__proto__:null,ArcElement:un,BarElement:Nn,LineElement:ue,PointElement:Rn}),Oo=["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)"],Al=Oo.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function dc(e){return Oo[e%Oo.length]}function hc(e){return Al[e%Al.length]}function Jh(e,t){return e.borderColor=dc(t),e.backgroundColor=hc(t),++t}function tp(e,t){return e.backgroundColor=e.data.map(()=>dc(t++)),t}function ep(e,t){return e.backgroundColor=e.data.map(()=>hc(t++)),t}function np(e){let t=0;return(n,s)=>{let r=e.getDatasetMeta(s).controller;r instanceof Te?t=tp(n,t):r instanceof dn?t=ep(n,t):r&&(t=Jh(n,t))}}function Ol(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ip(e){return e&&(e.borderColor||e.backgroundColor)}var sp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;let{data:{datasets:s},options:r}=e.config,{elements:o}=r;if(!n.forceOverride&&(Ol(s)||ip(r)||o&&Ol(o)))return;let a=np(e);s.forEach(a)}};function rp(e,t,n,s,r){let o=r.samples||s;if(o>=n)return e.slice(t,t+n);let a=[],l=(n-2)/(o-2),c=0,u=t+n-1,d=t,h,p,m,b,y;for(a[c++]=e[d],h=0;h<o-2;h++){let x=0,w=0,E,A=Math.floor((h+1)*l)+1+t,O=Math.min(Math.floor((h+2)*l)+1,n)+t,k=O-A;for(E=A;E<O;E++)x+=e[E].x,w+=e[E].y;x/=k,w/=k;let L=Math.floor(h*l)+1+t,M=Math.min(Math.floor((h+1)*l)+1,n)+t,{x:P,y:C}=e[d];for(m=b=-1,E=L;E<M;E++)b=.5*Math.abs((P-x)*(e[E].y-C)-(P-e[E].x)*(w-C)),b>m&&(m=b,p=e[E],y=E);a[c++]=p,d=y}return a[c++]=e[u],a}function op(e,t,n,s){let r=0,o=0,a,l,c,u,d,h,p,m,b,y,x=[],w=t+n-1,E=e[t].x,O=e[w].x-E;for(a=t;a<t+n;++a){l=e[a],c=(l.x-E)/O*s,u=l.y;let k=c|0;if(k===d)u<b?(b=u,h=a):u>y&&(y=u,p=a),r=(o*r+l.x)/++o;else{let L=a-1;if(!K(h)&&!K(p)){let M=Math.min(h,p),P=Math.max(h,p);M!==m&&M!==L&&x.push({...e[M],x:r}),P!==m&&P!==L&&x.push({...e[P],x:r})}a>0&&L!==m&&x.push(e[L]),x.push(l),d=k,o=0,b=y=u,h=p=m=a}}return x}function pc(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Dl(e){e.data.datasets.forEach(t=>{pc(t)})}function ap(e,t){let n=t.length,s=0,r,{iScale:o}=e,{min:a,max:l,minDefined:c,maxDefined:u}=o.getUserBounds();return c&&(s=ft(Gt(t,o.axis,a).lo,0,n-1)),u?r=ft(Gt(t,o.axis,l).hi+1,s,n)-s:r=n-s,{start:s,count:r}}var lp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Dl(e);return}let s=e.width;e.data.datasets.forEach((r,o)=>{let{_data:a,indexAxis:l}=r,c=e.getDatasetMeta(o),u=a||r.data;if(an([l,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;let d=e.scales[c.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:h,count:p}=ap(c,u),m=n.threshold||4*s;if(p<=m){pc(r);return}K(a)&&(r._data=u,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let b;switch(n.algorithm){case"lttb":b=rp(u,h,p,s,n);break;case"min-max":b=op(u,h,p,s);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=b})},destroy(e){Dl(e)}};function cp(e,t,n){let s=e.segments,r=e.points,o=t.points,a=[];for(let l of s){let{start:c,end:u}=l;u=Io(c,u,r);let d=Do(n,r[c],r[u],l.loop);if(!t.segments){a.push({source:l,target:d,start:r[c],end:r[u]});continue}let h=Ns(t,d);for(let p of h){let m=Do(n,o[p.start],o[p.end],p.loop),b=Rs(l,r,m);for(let y of b)a.push({source:y,target:p,start:{[n]:Ll(d,m,"start",Math.max)},end:{[n]:Ll(d,m,"end",Math.min)}})}}return a}function Do(e,t,n,s){if(s)return;let r=t[e],o=n[e];return e==="angle"&&(r=Mt(r),o=Mt(o)),{property:e,start:r,end:o}}function up(e,t){let{x:n=null,y:s=null}=e||{},r=t.points,o=[];return t.segments.forEach(({start:a,end:l})=>{l=Io(a,l,r);let c=r[a],u=r[l];s!==null?(o.push({x:c.x,y:s}),o.push({x:u.x,y:s})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:u.y}))}),o}function Io(e,t,n){for(;t>e;t--){let s=n[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Ll(e,t,n,s){return e&&t?s(e[n],t[n]):e?e[n]:t?t[n]:0}function gc(e,t){let n=[],s=!1;return Q(e)?(s=!0,n=e):n=up(e,t),n.length?new ue({points:n,options:{tension:0},_loop:s,_fullLoop:s}):null}function Il(e){return e&&e.fill!==!1}function fp(e,t,n){let r=e[t].fill,o=[t],a;if(!n)return r;for(;r!==!1&&o.indexOf(r)===-1;){if(!st(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;o.push(r),r=a.fill}return!1}function dp(e,t,n){let s=mp(e);if(q(s))return isNaN(s.value)?!1:s;let r=parseFloat(s);return st(r)&&Math.floor(r)===r?hp(s[0],t,r,n):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function hp(e,t,n,s){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=s?!1:n}function pp(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:q(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function gp(e,t,n){let s;return e==="start"?s=n:e==="end"?s=t.options.reverse?t.min:t.max:q(e)?s=e.value:s=t.getBaseValue(),s}function mp(e){let t=e.options,n=t.fill,s=H(n&&n.target,n);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function vp(e){let{scale:t,index:n,line:s}=e,r=[],o=s.segments,a=s.points,l=bp(t,n);l.push(gc({x:null,y:t.bottom},s));for(let c=0;c<o.length;c++){let u=o[c];for(let d=u.start;d<=u.end;d++)yp(r,a[d],l)}return new ue({points:r,options:{}})}function bp(e,t){let n=[],s=e.getMatchingVisibleMetas("line");for(let r=0;r<s.length;r++){let o=s[r];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function yp(e,t,n){let s=[];for(let r=0;r<n.length;r++){let o=n[r],{first:a,last:l,point:c}=_p(o,t,"x");if(!(!c||a&&l)){if(a)s.unshift(c);else if(e.push(c),!l)break}}e.push(...s)}function _p(e,t,n){let s=e.interpolate(t,n);if(!s)return{};let r=s[n],o=e.segments,a=e.points,l=!1,c=!1;for(let u=0;u<o.length;u++){let d=o[u],h=a[d.start][n],p=a[d.end][n];if(Zt(r,h,p)){l=r===h,c=r===p;break}}return{first:l,last:c,point:s}}var Gs=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,s){let{x:r,y:o,radius:a}=this;return n=n||{start:0,end:J},t.arc(r,o,a,n.end,n.start,!0),!s.bounds}interpolate(t){let{x:n,y:s,radius:r}=this,o=t.angle;return{x:n+Math.cos(o)*r,y:s+Math.sin(o)*r,angle:o}}};function xp(e){let{chart:t,fill:n,line:s}=e;if(st(n))return wp(t,n);if(n==="stack")return vp(e);if(n==="shape")return!0;let r=Sp(e);return r instanceof Gs?r:gc(r,s)}function wp(e,t){let n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Sp(e){return(e.scale||{}).getPointPositionForValue?Ep(e):Tp(e)}function Tp(e){let{scale:t={},fill:n}=e,s=pp(n,t);if(st(s)){let r=t.isHorizontal();return{x:r?s:null,y:r?null:s}}return null}function Ep(e){let{scale:t,fill:n}=e,s=t.options,r=t.getLabels().length,o=s.reverse?t.max:t.min,a=gp(n,t,o),l=[];if(s.grid.circular){let c=t.getPointPositionForValue(0,o);return new Gs({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<r;++c)l.push(t.getPointPositionForValue(c,a));return l}function _o(e,t,n){let s=xp(t),{line:r,scale:o,axis:a}=t,l=r.options,c=l.fill,u=l.backgroundColor,{above:d=u,below:h=u}=c||{};s&&r.points.length&&(Pn(e,n),Mp(e,{line:r,target:s,above:d,below:h,area:n,scale:o,axis:a}),Cn(e))}function Mp(e,t){let{line:n,target:s,above:r,below:o,area:a,scale:l}=t,c=n._loop?"angle":t.axis;e.save(),c==="x"&&o!==r&&(Rl(e,s,a.top),Nl(e,{line:n,target:s,color:r,scale:l,property:c}),e.restore(),e.save(),Rl(e,s,a.bottom)),Nl(e,{line:n,target:s,color:o,scale:l,property:c}),e.restore()}function Rl(e,t,n){let{segments:s,points:r}=t,o=!0,a=!1;e.beginPath();for(let l of s){let{start:c,end:u}=l,d=r[c],h=r[Io(c,u,r)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Nl(e,t){let{line:n,target:s,property:r,color:o,scale:a}=t,l=cp(n,s,r);for(let{source:c,target:u,start:d,end:h}of l){let{style:{backgroundColor:p=o}={}}=c,m=s!==!0;e.save(),e.fillStyle=p,Pp(e,a,m&&Do(r,d,h)),e.beginPath();let b=!!n.pathSegment(e,c),y;if(m){b?e.closePath():Fl(e,s,h,r);let x=!!s.pathSegment(e,u,{move:b,reverse:!0});y=b&&x,y||Fl(e,s,d,r)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function Pp(e,t,n){let{top:s,bottom:r}=t.chart.chartArea,{property:o,start:a,end:l}=n||{};o==="x"&&(e.beginPath(),e.rect(a,s,l-a,r-s),e.clip())}function Fl(e,t,n,s){let r=t.interpolate(n,s);r&&e.lineTo(r.x,r.y)}var Cp={id:"filler",afterDatasetsUpdate(e,t,n){let s=(e.data.datasets||[]).length,r=[],o,a,l,c;for(a=0;a<s;++a)o=e.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof ue&&(c={visible:e.isDatasetVisible(a),index:a,fill:dp(l,a,s),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,r.push(c);for(a=0;a<s;++a)c=r[a],!(!c||c.fill===!1)&&(c.fill=fp(r,a,n.propagate))},beforeDraw(e,t,n){let s=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=r.length-1;a>=0;--a){let l=r[a].$filler;!l||(l.line.updateControlPoints(o,l.axis),s&&l.fill&&_o(e.ctx,l,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;let s=e.getSortedVisibleDatasetMetas();for(let r=s.length-1;r>=0;--r){let o=s[r].$filler;Il(o)&&_o(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){let s=t.meta.$filler;!Il(s)||n.drawTime!=="beforeDatasetDraw"||_o(e.ctx,s,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},zl=(e,t)=>{let{boxHeight:n=t,boxWidth:s=t}=e;return e.usePointStyle&&(n=Math.min(n,t),s=e.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(t,n)}},kp=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ks=class extends Vt{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,n,s){this.maxWidth=t,this.maxHeight=n,this._margins=s,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(){let t=this.options.labels||{},n=V(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(s=>t.filter(s,this.chart.data))),t.sort&&(n=n.sort((s,r)=>t.sort(s,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let s=t.labels,r=ut(s.font),o=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=zl(s,o),u,d;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(a,o,l,c)+10):(d=this.maxHeight,u=this._fitCols(a,r,l,c)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,s,r){let{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.lineWidths=[0],d=r+l,h=t;o.textAlign="left",o.textBaseline="middle";let p=-1,m=-d;return this.legendItems.forEach((b,y)=>{let x=s+n/2+o.measureText(b.text).width;(y===0||u[u.length-1]+x+2*l>a)&&(h+=d,u[u.length-(y>0?0:1)]=0,m+=d,p++),c[y]={left:0,top:m,row:p,width:x,height:r},u[u.length-1]+=x+l}),h}_fitCols(t,n,s,r){let{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.columnSizes=[],d=a-t,h=l,p=0,m=0,b=0,y=0;return this.legendItems.forEach((x,w)=>{let{itemWidth:E,itemHeight:A}=Ap(s,n,o,x,r);w>0&&m+A+2*l>d&&(h+=p+l,u.push({width:p,height:m}),b+=p+l,y++,p=m=0),c[w]={left:b,top:m,col:y,width:E,height:A},p=Math.max(p,E),m+=A+l}),h+=p,u.push({width:p,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:r},rtl:o}}=this,a=Be(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=gt(s,this.left+r,this.right-this.lineWidths[l]);for(let u of n)l!==u.row&&(l=u.row,c=gt(s,this.left+r,this.right-this.lineWidths[l])),u.top+=this.top+t+r,u.left=a.leftForLtr(a.x(c),u.width),c+=u.width+r}else{let l=0,c=gt(s,this.top+t+r,this.bottom-this.columnSizes[l].height);for(let u of n)u.col!==l&&(l=u.col,c=gt(s,this.top+t+r,this.bottom-this.columnSizes[l].height)),u.top=c,u.left+=this.left+r,u.left=a.leftForLtr(a.x(u.left),u.width),c+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Pn(t,this),this._draw(),Cn(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:s,ctx:r}=this,{align:o,labels:a}=t,l=ot.color,c=Be(t.rtl,this.left,this.width),u=ut(a.font),{padding:d}=a,h=u.size,p=h/2,m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;let{boxWidth:b,boxHeight:y,itemHeight:x}=zl(a,h),w=function(L,M,P){if(isNaN(b)||b<=0||isNaN(y)||y<0)return;r.save();let C=H(P.lineWidth,1);if(r.fillStyle=H(P.fillStyle,l),r.lineCap=H(P.lineCap,"butt"),r.lineDashOffset=H(P.lineDashOffset,0),r.lineJoin=H(P.lineJoin,"miter"),r.lineWidth=C,r.strokeStyle=H(P.strokeStyle,l),r.setLineDash(H(P.lineDash,[])),a.usePointStyle){let I={radius:y*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:C},z=c.xPlus(L,b/2),W=M+p;Es(r,I,z,W,a.pointStyleWidth&&b)}else{let I=M+Math.max((h-y)/2,0),z=c.leftForLtr(L,b),W=xe(P.borderRadius);r.beginPath(),Object.values(W).some(G=>G!==0)?on(r,{x:z,y:I,w:b,h:y,radius:W}):r.rect(z,I,b,y),r.fill(),C!==0&&r.stroke()}r.restore()},E=function(L,M,P){_e(r,P.text,L,M+x/2,u,{strikethrough:P.hidden,textAlign:c.textAlign(P.textAlign)})},A=this.isHorizontal(),O=this._computeTitleHeight();A?m={x:gt(o,this.left+d,this.right-s[0]),y:this.top+d+O,line:0}:m={x:this.left+d,y:gt(o,this.top+O+d,this.bottom-n[0].height),line:0},Ls(this.ctx,t.textDirection);let k=x+d;this.legendItems.forEach((L,M)=>{r.strokeStyle=L.fontColor,r.fillStyle=L.fontColor;let P=r.measureText(L.text).width,C=c.textAlign(L.textAlign||(L.textAlign=a.textAlign)),I=b+p+P,z=m.x,W=m.y;c.setWidth(this.width),A?M>0&&z+I+d>this.right&&(W=m.y+=k,m.line++,z=m.x=gt(o,this.left+d,this.right-s[m.line])):M>0&&W+k>this.bottom&&(z=m.x=z+n[m.line].width+d,m.line++,W=m.y=gt(o,this.top+O+d,this.bottom-n[m.line].height));let G=c.x(z);if(w(G,W,L),z=Qr(C,z+b+p,A?z+I:this.right,t.rtl),E(c.x(z),W,L),A)m.x+=I+d;else if(typeof L.text!="string"){let nt=u.lineHeight;m.y+=mc(L,nt)}else m.y+=k}),Is(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,s=ut(n.font),r=mt(n.padding);if(!n.display)return;let o=Be(t.rtl,this.left,this.width),a=this.ctx,l=n.position,c=s.size/2,u=r.top+c,d,h=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+u,h=gt(t.align,h,this.right-p);else{let b=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=u+gt(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let m=gt(l,h,h+p);a.textAlign=o.textAlign(ai(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=s.string,_e(a,n.text,m,d,s)}_computeTitleHeight(){let t=this.options.title,n=ut(t.font),s=mt(t.padding);return t.display?n.lineHeight+s.height:0}_getLegendItemAt(t,n){let s,r,o;if(Zt(t,this.left,this.right)&&Zt(n,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(r=o[s],Zt(t,r.left,r.left+r.width)&&Zt(n,r.top,r.top+r.height))return this.legendItems[s]}return null}handleEvent(t){let n=this.options;if(!Lp(t.type,n))return;let s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let r=this._hoveredItem,o=kp(r,s);r&&!o&&V(n.onLeave,[t,r,this],this),this._hoveredItem=s,s&&!o&&V(n.onHover,[t,s,this],this)}else s&&V(n.onClick,[t,s,this],this)}};function Ap(e,t,n,s,r){let o=Op(s,e,t,n),a=Dp(r,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Op(e,t,n,s){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+s.measureText(r).width}function Dp(e,t,n){let s=e;return typeof t.text!="string"&&(s=mc(t,n)),s}function mc(e,t){let n=e.text?e.text.length+.5:0;return t*n}function Lp(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Ip={id:"legend",_element:Ks,start(e,t,n){let s=e.legend=new Ks({ctx:e.ctx,options:n,chart:e});xt.configure(e,s,n),xt.addBox(e,s)},stop(e){xt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let s=e.legend;xt.configure(e,s,n),s.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let s=t.datasetIndex,r=n.chart;r.isDatasetVisible(s)?(r.hide(s),t.hidden=!0):(r.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:r,color:o,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{let u=c.controller.getStyle(n?0:void 0),d=mt(u.borderWidth);return{text:t[c.index].label,fillStyle:u.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:s||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:a&&(l||u.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Ci=class extends Vt{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,n){let s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;let r=Q(s.text)?s.text.length:1;this._padding=mt(s.padding);let o=r*ut(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:n,left:s,bottom:r,right:o,options:a}=this,l=a.align,c=0,u,d,h;return this.isHorizontal()?(d=gt(l,s,o),h=n+t,u=o-s):(a.position==="left"?(d=s+t,h=gt(l,r,n),c=et*-.5):(d=o-t,h=gt(l,n,r),c=et*.5),u=r-n),{titleX:d,titleY:h,maxWidth:u,rotation:c}}draw(){let t=this.ctx,n=this.options;if(!n.display)return;let s=ut(n.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:u}=this._drawArgs(o);_e(t,n.text,0,0,s,{color:n.color,maxWidth:c,rotation:u,textAlign:ai(n.align),textBaseline:"middle",translation:[a,l]})}};function Rp(e,t){let n=new Ci({ctx:e.ctx,options:t,chart:e});xt.configure(e,n,t),xt.addBox(e,n),e.titleBlock=n}var Np={id:"title",_element:Ci,start(e,t,n){Rp(e,n)},stop(e){let t=e.titleBlock;xt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let s=e.titleBlock;xt.configure(e,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Vs=new WeakMap,Fp={id:"subtitle",start(e,t,n){let s=new Ci({ctx:e.ctx,options:n,chart:e});xt.configure(e,s,n),xt.addBox(e,s),Vs.set(e,s)},stop(e){xt.removeBox(e,Vs.get(e)),Vs.delete(e)},beforeUpdate(e,t,n){let s=Vs.get(e);xt.configure(e,s,n),s.options=n},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}},_i={average(e){if(!e.length)return!1;let t,n,s=0,r=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();s+=l.x,r+=l.y,++o}}return{x:s/o,y:r/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,s=t.y,r=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=e.length;o<a;++o){let c=e[o].element;if(c&&c.hasValue()){let u=c.getCenterPoint(),d=ii(t,u);d<r&&(r=d,l=c)}}if(l){let c=l.tooltipPosition();n=c.x,s=c.y}return{x:n,y:s}}};function le(e,t){return t&&(Q(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Se(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
4
|
+
`)>-1?e.split(`
|
|
5
|
+
`):e}function zp(e,t){let{element:n,datasetIndex:s,index:r}=t,o=e.getDatasetMeta(s).controller,{label:a,value:l}=o.getLabelAndValue(r);return{chart:e,label:a,parsed:o.getParsed(r),raw:e.data.datasets[s].data[r],formattedValue:l,dataset:o.getDataset(),dataIndex:r,datasetIndex:s,element:n}}function Bl(e,t){let n=e.chart.ctx,{body:s,footer:r,title:o}=e,{boxWidth:a,boxHeight:l}=t,c=ut(t.bodyFont),u=ut(t.titleFont),d=ut(t.footerFont),h=o.length,p=r.length,m=s.length,b=mt(t.padding),y=b.height,x=0,w=s.reduce((O,k)=>O+k.before.length+k.lines.length+k.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*u.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),w){let O=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;y+=m*O+(w-m)*c.lineHeight+(w-1)*t.bodySpacing}p&&(y+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let E=0,A=function(O){x=Math.max(x,n.measureText(O).width+E)};return n.save(),n.font=u.string,Y(e.title,A),n.font=c.string,Y(e.beforeBody.concat(e.afterBody),A),E=t.displayColors?a+2+t.boxPadding:0,Y(s,O=>{Y(O.before,A),Y(O.lines,A),Y(O.after,A)}),E=0,n.font=d.string,Y(e.footer,A),n.restore(),x+=b.width,{width:x,height:y}}function Bp(e,t){let{y:n,height:s}=t;return n<s/2?"top":n>e.height-s/2?"bottom":"center"}function Vp(e,t,n,s){let{x:r,width:o}=s,a=n.caretSize+n.caretPadding;if(e==="left"&&r+o+a>t.width||e==="right"&&r-o-a<0)return!0}function Hp(e,t,n,s){let{x:r,width:o}=n,{width:a,chartArea:{left:l,right:c}}=e,u="center";return s==="center"?u=r<=(l+c)/2?"left":"right":r<=o/2?u="left":r>=a-o/2&&(u="right"),Vp(u,e,t,n)&&(u="center"),u}function Vl(e,t,n){let s=n.yAlign||t.yAlign||Bp(e,n);return{xAlign:n.xAlign||t.xAlign||Hp(e,t,n,s),yAlign:s}}function Wp(e,t){let{x:n,width:s}=e;return t==="right"?n-=s:t==="center"&&(n-=s/2),n}function jp(e,t,n){let{y:s,height:r}=e;return t==="top"?s+=n:t==="bottom"?s-=r+n:s-=r/2,s}function Hl(e,t,n,s){let{caretSize:r,caretPadding:o,cornerRadius:a}=e,{xAlign:l,yAlign:c}=n,u=r+o,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:m}=xe(a),b=Wp(t,l),y=jp(t,c,u);return c==="center"?l==="left"?b+=u:l==="right"&&(b-=u):l==="left"?b-=Math.max(d,p)+r:l==="right"&&(b+=Math.max(h,m)+r),{x:ft(b,0,s.width-t.width),y:ft(y,0,s.height-t.height)}}function Hs(e,t,n){let s=mt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-s.right:e.x+s.left}function Wl(e){return le([],Se(e))}function Up(e,t,n){return ae(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function jl(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var vc={beforeTitle:Kt,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return n[t.dataIndex]}return""},afterTitle:Kt,beforeBody:Kt,beforeLabel:Kt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return K(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Kt,afterBody:Kt,beforeFooter:Kt,footer:Kt,afterFooter:Kt};function At(e,t,n,s){let r=e[t].call(n,s);return typeof r>"u"?vc[t].call(n,s):r}var Ei=class extends Vt{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(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,s=this.options.setContext(this.getContext()),r=s.enabled&&n.options.animation&&s.animations,o=new Xs(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Up(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:s}=n,r=At(s,"beforeTitle",this,t),o=At(s,"title",this,t),a=At(s,"afterTitle",this,t),l=[];return l=le(l,Se(r)),l=le(l,Se(o)),l=le(l,Se(a)),l}getBeforeBody(t,n){return Wl(At(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:s}=n,r=[];return Y(t,o=>{let a={before:[],lines:[],after:[]},l=jl(s,o);le(a.before,Se(At(l,"beforeLabel",this,o))),le(a.lines,At(l,"label",this,o)),le(a.after,Se(At(l,"afterLabel",this,o))),r.push(a)}),r}getAfterBody(t,n){return Wl(At(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:s}=n,r=At(s,"beforeFooter",this,t),o=At(s,"footer",this,t),a=At(s,"afterFooter",this,t),l=[];return l=le(l,Se(r)),l=le(l,Se(o)),l=le(l,Se(a)),l}_createItems(t){let n=this._active,s=this.chart.data,r=[],o=[],a=[],l=[],c,u;for(c=0,u=n.length;c<u;++c)l.push(zp(this.chart,n[c]));return t.filter&&(l=l.filter((d,h,p)=>t.filter(d,h,p,s))),t.itemSort&&(l=l.sort((d,h)=>t.itemSort(d,h,s))),Y(l,d=>{let h=jl(t.callbacks,d);r.push(At(h,"labelColor",this,d)),o.push(At(h,"labelPointStyle",this,d)),a.push(At(h,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){let s=this.options.setContext(this.getContext()),r=this._active,o,a=[];if(!r.length)this.opacity!==0&&(o={opacity:0});else{let l=_i[s.position].call(this,r,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let c=this._size=Bl(this,s),u=Object.assign({},l,c),d=Vl(this.chart,s,u),h=Hl(s,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,s,r){let o=this.getCaretPosition(t,s,r);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,s){let{xAlign:r,yAlign:o}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:h}=xe(l),{x:p,y:m}=t,{width:b,height:y}=n,x,w,E,A,O,k;return o==="center"?(O=m+y/2,r==="left"?(x=p,w=x-a,A=O+a,k=O-a):(x=p+b,w=x+a,A=O-a,k=O+a),E=x):(r==="left"?w=p+Math.max(c,d)+a:r==="right"?w=p+b-Math.max(u,h)-a:w=this.caretX,o==="top"?(A=m,O=A-a,x=w-a,E=w+a):(A=m+y,O=A+a,x=w+a,E=w-a),k=A),{x1:x,x2:w,x3:E,y1:A,y2:O,y3:k}}drawTitle(t,n,s){let r=this.title,o=r.length,a,l,c;if(o){let u=Be(s.rtl,this.x,this.width);for(t.x=Hs(this,s.titleAlign,s),n.textAlign=u.textAlign(s.titleAlign),n.textBaseline="middle",a=ut(s.titleFont),l=s.titleSpacing,n.fillStyle=s.titleColor,n.font=a.string,c=0;c<o;++c)n.fillText(r[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=s.titleMarginBottom-l)}}_drawColorBox(t,n,s,r,o){let a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:u}=o,d=ut(o.bodyFont),h=Hs(this,"left",o),p=r.x(h),m=c<d.lineHeight?(d.lineHeight-c)/2:0,b=n.y+m;if(o.usePointStyle){let y={radius:Math.min(u,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=r.leftForLtr(p,u)+u/2,w=b+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ci(t,y,x,w),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ci(t,y,x,w)}else{t.lineWidth=q(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let y=r.leftForLtr(p,u),x=r.leftForLtr(r.xPlus(p,1),u-2),w=xe(a.borderRadius);Object.values(w).some(E=>E!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,on(t,{x:y,y:b,w:u,h:c,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),on(t,{x,y:b+1,w:u-2,h:c-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,b,u,c),t.strokeRect(y,b,u,c),t.fillStyle=a.backgroundColor,t.fillRect(x,b+1,u-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,n,s){let{body:r}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:d}=s,h=ut(s.bodyFont),p=h.lineHeight,m=0,b=Be(s.rtl,this.x,this.width),y=function(P){n.fillText(P,b.x(t.x+m),t.y+p/2),t.y+=p+o},x=b.textAlign(a),w,E,A,O,k,L,M;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Hs(this,x,s),n.fillStyle=s.bodyColor,Y(this.beforeBody,y),m=l&&x!=="right"?a==="center"?u/2+d:u+2+d:0,O=0,L=r.length;O<L;++O){for(w=r[O],E=this.labelTextColors[O],n.fillStyle=E,Y(w.before,y),A=w.lines,l&&A.length&&(this._drawColorBox(n,t,O,b,s),p=Math.max(h.lineHeight,c)),k=0,M=A.length;k<M;++k)y(A[k]),p=h.lineHeight;Y(w.after,y)}m=0,p=h.lineHeight,Y(this.afterBody,y),t.y-=o}drawFooter(t,n,s){let r=this.footer,o=r.length,a,l;if(o){let c=Be(s.rtl,this.x,this.width);for(t.x=Hs(this,s.footerAlign,s),t.y+=s.footerMarginTop,n.textAlign=c.textAlign(s.footerAlign),n.textBaseline="middle",a=ut(s.footerFont),n.fillStyle=s.footerColor,n.font=a.string,l=0;l<o;++l)n.fillText(r[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,n,s,r){let{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:u,height:d}=s,{topLeft:h,topRight:p,bottomLeft:m,bottomRight:b}=xe(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+h,c),a==="top"&&this.drawCaret(t,n,s,r),n.lineTo(l+u-p,c),n.quadraticCurveTo(l+u,c,l+u,c+p),a==="center"&&o==="right"&&this.drawCaret(t,n,s,r),n.lineTo(l+u,c+d-b),n.quadraticCurveTo(l+u,c+d,l+u-b,c+d),a==="bottom"&&this.drawCaret(t,n,s,r),n.lineTo(l+m,c+d),n.quadraticCurveTo(l,c+d,l,c+d-m),a==="center"&&o==="left"&&this.drawCaret(t,n,s,r),n.lineTo(l,c+h),n.quadraticCurveTo(l,c,l+h,c),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,s=this.$animations,r=s&&s.x,o=s&&s.y;if(r||o){let a=_i[t.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=Bl(this,t),c=Object.assign({},a,this._size),u=Vl(n,t,c),d=Hl(t,c,u,n);(r._to!==d.x||o._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(n);let r={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=mt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,r,n),Ls(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Is(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let s=this._active,r=t.map(({datasetIndex:l,index:c})=>{let u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),o=!Mn(s,r),a=this._positionChanged(r,n);(o||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,s),l=this._positionChanged(a,t),c=n||!Mn(a,o)||l;return c&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,s,r){let o=this.options;if(t.type==="mouseout")return[];if(!r)return n;let a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,n){let{caretX:s,caretY:r,options:o}=this,a=_i[o.position].call(this,t,n);return a!==!1&&(s!==a.x||r!==a.y)}};F(Ei,"positioners",_i);var Xp={id:"tooltip",_element:Ei,positioners:_i,afterInit(e,t,n){n&&(e.tooltip=new Ei({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:vc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Yp=Object.freeze({__proto__:null,Colors:sp,Decimation:lp,Filler:Cp,Legend:Ip,SubTitle:Fp,Title:Np,Tooltip:Xp}),qp=(e,t,n,s)=>(typeof t=="string"?(n=e.push(t)-1,s.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function $p(e,t,n,s){let r=e.indexOf(t);if(r===-1)return qp(e,t,n,s);let o=e.lastIndexOf(t);return r!==o?n:r}var Gp=(e,t)=>e===null?null:ft(Math.round(e),0,t);function Ul(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var xi=class extends Ee{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let s=this.getLabels();for(let{index:r,label:o}of n)s[r]===o&&s.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(K(t))return null;let s=this.getLabels();return n=isFinite(n)&&s[n]===t?n:$p(s,t,H(n,t),this._addedLabels),Gp(n,s.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:s,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),n||(r=this.getLabels().length-1)),this.min=s,this.max=r}buildTicks(){let t=this.min,n=this.max,s=this.options.offset,r=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Ul.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){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(xi,"id","category"),F(xi,"defaults",{ticks:{callback:Ul}});function Kp(e,t){let n=[],{bounds:r,step:o,min:a,max:l,precision:c,count:u,maxTicks:d,maxDigits:h,includeBounds:p}=e,m=o||1,b=d-1,{min:y,max:x}=t,w=!K(a),E=!K(l),A=!K(u),O=(x-y)/(h+1),k=fs((x-y)/b/m)*m,L,M,P,C;if(k<1e-14&&!w&&!E)return[{value:y},{value:x}];C=Math.ceil(x/k)-Math.floor(y/k),C>b&&(k=fs(C*k/b/m)*m),K(c)||(L=Math.pow(10,c),k=Math.ceil(k*L)/L),r==="ticks"?(M=Math.floor(y/k)*k,P=Math.ceil(x/k)*k):(M=y,P=x),w&&E&&o&&Yr((l-a)/o,k/1e3)?(C=Math.round(Math.min((l-a)/k,d)),k=(l-a)/C,M=a,P=l):A?(M=w?a:M,P=E?l:P,C=u-1,k=(P-M)/C):(C=(P-M)/k,oe(C,Math.round(C),k/1e3)?C=Math.round(C):C=Math.ceil(C));let I=Math.max(hs(k),hs(M));L=Math.pow(10,K(c)?I:c),M=Math.round(M*L)/L,P=Math.round(P*L)/L;let z=0;for(w&&(p&&M!==a?(n.push({value:a}),M<a&&z++,oe(Math.round((M+z*k)*L)/L,a,Xl(a,O,e))&&z++):M<a&&z++);z<C;++z){let W=Math.round((M+z*k)*L)/L;if(E&&W>l)break;n.push({value:W})}return E&&p&&P!==l?n.length&&oe(n[n.length-1].value,l,Xl(l,O,e))?n[n.length-1].value=l:n.push({value:l}):(!E||P===l)&&n.push({value:P}),n}function Xl(e,t,{horizontal:n,minRotation:s}){let r=Ft(s),o=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}var zn=class extends Ee{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,n){return K(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds(),{min:r,max:o}=this,a=c=>r=n?r:c,l=c=>o=s?o:c;if(t){let c=Pt(r),u=Pt(o);c<0&&u<0?l(0):c>0&&u>0&&a(0)}if(r===o){let c=o===0?1:Math.abs(o*.05);l(o+c),t||a(r-c)}this.min=r,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:n,stepSize:s}=t,r;return s?(r=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,n=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let r={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=Kp(r,o);return t.bounds==="ticks"&&ds(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,n=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let r=(s-n)/Math.max(t.length-1,1)/2;n-=r,s+=r}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(t){return rn(t,this.chart.options.locale,this.options.ticks.format)}},wi=class extends zn{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=st(t)?t:0,this.max=st(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,s=Ft(this.options.ticks.minRotation),r=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}};F(wi,"id","linear"),F(wi,"defaults",{ticks:{callback:li.formatters.numeric}});var ki=e=>Math.floor(se(e)),cn=(e,t)=>Math.pow(10,ki(e)+t);function Yl(e){return e/Math.pow(10,ki(e))===1}function ql(e,t,n){let s=Math.pow(10,n),r=Math.floor(e/s);return Math.ceil(t/s)-r}function Zp(e,t){let n=t-e,s=ki(n);for(;ql(e,t,s)>10;)s++;for(;ql(e,t,s)<10;)s--;return Math.min(s,ki(e))}function Qp(e,{min:t,max:n}){t=Ct(e.min,t);let s=[],r=ki(t),o=Zp(t,n),a=o<0?Math.pow(10,Math.abs(o)):1,l=Math.pow(10,o),c=r>o?Math.pow(10,r):0,u=Math.round((t-c)*a)/a,d=Math.floor((t-c)/l/10)*l*10,h=Math.floor((u-d)/Math.pow(10,o)),p=Ct(e.min,Math.round((c+d+h*Math.pow(10,o))*a)/a);for(;p<n;)s.push({value:p,major:Yl(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),p=Math.round((c+d+h*Math.pow(10,o))*a)/a;let m=Ct(e.max,p);return s.push({value:m,major:Yl(m),significand:h}),s}var Si=class extends Ee{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let s=zn.prototype.parse.apply(this,[t,n]);if(s===0){this._zero=!0;return}return st(s)&&s>0?s:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=st(t)?Math.max(0,t):null,this.max=st(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!st(this._userMin)&&(this.min=t===cn(this.min,0)?cn(this.min,-1):cn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),s=this.min,r=this.max,o=l=>s=t?s:l,a=l=>r=n?r:l;s===r&&(s<=0?(o(1),a(10)):(o(cn(s,-1)),a(cn(r,1)))),s<=0&&o(cn(r,-1)),r<=0&&a(cn(s,1)),this.min=s,this.max=r}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},s=Qp(n,this);return t.bounds==="ticks"&&ds(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":rn(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=se(t),this._valueRange=se(this.max)-se(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(se(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(Si,"id","logarithmic"),F(Si,"defaults",{ticks:{callback:li.formatters.logarithmic,major:{enabled:!0}}});function Lo(e){let t=e.ticks;if(t.display&&e.display){let n=mt(t.backdropPadding);return H(t.font&&t.font.size,ot.font.size)+n.height}return 0}function Jp(e,t,n){return n=Q(n)?n:[n],{w:Jr(e,t.string,n),h:n.length*t.lineHeight}}function $l(e,t,n,s,r){return e===s||e===r?{start:t-n/2,end:t+n/2}:e<s||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function tg(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),s=[],r=[],o=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?et/o:0;for(let c=0;c<o;c++){let u=a.setContext(e.getPointLabelContext(c));r[c]=u.padding;let d=e.getPointPosition(c,e.drawingArea+r[c],l),h=ut(u.font),p=Jp(e.ctx,h,e._pointLabels[c]);s[c]=p;let m=Mt(e.getIndexAngle(c)+l),b=Math.round(ri(m)),y=$l(b,d.x,p.w,0,180),x=$l(b,d.y,p.h,90,270);eg(n,t,m,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=sg(e,s,r)}function eg(e,t,n,s,r){let o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n)),l=0,c=0;s.start<t.l?(l=(t.l-s.start)/o,e.l=Math.min(e.l,t.l-l)):s.end>t.r&&(l=(s.end-t.r)/o,e.r=Math.max(e.r,t.r+l)),r.start<t.t?(c=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-c)):r.end>t.b&&(c=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+c))}function ng(e,t,n){let s=e.drawingArea,{extra:r,additionalAngle:o,padding:a,size:l}=n,c=e.getPointPosition(t,s+r+a,o),u=Math.round(ri(Mt(c.angle+it))),d=ag(c.y,l.h,u),h=rg(u),p=og(c.x,l.w,h);return{visible:!0,x:c.x,y:d,textAlign:h,left:p,top:d,right:p+l.w,bottom:d+l.h}}function ig(e,t){if(!t)return!0;let{left:n,top:s,right:r,bottom:o}=e;return!(Nt({x:n,y:s},t)||Nt({x:n,y:o},t)||Nt({x:r,y:s},t)||Nt({x:r,y:o},t))}function sg(e,t,n){let s=[],r=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Lo(o)/2,additionalAngle:a?et/r:0},u;for(let d=0;d<r;d++){c.padding=n[d],c.size=t[d];let h=ng(e,d,c);s.push(h),l==="auto"&&(h.visible=ig(h,u),h.visible&&(u=h))}return s}function rg(e){return e===0||e===180?"center":e<180?"left":"right"}function og(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function ag(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function lg(e,t,n){let{left:s,top:r,right:o,bottom:a}=n,{backdropColor:l}=t;if(!K(l)){let c=xe(t.borderRadius),u=mt(t.backdropPadding);e.fillStyle=l;let d=s-u.left,h=r-u.top,p=o-s+u.width,m=a-r+u.height;Object.values(c).some(b=>b!==0)?(e.beginPath(),on(e,{x:d,y:h,w:p,h:m,radius:c}),e.fill()):e.fillRect(d,h,p,m)}}function cg(e,t){let{ctx:n,options:{pointLabels:s}}=e;for(let r=t-1;r>=0;r--){let o=e._pointLabelItems[r];if(!o.visible)continue;let a=s.setContext(e.getPointLabelContext(r));lg(n,a,o);let l=ut(a.font),{x:c,y:u,textAlign:d}=o;_e(n,e._pointLabels[r],c,u+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function bc(e,t,n,s){let{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,J);else{let o=e.getPointPosition(0,t);r.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=e.getPointPosition(a,t),r.lineTo(o.x,o.y)}}function ug(e,t,n,s,r){let o=e.ctx,a=t.circular,{color:l,lineWidth:c}=t;!a&&!s||!l||!c||n<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(r.dash),o.lineDashOffset=r.dashOffset,o.beginPath(),bc(e,n,a,s),o.closePath(),o.stroke(),o.restore())}function fg(e,t,n){return ae(e,{label:n,index:t,type:"pointLabel"})}var fn=class extends zn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=mt(Lo(this.options)/2),n=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(n,s)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=st(t)&&!isNaN(t)?t:0,this.max=st(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Lo(this.options))}generateTickLabels(t){zn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,s)=>{let r=V(this.options.pointLabels.callback,[n,s],this);return r||r===0?r:""}).filter((n,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?tg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,s,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((s-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,s,r))}getIndexAngle(t){let n=J/(this._pointLabels.length||1),s=this.options.startAngle||0;return Mt(t*n+Ft(s))}getDistanceFromCenterForValue(t){if(K(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(K(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let s=n[t];return fg(this.getContext(),t,s)}}getPointPosition(t,n,s=0){let r=this.getIndexAngle(t)-it+s;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:s,right:r,bottom:o}=this._pointLabelItems[t];return{left:n,top:s,right:r,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let s=this.ctx;s.save(),s.beginPath(),bc(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:s,grid:r,border:o}=n,a=this._pointLabels.length,l,c,u;if(n.pointLabels.display&&cg(this,a),r.display&&this.ticks.forEach((d,h)=>{if(h!==0){c=this.getDistanceFromCenterForValue(d.value);let p=this.getContext(h),m=r.setContext(p),b=o.setContext(p);ug(this,m,c,a,b)}}),s.display){for(t.save(),l=a-1;l>=0;l--){let d=s.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:p}=d;!p||!h||(t.lineWidth=p,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(l,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,n=this.options,s=n.ticks;if(!s.display)return;let r=this.getIndexAngle(0),o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&!n.reverse)return;let u=s.setContext(this.getContext(c)),d=ut(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),u.showLabelBackdrop){t.font=d.string,a=t.measureText(l.label).width,t.fillStyle=u.backdropColor;let h=mt(u.backdropPadding);t.fillRect(-a/2-h.left,-o-d.size/2-h.top,a+h.width,d.size+h.height)}_e(t,l.label,0,-o,d,{color:u.color})}),t.restore()}drawTitle(){}};F(fn,"id","radialLinear"),F(fn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:li.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(fn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(fn,"descriptors",{angleLines:{_fallback:"grid"}});var Zs={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}},Ot=Object.keys(Zs);function dg(e,t){return e-t}function Gl(e,t){if(K(t))return null;let n=e._adapter,{parser:s,round:r,isoWeekday:o}=e._parseOpts,a=t;return typeof s=="function"&&(a=s(a)),st(a)||(a=typeof s=="string"?n.parse(a,s):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Fe(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,r)),+a)}function Kl(e,t,n,s){let r=Ot.length;for(let o=Ot.indexOf(e);o<r-1;++o){let a=Zs[Ot[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=s)return Ot[o]}return Ot[r-1]}function hg(e,t,n,s,r){for(let o=Ot.length-1;o>=Ot.indexOf(n);o--){let a=Ot[o];if(Zs[a].common&&e._adapter.diff(r,s,a)>=t-1)return a}return Ot[n?Ot.indexOf(n):0]}function pg(e){for(let t=Ot.indexOf(e)+1,n=Ot.length;t<n;++t)if(Zs[Ot[t]].common)return Ot[t]}function Zl(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:s,hi:r}=oi(n,t),o=n[s]>=t?n[s]:n[r];e[o]=!0}}function gg(e,t,n,s){let r=e._adapter,o=+r.startOf(t[0].value,s),a=t[t.length-1].value,l,c;for(l=o;l<=a;l=+r.add(l,1,s))c=n[l],c>=0&&(t[c].major=!0);return t}function Ql(e,t,n){let s=[],r={},o=t.length,a,l;for(a=0;a<o;++a)l=t[a],r[l]=a,s.push({value:l,major:!1});return o===0||!n?s:gg(e,s,r,n)}var hn=class extends Ee{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,n={}){let s=t.time||(t.time={}),r=this._adapter=new Cd._date(t.adapters.date);r.init(n),en(s.displayFormats,r.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Gl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,s=t.time.unit||"day",{min:r,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(u){!a&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!l&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=st(r)&&!isNaN(r)?r:+n.startOf(Date.now(),s),o=st(o)&&!isNaN(o)?o:+n.endOf(Date.now(),s)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s}}buildTicks(){let t=this.options,n=t.time,s=t.ticks,r=s.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]);let o=this.min,a=this.max,l=Gr(r,o,a);return this._unit=n.unit||(s.autoSkip?Kl(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):hg(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:pg(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Ql(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,s=0,r,o;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;n=ft(n,0,a),s=ft(s,0,a),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){let t=this._adapter,n=this.min,s=this.max,r=this.options,o=r.time,a=o.unit||Kl(o.minUnit,n,s,this._getLabelCapacity(n)),l=H(r.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,u=Fe(c)||c===!0,d={},h=n,p,m;if(u&&(h=+t.startOf(h,"isoWeek",c)),h=+t.startOf(h,u?"day":a),t.diff(s,n,a)>1e5*l)throw new Error(n+" and "+s+" are too far apart with stepSize of "+l+" "+a);let b=r.ticks.source==="data"&&this.getDataTimestamps();for(p=h,m=0;p<s;p=+t.add(p,l,a),m++)Zl(d,p,b);return(p===s||r.bounds==="ticks"||m===1)&&Zl(d,p,b),Object.keys(d).sort((y,x)=>y-x).map(y=>+y)}getLabelForValue(t){let n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(t,s.tooltipFormat):n.format(t,s.displayFormats.datetime)}format(t,n){let r=this.options.time.displayFormats,o=this._unit,a=n||r[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,s,r){let o=this.options,a=o.ticks.callback;if(a)return V(a,[t,n,s],this);let l=o.time.displayFormats,c=this._unit,u=this._majorUnit,d=c&&l[c],h=u&&l[u],p=s[n],m=u&&h&&p&&p.major;return this._adapter.format(t,r||(m?h:d))}generateTickLabels(t){let n,s,r;for(n=0,s=t.length;n<s;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(t){let n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,s=this.ctx.measureText(t).width,r=Ft(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:s*o+l*a,h:s*a+l*o}}_getLabelCapacity(t){let n=this.options.time,s=n.displayFormats,r=s[n.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Ql(this,[t],this._majorUnit),r),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,s;if(t.length)return t;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,s=r.length;n<s;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,s;if(t.length)return t;let r=this.getLabels();for(n=0,s=r.length;n<s;++n)t.push(Gl(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ms(t.sort(dg))}};F(hn,"id","time"),F(hn,"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 Ws(e,t,n){let s=0,r=e.length-1,o,a,l,c;n?(t>=e[s].pos&&t<=e[r].pos&&({lo:s,hi:r}=Gt(e,"pos",t)),{pos:o,time:l}=e[s],{pos:a,time:c}=e[r]):(t>=e[s].time&&t<=e[r].time&&({lo:s,hi:r}=Gt(e,"time",t)),{time:o,pos:l}=e[s],{time:a,pos:c}=e[r]);let u=a-o;return u?l+(c-l)*(t-o)/u:l}var Ti=class extends hn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Ws(n,this.min),this._tableRange=Ws(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:s}=this,r=[],o=[],a,l,c,u,d;for(a=0,l=t.length;a<l;++a)u=t[a],u>=n&&u<=s&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(a=0,l=r.length;a<l;++a)d=r[a+1],c=r[a-1],u=r[a],Math.round((d+c)/2)!==u&&o.push({time:u,pos:a/(l-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?t=this.normalize(n.concat(s)):t=n.length?n:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Ws(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return Ws(this._table,s*this._tableRange+this._minPos,!0)}};F(Ti,"id","timeseries"),F(Ti,"defaults",hn.defaults);var mg=Object.freeze({__proto__:null,CategoryScale:xi,LinearScale:wi,LogarithmicScale:Si,RadialLinearScale:fn,TimeScale:hn,TimeSeriesScale:Ti}),yc=[Pd,Qh,Yp,mg];jt.register(...yc);var Ro=jt;var Bn=uu(_c());var Di=e=>e&&e.enabled&&e.modifierKey,Lc=(e,t)=>e&&t[e+"Key"],jo=(e,t)=>e&&!t[e+"Key"];function He(e,t,n){return e===void 0?!0:typeof e=="string"?e.indexOf(t)!==-1:typeof e=="function"?e({chart:n}).indexOf(t)!==-1:!1}function No(e,t){return typeof e=="function"&&(e=e({chart:t})),typeof e=="string"?{x:e.indexOf("x")!==-1,y:e.indexOf("y")!==-1}:{x:!1,y:!1}}function vg(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function bg({x:e,y:t},n){let s=n.scales,r=Object.keys(s);for(let o=0;o<r.length;o++){let a=s[r[o]];if(t>=a.top&&t<=a.bottom&&e>=a.left&&e<=a.right)return a}return null}function Ic(e,t,n){let{mode:s="xy",scaleMode:r,overScaleMode:o}=e||{},a=bg(t,n),l=No(s,n),c=No(r,n);if(o){let d=No(o,n);for(let h of["x","y"])d[h]&&(c[h]=l[h],l[h]=!1)}if(a&&c[a.axis])return[a];let u=[];return Y(n.scales,function(d){l[d.axis]&&u.push(d)}),u}var Fo=new WeakMap;function at(e){let t=Fo.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Fo.set(e,t)),t}function yg(e){Fo.delete(e)}function Rc(e,t,n,s){let r=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-r;return{min:s*r,max:s*o}}function Nc(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Fc(e,t,n){let s=e.max-e.min,r=s*(t-1),o=Nc(e,n);return Rc(o,e.min,s,r)}function _g(e,t,n){let s=Nc(e,n);if(s===void 0)return{min:e.min,max:e.max};let r=Math.log10(e.min),o=Math.log10(e.max),a=Math.log10(s),l=o-r,c=l*(t-1),u=Rc(a,r,l,c);return{min:Math.pow(10,r+u.min),max:Math.pow(10,o-u.max)}}function xg(e,t){return t&&(t[e.id]||t[e.axis])||{}}function xc(e,t,n,s,r){let o=n[s];if(o==="original"){let a=e.originalScaleLimits[t.id][s];o=H(a.options,a.scale)}return H(o,r)}function wg(e,t,n){let s=e.getValueForPixel(t),r=e.getValueForPixel(n);return{min:Math.min(s,r),max:Math.max(s,r)}}function Sg(e,{min:t,max:n,minLimit:s,maxLimit:r},o){let a=(e-n+t)/2;t-=a,n+=a;let l=o.min.options??o.min.scale,c=o.max.options??o.max.scale,u=e/1e6;return oe(t,l,u)&&(t=l),oe(n,c,u)&&(n=c),t<s?(t=s,n=Math.min(s+e,r)):n>r&&(n=r,t=Math.max(r-e,s)),{min:t,max:n}}function pn(e,{min:t,max:n},s,r=!1){let o=at(e.chart),{options:a}=e,l=xg(e,s),{minRange:c=0}=l,u=xc(o,e,l,"min",-1/0),d=xc(o,e,l,"max",1/0);if(r==="pan"&&(t<u||n>d))return!0;let h=e.max-e.min,p=r?Math.max(n-t,c):h;if(r&&p===c&&h<=c)return!0;let m=Sg(p,{min:t,max:n,minLimit:u,maxLimit:d},o.originalScaleLimits[e.id]);return a.min=m.min,a.max=m.max,o.updatedScaleLimits[e.id]=m,e.parse(m.min)!==e.min||e.parse(m.max)!==e.max}function Tg(e,t,n,s){let r=Fc(e,t,n),o={min:e.min+r.min,max:e.max-r.max};return pn(e,o,s,!0)}function Eg(e,t,n,s){let r=_g(e,t,n);return pn(e,r,s,!0)}function Mg(e,t,n,s){pn(e,wg(e,t,n),s,!0)}var wc=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function Pg(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Cg(e,t,n,s){let r=Fc(e,t,n);e.min===e.max&&t<1&&Pg(e);let o={min:e.min+wc(r.min),max:e.max-wc(r.max)};return pn(e,o,s,!0)}function kg(e){return e.isHorizontal()?e.width:e.height}function Ag(e,t,n){let r=e.getLabels().length-1,{min:o,max:a}=e,l=Math.max(a-o,1),c=Math.round(kg(e)/Math.max(l,10)),u=Math.round(Math.abs(t/c)),d;return t<-c?(a=Math.min(a+u,r),o=l===1?a:a-l,d=a===r):t>c&&(o=Math.max(0,o-u),a=l===1?o:o+l,d=o===0),pn(e,{min:o,max:a},n)||d}var Og={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function zc(e,t,n,s=!1){let{min:r,max:o,options:a}=e,l=a.time&&a.time.round,c=Og[l]||0,u=e.getValueForPixel(e.getPixelForValue(r+c)-t),d=e.getValueForPixel(e.getPixelForValue(o+c)-t);return isNaN(u)||isNaN(d)?!0:pn(e,{min:u,max:d},n,s?"pan":!1)}function Sc(e,t,n){return zc(e,t,n,!0)}var zo={category:Cg,default:Tg,logarithmic:Eg},Bo={default:Mg},Vo={category:Ag,default:zc,logarithmic:Sc,timeseries:Sc};function Dg(e,t,n){let{id:s,options:{min:r,max:o}}=e;if(!t[s]||!n[s])return!0;let a=n[s];return a.min!==r||a.max!==o}function Tc(e,t){Y(e,(n,s)=>{t[s]||delete e[s]})}function Vn(e,t){let{scales:n}=e,{originalScaleLimits:s,updatedScaleLimits:r}=t;return Y(n,function(o){Dg(o,s,r)&&(s[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Tc(s,n),Tc(r,n),s}function Ec(e,t,n,s){let r=zo[e.type]||zo.default;V(r,[e,t,n,s])}function Mc(e,t,n,s){let r=Bo[e.type]||Bo.default;V(r,[e,t,n,s])}function Lg(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Uo(e,t,n="none",s="api"){let{x:r=1,y:o=1,focalPoint:a=Lg(e)}=typeof t=="number"?{x:t,y:t}:t,l=at(e),{options:{limits:c,zoom:u}}=l;Vn(e,l);let d=r!==1,h=o!==1,p=Ic(u,a,e);Y(p||e.scales,function(m){m.isHorizontal()&&d?Ec(m,r,a,c):!m.isHorizontal()&&h&&Ec(m,o,a,c)}),e.update(n),V(u.onZoom,[{chart:e,trigger:s}])}function Bc(e,t,n,s="none",r="api"){let o=at(e),{options:{limits:a,zoom:l}}=o,{mode:c="xy"}=l;Vn(e,o);let u=He(c,"x",e),d=He(c,"y",e);Y(e.scales,function(h){h.isHorizontal()&&u?Mc(h,t.x,n.x,a):!h.isHorizontal()&&d&&Mc(h,t.y,n.y,a)}),e.update(s),V(l.onZoom,[{chart:e,trigger:r}])}function Ig(e,t,n,s="none",r="api"){let o=at(e);Vn(e,o);let a=e.scales[t];pn(a,n,void 0,!0),e.update(s),V(o.options.zoom?.onZoom,[{chart:e,trigger:r}])}function Rg(e,t="default"){let n=at(e),s=Vn(e,n);Y(e.scales,function(r){let o=r.options;s[r.id]?(o.min=s[r.id].min.options,o.max=s[r.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[r.id]}),e.update(t),V(n.options.zoom.onZoomComplete,[{chart:e}])}function Ng(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:s,max:r}=n;return H(r.options,r.scale)-H(s.options,s.scale)}function Fg(e){let t=at(e),n=1,s=1;return Y(e.scales,function(r){let o=Ng(t,r.id);if(o){let a=Math.round(o/(r.max-r.min)*100)/100;n=Math.min(n,a),s=Math.max(s,a)}}),n<1?n:s}function Pc(e,t,n,s){let{panDelta:r}=s,o=r[e.id]||0;Pt(o)===Pt(t)&&(t+=o);let a=Vo[e.type]||Vo.default;V(a,[e,t,n])?r[e.id]=0:r[e.id]=t}function Vc(e,t,n,s="none"){let{x:r=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,a=at(e),{options:{pan:l,limits:c}}=a,{onPan:u}=l||{};Vn(e,a);let d=r!==0,h=o!==0;Y(n||e.scales,function(p){p.isHorizontal()&&d?Pc(p,r,c,a):!p.isHorizontal()&&h&&Pc(p,o,c,a)}),e.update(s),V(u,[{chart:e}])}function Hc(e){let t=at(e);Vn(e,t);let n={};for(let s of Object.keys(e.scales)){let{min:r,max:o}=t.originalScaleLimits[s]||{min:{},max:{}};n[s]={min:r.scale,max:o.scale}}return n}function zg(e){let t=at(e),n={};for(let s of Object.keys(e.scales))n[s]=t.updatedScaleLimits[s];return n}function Bg(e){let t=Hc(e);for(let n of Object.keys(e.scales)){let{min:s,max:r}=t[n];if(s!==void 0&&e.scales[n].min!==s||r!==void 0&&e.scales[n].max!==r)return!0}return!1}function Cc(e){let t=at(e);return t.panning||t.dragging}var kc=(e,t,n)=>Math.min(n,Math.max(t,e));function Dt(e,t){let{handlers:n}=at(e),s=n[t];s&&s.target&&(s.target.removeEventListener(t,s),delete n[t])}function Oi(e,t,n,s){let{handlers:r,options:o}=at(e),a=r[n];if(a&&a.target===t)return;Dt(e,n),r[n]=c=>s(e,c,o),r[n].target=t;let l=n==="wheel"?!1:void 0;t.addEventListener(n,r[n],{passive:l})}function Vg(e,t){let n=at(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Hg(e,t){let n=at(e);!n.dragStart||t.key!=="Escape"||(Dt(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Ho(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return zt(e,t)}function Wc(e,t,n){let{onZoomStart:s,onZoomRejected:r}=n;if(s){let o=Ho(t,e);if(V(s,[{chart:e,event:t,point:o}])===!1)return V(r,[{chart:e,event:t}]),!1}}function Wg(e,t){if(e.legend){let o=zt(t,e);if(Nt(o,e.legend))return}let n=at(e),{pan:s,zoom:r={}}=n.options;if(t.button!==0||Lc(Di(s),t)||jo(Di(r.drag),t))return V(r.onZoomRejected,[{chart:e,event:t}]);Wc(e,t,r)!==!1&&(n.dragStart=t,Oi(e,e.canvas.ownerDocument,"mousemove",Vg),Oi(e,window.document,"keydown",Hg))}function jg({begin:e,end:t},n){let s=t.x-e.x,r=t.y-e.y,o=Math.abs(s/r);o>n?s=Math.sign(s)*Math.abs(r*n):o<n&&(r=Math.sign(r)*Math.abs(s/n)),t.x=e.x+s,t.y=e.y+r}function Ac(e,t,n,{min:s,max:r,prop:o}){e[s]=kc(Math.min(n.begin[o],n.end[o]),t[s],t[r]),e[r]=kc(Math.max(n.begin[o],n.end[o]),t[s],t[r])}function Ug(e,t,n){let s={begin:Ho(t.dragStart,e),end:Ho(t.dragEnd,e)};if(n){let r=e.chartArea.width/e.chartArea.height;jg(s,r)}return s}function jc(e,t,n,s){let r=He(t,"x",e),o=He(t,"y",e),{top:a,left:l,right:c,bottom:u,width:d,height:h}=e.chartArea,p={top:a,left:l,right:c,bottom:u},m=Ug(e,n,s&&r&&o);r&&Ac(p,e.chartArea,m,{min:"left",max:"right",prop:"x"}),o&&Ac(p,e.chartArea,m,{min:"top",max:"bottom",prop:"y"});let b=p.right-p.left,y=p.bottom-p.top;return{...p,width:b,height:y,zoomX:r&&b?1+(d-b)/d:1,zoomY:o&&y?1+(h-y)/h:1}}function Xg(e,t){let n=at(e);if(!n.dragStart)return;Dt(e,"mousemove");let{mode:s,onZoomComplete:r,drag:{threshold:o=0,maintainAspectRatio:a}}=n.options.zoom,l=jc(e,s,{dragStart:n.dragStart,dragEnd:t},a),c=He(s,"x",e)?l.width:0,u=He(s,"y",e)?l.height:0,d=Math.sqrt(c*c+u*u);if(n.dragStart=n.dragEnd=null,d<=o){n.dragging=!1,e.update("none");return}Bc(e,{x:l.left,y:l.top},{x:l.right,y:l.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,V(r,[{chart:e}])}function Yg(e,t,n){if(jo(Di(n.wheel),t)){V(n.onZoomRejected,[{chart:e,event:t}]);return}if(Wc(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function qg(e,t){let{handlers:{onZoomComplete:n},options:{zoom:s}}=at(e);if(!Yg(e,t,s))return;let r=t.target.getBoundingClientRect(),o=s.wheel.speed,a=t.deltaY>=0?2-1/(1-o):1+o,l={x:a,y:a,focalPoint:{x:t.clientX-r.left,y:t.clientY-r.top}};Uo(e,l,"zoom","wheel"),V(n,[{chart:e}])}function $g(e,t,n,s){n&&(at(e).handlers[t]=vg(()=>V(n,[{chart:e}]),s))}function Gg(e,t){let n=e.canvas,{wheel:s,drag:r,onZoomComplete:o}=t.zoom;s.enabled?(Oi(e,n,"wheel",qg),$g(e,"onZoomComplete",o,250)):Dt(e,"wheel"),r.enabled?(Oi(e,n,"mousedown",Wg),Oi(e,n.ownerDocument,"mouseup",Xg)):(Dt(e,"mousedown"),Dt(e,"mousemove"),Dt(e,"mouseup"),Dt(e,"keydown"))}function Kg(e){Dt(e,"mousedown"),Dt(e,"mousemove"),Dt(e,"mouseup"),Dt(e,"wheel"),Dt(e,"click"),Dt(e,"keydown")}function Zg(e,t){return function(n,s){let{pan:r,zoom:o={}}=t.options;if(!r||!r.enabled)return!1;let a=s&&s.srcEvent;return a&&!t.panning&&s.pointerType==="mouse"&&(jo(Di(r),a)||Lc(Di(o.drag),a))?(V(r.onPanRejected,[{chart:e,event:s}]),!1):!0}}function Qg(e,t){let n=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY),r=n/s,o,a;return r>.3&&r<1.7?o=a=!0:n>s?o=!0:a=!0,{x:o,y:a}}function Uc(e,t,n){if(t.scale){let{center:s,pointers:r}=n,o=1/t.scale*n.scale,a=n.target.getBoundingClientRect(),l=Qg(r[0],r[1]),c=t.options.zoom.mode,u={x:l.x&&He(c,"x",e)?o:1,y:l.y&&He(c,"y",e)?o:1,focalPoint:{x:s.x-a.left,y:s.y-a.top}};Uo(e,u,"zoom","pinch"),t.scale=n.scale}}function Jg(e,t,n){if(t.options.zoom.pinch.enabled){let s=zt(n,e);V(t.options.zoom.onZoomStart,[{chart:e,event:n,point:s}])===!1?(t.scale=null,V(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function tm(e,t,n){t.scale&&(Uc(e,t,n),t.scale=null,V(t.options.zoom.onZoomComplete,[{chart:e}]))}function Xc(e,t,n){let s=t.delta;s&&(t.panning=!0,Vc(e,{x:n.deltaX-s.x,y:n.deltaY-s.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function em(e,t,n){let{enabled:s,onPanStart:r,onPanRejected:o}=t.options.pan;if(!s)return;let a=n.target.getBoundingClientRect(),l={x:n.center.x-a.left,y:n.center.y-a.top};if(V(r,[{chart:e,event:n,point:l}])===!1)return V(o,[{chart:e,event:n}]);t.panScales=Ic(t.options.pan,l,e),t.delta={x:0,y:0},Xc(e,t,n)}function nm(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,V(t.options.pan.onPanComplete,[{chart:e}]))}var Wo=new WeakMap;function Oc(e,t){let n=at(e),s=e.canvas,{pan:r,zoom:o}=t,a=new Bn.default.Manager(s);o&&o.pinch.enabled&&(a.add(new Bn.default.Pinch),a.on("pinchstart",l=>Jg(e,n,l)),a.on("pinch",l=>Uc(e,n,l)),a.on("pinchend",l=>tm(e,n,l))),r&&r.enabled&&(a.add(new Bn.default.Pan({threshold:r.threshold,enable:Zg(e,n)})),a.on("panstart",l=>em(e,n,l)),a.on("panmove",l=>Xc(e,n,l)),a.on("panend",()=>nm(e,n))),Wo.set(e,a)}function Dc(e){let t=Wo.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Wo.delete(e))}function im(e,t){let{pan:n,zoom:s}=e,{pan:r,zoom:o}=t;return s?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==r?.enabled||n?.threshold!==r?.threshold}var sm="2.2.0";function Js(e,t,n){let s=n.zoom.drag,{dragStart:r,dragEnd:o}=at(e);if(s.drawTime!==t||!o)return;let{left:a,top:l,width:c,height:u}=jc(e,n.zoom.mode,{dragStart:r,dragEnd:o},s.maintainAspectRatio),d=e.ctx;d.save(),d.beginPath(),d.fillStyle=s.backgroundColor||"rgba(225,225,225,0.3)",d.fillRect(a,l,c,u),s.borderWidth>0&&(d.lineWidth=s.borderWidth,d.strokeStyle=s.borderColor||"rgba(225,225,225)",d.strokeRect(a,l,c,u)),d.restore()}var Yc={id:"zoom",version:sm,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let s=at(e);s.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),Bn.default&&Oc(e,n),e.pan=(r,o,a)=>Vc(e,r,o,a),e.zoom=(r,o)=>Uo(e,r,o),e.zoomRect=(r,o,a)=>Bc(e,r,o,a),e.zoomScale=(r,o,a)=>Ig(e,r,o,a),e.resetZoom=r=>Rg(e,r),e.getZoomLevel=()=>Fg(e),e.getInitialScaleBounds=()=>Hc(e),e.getZoomedScaleBounds=()=>zg(e),e.isZoomedOrPanned=()=>Bg(e),e.isZoomingOrPanning=()=>Cc(e)},beforeEvent(e,{event:t}){if(Cc(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=at(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let s=at(e),r=s.options;s.options=n,im(r,n)&&(Dc(e),Oc(e,n)),Gg(e,n)},beforeDatasetsDraw(e,t,n){Js(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){Js(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){Js(e,"beforeDraw",n)},afterDraw(e,t,n){Js(e,"afterDraw",n)},stop:function(e){Kg(e),Bn.default&&Dc(e),yg(e)},panFunctions:Vo,zoomFunctions:zo,zoomRectFunctions:Bo};Ro.register(Yc);function rm(e,t,n,s,r){let o=e.wave.value,a=e.response.value,l=t.wave.value,c=t.response.value,u=e.wave.unit,d=new Ro(n,{type:"line",data:{datasets:[{label:"Atmosphere",data:l.map((h,p)=>({x:h,y:c[p]})),fill:!0},{label:"Instrument",data:o.map((h,p)=>({x:h,y:a[p]})),fill:!0}]},options:{pointRadius:0,maintainAspectRatio:!1,interaction:{mode:"nearest",intersect:!0},scales:{x:{type:"linear",title:{display:!0,text:"Wavelength ["+u+"]"},min:e.wave_range.value[0],max:e.wave_range.value[1]},y:{title:{display:!0,text:"Transmission"},min:0,max:1}},plugins:{title:{display:!1,text:e.name+" filter"},legend:{display:!1},zoom:{zoom:{wheel:{enabled:!0},pinch:{enabled:!0},drag:{enabled:!0,modifierKey:"shift"},scaleMode:"xy",mode:"xy"},pan:{enabled:!0,scaleMode:"xy"},limits:{x:{min:"original",max:"original"},y:{min:"original",max:"original"}}}}}})}window.plot_filter=rm;async function qc(e){Lr("#content-slot",ts+"/"+e.id+"/etc_form").then(t=>{let n=document.querySelector("#etc-form");om(e),n.addEventListener("submit",async function(s){s.preventDefault();let r=new FormData(this),o=Object.fromEntries(r),a=o.filter_upload&&o.filter_upload.size>0;Lr("#modal-slot",ts+"/"+e.id+"/etc_results/query",a?{method:"post",data:r}:{data:r})})})}function om(e){if(select_filters=document.querySelector("#select-filters")){for(;select_filters.firstChild;)select_filters.lastChild.remove();let t=e.id,n=e.filters.transmissions,s=Xo(t);for(f in n){let r=document.createElement("ion-select-option");r.value=f,filter=n[f],r.innerHTML=filter.name,select_filters.appendChild(r),!s&&(filter.default||!s)&&(s=f)}option=document.createElement("ion-select-option"),option.value="upload",option.innerHTML="upload",select_filters.appendChild(option),select_filters.value=s,$c(t,s)}}var Yo=null;async function qo(){if(!Yo){let e=await Dr.create({message:"Loading instruments ...",duration:1e4});e.present(),Yo=ba(ma+"/instruments"),e.dismiss()}return Yo}function Gc(){return localStorage.getItem("pyDIETDefaultInstrument")}function $o(e){qo().then(t=>(instrument=t[e],qc(instrument),localStorage.setItem("pyDIETDefaultInstrument",e),e))}function Xo(e){return localStorage.getItem("pyDIETDefaultFilter_"+e)}function $c(e,t){return t?(localStorage.setItem("pyDIETDefaultFilter_"+e,t),t):Xo(e)}var tr=["Light","Dark","Auto"],Kc=["sunny","moon","contrast"],am=window.matchMedia("(prefers-color-scheme: dark)");function lm(e){document.body.classList.toggle("dark",e)}function Go(){return localStorage.getItem("pyDIETDefaultTheme")}function Ko(e){e?localStorage.setItem("pyDIETDefaultTheme",e):e=Go(),lm(typeof e=="string"&&e.includes("dark")||!(typeof e=="string"&&e.includes("light"))&&am.matches)}function Zc(){let e=document.querySelector("#theme-segment");if(e){for(var t in tr){let s=document.createElement("ion-segment-button"),r=document.createElement("ion-icon"),o=document.createElement("ion-label");s.value=tr[t].toLowerCase(),o.innerHTML=tr[t],s.appendChild(o),r.name=Kc[t],s.appendChild(r),e.appendChild(s)}let n=e.value=Go();Ko(n),e.addEventListener("ionChange",s=>{Ko(s.detail.value)})}}function Qc(e){if(instrument_segment=document.querySelector("#instrument-segment")){let t=Gc();for(i in e){let n=document.createElement("ion-segment-button"),s=document.createElement("ion-icon"),r=document.createElement("ion-label");n.value=i,instrument=e[i],r.innerHTML=instrument.name,n.appendChild(r),s.name="videocam",n.appendChild(s),instrument_segment.appendChild(n),!t&&(instrument.default||!t)&&(t=i)}instrument_segment.value=t,$o(t),instrument_segment.addEventListener("ionChange",n=>{$o(n.detail.value)})}}Zc();qo().then(e=>{Qc(e)});})();
|
|
6
|
+
/*!
|
|
7
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
8
|
+
*/
|
|
9
|
+
/*!
|
|
10
|
+
* @kurkle/color v0.3.4
|
|
11
|
+
* https://github.com/kurkle/color#readme
|
|
12
|
+
* (c) 2024 Jukka Kurkela
|
|
13
|
+
* Released under the MIT License
|
|
14
|
+
*/
|
|
15
|
+
/*!
|
|
16
|
+
* Chart.js v4.3.0
|
|
17
|
+
* https://www.chartjs.org
|
|
18
|
+
* (c) 2023 Chart.js Contributors
|
|
19
|
+
* Released under the MIT License
|
|
20
|
+
*/
|
|
21
|
+
/*!
|
|
22
|
+
* chartjs-plugin-zoom v2.2.0
|
|
23
|
+
* https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
|
|
24
|
+
* (c) 2016-2024 chartjs-plugin-zoom Contributors
|
|
25
|
+
* Released under the MIT License
|
|
26
|
+
*/
|
|
27
|
+
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
28
|
+
* http://hammerjs.github.io/
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) 2016 Jorik Tangelder;
|
|
31
|
+
* Licensed under the MIT license */
|