Repository navigation
Expand file tree
/
Copy pathcloudinary.js
More file actions
2 lines (2 loc) · 337 KB
/
Copy pathcloudinary.js
File metadata and controls
2 lines (2 loc) · 337 KB
1
2
(()=>{var t={951(t,e){var i,n,s,o;o=function(){var t="BKMGTPEZY".split("");function e(t,e){return t&&t.toLowerCase()===e.toLowerCase()}return function(i,n){return i="number"==typeof i?i:0,(n=n||{}).fixed="number"==typeof n.fixed?n.fixed:2,n.spacer="string"==typeof n.spacer?n.spacer:" ",n.calculate=function(t){var s=e(t,"si")?["k","B"]:["K","iB"],o=e(t,"si")?1e3:1024,r=Math.log(i)/Math.log(o)|0,a=i/Math.pow(o,r),l=a.toFixed(n.fixed);return r-1<3&&!e(t,"si")&&e(t,"jedec")&&(s[1]="B"),{suffix:r?(s[0]+"MGTPEZY")[r-1]+s[1]:1==(0|l)?"Byte":"Bytes",magnitude:r,result:a,fixed:l,bits:{result:a/8,fixed:(a/8).toFixed(n.fixed)}}},n.to=function(n,s){var o=e(s,"si")?1e3:1024,r=t.indexOf("string"==typeof n?n[0].toUpperCase():"B"),a=i;if(-1===r||0===r)return a.toFixed(2);for(;r>0;r--)a/=o;return a.toFixed(2)},n.human=function(t){var e=n.calculate(t);return e.fixed+n.spacer+e.suffix},n}},t.exports?t.exports=o():(n=[],void 0===(s="function"==typeof(i=o)?i.apply(e,n):i)||(t.exports=s))},998(t,e){var i,n,s;n=[],i=function(){"use strict";function t(t,e){var i,n,s;for(i=1,n=arguments.length;i<n;++i)if(null!=(e=arguments[i]))for(s in e)a(e,s)&&(t[s]=e[s]);return t}function e(t,e){return e.length-t.length}function i(t,e){return t.factor-e.factor}function n(t){return t.replace(/([.*+?=^!:${}()|[\]/\\])/g,"\\$1")}function s(t,e){var i,n;for(i=0,n=t.length;i<n;++i)e(t[i],i)}function o(t,e){var i;for(i in t)a(t,i)&&e(t[i],i)}var r,a=(r=Object.prototype.hasOwnProperty,function(t,e){return null!=t&&r.call(t,e)});function l(t,e){for(;"string"==typeof e;)e=t[e];return e}function c(t){this._prefixes=t;var s=[],r=[];o(t,function(t,e){s.push(n(e)),r.push({factor:t,prefix:e})});var l=this._lcPrefixes={};o(t,function(e,i){var n=i.toLowerCase();a(t,n)||(l[n]=i)}),r.sort(i),this._list=r,s.sort(e),this._regexp=new RegExp("^\\s*(-)?\\s*(\\d+(?:\\.\\d+)?)\\s*("+s.join("|")+")\\s*(.*)\\s*?$","i")}c.create=function(t,e,i){var n={};return void 0===i&&(i=0),s(t,function(t,s){n[t]=Math.pow(e,s+i)}),new c(n)},c.prototype.findPrefix=function(t){for(var e,i=this._list,n=0,s=i.length-1;n!==s;)i[e=n+s+1>>1].factor>t?s=e-1:n=e;return i[n]},c.prototype.parse=function(t,e){var i=t.match(this._regexp);if(null!==i){var n,s=i[3];if(a(this._prefixes,s))n=this._prefixes[s];else{if(e||(s=s.toLowerCase(),!a(this._lcPrefixes,s)))return;s=this._lcPrefixes[s],n=this._prefixes[s]}var o=+i[2];return void 0!==i[1]&&(o=-o),{factor:n,prefix:s,unit:i[4],value:o}}};var h={binary:c.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:c.create("y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y".split(","),1e3,-8)},d={maxDecimals:2,separator:" ",unit:""},u={scale:"SI",strict:!1};function f(e,i){var n=(i=t({},d,i)).decimals;void 0!==n&&delete i.maxDecimals;var s=v(e,i);e=void 0!==n?s.value.toFixed(n):String(s.value);var o=s.prefix+i.unit;return""===o?e:e+i.separator+o}var p={scale:"binary",unit:"B"};function g(e,i){return f(e,void 0===i?p:t({},p,i))}function m(t,e){var i=b(t,e);return i.value*i.factor}function b(e,i){if("string"!=typeof e)throw new TypeError("str must be a string");i=t({},u,i);var n=l(h,i.scale);if(void 0===n)throw new Error("missing scale");var s=n.parse(e,i.strict);if(void 0===s)throw new Error("cannot parse str");return s}function v(e,i){if(0===e)return{value:0,prefix:""};if(e<0){var n=v(-e,i);return n.value=-n.value,n}if("number"!=typeof e||Number.isNaN(e))throw new TypeError("value must be a number");i=t({},u,i);var s,o=l(h,i.scale);if(void 0===o)throw new Error("missing scale");var r=i.maxDecimals,c="auto"===r;c?s=10:void 0!==r&&(s=Math.pow(10,r));var d,f=i.prefix;if(void 0!==f){if(!a(o._prefixes,f))throw new Error("invalid prefix");d=o._prefixes[f]}else{var p=o.findPrefix(e);if(void 0!==s)do{var g=(d=p.factor)/s;e=Math.round(e/g)*g}while((p=o.findPrefix(e)).factor!==d);else d=p.factor;f=p.prefix}return e=void 0===s?e/d:Math.round(e*s/d)/s,c&&Math.abs(e)>=10&&(e=Math.round(e)),{prefix:f,value:e}}return f.bytes=g,f.parse=m,m.raw=b,f.raw=v,f.Scale=c,f},void 0===(s="function"==typeof i?i.apply(e,n):i)||(t.exports=s)},336(t){var e,i="loading"in HTMLImageElement.prototype,n="loading"in HTMLIFrameElement.prototype,s="onscroll"in window;function o(t){var e,i,n=[];"picture"===t.parentNode.tagName.toLowerCase()&&((i=(e=t.parentNode).querySelector("source[data-lazy-remove]"))&&e.removeChild(i),n=Array.prototype.slice.call(t.parentNode.querySelectorAll("source"))),n.push(t),n.forEach(function(t){t.hasAttribute("data-lazy-srcset")&&(t.setAttribute("srcset",t.getAttribute("data-lazy-srcset")),t.removeAttribute("data-lazy-srcset"))}),t.setAttribute("src",t.getAttribute("data-lazy-src")),t.removeAttribute("data-lazy-src")}function r(t){var o=document.createElement("div");for(o.innerHTML=function(t){var o=t.textContent||t.innerHTML,r="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 "+((o.match(/width=['"](\d+)['"]/)||!1)[1]||1)+" "+((o.match(/height=['"](\d+)['"]/)||!1)[1]||1)+"%27%3E%3C/svg%3E";return(/<img/gim.test(o)&&!i||/<iframe/gim.test(o)&&!n)&&s&&(o=void 0===e?o.replace(/(?:\r\n|\r|\n|\t| )src=/g,' lazyload="1" src='):(o=o.replace("<source",'<source srcset="'+r+'" data-lazy-remove="true"></source>\n<source')).replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src=')),o}(t);o.firstChild;){var r=o.firstChild;if(s&&void 0!==e&&r.tagName&&(("img"===r.tagName.toLowerCase()||"picture"===r.tagName.toLowerCase())&&!i||"iframe"===r.tagName.toLowerCase()&&!n)){var a="picture"===r.tagName.toLowerCase()?o.querySelector("img"):r;e.observe(a)}t.parentNode.insertBefore(r,t)}t.parentNode.removeChild(t)}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(e=new IntersectionObserver(function(t,e){t.forEach(function(t){if(0!==t.intersectionRatio){var i=t.target;e.unobserve(i),o(i)}})},{rootMargin:"0px 0px 256px 0px",threshold:.01}));var a=function(){document.querySelectorAll("noscript.loading-lazy").forEach(function(t){return r(t)}),void 0!==window.matchMedia&&window.matchMedia("print").addListener(function(t){t.matches&&document.querySelectorAll('img[loading="lazy"][data-lazy-src],iframe[loading="lazy"][data-lazy-src]').forEach(function(t){o(t)})})};/comp|inter/.test(document.readyState)?a():"addEventListener"in document?document.addEventListener("DOMContentLoaded",function(){a()}):document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&a()}),t.exports={}},941(t){var e;t.exports=function(){function t(e,i,n){function s(r,a){if(!i[r]){if(!e[r]){if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[r]={exports:{}};e[r][0].call(c.exports,function(t){return s(e[r][1][t]||t)},c,c.exports,t,e,i,n)}return i[r].exports}for(var o=void 0,r=0;r<n.length;r++)s(n[r]);return s}return t}()({1:[function(t,e,i){(function(t){(function(){var n=200,s="__lodash_hash_undefined__",o=800,r=16,a=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object AsyncFunction]",d="[object Boolean]",u="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",_="[object RegExp]",w="[object Set]",k="[object String]",S="[object Undefined]",M="[object WeakMap]",O="[object ArrayBuffer]",E="[object DataView]",A="[object Float64Array]",T="[object Int8Array]",C="[object Int16Array]",P="[object Int32Array]",L="[object Uint8Array]",D="[object Uint8ClampedArray]",I="[object Uint16Array]",R="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,B={};B["[object Float32Array]"]=B[A]=B[T]=B[C]=B[P]=B[L]=B[D]=B[I]=B[R]=!0,B[l]=B[c]=B[O]=B[d]=B[E]=B[u]=B[f]=B[p]=B[m]=B[b]=B[y]=B[_]=B[w]=B[k]=B[M]=!1;var N="object"==typeof t&&t&&t.Object===Object&&t,W="object"==typeof self&&self&&self.Object===Object&&self,V=N||W||Function("return this")(),H="object"==typeof i&&i&&!i.nodeType&&i,$=H&&"object"==typeof e&&e&&!e.nodeType&&e,U=$&&$.exports===H,q=U&&N.process,Y=function(){try{var t=$&&$.require&&$.require("util").types;return t||q&&q.binding&&q.binding("util")}catch(t){}}(),X=Y&&Y.isTypedArray;function J(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function G(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function K(t){return function(e){return t(e)}}function Q(t,e){return null==t?void 0:t[e]}function Z(t,e){return function(i){return t(e(i))}}var tt,et=Array.prototype,it=Function.prototype,nt=Object.prototype,st=V["__core-js_shared__"],ot=it.toString,rt=nt.hasOwnProperty,at=(tt=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||""))?"Symbol(src)_1."+tt:"",lt=nt.toString,ct=ot.call(Object),ht=RegExp("^"+ot.call(rt).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dt=U?V.Buffer:void 0,ut=V.Symbol,ft=V.Uint8Array,pt=dt?dt.allocUnsafe:void 0,gt=Z(Object.getPrototypeOf,Object),mt=Object.create,bt=nt.propertyIsEnumerable,vt=et.splice,yt=ut?ut.toStringTag:void 0,xt=function(){try{var t=ye(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),_t=dt?dt.isBuffer:void 0,wt=Math.max,kt=Date.now,St=ye(V,"Map"),Mt=ye(Object,"create"),Ot=function(){function t(){}return function(e){if(!Ve(e))return{};if(mt)return mt(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();function Et(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function At(){this.__data__=Mt?Mt(null):{},this.size=0}function Tt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Ct(t){var e=this.__data__;if(Mt){var i=e[t];return i===s?void 0:i}return rt.call(e,t)?e[t]:void 0}function Pt(t){var e=this.__data__;return Mt?void 0!==e[t]:rt.call(e,t)}function Lt(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Mt&&void 0===e?s:e,this}function Dt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function It(){this.__data__=[],this.size=0}function Rt(t){var e=this.__data__,i=te(e,t);return!(i<0||(i==e.length-1?e.pop():vt.call(e,i,1),--this.size,0))}function jt(t){var e=this.__data__,i=te(e,t);return i<0?void 0:e[i][1]}function Ft(t){return te(this.__data__,t)>-1}function zt(t,e){var i=this.__data__,n=te(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Nt(){this.size=0,this.__data__={hash:new Et,map:new(St||Dt),string:new Et}}function Wt(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e}function Vt(t){return ve(this,t).get(t)}function Ht(t){return ve(this,t).has(t)}function $t(t,e){var i=ve(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}function Ut(t){var e=this.__data__=new Dt(t);this.size=e.size}function qt(){this.__data__=new Dt,this.size=0}function Yt(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}function Xt(t){return this.__data__.get(t)}function Jt(t){return this.__data__.has(t)}function Gt(t,e){var i=this.__data__;if(i instanceof Dt){var s=i.__data__;if(!St||s.length<n-1)return s.push([t,e]),this.size=++i.size,this;i=this.__data__=new Bt(s)}return i.set(t,e),this.size=i.size,this}function Kt(t,e){var i=je(t),n=!i&&Re(t),s=!i&&!n&&Be(t),o=!i&&!n&&!s&&Ue(t),r=i||n||s||o,a=r?G(t.length,String):[],l=a.length;for(var c in t)!e&&!rt.call(t,c)||r&&("length"==c||s&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||we(c,l))||a.push(c);return a}function Qt(t,e,i){(void 0!==i&&!Ie(t[e],i)||void 0===i&&!(e in t))&&ee(t,e,i)}function Zt(t,e,i){var n=t[e];rt.call(t,e)&&Ie(n,i)&&(void 0!==i||e in t)||ee(t,e,i)}function te(t,e){for(var i=t.length;i--;)if(Ie(t[i][0],e))return i;return-1}function ee(t,e,i){"__proto__"==e&&xt?xt(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}Et.prototype.clear=At,Et.prototype.delete=Tt,Et.prototype.get=Ct,Et.prototype.has=Pt,Et.prototype.set=Lt,Dt.prototype.clear=It,Dt.prototype.delete=Rt,Dt.prototype.get=jt,Dt.prototype.has=Ft,Dt.prototype.set=zt,Bt.prototype.clear=Nt,Bt.prototype.delete=Wt,Bt.prototype.get=Vt,Bt.prototype.has=Ht,Bt.prototype.set=$t,Ut.prototype.clear=qt,Ut.prototype.delete=Yt,Ut.prototype.get=Xt,Ut.prototype.has=Jt,Ut.prototype.set=Gt;var ie=be();function ne(t){return null==t?void 0===t?S:v:yt&&yt in Object(t)?xe(t):Ae(t)}function se(t){return He(t)&&ne(t)==l}function oe(t){return!(!Ve(t)||Me(t))&&(Ne(t)?ht:F).test(De(t))}function re(t){return He(t)&&We(t.length)&&!!B[ne(t)]}function ae(t){if(!Ve(t))return Ee(t);var e=Oe(t),i=[];for(var n in t)("constructor"!=n||!e&&rt.call(t,n))&&i.push(n);return i}function le(t,e,i,n,s){t!==e&&ie(e,function(o,r){if(s||(s=new Ut),Ve(o))ce(t,e,r,i,le,n,s);else{var a=n?n(Ce(t,r),o,r+"",t,e,s):void 0;void 0===a&&(a=o),Qt(t,r,a)}},Ye)}function ce(t,e,i,n,s,o,r){var a=Ce(t,i),l=Ce(e,i),c=r.get(l);if(c)Qt(t,i,c);else{var h=o?o(a,l,i+"",t,e,r):void 0,d=void 0===h;if(d){var u=je(l),f=!u&&Be(l),p=!u&&!f&&Ue(l);h=l,u||f||p?je(a)?h=a:ze(a)?h=pe(a):f?(d=!1,h=de(l,!0)):p?(d=!1,h=fe(l,!0)):h=[]:$e(l)||Re(l)?(h=a,Re(a)?h=qe(a):Ve(a)&&!Ne(a)||(h=_e(l))):d=!1}d&&(r.set(l,h),s(h,l,n,o,r),r.delete(l)),Qt(t,i,h)}}function he(t,e){return Pe(Te(t,e,Ge),t+"")}function de(t,e){if(e)return t.slice();var i=t.length,n=pt?pt(i):new t.constructor(i);return t.copy(n),n}function ue(t){var e=new t.constructor(t.byteLength);return new ft(e).set(new ft(t)),e}function fe(t,e){var i=e?ue(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function pe(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}function ge(t,e,i,n){var s=!i;i||(i={});for(var o=-1,r=e.length;++o<r;){var a=e[o],l=n?n(i[a],t[a],a,i,t):void 0;void 0===l&&(l=t[a]),s?ee(i,a,l):Zt(i,a,l)}return i}function me(t){return he(function(e,i){var n=-1,s=i.length,o=s>1?i[s-1]:void 0,r=s>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&ke(i[0],i[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n<s;){var a=i[n];a&&t(e,a,n,o)}return e})}function be(t){return function(e,i,n){for(var s=-1,o=Object(e),r=n(e),a=r.length;a--;){var l=r[t?a:++s];if(!1===i(o[l],l,o))break}return e}}function ve(t,e){var i=t.__data__;return Se(e)?i["string"==typeof e?"string":"hash"]:i.map}function ye(t,e){var i=Q(t,e);return oe(i)?i:void 0}function xe(t){var e=rt.call(t,yt),i=t[yt];try{t[yt]=void 0;var n=!0}catch(t){}var s=lt.call(t);return n&&(e?t[yt]=i:delete t[yt]),s}function _e(t){return"function"!=typeof t.constructor||Oe(t)?{}:Ot(gt(t))}function we(t,e){var i=typeof t;return!!(e=e??a)&&("number"==i||"symbol"!=i&&z.test(t))&&t>-1&&t%1==0&&t<e}function ke(t,e,i){if(!Ve(i))return!1;var n=typeof e;return!!("number"==n?Fe(i)&&we(e,i.length):"string"==n&&e in i)&&Ie(i[e],t)}function Se(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Me(t){return!!at&&at in t}function Oe(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function Ee(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}function Ae(t){return lt.call(t)}function Te(t,e,i){return e=wt(void 0===e?t.length-1:e,0),function(){for(var n=arguments,s=-1,o=wt(n.length-e,0),r=Array(o);++s<o;)r[s]=n[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=n[s];return a[e]=i(r),J(t,this,a)}}function Ce(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Pe=Le(xt?function(t,e){return xt(t,"toString",{configurable:!0,enumerable:!1,value:Je(e),writable:!0})}:Ge);function Le(t){var e=0,i=0;return function(){var n=kt(),s=r-(n-i);if(i=n,s>0){if(++e>=o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function De(t){if(null!=t){try{return ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ie(t,e){return t===e||t!=t&&e!=e}var Re=se(function(){return arguments}())?se:function(t){return He(t)&&rt.call(t,"callee")&&!bt.call(t,"callee")},je=Array.isArray;function Fe(t){return null!=t&&We(t.length)&&!Ne(t)}function ze(t){return He(t)&&Fe(t)}var Be=_t||Ke;function Ne(t){if(!Ve(t))return!1;var e=ne(t);return e==p||e==g||e==h||e==x}function We(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Ve(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function He(t){return null!=t&&"object"==typeof t}function $e(t){if(!He(t)||ne(t)!=y)return!1;var e=gt(t);if(null===e)return!0;var i=rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&ot.call(i)==ct}var Ue=X?K(X):re;function qe(t){return ge(t,Ye(t))}function Ye(t){return Fe(t)?Kt(t,!0):ae(t)}var Xe=me(function(t,e,i){le(t,e,i)});function Je(t){return function(){return t}}function Ge(t){return t}function Ke(){return!1}e.exports=Xe}).call(this)}).call(this,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,i,n){var s,o;s=self,o=function(){return function(){"use strict";var t={720:function(t,e,i){i.r(e),i.d(e,{Scene:function(){return ae},Tweenable:function(){return Mt},interpolate:function(){return ee},processTweens:function(){return bt},setBezierFunction:function(){return H},shouldScheduleUpdate:function(){return xt},tween:function(){return Ot},unsetBezierFunction:function(){return $}});var n={};i.r(n),i.d(n,{bounce:function(){return R},bouncePast:function(){return j},easeFrom:function(){return z},easeFromTo:function(){return F},easeInBack:function(){return A},easeInCirc:function(){return S},easeInCubic:function(){return c},easeInExpo:function(){return _},easeInOutBack:function(){return C},easeInOutCirc:function(){return O},easeInOutCubic:function(){return d},easeInOutExpo:function(){return k},easeInOutQuad:function(){return l},easeInOutQuart:function(){return p},easeInOutQuint:function(){return b},easeInOutSine:function(){return x},easeInQuad:function(){return r},easeInQuart:function(){return u},easeInQuint:function(){return g},easeInSine:function(){return v},easeOutBack:function(){return T},easeOutBounce:function(){return E},easeOutCirc:function(){return M},easeOutCubic:function(){return h},easeOutExpo:function(){return w},easeOutQuad:function(){return a},easeOutQuart:function(){return f},easeOutQuint:function(){return m},easeOutSine:function(){return y},easeTo:function(){return B},elastic:function(){return P},linear:function(){return o},swingFrom:function(){return D},swingFromTo:function(){return L},swingTo:function(){return I}});var s={};i.r(s),i.d(s,{afterTween:function(){return Jt},beforeTween:function(){return Xt},doesApply:function(){return qt},tweenCreated:function(){return Yt}});var o=function(t){return t},r=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},l=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},h=function(t){return Math.pow(t-1,3)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},u=function(t){return Math.pow(t,4)},f=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},g=function(t){return Math.pow(t,5)},m=function(t){return Math.pow(t-1,5)+1},b=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},v=function(t){return 1-Math.cos(t*(Math.PI/2))},y=function(t){return Math.sin(t*(Math.PI/2))},x=function(t){return-.5*(Math.cos(Math.PI*t)-1)},_=function(t){return 0===t?0:Math.pow(2,10*(t-1))},w=function(t){return 1===t?1:1-Math.pow(2,-10*t)},k=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},O=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},A=function(t){var e=1.70158;return t*t*((e+1)*t-e)},T=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},C=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},P=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},L=function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},D=function(t){var e=1.70158;return t*t*((e+1)*t-e)},I=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},R=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},F=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},z=function(t){return Math.pow(t,4)},B=function(t){return Math.pow(t,.25)};function N(t,e,i,n,s,o){var r,a,l,c,h,d=0,u=0,f=0,p=function(t){return((d*t+u)*t+f)*t},g=function(t){return(3*d*t+2*u)*t+f},m=function(t){return t>=0?t:0-t};return d=1-(f=3*e)-(u=3*(n-e)-f),l=1-(h=3*i)-(c=3*(s-i)-h),r=t,a=function(t){return 1/(200*t)}(o),function(t){return((l*t+c)*t+h)*t}(function(t,e){var i,n,s,o,r,a;for(s=t,a=0;a<8;a++){if(o=p(s)-t,m(o)<e)return s;if(r=g(s),m(r)<1e-6)break;s-=o/r}if((s=t)<(i=0))return i;if(s>(n=1))return n;for(;i<n;){if(o=p(s),m(o-t)<e)return s;t>o?i=s:n=s,s=.5*(n-i)+i}return s}(r,a))}var W,V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(s){return N(s,t,e,i,n,1)}},H=function(t,e,i,n,s){var o=V(e,i,n,s);return o.displayName=t,o.x1=e,o.y1=i,o.x2=n,o.y2=s,Mt.formulas[t]=o},$=function(t){return delete Mt.formulas[t]};function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function X(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return J(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?J(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function G(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function K(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?G(Object(i),!0).forEach(function(e){Q(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):G(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function Q(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var Z,tt,et,it="linear",nt="undefined"!=typeof window?window:i.g,st="afterTween",ot="afterTweenEnd",rt="beforeTween",at="tweenCreated",lt="function",ct="string",ht=nt.requestAnimationFrame||nt.webkitRequestAnimationFrame||nt.oRequestAnimationFrame||nt.msRequestAnimationFrame||nt.mozCancelRequestAnimationFrame&&nt.mozRequestAnimationFrame||setTimeout,dt=function(){},ut=null,ft=null,pt=K({},n),gt=function(t,e,i,n,s,o,r){var a,l,c,h=t<o?0:(t-o)/s,d=!1;for(var u in r&&r.call&&(d=!0,a=r(h)),e)d||(a=((l=r[u]).call?l:pt[l])(h)),c=i[u],e[u]=c+(n[u]-c)*a;return e},mt=function(t,e){var i=t._timestamp,n=t._currentState,s=t._delay;if(!(e<i+s)){var o=t._duration,r=t._targetState,a=i+s+o,l=e>a?a:e;t._hasEnded=l>=a;var c=o-(a-l),h=t._filters.length>0;if(t._hasEnded)return t._render(r,t._data,c),t.stop(!0);h&&t._applyFilter(rt),l<i+s?i=o=l=1:i+=s,gt(l,n,t._originalState,r,o,i,t._easing),h&&t._applyFilter(st),t._render(n,t._data,c)}},bt=function(){for(var t,e=Mt.now(),i=ut;i;)t=i._next,mt(i,e),i=t},vt=Date.now||function(){return+new Date},yt=!1,xt=function(t){t&&yt||(yt=t,t&&_t())},_t=function t(){Z=vt(),yt&&ht.call(nt,t,16.666666666666668),bt()},wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(e))return V.apply(void 0,X(e));var n=Y(e);if(pt[e])return pt[e];if(n===ct||n===lt)for(var s in t)i[s]=e;else for(var o in t)i[o]=e[o]||it;return i},kt=function(t){t===ut?(ut=t._next)?ut._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ut=null:(tt=t._previous,et=t._next,tt._next=et,et._previous=tt),t._previous=t._next=null},St="function"==typeof Promise?Promise:null;W=Symbol.toStringTag;var Mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;U(this,t),Q(this,W,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=e||{},this._originalState={},this._targetState={},this._start=dt,this._render=dt,this._promiseCtor=St,i&&this.setConfig(i)}var e;return e=[{key:"_applyFilter",value:function(t){for(var e=this._filters.length;e>0;e--){var i=this._filters[e-e][t];i&&i(this)}}},{key:"tween",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!e&&this._config||this.setConfig(e),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._config;for(var n in e)i[n]=e[n];var s=i.promise,o=void 0===s?this._promiseCtor:s,r=i.start,a=void 0===r?dt:r,l=i.finish,c=i.render,h=void 0===c?this._config.step||dt:c,d=i.step,u=void 0===d?dt:d;this._data=i.data||i.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=e.delay||0,this._start=a,this._render=h||u,this._duration=i.duration||500,this._promiseCtor=o,l&&(this._resolve=l);var f=e.from,p=e.to,g=void 0===p?{}:p,m=this._currentState,b=this._originalState,v=this._targetState;for(var y in f)m[y]=f[y];var x=!1;for(var _ in m){var w=m[_];x||Y(w)!==ct||(x=!0),b[_]=w,v[_]=g.hasOwnProperty(_)?g[_]:w}if(this._easing=wt(this._currentState,i.easing,this._easing),this._filters.length=0,x){for(var k in t.filters)t.filters[k].doesApply(this)&&this._filters.push(t.filters[k]);this._applyFilter(at)}return this}},{key:"then",value:function(t,e){var i=this;return this._promise=new this._promiseCtor(function(t,e){i._resolve=t,i._reject=e}),this._promise.then(t,e)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return K({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,kt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=e-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ut?(ut=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(e){e=Math.max(e,0);var i=t.now();return this._timestamp+e===0||(this._timestamp=i-e,mt(this,i)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,kt(this);var e=this._filters.length>0;return t&&(e&&this._applyFilter(rt),gt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),e&&(this._applyFilter(st),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._currentState,i=this._data;return this._isPlaying?(this._reject&&this._reject({data:i,state:e,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(e){t.setScheduleFunction(e)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=K({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&q(t.prototype,e),t}();function Ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new Mt;return e.tween(t),e.tweenable=e,e}Q(Mt,"now",function(){return Z}),Q(Mt,"setScheduleFunction",function(t){return ht=t}),Q(Mt,"filters",{}),Q(Mt,"formulas",pt),xt(!0);var Et,At,Tt=/(\d|-|\.)/,Ct=/([^\-0-9.]+)/g,Pt=/[0-9.-]+/g,Lt=(Et=Pt.source,At=/,\s*/.source,new RegExp("rgba?\\(".concat(Et).concat(At).concat(Et).concat(At).concat(Et,"(").concat(At).concat(Et,")?\\)"),"g")),Dt=/^.*\(/,It=/#([0-9]|[a-f]){3,6}/gi,Rt="VAL",jt=function(t,e){return t.map(function(t,i){return"_".concat(e,"_").concat(i)})};function Ft(t){return parseInt(t,16)}var zt=function(t){return"rgb(".concat((e=t,3===(e=e.replace(/#/,"")).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[Ft(e.substr(0,2)),Ft(e.substr(2,2)),Ft(e.substr(4,2))]).join(","),")");var e},Bt=function(t,e,i){var n=e.match(t),s=e.replace(t,Rt);return n&&n.forEach(function(t){return s=s.replace(Rt,i(t))}),s},Nt=function(t){for(var e in t){var i=t[e];"string"==typeof i&&i.match(It)&&(t[e]=Bt(It,i,zt))}},Wt=function(t){var e=t.match(Pt),i=e.slice(0,3).map(Math.floor),n=t.match(Dt)[0];if(3===e.length)return"".concat(n).concat(i.join(","),")");if(4===e.length)return"".concat(n).concat(i.join(","),",").concat(e[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Vt=function(t){return t.match(Pt)},Ht=function(t,e){var i={};return e.forEach(function(e){i[e]=t[e],delete t[e]}),i},$t=function(t,e){return e.map(function(e){return t[e]})},Ut=function(t,e){return e.forEach(function(e){return t=t.replace(Rt,+e.toFixed(4))}),t},qt=function(t){for(var e in t._currentState)if("string"==typeof t._currentState[e])return!0;return!1};function Yt(t){var e=t._currentState;[e,t._originalState,t._targetState].forEach(Nt),t._tokenData=function(t){var e,i,n={};for(var s in t){var o=t[s];"string"==typeof o&&(n[s]={formatString:(e=o,i=void 0,i=e.match(Ct),i?(1===i.length||e.charAt(0).match(Tt))&&i.unshift(""):i=["",""],i.join(Rt)),chunkNames:jt(Vt(o),s)})}return n}(e)}function Xt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;!function(t,e){var i=function(i){var n=e[i].chunkNames,s=t[i];if("string"==typeof s){var o=s.split(" "),r=o[o.length-1];n.forEach(function(e,i){return t[e]=o[i]||r})}else n.forEach(function(e){return t[e]=s});delete t[i]};for(var n in e)i(n)}(s,o),[e,i,n].forEach(function(t){return function(t,e){var i=function(i){Vt(t[i]).forEach(function(n,s){return t[e[i].chunkNames[s]]=+n}),delete t[i]};for(var n in e)i(n)}(t,o)})}function Jt(t){var e=t._currentState,i=t._originalState,n=t._targetState,s=t._easing,o=t._tokenData;[e,i,n].forEach(function(t){return function(t,e){for(var i in e){var n=e[i],s=n.chunkNames,o=n.formatString,r=Ut(o,$t(Ht(t,s),s));t[i]=Bt(Lt,r,Wt)}}(t,o)}),function(t,e){for(var i in e){var n=e[i].chunkNames,s=t[n[0]];t[i]="string"==typeof s?n.map(function(e){var i=t[e];return delete t[e],i}).join(" "):s}}(s,o)}function Gt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function Kt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(i),!0).forEach(function(e){Qt(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gt(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function Qt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var Zt=new Mt,te=Mt.filters,ee=function(t,e,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=Kt({},t),r=wt(t,n);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=e,Zt._easing=r,te)te[a].doesApply(Zt)&&Zt._filters.push(te[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var l=gt(i,o,t,e,1,s,r);return Zt._applyFilter("afterTween"),l};function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function se(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oe(t,e){var i=e.get(t);if(!i)throw new TypeError("attempted to get private field on non-instance");return i.get?i.get.call(t):i.value}var re=new WeakMap,ae=function(){function t(){ne(this,t),re.set(this,{writable:!0,value:[]});for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];i.forEach(this.add.bind(this))}var e;return(e=[{key:"add",value:function(t){return oe(this,re).push(t),t}},{key:"remove",value:function(t){var e=oe(this,re).indexOf(t);return~e&&oe(this,re).splice(e,1),t}},{key:"empty",value:function(){return this.tweenables.map(this.remove.bind(this))}},{key:"isPlaying",value:function(){return oe(this,re).some(function(t){return t.isPlaying()})}},{key:"play",value:function(){return oe(this,re).forEach(function(t){return t.tween()}),this}},{key:"pause",value:function(){return oe(this,re).forEach(function(t){return t.pause()}),this}},{key:"resume",value:function(){return this.playingTweenables.forEach(function(t){return t.resume()}),this}},{key:"stop",value:function(t){return oe(this,re).forEach(function(e){return e.stop(t)}),this}},{key:"tweenables",get:function(){return function(t){if(Array.isArray(t))return ie(t)}(t=oe(this,re))||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ie(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ie(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var t}},{key:"playingTweenables",get:function(){return oe(this,re).filter(function(t){return!t.hasEnded()})}},{key:"promises",get:function(){return oe(this,re).map(function(t){return t.then()})}}])&&se(t.prototype,e),t}();Mt.filters.token=s}},e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}return i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(720)}()},"object"==typeof n&&"object"==typeof i?i.exports=o():"function"==typeof e&&e.amd?e("shifty",[],o):"object"==typeof n?n.shifty=o():s.shifty=o()},{}],3:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 50,50 m 0,-{radius} a {radius},{radius} 0 1 1 0,{2radius} a {radius},{radius} 0 1 1 0,-{2radius}",this.containerAspectRatio=1,n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=t.strokeWidth;t.trailWidth&&t.trailWidth>t.strokeWidth&&(e=t.trailWidth);var i=50-e/2;return s.render(this._pathTemplate,{radius:i,"2radius":2*i})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],4:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate=e.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._initializeSvg=function(t,e){var i=e.vertical?"0 0 "+e.strokeWidth+" 100":"0 0 100 "+e.strokeWidth;t.setAttribute("viewBox",i),t.setAttribute("preserveAspectRatio","none")},o.prototype._pathString=function(t){return s.render(this._pathTemplate,{center:t.strokeWidth/2})},o.prototype._trailString=function(t){return this._pathString(t)},e.exports=o},{"./shape":8,"./utils":10}],5:[function(t,e,i){e.exports={Line:t("./line"),Circle:t("./circle"),SemiCircle:t("./semicircle"),Square:t("./square"),Path:t("./path"),Shape:t("./shape"),utils:t("./utils")}},{"./circle":3,"./line":4,"./path":6,"./semicircle":7,"./shape":8,"./square":9,"./utils":10}],6:[function(t,e,i){var n=t("shifty"),s=t("./utils"),o=n.Tweenable,r={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},a=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");var n;i=s.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},i),n=s.isString(e)?document.querySelector(e):e,this.path=n,this._opts=i,this._tweenable=null;var o=this.path.getTotalLength();this.path.style.strokeDasharray=o+" "+o,this.set(0)};a.prototype.value=function(){var t=this._getComputedDashOffset(),e=this.path.getTotalLength();return parseFloat((1-t/e).toFixed(6),10)},a.prototype.set=function(t){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(t);var e=this._opts.step;if(s.isFunction(e)){var i=this._easing(this._opts.easing);e(this._calculateTo(t,i),this._opts.shape||this,this._opts.attachment)}},a.prototype.stop=function(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},a.prototype.animate=function(t,e,i){e=e||{},s.isFunction(e)&&(i=e,e={});var n=s.extend({},e),r=s.extend({},this._opts);e=s.extend(r,e);var a=this._easing(e.easing),l=this._resolveFromAndTo(t,a,n);this.stop(),this.path.getBoundingClientRect();var c=this._getComputedDashOffset(),h=this._progressToOffset(t),d=this;this._tweenable=new o,this._tweenable.tween({from:s.extend({offset:c},l.from),to:s.extend({offset:h},l.to),duration:e.duration,delay:e.delay,easing:a,step:function(t){d.path.style.strokeDashoffset=t.offset;var i=e.shape||d;e.step(t,i,e.attachment)}}).then(function(t){s.isFunction(i)&&i()}).catch(function(t){throw console.error("Error in tweening:",t),t})},a.prototype._getComputedDashOffset=function(){var t=window.getComputedStyle(this.path,null);return parseFloat(t.getPropertyValue("stroke-dashoffset"),10)},a.prototype._progressToOffset=function(t){var e=this.path.getTotalLength();return e-t*e},a.prototype._resolveFromAndTo=function(t,e,i){return i.from&&i.to?{from:i.from,to:i.to}:{from:this._calculateFrom(e),to:this._calculateTo(t,e)}},a.prototype._calculateFrom=function(t){return n.interpolate(this._opts.from,this._opts.to,this.value(),t)},a.prototype._calculateTo=function(t,e){return n.interpolate(this._opts.from,this._opts.to,t,e)},a.prototype._stopTween=function(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},a.prototype._easing=function(t){return r.hasOwnProperty(t)?r[t]:t},e.exports=a},{"./utils":10,shifty:2}],7:[function(t,e,i){var n=t("./shape"),s=t("./circle"),o=t("./utils"),r=function(t,e){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,n.apply(this,arguments)};r.prototype=new n,r.prototype.constructor=r,r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 50")},r.prototype._initializeTextContainer=function(t,e,i){t.text.style&&(i.style.top="auto",i.style.bottom="0",t.text.alignToBottom?o.setStyle(i,"transform","translate(-50%, 0)"):o.setStyle(i,"transform","translate(-50%, 50%)"))},r.prototype._pathString=s.prototype._pathString,r.prototype._trailString=s.prototype._trailString,e.exports=r},{"./circle":3,"./shape":8,"./utils":10}],8:[function(t,e,i){var n=t("./path"),s=t("./utils"),o="Object is destroyed",r=function t(e,i){if(!(this instanceof t))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=s.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},i,!0),s.isObject(i)&&void 0!==i.svgStyle&&(this._opts.svgStyle=i.svgStyle),s.isObject(i)&&s.isObject(i.text)&&void 0!==i.text.style&&(this._opts.text.style=i.text.style);var o,r=this._createSvgView(this._opts);if(!(o=s.isString(e)?document.querySelector(e):e))throw new Error("Container does not exist: "+e);this._container=o,this._container.appendChild(r.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&s.setStyles(r.svg,this._opts.svgStyle),this.svg=r.svg,this.path=r.path,this.trail=r.trail,this.text=null;var a=s.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new n(r.path,a),s.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};r.prototype.animate=function(t,e,i){if(null===this._progressPath)throw new Error(o);this._progressPath.animate(t,e,i)},r.prototype.stop=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath.stop()},r.prototype.pause=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},r.prototype.resume=function(){if(null===this._progressPath)throw new Error(o);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},r.prototype.destroy=function(){if(null===this._progressPath)throw new Error(o);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},r.prototype.set=function(t){if(null===this._progressPath)throw new Error(o);this._progressPath.set(t)},r.prototype.value=function(){if(null===this._progressPath)throw new Error(o);return void 0===this._progressPath?0:this._progressPath.value()},r.prototype.setText=function(t){if(null===this._progressPath)throw new Error(o);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),s.isObject(t)?(s.removeChildren(this.text),this.text.appendChild(t)):this.text.innerHTML=t},r.prototype._createSvgView=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(e,t);var i=null;(t.trailColor||t.trailWidth)&&(i=this._createTrail(t),e.appendChild(i));var n=this._createPath(t);return e.appendChild(n),{svg:e,path:n,trail:i}},r.prototype._initializeSvg=function(t,e){t.setAttribute("viewBox","0 0 100 100")},r.prototype._createPath=function(t){var e=this._pathString(t);return this._createPathElement(e,t)},r.prototype._createTrail=function(t){var e=this._trailString(t),i=s.extend({},t);return i.trailColor||(i.trailColor="#eee"),i.trailWidth||(i.trailWidth=i.strokeWidth),i.color=i.trailColor,i.strokeWidth=i.trailWidth,i.fill=null,this._createPathElement(e,i)},r.prototype._createPathElement=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i.setAttribute("stroke",e.color),i.setAttribute("stroke-width",e.strokeWidth),e.fill?i.setAttribute("fill",e.fill):i.setAttribute("fill-opacity","0"),i},r.prototype._createTextContainer=function(t,e){var i=document.createElement("div");i.className=t.text.className;var n=t.text.style;return n&&(t.text.autoStyleContainer&&(e.style.position="relative"),s.setStyles(i,n),n.color||(i.style.color=t.color)),this._initializeTextContainer(t,e,i),i},r.prototype._initializeTextContainer=function(t,e,i){},r.prototype._pathString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._trailString=function(t){throw new Error("Override this function for each progress bar")},r.prototype._warnContainerAspectRatio=function(t){if(this.containerAspectRatio){var e=window.getComputedStyle(t,null),i=parseFloat(e.getPropertyValue("width"),10),n=parseFloat(e.getPropertyValue("height"),10);s.floatEquals(this.containerAspectRatio,i/n)||(console.warn("Incorrect aspect ratio of container","#"+t.id,"detected:",e.getPropertyValue("width")+"(width)","/",e.getPropertyValue("height")+"(height)","=",i/n),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},e.exports=r},{"./path":6,"./utils":10}],9:[function(t,e,i){var n=t("./shape"),s=t("./utils"),o=function(t,e){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",n.apply(this,arguments)};o.prototype=new n,o.prototype.constructor=o,o.prototype._pathString=function(t){var e=100-t.strokeWidth/2;return s.render(this._pathTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2})},o.prototype._trailString=function(t){var e=100-t.strokeWidth/2;return s.render(this._trailTemplate,{width:e,strokeWidth:t.strokeWidth,halfOfStrokeWidth:t.strokeWidth/2,startMargin:t.strokeWidth/2-t.trailWidth/2})},e.exports=o},{"./shape":8,"./utils":10}],10:[function(t,e,i){var n=t("lodash.merge"),s="Webkit Moz O ms".split(" "),o=.001;function r(t,e){var i=t;for(var n in e)if(e.hasOwnProperty(n)){var s=e[n],o=new RegExp("\\{"+n+"\\}","g");i=i.replace(o,s)}return i}function a(t,e,i){for(var n=t.style,o=0;o<s.length;++o)n[s[o]+c(e)]=i;n[e]=i}function l(t,e){p(e,function(e,i){null!=e&&(f(e)&&!0===e.prefix?a(t,i,e.value):t.style[i]=e)})}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function h(t){return"string"==typeof t||t instanceof String}function d(t){return"function"==typeof t}function u(t){return"[object Array]"===Object.prototype.toString.call(t)}function f(t){return!u(t)&&"object"==typeof t&&!!t}function p(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)}function g(t,e){return Math.abs(t-e)<o}function m(t){for(;t.firstChild;)t.removeChild(t.firstChild)}e.exports={extend:n,render:r,setStyle:a,setStyles:l,capitalize:c,isString:h,isFunction:d,isObject:f,forEachObject:p,floatEquals:g,removeChildren:m}},{"lodash.merge":1}]},{},[5])(5)},544(){!function(){const t=function(){const t=jQuery("#field-video_player").val(),e=jQuery("#field-video_controls").prop("checked"),i=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==t||e?i.prop("disabled",!1):(i.prop("disabled",!0),i.prop("selected")&&i.next().prop("selected",!0))};t(),jQuery(document).on("change","#field-video_player",t),jQuery(document).on("change","#field-video_controls",t),jQuery(document).ready(function(t){t.isFunction(t.fn.wpColorPicker)&&t(".regular-color").wpColorPicker(),t(document).on("tabs.init",function(){const e=t(".settings-tab-trigger"),i=t(".settings-tab-section");t(this).on("click",".settings-tab-trigger",function(n){const s=t(this),o=t(s.attr("href"));n.preventDefault(),e.removeClass("active"),i.removeClass("active"),s.addClass("active"),o.addClass("active"),t(document).trigger("settings.tabbed",s)}),t(".cld-field").not('[data-condition="false"]').each(function(){const e=t(this),i=e.data("condition");for(const n in i){let s=t("#field-"+n);const o=i[n],r=e.closest("tr");s.length||(s=t(`[id^=field-${n}-]`));let a=!1;s.on("change init",function(t,e=!1){if(a&&e)return;let i=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":i=this.value!==o[0];break;case"gt":i=this.value>o[0];break;case"lt":i=this.value<o[0]}i?r.show():r.hide(),a=!0}),s.trigger("init",!0)}}),t("#field-cloudinary_url").on("input change",function(){const e=t(this),i=e.val();new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d)*[:]{1}[^:@]*[@]{1}[^@]*$/g).test(i)?(e.addClass("settings-valid-field"),e.removeClass("settings-invalid-field")):(e.removeClass("settings-valid-field"),e.addClass("settings-invalid-field"))}).trigger("change"),t('[name="cloudinary_sync_media[auto_sync]"]').change(function(){"on"===t(this).val()&&t("#auto-sync-alert-btn").click()})}),t(".render-trigger[data-event]").each(function(){const e=t(this),i=e.data("event");e.trigger(i,this)})})}(window,jQuery)},712(){document.querySelectorAll(".cloudinary-collapsible__toggle").forEach(function(t){t.addEventListener("click",function(){const e=t.dataset.collapsibleTarget;if(!e)return;const i=document.getElementById(e);if(!i)return;i.hidden=!i.hidden;const n=t.querySelector("button"),s=t.querySelector("button i");n&&n.setAttribute("aria-expanded",String(!i.hidden)),s&&(s.classList.toggle("dashicons-arrow-down-alt2",i.hidden),s.classList.toggle("dashicons-arrow-up-alt2",!i.hidden))})})}};const e={};function i(n){const s=e[n];if(void 0!==s)return s.exports;const o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.hasOwn(t,e),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const i=e.getElementsByTagName("script");if(i.length){let e=i.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=i[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),i.p=t})(),(()=>{"use strict";i(336),i(712),i(544);const t={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_settings.image_optimization"),video:document.getElementById("video_settings.video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(t){null!==t&&(t.style.display="block",t.style.visibility="visible",t.style.position="absolute",t.style.top=t.parentElement.clientHeight/2-t.clientHeight/2+"px",t.style.left=t.parentElement.clientWidth/2-t.clientWidth/2+"px")},_setLoading(t){this.sample[t]&&(this.button[t].style.display="block",this._placeItem(this.button[t]),this.preview[t].style.opacity="0.1")},_build(t){if(!this.sample[t])return;this.sample[t].innerHTML="",this.elements[t]=[];for(const e of this.fields){if(t!==e.dataset.context||e.dataset.disabled&&"true"===e.dataset.disabled)continue;let i=e.value.trim();if(i.length){if("select-one"===e.type){if("none"===i||!1===this.optimization[t].checked)continue;i=e.dataset.meta+"_"+i}else t=e.dataset.context,e.dataset.meta&&(i=e.dataset.meta+"_"+i),e.dataset.suffix&&(i+=e.dataset.suffix),i=this._transformations(i,t,!0);i&&this.elements[t].push(i)}}let e="";this.elements[t].length&&(e="/"+this._getGlobalTransformationElements(t).replace(/ /g,"%20")),this.sample[t].textContent=e,this.sample[t].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[t].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(t){this.spinner[t].style.visibility="hidden",this.activeItem=null,this.preview[t].style.opacity=1},_refresh(t,e){if(t&&t.preventDefault(),!this.sample[e])return;const i=this,n=CLD_GLOBAL_TRANSFORMATIONS[e].preview_url+this._getGlobalTransformationElements(e)+CLD_GLOBAL_TRANSFORMATIONS[e].file;if(this.button[e].style.display="none",this._placeItem(this.spinner[e]),"image"===e){const t=new Image;t.onload=function(){i.preview[e].src=this.src,i._clearLoading(e),i.error_container&&(i.error_container.style.display="none"),t.remove()},t.onerror=function(){const t=i.elements[e].includes("f_mp4");i.error_container&&(i.error_container.style.display="block",t?(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].warning.replace("%s","f_mp4"),i.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(i.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[e].error,i.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),i._clearLoading(e)},t.src=n}else{const t=i._transformations(i._getGlobalTransformationElements(e),e);samplePlayer.source({publicId:"sailing_boat",transformation:t}),i._clearLoading(e)}},_getGlobalTransformationElements(t){let e=[];return e.push(this.elements[t].slice(0,2).join(",")),e.push(this.elements[t].slice(2).join(",")),e=e.filter(t=>t).join("/"),e},_transformations(t,e,i=!1){const n=CLD_GLOBAL_TRANSFORMATIONS[e].valid_types;let s=null;const o=t.split("/"),r=[];for(let t=0;t<o.length;t++){const s=o[t].split(",");let a;a=!0===i?[]:{};for(let t=0;t<s.length;t++){const o=s[t].trim().split("_");if(o.length<=1||void 0===n[o[0]])continue;const r=o.shift(),l=o.join("_");if(!0===i){if("f"===r||"q"===r)for(const t in this.elements[e])r+"_"===this.elements[e][t].substr(0,2)&&this.elements[e].splice(t,1);a.push(s[t])}else a[n[r]]=l.trim()}let l=0;l=!0===i?a.length:Object.keys(a).length,l&&(!0===i&&(a=a.join(",")),r.push(a))}return r.length&&(s=!0===i?r.join("/").trim():r),s},_reset(){for(const t of this.fields)t.value=null;for(const t in this.button)this._build(t),this._refresh(null,t)},_input(t){if(void 0!==t.dataset.context&&t.dataset.context.length){const e=t.dataset.context;this._setLoading(e),this._build(e)}},_init(){if("undefined"!=typeof CLD_GLOBAL_TRANSFORMATIONS){const t=this;document.addEventListener("DOMContentLoaded",function(){for(const e in t.button)t.button[e]&&t.button[e].addEventListener("click",function(i){t._refresh(i,e)});for(const e of t.fields)e.addEventListener("input",function(){t._input(this)}),e.addEventListener("change",function(){t._input(this)});for(const e in CLD_GLOBAL_TRANSFORMATIONS)t._build(e),t._refresh(null,e)}),jQuery(document).ajaxComplete(function(e,i,n){-1!==n.data.indexOf("action=add-tag")&&-1===i.responseText.indexOf("wp_error")&&t._reset()})}}};t._init();var e,n,s,o;e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},n=["(","?"],s={")":["("],":":["?","?:"]},o=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var r={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,i){if(t)throw e;return i}};function a(t){var i=function(t){for(var i,r,a,l,c=[],h=[];i=t.match(o);){for(r=i[0],(a=t.substr(0,i.index).trim())&&c.push(a);l=h.pop();){if(s[r]){if(s[r][0]===l){r=s[r][1]||r;break}}else if(n.indexOf(l)>=0||e[l]<e[r]){h.push(l);break}c.push(l)}s[r]||h.push(r),t=t.substr(i.index+r.length)}return(t=t.trim())&&c.push(t),c.concat(h.reverse())}(t);return function(t){return function(t,e){var i,n,s,o,a,l,c=[];for(i=0;i<t.length;i++){if(a=t[i],o=r[a]){for(n=o.length,s=Array(n);n--;)s[n]=c.pop();try{l=o.apply(null,s)}catch(t){return t}}else l=e.hasOwnProperty(a)?e[a]:+a;c.push(l)}return c[0]}(i,t)}}var l={contextDelimiter:"",onMissingKey:null};function c(t,e){var i;for(i in this.data=t,this.pluralForms={},this.options={},l)this.options[i]=void 0!==e&&i in e?e[i]:l[i]}c.prototype.getPluralForm=function(t,e){var i,n,s,o=this.pluralForms[t];return o||("function"!=typeof(s=(i=this.data[t][""])["Plural-Forms"]||i["plural-forms"]||i.plural_forms)&&(n=function(t){var e,i,n;for(e=t.split(";"),i=0;i<e.length;i++)if(0===(n=e[i].trim()).indexOf("plural="))return n.substr(7)}(i["Plural-Forms"]||i["plural-forms"]||i.plural_forms),s=function(t){var e=a(t);return function(t){return+e({n:t})}}(n)),o=this.pluralForms[t]=s),o(e)},c.prototype.dcnpgettext=function(t,e,i,n,s){var o,r,a;return o=void 0===s?0:this.getPluralForm(t,s),r=i,e&&(r=e+this.options.contextDelimiter+i),(a=this.data[t][r])&&a[o]?a[o]:(this.options.onMissingKey&&this.options.onMissingKey(i,t),0===o?i:n)};var h={plural_forms:t=>1===t?0:1},d=/^i18n\.(n?gettext|has_translation)(_|$)/;var u=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var f=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var p=function(t,e){return function(i,n,s,o=10){const r=t[e];if(!f(i))return;if(!u(n))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof o)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:o,namespace:n};if(r[i]){const t=r[i].handlers;let e;for(e=t.length;e>0&&!(o>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),r.__current.forEach(t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex++})}else r[i]={handlers:[a],runs:0};"hookAdded"!==i&&t.doAction("hookAdded",i,n,s,o)}};var g=function(t,e,i=!1){return function(n,s){const o=t[e];if(!f(n))return;if(!i&&!u(s))return;if(!o[n])return 0;let r=0;if(i)r=o[n].handlers.length,o[n]={runs:o[n].runs,handlers:[]};else{const t=o[n].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),r++,o.__current.forEach(t=>{t.name===n&&t.currentIndex>=e&&t.currentIndex--}))}return"hookRemoved"!==n&&t.doAction("hookRemoved",n,s),r}};var m=function(t,e){return function(i,n){const s=t[e];return void 0!==n?i in s&&s[i].handlers.some(t=>t.namespace===n):i in s}};var b=function(t,e,i,n){return function(s,...o){const r=t[e];r[s]||(r[s]={handlers:[],runs:0}),r[s].runs++;const a=r[s].handlers;if(!a||!a.length)return i?o[0]:void 0;const l={name:s,currentIndex:0};return(n?async function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex<a.length;){const e=a[l.currentIndex];t=await e.callback.apply(null,o),i&&(o[0]=t),l.currentIndex++}return i?t:void 0}finally{r.__current.delete(l)}}:function(){try{r.__current.add(l);let t=i?o[0]:void 0;for(;l.currentIndex<a.length;){t=a[l.currentIndex].callback.apply(null,o),i&&(o[0]=t),l.currentIndex++}return i?t:void 0}finally{r.__current.delete(l)}})()}};var v=function(t,e){return function(){const i=t[e],n=Array.from(i.__current);return n.at(-1)?.name??null}};var y=function(t,e){return function(i){const n=t[e];return void 0===i?n.__current.size>0:Array.from(n.__current).some(t=>t.name===i)}};var x=function(t,e){return function(i){const n=t[e];if(f(i))return n[i]&&n[i].runs?n[i].runs:0}},_=class{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=p(this,"actions"),this.addFilter=p(this,"filters"),this.removeAction=g(this,"actions"),this.removeFilter=g(this,"filters"),this.hasAction=m(this,"actions"),this.hasFilter=m(this,"filters"),this.removeAllActions=g(this,"actions",!0),this.removeAllFilters=g(this,"filters",!0),this.doAction=b(this,"actions",!1,!1),this.doActionAsync=b(this,"actions",!1,!0),this.applyFilters=b(this,"filters",!0,!1),this.applyFiltersAsync=b(this,"filters",!0,!0),this.currentAction=v(this,"actions"),this.currentFilter=v(this,"filters"),this.doingAction=y(this,"actions"),this.doingFilter=y(this,"filters"),this.didAction=x(this,"actions"),this.didFilter=x(this,"filters")}};var w=function(){return new _}(),{addAction:k,addFilter:S,removeAction:M,removeFilter:O,hasAction:E,hasFilter:A,removeAllActions:T,removeAllFilters:C,doAction:P,doActionAsync:L,applyFilters:D,applyFiltersAsync:I,currentAction:R,currentFilter:j,doingAction:F,doingFilter:z,didAction:B,didFilter:N,actions:W,filters:V}=w,H=((t,e,i)=>{const n=new c({}),s=new Set,o=()=>{s.forEach(t=>t())},r=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},a=(t,e)=>{r(t,e),o()},l=(t="default",e,i,s,o)=>(n.data[t]||r(void 0,t),n.dcnpgettext(t,e,i,s,o)),u=t=>t||"default",f=(t,e,n)=>{let s=l(n,e,t);return i?(s=i.applyFilters("i18n.gettext_with_context",s,t,e,n),i.applyFilters("i18n.gettext_with_context_"+u(n),s,t,e,n)):s};if(t&&a(t,e),i){const t=t=>{d.test(t)&&o()};i.addAction("hookAdded","core/i18n",t),i.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:a,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],o()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},a(t,e)},subscribe:t=>(s.add(t),()=>s.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return i?(n=i.applyFilters("i18n.gettext",n,t,e),i.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:f,_n:(t,e,n,s)=>{let o=l(s,void 0,t,e,n);return i?(o=i.applyFilters("i18n.ngettext",o,t,e,n,s),i.applyFilters("i18n.ngettext_"+u(s),o,t,e,n,s)):o},_nx:(t,e,n,s,o)=>{let r=l(o,s,t,e,n);return i?(r=i.applyFilters("i18n.ngettext_with_context",r,t,e,n,s,o),i.applyFilters("i18n.ngettext_with_context_"+u(o),r,t,e,n,s,o)):r},isRTL:()=>"rtl"===f("ltr","text direction"),hasTranslation:(t,e,s)=>{const o=e?e+""+t:t;let r=!!n.data?.[s??"default"]?.[o];return i&&(r=i.applyFilters("i18n.has_translation",r,t,e,s),r=i.applyFilters("i18n.has_translation_"+u(s),r,t,e,s)),r}}})(void 0,void 0,w),$=(H.getLocaleData.bind(H),H.setLocaleData.bind(H),H.resetLocaleData.bind(H),H.subscribe.bind(H),H.__.bind(H)),U=(H._x.bind(H),H._n.bind(H),H._nx.bind(H),H.isRTL.bind(H),H.hasTranslation.bind(H),["@wordpress/admin-ui","@wordpress/api-fetch","@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/compose","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/storybook","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-engine","@wordpress/global-styles-ui","@wordpress/ui","@wordpress/views","@wordpress/widget-dashboard"]);function q(t,e){if(!t)throw new Error("Cannot lock an undefined object.");const i=t;J in i||(i[J]={}),X.set(i[J],e)}function Y(t){if(!t)throw new Error("Cannot unlock an undefined object.");const e=t;if(!(J in e))throw new Error("Cannot unlock an object that was not locked before. ");return X.get(e[J])}var X=new WeakMap,J=Symbol("Private API ID");var{lock:G,unlock:K}=((t,e)=>{if(!U.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."!==t)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:q,unlock:Y}})("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/api-fetch");var Q=function(t){const e=(t,i)=>{const{headers:n={}}=t;for(const s in n)if("x-wp-nonce"===s.toLowerCase()&&n[s]===e.nonce)return i(t);return i({...t,headers:{...n,"X-WP-Nonce":e.nonce}})};return e.nonce=t,e},Z=(t,e)=>{let i,n,s=t.path;return"string"==typeof t.namespace&&"string"==typeof t.endpoint&&(i=t.namespace.replace(/^\/|\/$/g,""),n=t.endpoint.replace(/^\//,""),s=n?i+"/"+n:i),delete t.namespace,delete t.endpoint,e({...t,path:s})},tt=t=>(e,i)=>Z(e,e=>{let n,s=e.url,o=e.path;return"string"==typeof o&&(n=t,-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(o=o.replace("?","&")),s=n+o),i({...e,url:s})});function et(t){try{return decodeURIComponent(t)}catch{return t}}function it(t){const e=t.indexOf("?");if(-1===e)return t;const i=t.slice(0,e),n=t.slice(e+1);return n?i+"?"+n.split("&").map(t=>t.split("=")).map(t=>t.map(et)).sort((t,e)=>t[0].localeCompare(e[0])).map(t=>t.map(encodeURIComponent)).map(t=>t.join("=")).join("&"):i}function nt(t){return(function(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch{}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((t,e)=>{const i=e.indexOf("="),n=-1!==i,s=et(n?e.slice(0,i):e);if(s){const o=n?et(e.slice(i+1)):"";!function(t,e,i){const n=e.length,s=n-1;for(let o=0;o<n;o++){let n=e[o];!n&&Array.isArray(t)&&(n=t.length.toString()),n=["__proto__","constructor","prototype"].includes(n)?n.toUpperCase():n;const r=!isNaN(Number(e[o+1]));t[n]=o===s?i:t[n]||(r?[]:{}),Array.isArray(t[n])&&!r&&(t[n]={...t[n]}),t=t[n]}}(t,s.replace(/\]/g,"").split("["),o)}return t},Object.create(null))}function st(t){let e="";const i=Object.entries(t);let n;for(;n=i.shift();){let[t,s]=n;if(Array.isArray(s)||s&&s.constructor===Object){const e=Object.entries(s).reverse();for(const[n,s]of e)i.unshift([`${t}[${n}]`,s])}else void 0!==s&&(null===s&&(s=""),e+="&"+[t,String(s)].map(encodeURIComponent).join("="))}return e.substr(1)}function ot(t="",e){if(!e||!Object.keys(e).length)return t;const i=function(t){const e=/^\S+?(#[^\s\?]*)/.exec(t);if(e)return e[1]}(t)||"";let n=t.replace(i,"");const s=t.indexOf("?");return-1!==s&&(e=Object.assign(nt(t),e),n=n.substr(0,s)),n+"?"+st(e)+i}var rt=Symbol("preloadingEnableMultiUse"),at=Symbol("preloadingClear");function lt(t,e){if(e)return Promise.resolve(t.body);try{return Promise.resolve(new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}catch{return Object.entries(t.headers).forEach(([e,i])=>{"link"===e.toLowerCase()&&(t.headers[e]=i.replace(/<([^>]+)>/,(t,e)=>`<${encodeURI(e)}>`))}),Promise.resolve(e?t.body:new window.Response(JSON.stringify(t.body),{status:200,statusText:"OK",headers:t.headers}))}}var ct=function(t){const{OPTIONS:e={},...i}=Object.fromEntries(Object.entries(t).map(([t,e])=>[it(t),e])),n=new Set(Object.keys(i)),s=new Set(Object.keys(e));let o=!1;const r=(t,r)=>{const{parse:a=!0}=t;let l=t.path;if(!l&&t.url){const{rest_route:e,...i}=nt(t.url);"string"==typeof e&&(l=ot(e,i))}if("string"!=typeof l)return r(t);const c=t.method||"GET",h=it(l);if("GET"===c&&i[h]){const t=i[h];return o||delete i[h],n.delete(h),lt(t,!!a)}if("OPTIONS"===c&&e[h]){const t=e[h];return o||delete e[h],s.delete(h),lt(t,!!a)}return r(t)};return r[rt]=()=>{o=!0},r[at]=()=>{const t=[...Array.from(n,t=>`GET ${t}`),...Array.from(s,t=>`OPTIONS ${t}`)];t.length?console.warn("[api-fetch][preload] Some preloads were never consumed:",t):console.log("[api-fetch][preload] All preloads consumed."),n.clear(),s.clear();for(const t of Object.keys(i))delete i[t];for(const t of Object.keys(e))delete e[t]},r},ht=({path:t,url:e,...i},n)=>({...i,url:e&&ot(e,n),path:t&&ot(t,n)}),dt=t=>t.json?t.json():Promise.reject(t),ut=t=>{const{next:e}=(t=>{if(!t)return{};const e=t.match(/<([^>]+)>; rel="next"/);return e?{next:e[1]}:{}})(t.headers.get("link"));return e},ft=async(t,e)=>{if(!1===t.parse)return e(t);if(!(t=>{const e=!!t.path&&-1!==t.path.indexOf("per_page=-1"),i=!!t.url&&-1!==t.url.indexOf("per_page=-1");return e||i})(t))return e(t);const i=await Pt({...ht(t,{per_page:100}),parse:!1}),n=await dt(i);if(!Array.isArray(n))return n;let s=ut(i);if(!s)return n;let o=[].concat(n);for(;s;){const e=await Pt({...t,path:void 0,url:s,parse:!1}),i=await dt(e);o=o.concat(i),s=ut(e)}return o},pt=new Set(["PATCH","PUT","DELETE"]),gt="GET",mt=(t,e)=>{const{method:i=gt}=t;return pt.has(i.toUpperCase())&&(t={...t,headers:{"Content-Type":"application/json",...t.headers,"X-HTTP-Method-Override":i},method:"POST"}),e(t)};function bt(t,e){return nt(t)[e]}function vt(t,e){return void 0!==bt(t,e)}async function yt(t,e=!1){try{if("function"!=typeof t.text)return await t.json();const i=await t.text();return e&&""===i?null:JSON.parse(i)}catch{throw{code:"invalid_json",message:$("The response is not a valid JSON response.")}}}async function xt(t,e=!0){return e?204===t.status?null:await yt(t,!0):t}async function _t(t,e=!0){if(!e)throw t;throw await yt(t)}var wt=(t,e)=>{if(!function(t){const e=!!t.method&&"POST"===t.method;return(!!t.path&&-1!==t.path.indexOf("/wp/v2/media")||!!t.url&&-1!==t.url.indexOf("/wp/v2/media"))&&e}(t))return e(t);let i=0;const n=t=>(i++,e({path:`/wp/v2/media/${t}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>i<5?n(t):(e({path:`/wp/v2/media/${t}?force=true`,method:"DELETE"}),Promise.reject())));return e({...t,parse:!1}).catch(e=>{if(!(e instanceof globalThis.Response))return Promise.reject(e);const i=e.headers.get("x-wp-upload-attachment-id");return e.status>=500&&e.status<600&&i?n(i).catch(()=>!1!==t.parse?Promise.reject({code:"post_process",message:$("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(e)):_t(e,t.parse)}).then(e=>xt(e,t.parse))};function kt(t,...e){const i=t.replace(/^[^#]*/,""),n=(t=t.replace(/#.*/,"")).indexOf("?");if(-1===n)return t+i;const s=nt(t),o=t.substr(0,n);e.forEach(t=>delete s[t]);const r=st(s);return(r?o+"?"+r:o)+i}var St=t=>(e,i)=>{if("string"==typeof e.url){const i=bt(e.url,"wp_theme_preview");void 0===i?e.url=ot(e.url,{wp_theme_preview:t}):""===i&&(e.url=kt(e.url,"wp_theme_preview"))}if("string"==typeof e.path){const i=bt(e.path,"wp_theme_preview");void 0===i?e.path=ot(e.path,{wp_theme_preview:t}):""===i&&(e.path=kt(e.path,"wp_theme_preview"))}return i(e)},Mt={Accept:"application/json, */*;q=0.1"},Ot={credentials:"include"},Et=[(t,e)=>("string"!=typeof t.url||vt(t.url,"_locale")||(t.url=ot(t.url,{_locale:"user"})),"string"!=typeof t.path||vt(t.path,"_locale")||(t.path=ot(t.path,{_locale:"user"})),e(t)),Z,mt,ft];var At=t=>{const{url:e,path:i,data:n,parse:s=!0,...o}=t;let{body:r,headers:a}=t;a={...Mt,...a},n&&(r=JSON.stringify(n),a["Content-Type"]="application/json");return globalThis.fetch(e||i||window.location.href,{...Ot,...o,body:r,headers:a}).then(t=>t.ok?xt(t,s):_t(t,s),t=>{if(t&&"AbortError"===t.name)throw t;if(!globalThis.navigator.onLine)throw{code:"offline_error",message:$("Unable to connect. Please check your Internet connection.")};throw{code:"fetch_error",message:$("Could not get a valid response from the server.")}})},Tt=At;var Ct=t=>Et.reduceRight((t,e)=>i=>e(i,t),Tt)(t).catch(e=>"rest_cookie_invalid_nonce"!==e.code?Promise.reject(e):globalThis.fetch(Ct.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(e)).then(e=>(Ct.nonceMiddleware.nonce=e,Ct(t))));Ct.use=function(t){Et.unshift(t)},Ct.unregister=function(t){const e=Et.indexOf(t);return-1!==e&&(Et.splice(e,1),!0)},Ct.setFetchHandler=function(t){Tt=t},Ct.defaultFetchHandler=At,Ct.privateApis={},G(Ct.privateApis,{enablePreloadMultiUse:function(){for(const t of Et)t[rt]?.()},clearPreloadedData:function(){for(const t of Et)t[at]?.()}}),Ct.createNonceMiddleware=Q,Ct.createPreloadingMiddleware=ct,Ct.createRootURLMiddleware=tt,Ct.fetchAllMiddleware=ft,Ct.httpV1Middleware=mt,Ct.mediaUploadMiddleware=wt,Ct.createThemePreviewMiddleware=St;var Pt=Ct;const Lt={wpWrap:document.getElementById("wpwrap"),adminbar:document.getElementById("wpadminbar"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-dam"),cloudinaryHeader:document.getElementById("cloudinary-header"),wpFooter:document.getElementById("wpfooter"),importStatus:document.getElementById("import-status"),downloading:{},_init(){const t=this,e=this.libraryWrap,i=this.importStatus;"undefined"!=typeof CLDN&&document.querySelector(CLDN.mloptions.inline_container)&&(Pt.use(Pt.createNonceMiddleware(CLDN.nonce)),cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(n){const s=[];for(let o=0;o<n.assets.length;o++){const r=n.assets[o];wp.ajax.post("cloudinary-down-sync",{nonce:CLDN.nonce,asset:r}).done(function(n){e.style.marginRight="220px",i.style.display="block";const o=t.makeProgress(n),r="download-"+n.public_id;s[r]=o,i.appendChild(o),setTimeout(()=>{o.style.opacity=1},250),Pt({path:cldData.dam.fetch_url,data:{src:n.url,filename:n.filename,attachment_id:n.attachment_id,transformations:n.transformations},method:"POST"}).then(t=>{const n=s[r];delete s[r],n.removeChild(n.firstChild),setTimeout(()=>{n.style.opacity=0,setTimeout(()=>{n.parentNode.removeChild(n),Object.keys(s).length||(e.style.marginRight="0px",i.style.display="none")},1e3)},500)})})}}}),window.addEventListener("resize",function(){t._resize()}),t._resize())},_resize(){this.libraryWrap.style.height=this.wpFooter.offsetTop-this.libraryWrap.offsetTop-this.adminbar.offsetHeight+"px"},makeProgress(t){const e=document.createElement("div"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-import-item"),i.classList.add("spinner"),n.classList.add("cld-import-item-id"),n.innerText=t.public_id,e.appendChild(i),e.appendChild(n),e}};window.addEventListener("load",()=>Lt._init());const Dt={_init(){const t=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach(e=>{const i=e.getElementsByClassName("notice-dismiss");i.length&&i[0].addEventListener("click",i=>{e.style.height=e.offsetHeight+"px",i.preventDefault(),setTimeout(function(){t._dismiss(e)},5)})})}},_dismiss(t){const e=t.dataset.dismiss,i=parseInt(t.dataset.duration);t.classList.add("dismissed"),t.style.height="0px",setTimeout(function(){t.remove()},400),0<i&&wp.ajax.send({url:CLDIS.url,data:{token:e,duration:i,_wpnonce:CLDIS.nonce}})}};window.addEventListener("load",Dt._init());function It(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Rt(t){return t instanceof It(t).Element||t instanceof Element}function jt(t){return t instanceof It(t).HTMLElement||t instanceof HTMLElement}function Ft(t){return"undefined"!=typeof ShadowRoot&&(t instanceof It(t).ShadowRoot||t instanceof ShadowRoot)}var zt=Math.max,Bt=Math.min,Nt=Math.round;function Wt(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Vt(){return!/^((?!chrome|android).)*safari/i.test(Wt())}function Ht(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&jt(t)&&(s=t.offsetWidth>0&&Nt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Nt(n.height)/t.offsetHeight||1);var r=(Rt(t)?It(t):window).visualViewport,a=!Vt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function $t(t){var e=It(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){return((Rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return Ht(qt(t)).left+$t(t).scrollLeft}function Xt(t){return It(t).getComputedStyle(t)}function Jt(t){var e=Xt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Gt(t,e,i){void 0===i&&(i=!1);var n,s,o=jt(e),r=jt(e)&&function(t){var e=t.getBoundingClientRect(),i=Nt(e.width)/t.offsetWidth||1,n=Nt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=qt(e),l=Ht(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ut(e)||Jt(a))&&(c=(n=e)!==It(n)&&jt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:$t(n)),jt(e)?((h=Ht(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Yt(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Kt(t){var e=Ht(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Qt(t){return"html"===Ut(t)?t:t.assignedSlot||t.parentNode||(Ft(t)?t.host:null)||qt(t)}function Zt(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:jt(t)&&Jt(t)?t:Zt(Qt(t))}function te(t,e){var i;void 0===e&&(e=[]);var n=Zt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=It(n),r=s?[o].concat(o.visualViewport||[],Jt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(te(Qt(r)))}function ee(t){return["table","td","th"].indexOf(Ut(t))>=0}function ie(t){return jt(t)&&"fixed"!==Xt(t).position?t.offsetParent:null}function ne(t){for(var e=It(t),i=ie(t);i&&ee(i)&&"static"===Xt(i).position;)i=ie(i);return i&&("html"===Ut(i)||"body"===Ut(i)&&"static"===Xt(i).position)?e:i||function(t){var e=/firefox/i.test(Wt());if(/Trident/i.test(Wt())&&jt(t)&&"fixed"===Xt(t).position)return null;var i=Qt(t);for(Ft(i)&&(i=i.host);jt(i)&&["html","body"].indexOf(Ut(i))<0;){var n=Xt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}var se="top",oe="bottom",re="right",ae="left",le="auto",ce=[se,oe,re,ae],he="start",de="end",ue="viewport",fe="popper",pe=ce.reduce(function(t,e){return t.concat([e+"-"+he,e+"-"+de])},[]),ge=[].concat(ce,[le]).reduce(function(t,e){return t.concat([e,e+"-"+he,e+"-"+de])},[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function ye(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function xe(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,s=e.defaultOptions,o=void 0===s?ve:s;return function(t,e,i){void 0===i&&(i=o);var s,r,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},ve,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(i){var s="function"==typeof i?i(a.options):i;d(),a.options=Object.assign({},o,a.options,s),a.scrollParents={reference:Rt(t)?te(t):t.contextElement?te(t.contextElement):[],popper:te(e)};var r,c,u=function(t){var e=be(t);return me.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((r=[].concat(n,a.options.modifiers),c=r.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(c).map(function(t){return c[t]})));return a.orderedModifiers=u.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,s=t.effect;if("function"==typeof s){var o=s({state:a,name:e,instance:h,options:n}),r=function(){};l.push(o||r)}}),h.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(ye(e,i)){a.rects={reference:Gt(e,ne(i),"fixed"===a.options.strategy),popper:Kt(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var s=a.orderedModifiers[n],o=s.fn,r=s.options,l=void 0===r?{}:r,d=s.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:h})||a)}else a.reset=!1,n=-1}}},update:(s=function(){return new Promise(function(t){h.forceUpdate(),t(a)})},function(){return r||(r=new Promise(function(t){Promise.resolve().then(function(){r=void 0,t(s())})})),r}),destroy:function(){d(),c=!0}};if(!ye(t,e))return h;function d(){l.forEach(function(t){return t()}),l=[]}return h.setOptions(i).then(function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)}),h}}var _e={passive:!0};function we(t){return t.split("-")[0]}function ke(t){return t.split("-")[1]}function Se(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Me(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?ke(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case se:e={x:a,y:i.y-n.height};break;case oe:e={x:a,y:i.y+i.height};break;case re:e={x:i.x+i.width,y:l};break;case ae:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Se(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case he:e[c]=e[c]-(i[h]/2-n[h]/2);break;case de:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}var Oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ee(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,g=void 0===p?0:p,m="function"==typeof h?h({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var b=r.hasOwnProperty("x"),v=r.hasOwnProperty("y"),y=ae,x=se,_=window;if(c){var w=ne(i),k="clientHeight",S="clientWidth";if(w===It(i)&&"static"!==Xt(w=qt(i)).position&&"absolute"===a&&(k="scrollHeight",S="scrollWidth"),s===se||(s===ae||s===re)&&o===de)x=oe,g-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,g*=l?1:-1;if(s===ae||(s===se||s===oe)&&o===de)y=re,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-n.width,f*=l?1:-1}var M,O=Object.assign({position:a},c&&Oe),E=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Nt(i*s)/s||0,y:Nt(n*s)/s||0}}({x:f,y:g},It(i)):{x:f,y:g};return f=E.x,g=E.y,l?Object.assign({},O,((M={})[x]=v?"0":"",M[y]=b?"0":"",M.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},O,((e={})[x]=v?g+"px":"",e[y]=b?f+"px":"",e.transform="",e))}const Ae={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];jt(s)&&Ut(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});jt(n)&&Ut(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};const Te={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ge.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[ae,se].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[ae,re].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}};var Ce={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(t){return Ce[t]})}var Le={start:"end",end:"start"};function De(t){return t.replace(/start|end/g,function(t){return Le[t]})}function Ie(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ft(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Re(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function je(t,e,i){return e===ue?Re(function(t,e){var i=It(t),n=qt(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Vt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Yt(t),y:l}}(t,i)):Rt(e)?function(t,e){var i=Ht(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Re(function(t){var e,i=qt(t),n=$t(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=zt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=zt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Yt(t),l=-n.scrollTop;return"rtl"===Xt(s||i).direction&&(a+=zt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(qt(t)))}function Fe(t,e,i,n){var s="clippingParents"===e?function(t){var e=te(Qt(t)),i=["absolute","fixed"].indexOf(Xt(t).position)>=0&&jt(t)?ne(t):t;return Rt(i)?e.filter(function(t){return Rt(t)&&Ie(t,i)&&"body"!==Ut(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=je(t,i,n);return e.top=zt(s.top,e.top),e.right=Bt(s.right,e.right),e.bottom=Bt(s.bottom,e.bottom),e.left=zt(s.left,e.left),e},je(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ze(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Be(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}function Ne(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,c=i.rootBoundary,h=void 0===c?ue:c,d=i.elementContext,u=void 0===d?fe:d,f=i.altBoundary,p=void 0!==f&&f,g=i.padding,m=void 0===g?0:g,b=ze("number"!=typeof m?m:Be(m,ce)),v=u===fe?"reference":fe,y=t.rects.popper,x=t.elements[p?v:u],_=Fe(Rt(x)?x:x.contextElement||qt(t.elements.popper),l,h,r),w=Ht(t.elements.reference),k=Me({reference:w,element:y,strategy:"absolute",placement:s}),S=Re(Object.assign({},y,k)),M=u===fe?S:w,O={top:_.top-M.top+b.top,bottom:M.bottom-_.bottom+b.bottom,left:_.left-M.left+b.left,right:M.right-_.right+b.right},E=t.modifiersData.offset;if(u===fe&&E){var A=E[s];Object.keys(O).forEach(function(t){var e=[re,oe].indexOf(t)>=0?1:-1,i=[se,oe].indexOf(t)>=0?"y":"x";O[t]+=A[i]*e})}return O}function We(t,e,i){return zt(t,Bt(e,i))}const Ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,g=void 0===p?0:p,m=Ne(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),b=we(e.placement),v=ke(e.placement),y=!v,x=Se(b),_="x"===x?"y":"x",w=e.modifiersData.popperOffsets,k=e.rects.reference,S=e.rects.popper,M="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O="number"==typeof M?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(w){if(o){var T,C="y"===x?se:ae,P="y"===x?oe:re,L="y"===x?"height":"width",D=w[x],I=D+m[C],R=D-m[P],j=f?-S[L]/2:0,F=v===he?k[L]:S[L],z=v===he?-S[L]:-k[L],B=e.elements.arrow,N=f&&B?Kt(B):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=W[C],H=W[P],$=We(0,k[L],N[L]),U=y?k[L]/2-j-$-V-O.mainAxis:F-$-V-O.mainAxis,q=y?-k[L]/2+j+$+H+O.mainAxis:z+$+H+O.mainAxis,Y=e.elements.arrow&&ne(e.elements.arrow),X=Y?"y"===x?Y.clientTop||0:Y.clientLeft||0:0,J=null!=(T=null==E?void 0:E[x])?T:0,G=D+q-J,K=We(f?Bt(I,D+U-J-X):I,D,f?zt(R,G):R);w[x]=K,A[x]=K-D}if(a){var Q,Z="x"===x?se:ae,tt="x"===x?oe:re,et=w[_],it="y"===_?"height":"width",nt=et+m[Z],st=et-m[tt],ot=-1!==[se,ae].indexOf(b),rt=null!=(Q=null==E?void 0:E[_])?Q:0,at=ot?nt:et-k[it]-S[it]-rt+O.altAxis,lt=ot?et+k[it]+S[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=We(t,e,i);return n>i?i:n}(at,et,lt):We(f?at:nt,et,f?lt:st);w[_]=ct,A[_]=ct-et}e.modifiersData[n]=A}},requiresIfExists:["offset"]};const He={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=Se(a),c=[ae,re].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ze("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Be(t,ce))}(s.padding,i),d=Kt(o),u="y"===l?se:ae,f="y"===l?oe:re,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=ne(o),b=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,v=p/2-g/2,y=h[u],x=b-d[c]-h[f],_=b/2-d[c]/2+v,w=We(y,_,x),k=l;i.modifiersData[n]=((e={})[k]=w,e.centerOffset=w-_,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ie(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $e(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ue(t){return[se,re,oe,ae].some(function(e){return t[e]>=0})}var qe=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=It(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,_e)}),a&&l.addEventListener("resize",i.update,_e),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,_e)}),a&&l.removeEventListener("resize",i.update,_e)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Me({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Ee(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ee(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ae,Te,{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,g=i.allowedAutoPlacements,m=e.options.placement,b=we(m),v=l||(b===m||!p?[Pe(m)]:function(t){if(we(t)===le)return[];var e=Pe(t);return[De(t),e,De(e)]}(m)),y=[m].concat(v).reduce(function(t,i){return t.concat(we(i)===le?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ge:l,h=ke(n),d=h?a?pe:pe.filter(function(t){return ke(t)===h}):ce,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=Ne(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,_=e.rects.popper,w=new Map,k=!0,S=y[0],M=0;M<y.length;M++){var O=y[M],E=we(O),A=ke(O)===he,T=[se,oe].indexOf(E)>=0,C=T?"width":"height",P=Ne(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),L=T?A?re:ae:A?oe:se;x[C]>_[C]&&(L=Pe(L));var D=Pe(L),I=[];if(o&&I.push(P[E]<=0),a&&I.push(P[L]<=0,P[D]<=0),I.every(function(t){return t})){S=O,k=!1;break}w.set(O,I)}if(k)for(var R=function(t){var e=y.find(function(e){var i=w.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return S=e,"break"},j=p?3:1;j>0;j--){if("break"===R(j))break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Ve,He,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Ne(e,{elementContext:"reference"}),a=Ne(e,{altBoundary:!0}),l=$e(r,n),c=$e(a,s,o),h=Ue(l),d=Ue(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]}),Ye="tippy-content",Xe="tippy-backdrop",Je="tippy-arrow",Ge="tippy-svg-arrow",Ke={passive:!0,capture:!0},Qe=function(){return document.body};function Ze(t,e,i){if(Array.isArray(t)){var n=t[e];return n??(Array.isArray(i)?i[e]:i)}return t}function ti(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function ei(t,e){return"function"==typeof t?t.apply(void 0,e):t}function ii(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)};var i}function ni(t){return[].concat(t)}function si(t,e){-1===t.indexOf(e)&&t.push(e)}function oi(t){return t.split("-")[0]}function ri(t){return[].slice.call(t)}function ai(t){return Object.keys(t).reduce(function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e},{})}function li(){return document.createElement("div")}function ci(t){return["Element","Fragment"].some(function(e){return ti(t,e)})}function hi(t){return ti(t,"MouseEvent")}function di(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function ui(t){return ci(t)?[t]:function(t){return ti(t,"NodeList")}(t)?ri(t):Array.isArray(t)?t:ri(document.querySelectorAll(t))}function fi(t,e){t.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function pi(t,e){t.forEach(function(t){t&&t.setAttribute("data-state",e)})}function gi(t){var e,i=ni(t)[0];return null!=i&&null!=(e=i.ownerDocument)&&e.body?i.ownerDocument:document}function mi(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(e){t[n](e,i)})}function bi(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var vi={isTouch:!1},yi=0;function xi(){vi.isTouch||(vi.isTouch=!0,window.performance&&document.addEventListener("mousemove",_i))}function _i(){var t=performance.now();t-yi<20&&(vi.isTouch=!1,document.removeEventListener("mousemove",_i)),yi=t}function wi(){var t=document.activeElement;if(di(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var ki=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Si={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Mi=Object.assign({appendTo:Qe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Si,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oi=Object.keys(Mi);function Ei(t){var e=(t.plugins||[]).reduce(function(e,i){var n,s=i.name,o=i.defaultValue;s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=Mi[s])?n:o);return e},{});return Object.assign({},t,e)}function Ai(t,e){var i=Object.assign({},e,{content:ei(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Ei(Object.assign({},Mi,{plugins:e}))):Oi).reduce(function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e},{})}(t,e.plugins));return i.aria=Object.assign({},Mi.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ti(t,e){t.innerHTML=e}function Ci(t){var e=li();return!0===t?e.className=Je:(e.className=Ge,ci(t)?e.appendChild(t):Ti(e,t)),e}function Pi(t,e){ci(e.content)?(Ti(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ti(t,e.content):t.textContent=e.content)}function Li(t){var e=t.firstElementChild,i=ri(e.children);return{box:e,content:i.find(function(t){return t.classList.contains(Ye)}),arrow:i.find(function(t){return t.classList.contains(Je)||t.classList.contains(Ge)}),backdrop:i.find(function(t){return t.classList.contains(Xe)})}}function Di(t){var e=li(),i=li();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=li();function s(i,n){var s=Li(e),o=s.box,r=s.content,a=s.arrow;n.theme?o.setAttribute("data-theme",n.theme):o.removeAttribute("data-theme"),"string"==typeof n.animation?o.setAttribute("data-animation",n.animation):o.removeAttribute("data-animation"),n.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Pi(r,t.props),n.arrow?a?i.arrow!==n.arrow&&(o.removeChild(a),o.appendChild(Ci(n.arrow))):o.appendChild(Ci(n.arrow)):a&&o.removeChild(a)}return n.className=Ye,n.setAttribute("data-state","hidden"),Pi(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Di.$$tippy=!0;var Ii=1,Ri=[],ji=[];function Fi(t,e){var i,n,s,o,r,a,l,c,h=Ai(t,Object.assign({},Mi,Ei(ai(e)))),d=!1,u=!1,f=!1,p=!1,g=[],m=ii(Y,h.interactiveDebounce),b=Ii++,v=(c=h.plugins).filter(function(t,e){return c.indexOf(t)===e}),y={id:b,reference:t,popper:li(),popperInstance:null,props:h,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){0;if(y.state.isDestroyed)return;D("onBeforeUpdate",[y,e]),U();var i=y.props,n=Ai(t,Object.assign({},i,ai(e),{ignoreAttributes:!0}));y.props=n,$(),i.interactiveDebounce!==n.interactiveDebounce&&(j(),m=ii(Y,n.interactiveDebounce));i.triggerTarget&&!n.triggerTarget?ni(i.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):n.triggerTarget&&t.removeAttribute("aria-expanded");R(),L(),w&&w(i,n);y.popperInstance&&(K(),Z().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}));D("onAfterUpdate",[y,e])},setContent:function(t){y.setProps({content:t})},show:function(){0;var t=y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=vi.isTouch&&!y.props.touch,s=Ze(y.props.duration,0,Mi.duration);if(t||e||i||n)return;if(A().hasAttribute("disabled"))return;if(D("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,E()&&(_.style.visibility="visible");L(),N(),y.state.isMounted||(_.style.transition="none");if(E()){var o=C();fi([o.box,o.content],0)}a=function(){var t;if(y.state.isVisible&&!p){if(p=!0,_.offsetHeight,_.style.transition=y.props.moveTransition,E()&&y.props.animation){var e=C(),i=e.box,n=e.content;fi([i,n],s),pi([i,n],"visible")}I(),R(),si(ji,y),null==(t=y.popperInstance)||t.forceUpdate(),D("onMount",[y]),y.props.animation&&E()&&function(t,e){V(t,e)}(s,function(){y.state.isShown=!0,D("onShown",[y])})}},function(){var t,e=y.props.appendTo,i=A();t=y.props.interactive&&e===Qe||"parent"===e?i.parentNode:ei(e,[i]);t.contains(_)||t.appendChild(_);y.state.isMounted=!0,K(),!1}()},hide:function(){0;var t=!y.state.isVisible,e=y.state.isDestroyed,i=!y.state.isEnabled,n=Ze(y.props.duration,1,Mi.duration);if(t||e||i)return;if(D("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,p=!1,d=!1,E()&&(_.style.visibility="hidden");if(j(),W(),L(!0),E()){var s=C(),o=s.box,r=s.content;y.props.animation&&(fi([o,r],n),pi([o,r],"hidden"))}I(),R(),y.props.animation?E()&&function(t,e){V(t,function(){!y.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&e()})}(n,y.unmount):y.unmount()},hideWithInteractivity:function(t){0;T().addEventListener("mousemove",m),si(Ri,m),m(t)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){0;y.state.isVisible&&y.hide();if(!y.state.isMounted)return;Q(),Z().forEach(function(t){t._tippy.unmount()}),_.parentNode&&_.parentNode.removeChild(_);ji=ji.filter(function(t){return t!==y}),y.state.isMounted=!1,D("onHidden",[y])},destroy:function(){0;if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),U(),delete t._tippy,y.state.isDestroyed=!0,D("onDestroy",[y])}};if(!h.render)return y;var x=h.render(y),_=x.popper,w=x.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+y.id,y.popper=_,t._tippy=y,_._tippy=y;var k=v.map(function(t){return t.fn(y)}),S=t.hasAttribute("aria-expanded");return $(),R(),L(),D("onCreate",[y]),h.showOnCreate&&tt(),_.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),_.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",m)}),y;function M(){var t=y.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===M()[0]}function E(){var t;return!(null==(t=y.props.render)||!t.$$tippy)}function A(){return l||t}function T(){var t=A().parentNode;return t?gi(t):document}function C(){return Li(_)}function P(t){return y.state.isMounted&&!y.state.isVisible||vi.isTouch||o&&"focus"===o.type?0:Ze(y.props.delay,t?0:1,Mi.delay)}function L(t){void 0===t&&(t=!1),_.style.pointerEvents=y.props.interactive&&!t?"":"none",_.style.zIndex=""+y.props.zIndex}function D(t,e,i){var n;(void 0===i&&(i=!0),k.forEach(function(i){i[t]&&i[t].apply(i,e)}),i)&&(n=y.props)[t].apply(n,e)}function I(){var e=y.props.aria;if(e.content){var i="aria-"+e.content,n=_.id;ni(y.props.triggerTarget||t).forEach(function(t){var e=t.getAttribute(i);if(y.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}})}}function R(){!S&&y.props.aria.expanded&&ni(y.props.triggerTarget||t).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===A()?"true":"false"):t.removeAttribute("aria-expanded")})}function j(){T().removeEventListener("mousemove",m),Ri=Ri.filter(function(t){return t!==m})}function F(e){if(!vi.isTouch||!f&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!y.props.interactive||!bi(_,i)){if(ni(y.props.triggerTarget||t).some(function(t){return bi(t,i)})){if(vi.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,e]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||W())}}}function z(){f=!0}function B(){f=!1}function N(){var t=T();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,Ke),t.addEventListener("touchstart",B,Ke),t.addEventListener("touchmove",z,Ke)}function W(){var t=T();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,Ke),t.removeEventListener("touchstart",B,Ke),t.removeEventListener("touchmove",z,Ke)}function V(t,e){var i=C().box;function n(t){t.target===i&&(mi(i,"remove",n),e())}if(0===t)return e();mi(i,"remove",r),mi(i,"add",n),r=n}function H(e,i,n){void 0===n&&(n=!1),ni(y.props.triggerTarget||t).forEach(function(t){t.addEventListener(e,i,n),g.push({node:t,eventType:e,handler:i,options:n})})}function $(){var t;O()&&(H("touchstart",q,{passive:!0}),H("touchend",X,{passive:!0})),(t=y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach(function(t){if("manual"!==t)switch(H(t,q),t){case"mouseenter":H("mouseleave",X);break;case"focus":H(ki?"focusout":"blur",J);break;case"focusin":H("focusout",J)}})}function U(){g.forEach(function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)}),g=[]}function q(t){var e,i=!1;if(y.state.isEnabled&&!G(t)&&!u){var n="focus"===(null==(e=o)?void 0:e.type);o=t,l=t.currentTarget,R(),!y.state.isVisible&&hi(t)&&Ri.forEach(function(e){return e(t)}),"click"===t.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:tt(t),"click"===t.type&&(d=!i),i&&!n&&et(t)}}function Y(t){var e=t.target,i=A().contains(e)||_.contains(e);if("mousemove"!==t.type||!i){var n=Z().concat(_).map(function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:h}:null}).filter(Boolean);(function(t,e){var i=e.clientX,n=e.clientY;return t.every(function(t){var e=t.popperRect,s=t.popperState,o=t.props.interactiveBorder,r=oi(s.placement),a=s.modifiersData.offset;if(!a)return!0;var l="bottom"===r?a.top.y:0,c="top"===r?a.bottom.y:0,h="right"===r?a.left.x:0,d="left"===r?a.right.x:0,u=e.top-n+l>o,f=n-e.bottom-c>o,p=e.left-i+h>o,g=i-e.right-d>o;return u||f||p||g})})(n,t)&&(j(),et(t))}}function X(t){G(t)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(t):et(t))}function J(t){y.props.trigger.indexOf("focusin")<0&&t.target!==A()||y.props.interactive&&t.relatedTarget&&_.contains(t.relatedTarget)||et(t)}function G(t){return!!vi.isTouch&&O()!==t.type.indexOf("touch")>=0}function K(){Q();var e=y.props,i=e.popperOptions,n=e.placement,s=e.offset,o=e.getReferenceClientRect,r=e.moveTransition,l=E()?Li(_).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:t,h={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(E()){var i=C().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)}),e.attributes.popper={}}}},d=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!r}},h];E()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==i?void 0:i.modifiers)||[]),y.popperInstance=qe(c,_,Object.assign({},i,{placement:n,onFirstUpdate:a,modifiers:d}))}function Q(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Z(){return ri(_.querySelectorAll("[data-tippy-root]"))}function tt(t){y.clearDelayTimeouts(),t&&D("onTrigger",[y,t]),N();var e=P(!0),n=M(),s=n[0],o=n[1];vi.isTouch&&"hold"===s&&o&&(e=o),e?i=setTimeout(function(){y.show()},e):y.show()}function et(t){if(y.clearDelayTimeouts(),D("onUntrigger",[y,t]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=P(!1);e?n=setTimeout(function(){y.state.isVisible&&y.hide()},e):s=requestAnimationFrame(function(){y.hide()})}}else W()}}function zi(t,e){void 0===e&&(e={});var i=Mi.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",xi,Ke),window.addEventListener("blur",wi);var n=Object.assign({},e,{plugins:i}),s=ui(t).reduce(function(t,e){var i=e&&Fi(e,n);return i&&t.push(i),t},[]);return ci(t)?s[0]:s}zi.defaultProps=Mi,zi.setDefaultProps=function(t){Object.keys(t).forEach(function(e){Mi[e]=t[e]})},zi.currentInput=vi;Object.assign({},Ae,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}});zi.setDefaultProps({render:Di});const Bi=zi;var Ni=i(951),Wi=i.n(Ni);const Vi={controlled:null,bind(t){this.controlled=t,this.controlled.forEach(t=>{this._main(t)}),this._init()},_init(){this.controlled.forEach(t=>{this._checkUp(t)})},_main(t){const e=JSON.parse(t.dataset.main);t.dataset.size&&(t.filesize=parseInt(t.dataset.size,10)),t.mains=e.map(e=>{const i=document.getElementById(e),n=document.getElementById(e+"_size_wrapper");return n&&(i.filesize=0,i.sizespan=n),this._addChild(i,t),i}),this._bindEvents(t),t.mains.forEach(t=>{this._bindEvents(t)})},_bindEvents(t){t.eventBound||(t.addEventListener("click",e=>{const i=e.target;i.elements&&(this._checkDown(i),this._evaluateSize(i)),i.mains&&this._checkUp(t)}),t.eventBound=!0)},_addChild(t,e){const i=t.elements?t.elements:[];-1===i.indexOf(e)&&(i.push(e),t.elements=i)},_removeChild(t,e){const i=t.elements.indexOf(e);-1<i&&t.elements.splice(i,1)},_checkDown(t){t.elements&&(t.classList.remove("partial"),t.elements.forEach(e=>{e.checked!==t.checked&&(e.checked=t.checked,e.disabled&&(e.checked=!1),e.dispatchEvent(new Event("change")))}),t.elements.forEach(e=>{this._checkDown(e),e.elements||this._checkUp(e,t)}))},_checkUp(t,e){t.mains&&[...t.mains].forEach(t=>{t!==e&&this._evaluateCheckStatus(t),this._checkUp(t),this._evaluateSize(t)})},_evaluateCheckStatus(t){let e=0,i=t.classList.contains("partial");i&&(t.classList.remove("partial"),i=!1),t.elements.forEach(n=>{null!==n.parentNode?(e+=n.checked,n.classList.contains("partial")&&(i=!0)):this._removeChild(t,n)});let n="some";e===t.elements.length?n="on":0===e?n="off":i=!0,i&&t.classList.add("partial");const s="off"!==n;t.checked===s&&t.value===n||(t.value=n,t.checked=s,t.dispatchEvent(new Event("change")))},_evaluateSize(t){if(t.sizespan&&t.elements){t.filesize=0,t.elements.forEach(e=>{e.checked&&(t.filesize+=e.filesize)});let e=null;0<t.filesize&&(e=Wi()(t.filesize,{spacer:" "}).human("jedec")),t.sizespan.innerText=e}}},Hi=Vi;var $i=i(941),Ui=i.n($i);function qi(t){return t+.5|0}const Yi=(t,e,i)=>Math.max(Math.min(t,i),e);function Xi(t){return Yi(qi(2.55*t),0,255)}function Ji(t){return Yi(qi(255*t),0,255)}function Gi(t){return Yi(qi(t/2.55)/100,0,1)}function Ki(t){return Yi(qi(100*t),0,100)}const Qi={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},Zi=[..."0123456789ABCDEF"],tn=t=>Zi[15&t],en=t=>Zi[(240&t)>>4]+Zi[15&t],nn=t=>(240&t)>>4==(15&t);function sn(t){var e=(t=>nn(t.r)&&nn(t.g)&&nn(t.b)&&nn(t.a))(t)?tn:en;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const on=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rn(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function an(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function ln(t,e,i){const n=rn(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function cn(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),o=Math.min(e,i,n),r=(s+o)/2;let a,l,c;return s!==o&&(c=s-o,l=r>.5?c/(2-s-o):c/(s+o),a=function(t,e,i,n,s){return t===s?(e-i)/n+(e<i?6:0):e===s?(i-t)/n+2:(t-e)/n+4}(e,i,n,c,s),a=60*a+.5),[0|a,l||0,r]}function hn(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(Ji)}function dn(t,e,i){return hn(rn,t,e,i)}function un(t){return(t%360+360)%360}function fn(t){const e=on.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?Xi(+e[5]):Ji(+e[5]));const s=un(+e[2]),o=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return hn(ln,t,e,i)}(s,o,r):"hsv"===e[1]?function(t,e,i){return hn(an,t,e,i)}(s,o,r):dn(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}const pn={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"},gn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let mn;function bn(t){mn||(mn=function(){const t={},e=Object.keys(gn),i=Object.keys(pn);let n,s,o,r,a;for(n=0;n<e.length;n++){for(r=a=e[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,pn[o]);o=parseInt(gn[r],16),t[a]=[o>>16&255,o>>8&255,255&o]}return t}(),mn.transparent=[0,0,0,0]);const e=mn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const yn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,xn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _n(t,e,i){if(t){let n=cn(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=dn(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function wn(t,e){return t?Object.assign(e||{},t):t}function kn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ji(t[3]))):(e=wn(t,{r:0,g:0,b:0,a:1})).a=Ji(e.a),e}function Sn(t){return"r"===t.charAt(0)?function(t){const e=vn.exec(t);let i,n,s,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?Xi(t):Yi(255*t,0,255)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?Xi(i):Yi(i,0,255)),n=255&(e[4]?Xi(n):Yi(n,0,255)),s=255&(e[6]?Xi(s):Yi(s,0,255)),{r:i,g:n,b:s,a:o}}}(t):fn(t)}class Mn{constructor(t){if(t instanceof Mn)return t;const e=typeof t;let i;var n,s,o;"object"===e?i=kn(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?s={r:255&17*Qi[n[1]],g:255&17*Qi[n[2]],b:255&17*Qi[n[3]],a:5===o?17*Qi[n[4]]:255}:7!==o&&9!==o||(s={r:Qi[n[1]]<<4|Qi[n[2]],g:Qi[n[3]]<<4|Qi[n[4]],b:Qi[n[5]]<<4|Qi[n[6]],a:9===o?Qi[n[7]]<<4|Qi[n[8]]:255})),i=s||bn(t)||Sn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wn(this._rgb);return t&&(t.a=Gi(t.a)),t}set rgb(t){this._rgb=kn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?sn(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=cn(t),i=e[0],n=Ki(e[1]),s=Ki(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${Gi(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let s;const o=e===s?.5:e,r=2*o-1,a=i.a-n.a,l=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-l,i.r=255&l*i.r+s*n.r+.5,i.g=255&l*i.g+s*n.g+.5,i.b=255&l*i.b+s*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=xn(Gi(t.r)),s=xn(Gi(t.g)),o=xn(Gi(t.b));return{r:Ji(yn(n+i*(xn(Gi(e.r))-n))),g:Ji(yn(s+i*(xn(Gi(e.g))-s))),b:Ji(yn(o+i*(xn(Gi(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Mn(this.rgb)}alpha(t){return this._rgb.a=Ji(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=qi(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _n(this._rgb,2,t),this}darken(t){return _n(this._rgb,2,-t),this}saturate(t){return _n(this._rgb,1,t),this}desaturate(t){return _n(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=cn(t);i[0]=un(i[0]+e),i=dn(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function On(){}const En=(()=>{let t=0;return()=>t++})();function An(t){return null==t}function Tn(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Cn(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function Pn(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Ln(t,e){return Pn(t)?t:e}function Dn(t,e){return void 0===t?e:t}const In=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Rn(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function jn(t,e,i,n){let s,o,r;if(Tn(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(Cn(t))for(r=Object.keys(t),o=r.length,s=0;s<o;s++)e.call(i,t[r[s]],r[s])}function Fn(t,e){let i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function zn(t){if(Tn(t))return t.map(zn);if(Cn(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let s=0;for(;s<n;++s)e[i[s]]=zn(t[i[s]]);return e}return t}function Bn(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Nn(t,e,i,n){if(!Bn(t))return;const s=e[t],o=i[t];Cn(s)&&Cn(o)?Wn(s,o,n):e[t]=zn(o)}function Wn(t,e,i){const n=Tn(e)?e:[e],s=n.length;if(!Cn(t))return t;const o=(i=i||{}).merger||Nn;let r;for(let e=0;e<s;++e){if(r=n[e],!Cn(r))continue;const s=Object.keys(r);for(let e=0,n=s.length;e<n;++e)o(s[e],t,r,i)}return t}function Vn(t,e){return Wn(t,e,{merger:Hn})}function Hn(t,e,i){if(!Bn(t))return;const n=e[t],s=i[t];Cn(n)&&Cn(s)?Vn(n,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=zn(s))}const $n={"":t=>t,x:t=>t.x,y:t=>t.y};function Un(t,e){const i=$n[e]||($n[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const t of e)n+=t,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function qn(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Yn=t=>void 0!==t,Xn=t=>"function"==typeof t,Jn=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const Gn=Math.PI,Kn=2*Gn,Qn=Kn+Gn,Zn=Number.POSITIVE_INFINITY,ts=Gn/180,es=Gn/2,is=Gn/4,ns=2*Gn/3,ss=Math.log10,os=Math.sign;function rs(t,e,i){return Math.abs(t-e)<i}function as(t){const e=Math.round(t);t=rs(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(ss(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function ls(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function cs(t,e,i){let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function hs(t){return t*(Gn/180)}function ds(t){return t*(180/Gn)}function us(t){if(!Pn(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function fs(t,e){const i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*Gn&&(o+=Kn),{angle:o,distance:s}}function ps(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gs(t,e){return(t-e+Qn)%Kn-Gn}function ms(t){return(t%Kn+Kn)%Kn}function bs(t,e,i,n){const s=ms(t),o=ms(e),r=ms(i),a=ms(o-s),l=ms(r-s),c=ms(s-o),h=ms(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function vs(t,e,i){return Math.max(e,Math.min(i,t))}function ys(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function xs(t,e,i){i=i||(i=>t[i]<e);let n,s=t.length-1,o=0;for(;s-o>1;)n=o+s>>1,i(n)?o=n:s=n;return{lo:o,hi:s}}const _s=(t,e,i,n)=>xs(t,i,n?n=>{const s=t[n][e];return s<i||s===i&&t[n+1][e]===i}:n=>t[n][e]<i),ws=(t,e,i)=>xs(t,i,n=>t[n][e]>=i);const ks=["push","pop","shift","splice","unshift"];function Ss(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ks.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ms(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Os="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Es(t,e){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Os.call(window,()=>{n=!1,t.apply(e,i)}))}}const As=t=>"start"===t?"left":"end"===t?"right":"center",Ts=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Cs(t,e,i){const n=e.length;let s=0,o=n;if(t._sorted){const{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(_s(l,h,d).lo,i?n:_s(e,h,r.getPixelForValue(d)).lo),c){const t=l.slice(0,s+1).reverse().findIndex(t=>!An(t[a.axis]));s-=Math.max(0,t)}s=vs(s,0,n-1)}if(p){let t=Math.max(_s(l,r.axis,u,!0).hi+1,i?0:_s(e,h,r.getPixelForValue(u),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!An(t[a.axis]));t+=Math.max(0,e)}o=vs(t,s,n)-s}else o=n-s}return{start:s,count:o}}function Ps(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}const Ls=t=>0===t||1===t,Ds=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Kn/i),Is=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Kn/i)+1,Rs={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*es),easeOutSine:t=>Math.sin(t*es),easeInOutSine:t=>-.5*(Math.cos(Gn*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ls(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ls(t)?t:Ds(t,.075,.3),easeOutElastic:t=>Ls(t)?t:Is(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ls(t)?t:t<.5?.5*Ds(2*t,e,.45):.5+.5*Is(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Rs.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Rs.easeInBounce(2*t):.5*Rs.easeOutBounce(2*t-1)+.5};function js(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Fs(t){return js(t)?t:new Mn(t)}function zs(t){return js(t)?t:new Mn(t).saturate(.5).darken(.1).hexString()}const Bs=["x","y","borderWidth","radius","tension"],Ns=["color","borderColor","backgroundColor"];const Ws=new Map;function Vs(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=Ws.get(i);return n||(n=new Intl.NumberFormat(t,e),Ws.set(i,n)),n}(e,i).format(t)}const Hs={values:t=>Tn(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const r=ss(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Vs(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(ss(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Hs.numeric.call(this,t,e,i):""}};var $s={formatters:Hs};const Us=Object.create(null),qs=Object.create(null);function Ys(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function Xs(t,e,i){return"string"==typeof e?Wn(Ys(t,e),i):Wn(Ys(t,""),e)}class Js{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>zs(e.backgroundColor),this.hoverBorderColor=(t,e)=>zs(e.borderColor),this.hoverColor=(t,e)=>zs(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xs(this,t,e)}get(t){return Ys(this,t)}describe(t,e){return Xs(qs,t,e)}override(t,e){return Xs(Us,t,e)}route(t,e,i,n){const s=Ys(this,t),o=Ys(this,i),r="_"+e;Object.defineProperties(s,{[r]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=o[n];return Cn(t)?Object.assign({},e,t):Dn(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}var Gs=new Js({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Ns},numbers:{type:"number",properties:Bs}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Ks(t,e,i,n,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n}function Qs(t,e,i,n){let s=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const a=i.length;let l,c,h,d,u;for(l=0;l<a;l++)if(d=i[l],null==d||Tn(d)){if(Tn(d))for(c=0,h=d.length;c<h;c++)u=d[c],null==u||Tn(u)||(r=Ks(t,s,o,r,u))}else r=Ks(t,s,o,r,d);t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Zs(t,e,i){const n=t.currentDevicePixelRatio,s=0!==i?Math.max(i/2,.5):0;return Math.round((e-s)*n)/n+s}function to(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function eo(t,e,i,n){io(t,e,i,n,null)}function io(t,e,i,n,s){let o,r,a,l,c,h,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*ts;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:s?t.ellipse(i,n,s/2,g,0,0,Kn):t.arc(i,n,g,0,Kn),t.closePath();break;case"triangle":h=s?s/2:g,t.moveTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=ns,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),m+=ns,t.lineTo(i+Math.sin(m)*h,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":c=.516*g,l=g-c,r=Math.cos(m+is)*l,d=Math.cos(m+is)*(s?s/2-c:l),a=Math.sin(m+is)*l,u=Math.sin(m+is)*(s?s/2-c:l),t.arc(i-d,n-a,c,m-Gn,m-es),t.arc(i+u,n-r,c,m-es,m),t.arc(i+d,n+a,c,m,m+es),t.arc(i-u,n+r,c,m+es,m+Gn),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,t.rect(i-h,n-l,2*h,2*l);break}m+=is;case"rectRot":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+u,n-r),t.lineTo(i+d,n+a),t.lineTo(i-u,n+r),t.closePath();break;case"crossRot":m+=is;case"cross":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"star":d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r),m+=is,d=Math.cos(m)*(s?s/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),t.moveTo(i-d,n-a),t.lineTo(i+d,n+a),t.moveTo(i+u,n-r),t.lineTo(i-u,n+r);break;case"line":r=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-r,n-a),t.lineTo(i+r,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function no(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function so(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function oo(t){t.restore()}function ro(t,e,i,n,s){if(!e)return t.lineTo(i.x,i.y);if("middle"===s){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===s!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function ao(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function lo(t,e,i,n,s){if(s.strikethrough||s.underline){const o=t.measureText(n),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,h),t.lineTo(a,h),t.stroke()}}function co(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function ho(t,e,i,n,s,o={}){const r=Tn(e)?e:[e],a=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),An(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&co(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),An(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,i,n,o.maxWidth)),t.fillText(c,i,n,o.maxWidth),lo(t,i,n,c,o),n+=Number(s.lineHeight);t.restore()}function uo(t,e){const{x:i,y:n,w:s,h:o,radius:r}=e;t.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*Gn,Gn,!0),t.lineTo(i,n+o-r.bottomLeft),t.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,Gn,es,!0),t.lineTo(i+s-r.bottomRight,n+o),t.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,es,0,!0),t.lineTo(i+s,n+r.topRight),t.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-es,!0),t.lineTo(i+r.topLeft,n)}const fo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,po=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function go(t,e){const i=(""+t).match(fo);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const mo=t=>+t||0;function bo(t,e){const i={},n=Cn(e),s=n?Object.keys(e):e,o=Cn(t)?n?i=>Dn(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=mo(o(t));return i}function vo(t){return bo(t,{top:"y",right:"x",bottom:"y",left:"x"})}function yo(t){return bo(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xo(t){const e=vo(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _o(t,e){t=t||{},e=e||Gs.font;let i=Dn(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=Dn(t.style,e.style);n&&!(""+n).match(po)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:Dn(t.family,e.family),lineHeight:go(Dn(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:Dn(t.weight,e.weight),string:""};return s.string=function(t){return!t||An(t.size)||An(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function wo(t,e,i,n){let s,o,r,a=!0;for(s=0,o=t.length;s<o;++s)if(r=t[s],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),a=!1),void 0!==i&&Tn(r)&&(r=r[i%r.length],a=!1),void 0!==r))return n&&!a&&(n.cacheable=!1),r}function ko(t,e){return Object.assign(Object.create(t),e)}function So(t,e=[""],i,n,s=()=>t[0]){const o=i||t;void 0===n&&(n=Ro("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:n,_getTarget:s,override:i=>So([i,...t],e,o,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>To(i,n,()=>function(t,e,i,n){let s;for(const o of e)if(s=Ro(Eo(o,t),i),void 0!==s)return Ao(t,s)?Do(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>jo(t).includes(e),ownKeys:t=>jo(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Mo(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Oo(t,n),setContext:e=>Mo(t,e,i,n),override:s=>Mo(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>To(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=t;let a=n[e];Xn(a)&&r.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,r||n);a.delete(t),Ao(t,l)&&(l=Do(s._scopes,s,t,l));return l}(e,a,t,i));Tn(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(void 0!==o.index&&n(t))return e[o.index%e.length];if(Cn(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Do(n,s,t,l);e.push(Mo(i,o,r&&r[t],a))}}return e}(e,a,t,r.isIndexable));Ao(e,a)&&(a=Mo(a,s,o&&o[e],r));return a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function Oo(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Xn(i)?i:()=>i,isIndexable:Xn(n)?n:()=>n}}const Eo=(t,e)=>t?t+qn(e):e,Ao=(t,e)=>Cn(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function To(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const n=i();return t[e]=n,n}function Co(t,e,i){return Xn(t)?t(e,i):t}const Po=(t,e)=>!0===t?e:"string"==typeof t?Un(e,t):void 0;function Lo(t,e,i,n,s){for(const o of e){const e=Po(i,o);if(e){t.add(e);const o=Co(e._fallback,i,s);if(void 0!==o&&o!==i&&o!==n)return o}else if(!1===e&&void 0!==n&&i!==n)return null}return!1}function Do(t,e,i,n){const s=e._rootScopes,o=Co(e._fallback,i,n),r=[...t,...s],a=new Set;a.add(n);let l=Io(a,r,i,o||i,n);return null!==l&&((void 0===o||o===i||(l=Io(a,r,o,l,n),null!==l))&&So(Array.from(a),[""],s,o,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];if(Tn(s)&&Cn(i))return i;return s||{}}(e,i,n)))}function Io(t,e,i,n,s){for(;i;)i=Lo(t,e,i,n,s);return i}function Ro(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function jo(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Fo(t,e,i,n){const{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],r[a]={r:s.parse(Un(h,o),c)};return r}const zo=Number.EPSILON||1e-14,Bo=(t,e)=>e<t.length&&!t[e].skip&&t[e],No=t=>"x"===t?"y":"x";function Wo(t,e,i,n){const s=t.skip?e:t,o=e,r=i.skip?e:i,a=ps(o,s),l=ps(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Vo(t,e="x"){const i=No(e),n=t.length,s=Array(n).fill(0),o=Array(n);let r,a,l,c=Bo(t,0);for(r=0;r<n;++r)if(a=l,l=c,c=Bo(t,r+1),l){if(c){const t=c[e]-l[e];s[r]=0!==t?(c[i]-l[i])/t:0}o[r]=a?c?os(s[r-1])!==os(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}!function(t,e,i){const n=t.length;let s,o,r,a,l,c=Bo(t,0);for(let h=0;h<n-1;++h)l=c,c=Bo(t,h+1),l&&c&&(rs(e[h],0,zo)?i[h]=i[h+1]=0:(s=i[h]/e[h],o=i[h+1]/e[h],a=Math.pow(s,2)+Math.pow(o,2),a<=9||(r=3/Math.sqrt(a),i[h]=s*r*e[h],i[h+1]=o*r*e[h])))}(t,s,o),function(t,e,i="x"){const n=No(i),s=t.length;let o,r,a,l=Bo(t,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Bo(t,c+1),!a)continue;const s=a[i],h=a[n];r&&(o=(s-r[i])/3,a[`cp1${i}`]=s-o,a[`cp1${n}`]=h-o*e[c]),l&&(o=(l[i]-s)/3,a[`cp2${i}`]=s+o,a[`cp2${n}`]=h+o*e[c])}}(t,o,e)}function Ho(t,e,i){return Math.max(Math.min(t,i),e)}function $o(t,e,i,n,s){let o,r,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)Vo(t,s);else{let i=n?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],l=Wo(i,a,t[Math.min(o+1,r-(n?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,s,o,r,a=no(t[0],e);for(i=0,n=t.length;i<n;++i)r=o,o=a,a=i<n-1&&no(t[i+1],e),o&&(s=t[i],r&&(s.cp1x=Ho(s.cp1x,e.left,e.right),s.cp1y=Ho(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=Ho(s.cp2x,e.left,e.right),s.cp2y=Ho(s.cp2y,e.top,e.bottom)))}(t,i)}function Uo(){return"undefined"!=typeof window&&"undefined"!=typeof document}function qo(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Yo(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const Xo=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const Jo=["top","right","bottom","left"];function Go(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const o=Jo[s];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Ko(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,s=Xo(i),o="border-box"===s.boxSizing,r=Go(s,"padding"),a=Go(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:s,offsetY:o}=n;let r,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))r=s,a=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:r,y:a,box:l}}(t,i),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=e;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Qo=t=>Math.round(10*t)/10;function Zo(t,e,i,n){const s=Xo(t),o=Go(s,"margin"),r=Yo(s.maxWidth,t,"clientWidth")||Zn,a=Yo(s.maxHeight,t,"clientHeight")||Zn,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const o=t&&qo(t);if(o){const t=o.getBoundingClientRect(),r=Xo(o),a=Go(r,"border","width"),l=Go(r,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Yo(r.maxWidth,o,"clientWidth"),s=Yo(r.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Zn,maxHeight:s||Zn}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Go(s,"border","width"),e=Go(s,"padding");c-=e.width+t.width,h-=e.height+t.height}c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Qo(Math.min(c,r,l.maxWidth)),h=Qo(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Qo(c/2));return(void 0!==e||void 0!==i)&&n&&l.height&&h>l.height&&(h=l.height,c=Qo(Math.floor(h*n))),{width:c,height:h}}function tr(t,e,i){const n=e||1,s=Qo(t.height*n),o=Qo(t.width*n);t.height=Qo(t.height),t.width=Qo(t.width);const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||r.height!==s||r.width!==o)&&(t.currentDevicePixelRatio=n,r.height=s,r.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const er=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Uo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ir(t,e){const i=function(t,e){return Xo(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function nr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function sr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function or(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},r=nr(t,s,i),a=nr(s,o,i),l=nr(o,e,i),c=nr(r,a,i),h=nr(a,l,i);return nr(c,h,i)}function rr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ar(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function lr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function cr(t){return"angle"===t?{between:bs,compare:gs,normalize:ms}:{between:ys,compare:(t,e)=>t-e,normalize:t=>t}}function hr({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function dr(t,e,i){if(!i)return[t];const{property:n,start:s,end:o}=i,r=e.length,{compare:a,between:l,normalize:c}=cr(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:o}=i,{between:r,normalize:a}=cr(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;c<h&&r(a(e[d%l][n]),s,o);++c)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,b,v=!1,y=null;const x=()=>v||l(s,b,g)&&0!==a(s,b),_=()=>!v||0===a(o,g)||l(o,b,g);for(let t=h,i=h;t<=d;++t)m=e[t%r],m.skip||(g=c(m[n]),g!==b&&(v=l(g,s,o),null===y&&x()&&(y=0===a(g,s)?t:i),null!==y&&_()&&(p.push(hr({start:y,end:t,loop:u,count:r,style:f})),y=null),i=t,b=g));return null!==y&&p.push(hr({start:y,end:d,loop:u,count:r,style:f})),p}function ur(t,e){const i=[],n=t.segments;for(let s=0;s<n.length;s++){const o=dr(n[s],t.points,e);o.length&&i.push(...o)}return i}function fr(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),o=pr(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=i.length,c=[];let h=o,d=e[0].start,u=d;function f(t,e,n,s){const o=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!==e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=pr(n.setContext(ko(s,{type:"segment",p0:o,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),gr(e,h)&&f(d,u-1,t.loop,h),o=a,h=e}d<u-1&&f(d,u-1,t.loop,h)}return c}(t,e,i,n):e}function pr(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function gr(t,e){if(!e)return!1;const i=[],n=function(t,e){return js(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}function mr(t,e,i){return t.options.clip?t[i]:e[i]}function br(t,e){const i=e._clip;if(i.disabled)return!1;const n=function(t,e){const{xScale:i,yScale:n}=t;return i&&n?{left:mr(i,e,"left"),right:mr(i,e,"right"),top:mr(n,e,"top"),bottom:mr(n,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:n.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:n.right+(!0===i.right?0:i.right),top:!1===i.top?0:n.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:n.bottom+(!0===i.bottom?0:i.bottom)}}class vr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const s=e.listeners[n],o=e.duration;s.forEach(n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let o,r=s.length-1,a=!1;for(;r>=0;--r)o=s[r],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),a=!0):(s[r]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yr=new vr;const xr="transparent",_r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Fs(t||xr),s=n.valid&&Fs(e||xr);return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class wr{constructor(t,e,i,n){const s=e[i];n=wo([t.to,n,s,t.from]);const o=wo([t.from,s,n]);this._active=!0,this._fn=t.fn||_r[t.type||typeof o],this._easing=Rs[t.easing]||Rs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=wo([t.to,e,n,t.from]),this._from=wo([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||e<i),!this._active)return this._target[n]=r,void this._notify(!0);e<0?this._target[n]=s:(a=e/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,r,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class kr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Cn(t))return;const e=Object.keys(Gs.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const s=t[n];if(!Cn(s))return;const o={};for(const t of e)o[t]=s[t];(Tn(s.properties)&&s.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,o)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const s=t[n[e]];s&&s.active()&&i.push(s.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),o=Object.keys(e),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(s[l]=h=new wr(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(yr.add(this._chart,i),!0):void 0}}function Sr(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Mr(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function Or(t,e,i,n={}){const s=t.keys,o="single"===n.mode;let r,a,l,c;if(null===e)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(h=!0,n.all)continue;break}c=t.values[l],Pn(c)&&(o||0===e||os(e)===os(c))&&(e+=c)}return h||n.all?e:0}function Er(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Ar(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Tr(t,e,i,n){for(const s of e.getMatchingVisibleMetas(n).reverse()){const e=t[s.index];if(i&&e>0||!i&&e<0)return s.index}return null}function Cr(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,r,n),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[c]:d}=i;u=(i._stacks||(i._stacks={}))[c]=Ar(s,h,o),u[a]=d,u._top=Tr(u,r,!0,n.type),u._bottom=Tr(u,r,!1,n.type);(u._visualValues||(u._visualValues={}))[a]=d}}function Pr(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Lr(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Dr=t=>"reset"===t||"none"===t,Ir=(t,e)=>e?t:Object.assign({},t);class Rr{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Er(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&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=Dn(i.xAxisID,Pr(t,"x")),o=e.yAxisID=Dn(i.yAxisID,Pr(t,"y")),r=e.rAxisID=Dn(i.rAxisID,Pr(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,o,r),c=e.vAxisID=n(a,o,s,r);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ss(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Cn(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:n}=e,s="x"===i.axis?"x":"y",o="x"===n.axis?"x":"y",r=Object.keys(t),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:t[h]};return a}(e,t)}else if(i!==e){if(i){Ss(i,this);const t=this._cachedMeta;Lr(t),t._parsed=[]}e&&Object.isExtensible(e)&&(s=this,(n=e)._chartjs?n._chartjs.listeners.push(s):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[s]}}),ks.forEach(t=>{const e="_onData"+qn(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n,s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=Er(e.vScale,e),e.stack!==i.stack&&(n=!0,Lr(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&(Cr(this,e._parsed),e._stacked=Er(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=Tn(n[t])?this.parseArrayData(i,n,t,e):Cn(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[r]||d&&l[r]<d[r];for(a=0;a<e;++a)i._parsed[a+t]=l=c[a],h&&(s()&&(h=!1),d=l);i._sorted=h}o&&Cr(this,c)}parsePrimitiveData(t,e,i,n){const{iScale:s,vScale:o}=t,r=s.axis,a=o.axis,l=s.getLabels(),c=s===o,h=new Array(n);let d,u,f;for(d=0,u=n;d<u;++d)f=d+i,h[d]={[r]:c||s.parse(l[f],f),[a]:o.parse(e[f],f)};return h}parseArrayData(t,e,i,n){const{xScale:s,yScale:o}=t,r=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=e[c],r[a]={x:s.parse(h[0],c),y:o.parse(h[1],c)};return r}parseObjectData(t,e,i,n){const{xScale:s,yScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let c,h,d,u;for(c=0,h=n;c<h;++c)d=c+i,u=e[d],l[c]={x:s.parse(Un(u,r),d),y:o.parse(Un(u,a),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,s=this._cachedMeta,o=e[t.axis];return Or({keys:Mr(n,!0),values:e._stacks[t.axis]._visualValues},o,s.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const s=i[e.axis];let o=null===s?NaN:s;const r=n&&i._stacks[e.axis];n&&r&&(n.values=r,o=Or(n,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,s=i._sorted&&t===i.iScale,o=n.length,r=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Mr(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!Pn(u[t.axis])||c>e||h<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,t,u,a),!s));++d);if(s)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,o;for(n=0,s=e.length;n<s;++n)o=e[n][t.axis],Pn(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:n?""+n.getLabelForValue(s[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,s;return Cn(t)?(e=t.top,i=t.right,n=t.bottom,s=t.left):e=i=n=s=t,{top:e,right:i,bottom:n,left:s,disabled:!1===t}}(Dn(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=Sr(t,i),s=Sr(e,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],s=e.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||n.length-r,l=this.options.drawActiveElementsOnTop;let c;for(i.dataset&&i.dataset.draw(t,s,r,a),c=r;c<r+a;++c){const e=n[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,s))}for(c=0;c<o.length;++c)o[c].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];s=e.$context||(e.$context=function(t,e,i){return ko(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),s.parsed=this.getParsed(t),s.raw=n.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=function(t,e){return ko(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),s.dataset=n,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,s=this._cachedDataOpts,o=t+"-"+e,r=s[o],a=this.enableOptionSharing&&Yn(i);if(r)return Ir(r,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),u=Object.keys(Gs.elements[t]),f=l.resolveNamedOptions(d,u,()=>this.getContext(i,n,e),h);return f.$shared&&(f.$shared=a,s[o]=Object.freeze(Ir(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,o=`animation-${e}`,r=s[o];if(r)return r;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(o,this.getContext(t,i,e))}const l=new kr(n,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Dr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(e,s)||s!==n;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:o}}updateElement(t,e,i,n){Dr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Dr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,o=Math.min(s,n);o&&this.parse(0,o),s>n?this._insertElements(n,s-n,t):s<n&&this._removeElements(s,n-s)}_insertElements(t,e,i=!0){const n=this._cachedMeta,s=n.data,o=t+e;let r;const a=t=>{for(t.length+=e,r=t.length-1;r>=o;r--)t[r]=t[r-e]};for(a(s),r=t;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&Lr(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function jr(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,s=i.length;e<s;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Ms(n.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let n,s,o,r,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(Yn(r)&&(a=Math.min(a,Math.abs(o-r)||a)),r=o)};for(n=0,s=i.length;n<s;++n)o=e.getPixelForValue(i[n]),l();for(r=void 0,n=0,s=e.ticks.length;n<s;++n)o=e.getPixelForTick(n),l();return a}function Fr(t,e,i,n){return Tn(t)?function(t,e,i,n){const s=i.parse(t[0],n),o=i.parse(t[1],n),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function zr(t,e,i,n){const s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=i,h=i+n;c<h;++c)u=e[c],d={},d[s.axis]=a||s.parse(r[c],c),l.push(Fr(u,d,o,c));return l}function Br(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Nr(t,e,i,n){let s=e.borderSkipped;const o={};if(!s)return void(t.borderSkipped=o);if(!0===s)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:r,end:a,reverse:l,top:c,bottom:h}=function(t){let e,i,n,s,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:e,top:s,bottom:o}}(t);"middle"===s&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=h:(o[Wr(h,r,a,l)]=!0,s=c)),o[Wr(s,r,a,l)]=!0,t.borderSkipped=o}function Wr(t,e,i,n){var s,o,r;return n?(r=i,t=Vr(t=(s=t)===(o=e)?r:s===r?o:s,i,e)):t=Vr(t,e,i),t}function Vr(t,e,i){return"start"===t?e:"end"===t?i:t}function Hr(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class $r extends Rr{static id="doughnut";static 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"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:n,color:s,useBorderRadius:o,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(a),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:n,pointStyle:i,borderRadius:o&&(r||l.borderRadius),index:a}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,o,r=t=>+i[t];if(Cn(i[t])){const{key:t="value"}=this._parsing;r=e=>+Un(i[e],t)}for(s=t,o=t+e;s<o;++s)n._parsed[s]=r(s)}}_getRotation(){return hs(this.options.rotation-90)}_getCircumference(){return hs(this.options.circumference)}_getRotationExtents(){let t=Kn,e=-Kn;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,s=n._getRotation(),o=n._getCircumference();t=Math.min(t,s),e=Math.max(e,s+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,s=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min((l=this.options.cutout,c=r,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let n=1,s=1,o=0,r=0;if(e<Kn){const a=t,l=a+e,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),u=Math.sin(l),f=(t,e,n)=>bs(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>bs(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(es,h,u),b=p(Gn,c,d),v=p(Gn+es,h,u);n=(g-b)/2,s=(m-v)/2,o=-(g+b)/2,r=-(m+v)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}(u,d,a),b=(i.width-o)/f,v=(i.height-o)/p,y=Math.max(Math.min(b,v)/2,0),x=In(this.options.radius,y),_=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,n.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/Kn)}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.chartArea,a=o.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,s);for(g=e;g<e+i;++g){const e=this._circumference(g,s),i=t[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=f||this.resolveDataElementOptions(g,i.active?"active":n)),m+=e,this.updateElement(i,g,o,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(s))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Kn*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,o,r,a;if(!t)for(n=0,s=i.data.datasets.length;n<s;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,r=o.controller;break}if(!t)return 0;for(n=0,s=t.length;n<s;++n)a=r.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Dn(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Ur extends Rr{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map((e,s)=>{const o=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:n,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=Vs(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),o=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const s="reset"===n,o=this.chart,r=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,h=a.getIndexAngle(0)-.5*Gn;let d,u=h;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,n,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,p=u+this._computeAngle(d,n,f),g=o.getDataVisibility(d)?a.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=p,s&&(r.animateScale&&(g=0),r.animateRotate&&(i=p=h));const m={x:l,y:c,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":n)};this.updateElement(e,d,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?hs(this.resolveDataElementOptions(t,e).angle||i):0}}var qr=Object.freeze({__proto__:null,BarController:class extends Rr{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,n){return zr(t,e,i,n)}parseArrayData(t,e,i,n){return zr(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:s,vScale:o}=t,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,l="x"===s.axis?r:a,c="x"===o.axis?r:a,h=[];let d,u,f,p;for(d=i,u=i+n;d<u;++d)p=e[d],f={},f[s.axis]=s.parse(Un(p,l),d),h.push(Fr(Un(p,c),f,o,d));return h}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,s=this.getParsed(t),o=s._custom,r=Br(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(s[n.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const s="reset"===n,{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=s||An(e[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,c),p=(e._stacks||{})[r.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||Br(e._custom)||o===p._top||o===p._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};d&&(g.options=h||this.resolveDataElementOptions(u,t[u].active?"active":n));const m=g.options||t[u].options;Nr(g,m,p,o),Hr(g,m,c.ratio),this.updateElement(t[u],u,g,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),s=i.options.stacked,o=[],r=this._cachedMeta.controller.getParsed(e),a=r&&r[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===a),n=e&&e[t.vScale.axis];if(An(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!l(i))&&((!1===s||-1===o.indexOf(i.stack)||void 0===s&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Dn("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const n=this._getStacks(t,i),s=void 0!==e?n.indexOf(e):-1;return-1===s?n.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let s,o;for(s=0,o=e.data.length;s<o;++s)n.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const r=t.barThickness;return{min:r||jr(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:s,minBarLength:o}}=this,r=s||0,a=this.getParsed(t),l=a._custom,c=Br(l);let h,d,u=a[e.axis],f=0,p=i?this.applyStack(e,a,i):u;p!==u&&(f=p-u,p=u),c&&(u=l.barStart,p=l.barEnd-l.barStart,0!==u&&os(u)!==os(l.barEnd)&&(f=0),f+=u);const g=An(s)||c?f:s;let m=e.getPixelForValue(g);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(f+p):m,d=h-m,Math.abs(d)<o){d=function(t,e,i){return 0!==t?os(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,r)*o,u===r&&(m-=d/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),l=Math.min(t,s),f=Math.max(t,s);m=Math.max(Math.min(m,f),l),h=m+d,i&&!c&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(h)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const t=os(d)*e.getLineWidthForValue(r)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,o=Dn(n.maxBarThickness,1/0);let r,a;const l=this._getAxisCount();if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,c="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,o=s[t];let r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const l=i.categoryPercentage;null===r&&(r=o-(null===a?e.end-e.start:a-o)),null===a&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}(t,e,n,i*l):function(t,e,i,n){const s=i.barThickness;let o,r;return An(s)?(o=e.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:e.pixels[t]-o/2}}(t,e,n,i*l),h="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(Dn(h,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+d;r=c.start+c.chunk*u+c.chunk/2,a=Math.min(o,c.chunk*c.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(o,e.min*e.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let s=0;for(;s<n;++s)null===this.getParsed(s)[e.axis]||i[s].hidden||i[s].draw(this._ctx)}},BubbleController:class extends Rr{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const s=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<s.length;t++)s[t]._custom=this.resolveDataElementOptions(t+i).radius;return s}parseArrayData(t,e,i,n){const s=super.parseArrayData(t,e,i,n);for(let t=0;t<s.length;t++){const n=e[i+t];s[t]._custom=Dn(n[2],this.resolveDataElementOptions(t+i).radius)}return s}parseObjectData(t,e,i,n){const s=super.parseObjectData(t,e,i,n);for(let t=0;t<s.length;t++){const n=e[i+t];s[t]._custom=Dn(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),c=o.axis,h=r.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!s&&this.getParsed(d),u={},f=u[c]=s?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),p=u[h]=s?r.getBasePixel():r.getPixelForValue(i[h]);u.skip=isNaN(f)||isNaN(p),l&&(u.options=a||this.resolveDataElementOptions(d,e.active?"active":n),s&&(u.options.radius=0)),this.updateElement(e,d,u,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const s=n.radius;return"active"!==e&&(n.radius=0),n.radius+=Dn(i&&i._custom,s),n}},DoughnutController:$r,LineController:class extends Rr{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,o=this.chart._animationsDisabled;let{start:r,count:a}=Cs(e,n,o);this._drawStart=r,this._drawCount=a,Ps(e)&&(r=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(n,r,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),d=o.axis,u=r.axis,{spanGaps:f,segment:p}=this.options,g=ls(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||s||"none"===n,b=e+i,v=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<v;++i){const f=t[i],v=m?f:{};if(i<e||i>=b){v.skip=!0;continue}const x=this.getParsed(i),_=An(x[u]),w=v[d]=o.getPixelForValue(x[d],i),k=v[u]=s||_?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,x,a):x[u],i);v.skip=isNaN(w)||isNaN(k)||_,v.stop=i>0&&Math.abs(x[d]-y[d])>g,p&&(v.parsed=x,v.raw=l.data[i]),h&&(v.options=c||this.resolveDataElementOptions(i,f.active?"active":n)),m||this.updateElement(f,i,v,n),y=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends $r{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Ur,RadarController:class extends Rr{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Fo.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this._cachedMeta.rScale,o="reset"===n;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":n),a=s.getPointPositionForValue(r,this.getParsed(r).r),l=o?s.xCenter:a.x,c=o?s.yCenter:a.y,h={x:l,y:c,angle:a.angle,skip:isNaN(l)||isNaN(c),options:i};this.updateElement(e,r,h,n)}}},ScatterController:class extends Rr{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),a=s.getLabelForValue(o.y);return{label:i[t]||"",value:"("+r+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:s,count:o}=Cs(e,i,n);if(this._drawStart=s,this._drawCount=o,Ps(e)&&(s=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:s,_dataset:o}=e;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(s,void 0,{animated:!n,options:r},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const s="reset"===n,{iScale:o,vScale:r,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=o.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=ls(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||s||"none"===n;let v=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),p=b?e:{},y=An(i[f]),x=p[u]=o.getPixelForValue(i[u],c),_=p[f]=s||y?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,i,a):i[f],c);p.skip=isNaN(x)||isNaN(_)||y,p.stop=c>0&&Math.abs(i[u]-v[u])>m,g&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),v=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,s,o)/2}}});function Yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Yr()}parse(){return Yr()}format(){return Yr()}add(){return Yr()}diff(){return Yr()}startOf(){return Yr()}endOf(){return Yr()}}var Jr=Xr;function Gr(t,e,i,n){const{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&"r"!==e&&r&&o.length){const r=a._reversePixels?ws:_s;if(!n){const n=r(o,e,i);if(l){const{vScale:e}=s._cachedMeta,{_parsed:i}=t,o=i.slice(0,n.lo+1).reverse().findIndex(t=>!An(t[e.axis]));n.lo-=Math.max(0,o);const r=i.slice(n.hi).findIndex(t=>!An(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(s._sharedOptions){const t=o[0],n="function"==typeof t.getRange&&t.getRange(e);if(n){const t=r(o,e,i-n),s=r(o,e,i+n);return{lo:t.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,i,n,s){const o=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:a}=o[t],{lo:l,hi:c}=Gr(o[t],e,r,s);for(let t=l;t<=c;++t){const e=a[t];e.skip||n(e,i,t)}}}function Qr(t,e,i,n,s){const o=[];if(!s&&!t.isPointInArea(e))return o;return Kr(t,i,e,function(i,r,a){(s||no(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&o.push({element:i,datasetIndex:r,index:a})},!0),o}function Zr(t,e,i,n,s,o){let r=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return Kr(t,i,e,function(i,c,h){const d=i.inRange(e.x,e.y,s);if(n&&!d)return;const u=i.getCenterPoint(s);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=a(e,u);f<l?(r=[{element:i,datasetIndex:c,index:h}],l=f):f===l&&r.push({element:i,datasetIndex:c,index:h})}),r}function ta(t,e,i,n,s,o){return o||t.isPointInArea(e)?"r"!==i||n?Zr(t,e,i,n,s,o):function(t,e,i,n){let s=[];return Kr(t,i,e,function(t,i,o){const{startAngle:r,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=fs(t,{x:e.x,y:e.y});bs(l,r,a)&&s.push({element:t,datasetIndex:i,index:o})}),s}(t,e,i,s):[]}function ea(t,e,i,n,s){const o=[],r="x"===i?"inXRange":"inYRange";let a=!1;return Kr(t,i,e,(t,n,l)=>{t[r]&&t[r](e[i],s)&&(o.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,s))}),n&&!a?[]:o}var ia={evaluateInteractionItems:Kr,modes:{index(t,e,i,n){const s=Ko(e,t),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;let a=i.intersect?Qr(t,s,o,n,r):ta(t,s,o,!1,n,r);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>Qr(t,Ko(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const s=Ko(e,t),o=i.axis||"xy",r=i.includeInvisible||!1;return ta(t,s,o,i.intersect,n,r)},x:(t,e,i,n)=>ea(t,Ko(e,t),"x",i.intersect,n),y:(t,e,i,n)=>ea(t,Ko(e,t),"y",i.intersect,n)}};const na=["left","top","right","bottom"];function sa(t,e){return t.filter(t=>t.pos===e)}function oa(t,e){return t.filter(t=>-1===na.indexOf(t.pos)&&t.box.axis===e)}function ra(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function aa(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!na.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];const{fullSize:r}=a.box,l=i[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*n:r&&e.availableWidth,a.height=s):(a.width=n,a.height=c?c*s:r&&e.availableHeight)}return i}function la(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function ca(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function ha(t,e,i,n){const{pos:s,box:o}=i,r=t.maxPadding;if(!Cn(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[s]+=i.size}o.getPadding&&ca(r,o.getPadding());const a=Math.max(0,e.outerWidth-la(r,t,"left","right")),l=Math.max(0,e.outerHeight-la(r,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function da(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}return n(t?["left","right"]:["top","bottom"])}function ua(t,e,i,n){const s=[];let o,r,a,l,c,h;for(o=0,r=t.length,c=0;o<r;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,da(a.horizontal,e));const{same:r,other:d}=ha(e,i,a,n);c|=r&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&ua(s,e,i,n)||h}function fa(t,e,i,n,s){t.top=i,t.left=e,t.right=e+n,t.bottom=i+s,t.width=n,t.height=s}function pa(t,e,i,n){const s=i.padding;let{x:o,y:r}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*c,o=l.size||t.height;Yn(l.start)&&(r=l.start),t.fullSize?fa(t,s.left,r,i.outerWidth-s.right-s.left,o):fa(t,e.left+l.placed,r,n,o),l.start=r,l.placed+=n,r=t.bottom}else{const n=e.h*c,r=l.size||t.width;Yn(l.start)&&(o=l.start),t.fullSize?fa(t,o,s.top,r,i.outerHeight-s.bottom-s.top):fa(t,o,e.top+l.placed,r,n),l.start=o,l.placed+=n,o=t.right}}e.x=o,e.y=r}var ga={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const s=xo(t.options.layout.padding),o=Math.max(e-s.width,0),r=Math.max(i-s.height,0),a=function(t){const e=function(t){const e=[];let i,n,s,o,r,a;for(i=0,n=(t||[]).length;i<n;++i)s=t[i],({position:o,options:{stack:r,stackWeight:a=1}}=s),e.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return e}(t),i=ra(e.filter(t=>t.box.fullSize),!0),n=ra(sa(e,"left"),!0),s=ra(sa(e,"right")),o=ra(sa(e,"top"),!0),r=ra(sa(e,"bottom")),a=oa(e,"x"),l=oa(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:sa(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;jn(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);ca(u,xo(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),p=aa(l.concat(c),d);ua(a.fullSize,f,d,p),ua(l,f,d,p),ua(c,f,d,p)&&ua(l,f,d,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),pa(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,pa(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},jn(a.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class ba extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const va="$chartjs",ya={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=t=>null===t||""===t;const _a=!!er&&{passive:!0};function wa(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_a)}function ka(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Sa(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.addedNodes,n),e=e&&!ka(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ma(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||ka(i.removedNodes,n),e=e&&!ka(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Oa=new Map;let Ea=0;function Aa(){const t=window.devicePixelRatio;t!==Ea&&(Ea=t,Oa.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Ta(t,e,i){const n=t.canvas,s=n&&qo(n);if(!s)return;const o=Es((t,e)=>{const n=s.clientWidth;i(t,e),n<s.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||o(i,n)});return r.observe(s),function(t,e){Oa.size||window.addEventListener("resize",Aa),Oa.set(t,e)}(t,o),r}function Ca(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Oa.delete(t),Oa.size||window.removeEventListener("resize",Aa)}(t)}function Pa(t,e,i){const n=t.canvas,s=Es(e=>{null!==t.ctx&&i(function(t,e){const i=ya[t.type]||t.type,{x:n,y:s}=Ko(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_a)}(n,e,s),s}class La extends ma{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[va]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){const e=ir(t,"width");void 0!==e&&(t.width=e)}if(xa(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ir(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[va])return!1;const i=e[va].initial;["height","width"].forEach(t=>{const n=i[t];An(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[va],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:Sa,detach:Ma,resize:Ta}[e]||Pa;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:Ca,detach:Ca,resize:Ca}[e]||wa)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Zo(t,e,i,n)}isAttached(t){const e=t&&qo(t);return!(!e||!e.isConnected)}}class Da{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ls(this.x)&&ls(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}function Ia(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),s=t._maxLength/i;return Math.floor(Math.min(n,s))}(t),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return function(t,e,i,n){let s,o=0,r=i[0];for(n=Math.ceil(n),s=0;s<t.length;s++)s===r&&(e.push(t[s]),o++,r=i[o*n])}(e,c,o,r/s),c;const h=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),s=e.length/i;if(!n)return Math.max(s,1);const o=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n===0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}(n);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>s)return e}return Math.max(s,1)}(o,e,s);if(r>0){let t,i;const n=r>1?Math.round((l-a)/(r-1)):null;for(Ra(e,c,h,An(n)?0:a-n,a),t=0,i=r-1;t<i;t++)Ra(e,c,h,o[t],o[t+1]);return Ra(e,c,h,l,An(n)?e.length:l+n),c}return Ra(e,c,h),c}function Ra(t,e,i,n,s){const o=Dn(n,0),r=Math.min(Dn(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=o;c<0;)h++,c=Math.round(o+h*i);for(l=Math.max(o,0);l<r;l++)l===c&&(e.push(t[l]),h++,c=Math.round(o+h*i))}const ja=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Fa=(t,e)=>Math.min(e||t,t);function za(t,e){const i=[],n=t.length/e,s=t.length;let o=0;for(;o<s;o+=n)i.push(t[Math.floor(o)]);return i}function Ba(t,e,i){const n=t.ticks.length,s=Math.min(e,n-1),o=t._startPixel,r=t._endPixel,a=1e-6;let l,c=t.getPixelForTick(s);if(!(i&&(l=1===n?Math.max(c-o,r-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(s-1))/2,c+=s<e?l:-l,c<o-a||c>r+a)))return c}function Na(t){return t.drawTicks?t.tickLength:0}function Wa(t,e){if(!t.display)return 0;const i=_o(t.font,e),n=xo(t.padding);return(Tn(t.text)?t.text.length:1)*i.lineHeight+n.height}function Va(t,e,i){let n=As(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ha extends Da{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=Ln(t,Number.POSITIVE_INFINITY),e=Ln(e,Number.NEGATIVE_INFINITY),i=Ln(i,Number.POSITIVE_INFINITY),n=Ln(n,Number.NEGATIVE_INFINITY),{min:Ln(t,i),max:Ln(e,n),minDefined:Pn(t),maxDefined:Pn(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds();if(s&&o)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),s||(i=Math.min(i,e.min)),o||(n=Math.max(n,e.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:Ln(i,Ln(n,i)),max:Ln(n,Ln(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Rn(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,o=In(e,(s-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(o)),max:r(s,o)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?za(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Ia(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Rn(this.options.afterUpdate,[this])}beforeSetDimensions(){Rn(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(){Rn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Rn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Rn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,s;for(i=0,n=t.length;i<n;i++)s=t[i],s.label=Rn(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Rn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Rn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Fa(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,s=e.maxRotation;let o,r,a,l=n;if(!this._isVisible()||!e.display||n>=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=vs(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),h+6>o&&(o=u/(i-(t.offset?.5:1)),r=this.maxHeight-Na(t.grid)-e.padding-Wa(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=ds(Math.min(Math.asin(vs((c.highest.height+6)/o,-1,1)),Math.asin(vs(r/a,-1,1))-Math.asin(vs(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){Rn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const o=Wa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Na(s)+o):(t.height=this.maxHeight,t.width=Na(s)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:o}=this._getLabelSizes(),a=2*i.padding,l=hs(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*s.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:o},position:r}=this.options,a=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:"inner"!==s&&(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+o)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+o)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_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(){Rn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)An(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=za(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:s}=this,o=[],r=[],a=Math.floor(e/Fa(e,i));let l,c,h,d,u,f,p,g,m,b,v,y=0,x=0;for(l=0;l<e;l+=a){if(d=t[l].label,u=this._resolveTickFontOptions(l),n.font=f=u.string,p=s[f]=s[f]||{data:{},gc:[]},g=u.lineHeight,m=b=0,An(d)||Tn(d)){if(Tn(d))for(c=0,h=d.length;c<h;++c)v=d[c],An(v)||Tn(v)||(m=Ks(n,p.data,p.gc,m,v),b+=g)}else m=Ks(n,p.data,p.gc,m,d),b=g;o.push(m),r.push(b),y=Math.max(m,y),x=Math.max(b,x)}!function(t,e){jn(t,t=>{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s<n;++s)delete t.data[i[s]];i.splice(0,n)}})}(s,e);const _=o.indexOf(y),w=r.indexOf(x),k=t=>({width:o[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(w),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return vs(this._alignToPixels?Zs(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return ko(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=ko(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=hs(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,r=s?s.widest.width+o:0,a=s?s.highest.height+o:0;return this.isHorizontal()?a*i>r*n?r/i:a/n:a*n<r*i?a/i:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:o,border:r}=n,a=s.offset,l=this.isHorizontal(),c=this.ticks.length+(a?1:0),h=Na(s),d=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return Zs(i,t,f)};let m,b,v,y,x,_,w,k,S,M,O,E;if("top"===o)m=g(this.bottom),_=this.bottom-h,k=m-p,M=g(t.top)+p,E=t.bottom;else if("bottom"===o)m=g(this.top),M=t.top,E=g(t.bottom)-p,_=m+p,k=this.top+h;else if("left"===o)m=g(this.right),x=this.right-h,w=m-p,S=g(t.left)+p,O=t.right;else if("right"===o)m=g(this.left),S=t.left,O=g(t.right)-p,x=m+p,w=this.left+h;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}M=t.top,E=t.bottom,_=m+p,k=_+h}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(Cn(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-p,w=x-h,S=t.left,O=t.right}const A=Dn(n.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(b=0;b<c;b+=T){const t=this.getContext(b),e=s.setContext(t),n=r.setContext(t),o=e.lineWidth,c=e.color,h=n.dash||[],u=n.dashOffset,f=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;v=Ba(this,b,a),void 0!==v&&(y=Zs(i,v,o),l?x=w=S=O=y:_=k=M=E=y,d.push({tx1:x,ty1:_,tx2:w,ty2:k,x1:S,y1:M,x2:O,y2:E,width:o,color:c,borderDash:h,borderDashOffset:u,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:s}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:l,padding:c,mirror:h}=s,d=Na(i.grid),u=d+c,f=h?-c:u,p=-hs(this.labelRotation),g=[];let m,b,v,y,x,_,w,k,S,M,O,E,A="middle";if("top"===n)_=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===n)_=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,x=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,x=t.x}else if("x"===e){if("center"===n)_=(t.top+t.bottom)/2+u;else if(Cn(n)){const t=Object.keys(n)[0],e=n[t];_=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)x=(t.left+t.right)/2-u;else if(Cn(n)){const t=Object.keys(n)[0],e=n[t];x=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===a?A="top":"end"===a&&(A="bottom"));const T=this._getLabelSizes();for(m=0,b=r.length;m<b;++m){v=r[m],y=v.label;const t=s.setContext(this.getContext(m));k=this.getPixelForTick(m)+s.labelOffset,S=this._resolveTickFontOptions(m),M=S.lineHeight,O=Tn(y)?y.length:1;const e=O/2,i=t.color,a=t.textStrokeColor,c=t.textStrokeWidth;let d,u=w;if(o?(x=k,"inner"===w&&(u=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),E="top"===n?"near"===l||0!==p?-O*M+M/2:"center"===l?-T.highest.height/2-e*M+M:-T.highest.height+M/2:"near"===l||0!==p?M/2:"center"===l?T.highest.height/2-e*M:T.highest.height-O*M,h&&(E*=-1),0===p||t.showLabelBackdrop||(x+=M/2*Math.sin(p))):(_=k,E=(1-O)*M/2),t.showLabelBackdrop){const e=xo(t.backdropPadding),i=T.heights[m],n=T.widths[m];let s=E-e.top,o=0-e.left;switch(A){case"middle":s-=i/2;break;case"bottom":s-=i}switch(w){case"center":o-=n/2;break;case"right":o-=n;break;case"inner":m===b-1?o-=n:m>0&&(o-=n/2)}d={left:o,top:s,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:y,font:S,textOffset:E,options:{rotation:p,color:i,strokeColor:a,strokeWidth:c,textAlign:u,textBaseline:A,translation:[x,_],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-hs(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:s}}=this.options,o=t+s,r=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+s,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l+=r)):(l=this.right-o,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+s,"near"===i?a="right":"center"===i?(a="center",l-=r/2):(a="left",l-=r)):(l=this.left+o,"near"===i?a="left":"center"===i?(a="center",l+=r/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:s,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,s,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,o=n.length;s<o;++s){const t=n[s];e.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,s=i.setContext(this.getContext()),o=i.display?s.width:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=Zs(t,this.left,o)-o/2,c=Zs(t,this.right,r)+r/2,h=d=a):(h=Zs(t,this.top,o)-o/2,d=Zs(t,this.bottom,r)+r/2,l=c=a),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(l,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&so(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font;ho(e,t.label,0,t.textOffset,n,i)}i&&oo(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const s=_o(i.font),o=xo(i.padding),r=i.align;let a=s.lineHeight/2;"bottom"===e||"center"===e||Cn(e)?(a+=o.bottom,Tn(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=function(t,e,i,n){const{top:s,left:o,bottom:r,right:a,chart:l}=t,{chartArea:c,scales:h}=l;let d,u,f,p=0;const g=r-s,m=a-o;if(t.isHorizontal()){if(u=Ts(n,o,a),Cn(i)){const t=Object.keys(i)[0],n=i[t];f=h[t].getPixelForValue(n)+g-e}else f="center"===i?(c.bottom+c.top)/2+g-e:ja(t,i,e);d=a-o}else{if(Cn(i)){const t=Object.keys(i)[0],n=i[t];u=h[t].getPixelForValue(n)-m+e}else u="center"===i?(c.left+c.right)/2-m+e:ja(t,i,e);f=Ts(n,r,s),p="left"===i?-es:es}return{titleX:u,titleY:f,maxWidth:d,rotation:p}}(this,a,e,r);ho(t,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:d,textAlign:Va(r,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Dn(t.grid&&t.grid.z,-1),n=Dn(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Ha.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,o;for(s=0,o=e.length;s<o;++s){const o=e[s];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){return _o(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class $a{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in n||(n[s]=t,function(t,e,i){const n=Wn(Object.create(null),[i?Gs.get(i):{},Gs.get(e),t.defaults]);Gs.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),s=n.pop(),o=[t].concat(n).join("."),r=e[i].split("."),a=r.pop(),l=r.join(".");Gs.route(o,s,l,a)})}(e,t.defaultRoutes);t.descriptors&&Gs.describe(e,t.descriptors)}(t,o,i),this.override&&Gs.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Gs[n]&&(delete Gs[n][i],this.override&&delete Us[i])}}class Ua{constructor(){this.controllers=new $a(Rr,"datasets",!0),this.elements=new $a(Da,"elements"),this.plugins=new $a(Object,"plugins"),this.scales=new $a(Ha,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):jn(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=qn(t);Rn(i["before"+n],[],i),e[t](i),Rn(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var qa=new Ua;class Ya{constructor(){this._init=void 0}notify(t,e,i,n){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const s=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,e,i,n){n=n||{};for(const s of t){const t=s.plugin;if(!1===Rn(t[i],[e,n,s.options],t)&&n.cancelable)return!1}return!0}invalidate(){An(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=Dn(i.options&&i.options.plugins,{}),s=function(t){const e={},i=[],n=Object.keys(qa.plugins.items);for(let t=0;t<n.length;t++)i.push(qa.getPlugin(n[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const n=s[t];-1===i.indexOf(n)&&(i.push(n),e[n.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,s){const o=[],r=t.getContext();for(const a of e){const e=a.id,l=Xa(n[e],s);null!==l&&o.push({plugin:a,options:Ja(t.config,{plugin:a,local:i[e]},l,r)})}return o}(t,s,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Xa(t,e){return e||!1!==t?!0===t?{}:t:null}function Ja(t,{plugin:e,local:i},n,s){const o=t.pluginScopeKeys(e),r=t.getOptionScopes(n,o);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ga(t,e){const i=Gs.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ka(t){if("x"===t||"y"===t||"r"===t)return t}function Qa(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Za(t,...e){if(Ka(t))return t;for(const i of e){const e=i.axis||Qa(i.position)||t.length>1&&Ka(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function tl(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function el(t,e){const i=Us[t.type]||{scales:{}},n=e.scales||{},s=Ga(t.type,e),o=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!Cn(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const a=Za(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return tl(t,"x",i[0])||tl(t,"y",i[0])}return{}}(e,t),Gs.scales[r.type]),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};o[e]=Vn(Object.create(null),[{axis:a},r,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,r=i.indexAxis||Ga(s,e),a=(Us[s]||{}).scales||{};Object.keys(a).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),s=i[e+"AxisID"]||e;o[s]=o[s]||Object.create(null),Vn(o[s],[{axis:e},n[s],a[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];Vn(e,[Gs.scales[e.type],Gs.scale])}),o}function il(t){const e=t.options||(t.options={});e.plugins=Dn(e.plugins,{}),e.scales=el(t,e)}function nl(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const sl=new Map,ol=new Set;function rl(t,e){let i=sl.get(t);return i||(i=e(),sl.set(t,i),ol.add(i)),i}const al=(t,e,i)=>{const n=Un(e,i);void 0!==n&&t.add(n)};class ll{constructor(t){this._config=function(t){return(t=t||{}).data=nl(t.data),il(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=nl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),il(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return rl(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return rl(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return rl(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,o=this._cachedScopes(t,i),r=o.get(e);if(r)return r;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>al(a,t,e))),e.forEach(t=>al(a,n,t)),e.forEach(t=>al(a,Us[s]||{},t)),e.forEach(t=>al(a,Gs,t)),e.forEach(t=>al(a,qs,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),ol.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Us[e]||{},Gs.datasets[e]||{},{type:e},Gs,qs]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=cl(this._resolverCache,t,n);let a=o;if(function(t,e){const{isScriptable:i,isIndexable:n}=Oo(t);for(const s of e){const e=i(s),o=n(s),r=(o||e)&&t[s];if(e&&(Xn(r)||hl(r))||o&&Tn(r))return!0}return!1}(o,e)){s.$shared=!1;a=Mo(o,i=Xn(i)?i():i,this.createResolver(t,i,r))}for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=cl(this._resolverCache,t,i);return Cn(e)?Mo(s,e,void 0,n):s}}function cl(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let o=n.get(s);if(!o){o={resolver:So(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,o)}return o}const hl=t=>Cn(t)&&Object.getOwnPropertyNames(t).some(e=>Xn(t[e]));const dl=["top","bottom","left","right","chartArea"];function ul(t,e){return"top"===t||"bottom"===t||-1===dl.indexOf(t)&&"x"===e}function fl(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function pl(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Rn(i&&i.onComplete,[t],e)}function gl(t){const e=t.chart,i=e.options.animation;Rn(i&&i.onProgress,[t],e)}function ml(t){return Uo()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const bl={},vl=t=>{const e=ml(t);return Object.values(bl).filter(t=>t.canvas===e).pop()};function yl(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const o=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=o)}}}class xl{static defaults=Gs;static instances=bl;static overrides=Us;static registry=qa;static version="4.5.1";static getChart=vl;static register(...t){qa.add(...t),_l()}static unregister(...t){qa.remove(...t),_l()}constructor(t,e){const i=this.config=new ll(e),n=ml(t),s=vl(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Uo()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ba:La}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,o.aspectRatio),a=r&&r.canvas,l=a&&a.height,c=a&&a.width;this.id=En(),this.ctx=r,this.canvas=a,this.width=c,this.height=l,this._options=o,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 Ya,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],bl[this.id]=this,r&&a?(yr.listen(this,"complete",pl),yr.listen(this,"progress",gl),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return An(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qa}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return to(this.canvas,this.ctx),this}stop(){return yr.stop(this),this}resize(t,e){yr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tr(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rn(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){jn(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Za(t,i),s="r"===n,o="x"===n;return{options:i,dposition:s?"chartArea":o?"bottom":"left",dtype:s?"radialLinear":o?"category":"linear"}}))),jn(s,e=>{const s=e.options,o=s.id,r=Za(o,s),a=Dn(s.type,e.dtype);void 0!==s.position&&ul(s.position,r)===ul(e.dposition)||(s.position=e.dposition),n[o]=!0;let l=null;if(o in i&&i[o].type===a)l=i[o];else{l=new(qa.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(s,t)}),jn(n,(t,e)=>{t||delete i[e]}),jn(i,t=>{ga.configure(this,t,t.options),ga.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(fl("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let s=this.getDatasetMeta(i);const o=n.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=n.indexAxis||Ga(o,this.options),s.order=n.order||0,s.index=i,s.label=""+n.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const e=qa.getController(o),{datasetElementType:n,dataElementType:r}=Gs.datasets[o];Object.assign(e,{dataElementType:qa.getElement(r),datasetElementType:n&&qa.getElement(n)}),s.controller=new e(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){jn(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===s.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),n||jn(s,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(fl("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){jn(this.scales,t=>{ga.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Jn(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e){yl(t,n,"_removeElements"===i?-s:s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;t<e;t++)if(!Jn(n,i(t)))return;return Array.from(n).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ga.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],jn(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Xn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(yr.has(this)?this.attached&&!yr.running(this)&&yr.start(this):(this.draw(),pl({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,s;for(n=0,s=e.length;n<s;++n){const s=e[n];t&&!s.visible||i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=br(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&so(e,n),t.controller.draw(),n&&oo(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return no(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const s=ia.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=ko(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,n);Yn(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yr.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),to(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete bl[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};jn(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():o()}unbindEvents(){jn(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},jn(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,o,r,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),r=0,a=t.length;r<a;++r){o=t[r];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!Fn(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=s(e,t),r=i?t:s(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,o=e,r=this._getActiveElements(t,n,i,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,Rn(s.onHover,[t,r,this],this),a&&Rn(s.onClick,[t,r,this],this));const c=!Fn(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}function _l(){return jn(xl.instances,t=>t._plugins.invalidate())}function wl(t,e,i,n){const s=bo(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,r=Math.min(o,n*e/2),a=t=>{const e=(i-Math.min(o,t))*n/2;return vs(t,0,Math.min(o,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:vs(s.innerStart,0,r),innerEnd:vs(s.innerEnd,0,r)}}function kl(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Sl(t,e,i,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+n+i-c,0),u=h>0?h+n+i+c:0;let f=0;const p=s-l;if(n){const t=((h>0?h-n:0)+(d>0?d-n:0))/2;f=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*d-i/Gn)/d)/2,m=l+g+f,b=s-g-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:_}=wl(e,u,d,b-m),w=d-v,k=d-y,S=m+v/w,M=b-y/k,O=u+x,E=u+_,A=m+x/O,T=b-_/E;if(t.beginPath(),o){const e=(S+M)/2;if(t.arc(r,a,d,S,e),t.arc(r,a,d,e,M),y>0){const e=kl(k,M,r,a);t.arc(e.x,e.y,y,M,b+es)}const i=kl(E,b,r,a);if(t.lineTo(i.x,i.y),_>0){const e=kl(E,T,r,a);t.arc(e.x,e.y,_,b+es,T+Math.PI)}const n=(b-_/u+(m+x/u))/2;if(t.arc(r,a,u,b-_/u,n,!0),t.arc(r,a,u,n,m+x/u,!0),x>0){const e=kl(O,A,r,a);t.arc(e.x,e.y,x,A+Math.PI,m-es)}const s=kl(w,m,r,a);if(t.lineTo(s.x,s.y),v>0){const e=kl(w,S,r,a);t.arc(e.x,e.y,v,m-es,S)}}else{t.moveTo(r,a);const e=Math.cos(S)*d+r,i=Math.sin(S)*d+a;t.lineTo(e,i);const n=Math.cos(M)*d+r,s=Math.sin(M)*d+a;t.lineTo(n,s)}t.closePath()}function Ml(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p="inner"===l.borderAlign;if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=u,p?(t.lineWidth=2*c,t.lineJoin=h||"round"):(t.lineWidth=c,t.lineJoin=h||"bevel");let g=e.endAngle;if(o){Sl(t,e,i,n,g,s);for(let e=0;e<o;++e)t.stroke();isNaN(a)||(g=r+(a%Kn||Kn))}p&&function(t,e,i){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(o,r,a,n-c,i+c),l>s?(c=s/l,t.arc(o,r,l,i+c,n-c,!0)):t.arc(o,r,s,i+es,n-es),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-r>=Gn&&0===f&&"miter"!==h&&function(t,e,i){const{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,ms(n-i));if(t.beginPath(),t.arc(s,o,r-c/2,n+d/2,i-d/2),a>0){const e=Math.min(c/a,ms(n-i));t.arc(s,o,a+c/2,i-e/2,n+e/2,!0)}else{const e=Math.min(c/2,r*ms(n-i));if("round"===h)t.arc(s,o,e,i-Gn/2,n+Gn/2,!0);else if("bevel"===h){const r=2*e*e,a=-r*Math.cos(i+Gn/2)+s,l=-r*Math.sin(i+Gn/2)+o,c=r*Math.cos(n+Gn/2)+s,h=r*Math.sin(n+Gn/2)+o;t.lineTo(a,l),t.lineTo(c,h)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Sl(t,e,i,n,g,s),t.stroke())}function Ol(t,e,i=e){t.lineCap=Dn(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Dn(i.borderDash,e.borderDash)),t.lineDashOffset=Dn(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Dn(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Dn(i.borderWidth,e.borderWidth),t.strokeStyle=Dn(i.borderColor,e.borderColor)}function El(t,e,i){t.lineTo(i.x,i.y)}function Al(t,e,i={}){const n=t.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=e,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:e.loop,ilen:c<l&&!h?n+c-l:c-l}}function Tl(t,e,i,n){const{points:s,options:o}=e,{count:r,start:a,loop:l,ilen:c}=Al(s,i,n),h=function(t){return t.stepped?ro:t.tension||"monotone"===t.cubicInterpolationMode?ao:El}(o);let d,u,f,{move:p=!0,reverse:g}=n||{};for(d=0;d<=c;++d)u=s[(a+(g?c-d:d))%r],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):h(t,f,u,g,o.stepped),f=u);return l&&(u=s[(a+(g?c:0))%r],h(t,f,u,g,o.stepped)),!!l}function Cl(t,e,i,n){const s=e.points,{count:o,start:r,ilen:a}=Al(s,i,n),{move:l=!0,reverse:c}=n||{};let h,d,u,f,p,g,m=0,b=0;const v=t=>(r+(c?a-t:t))%o,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=s[v(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[v(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(i<f?f=i:i>p&&(p=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}y()}function Pl(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Cl:Tl}const Ll="function"==typeof Path2D;function Dl(t,e,i,n){Ll&&!e.options.segment?function(t,e,i,n){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,n)&&s.closePath()),Ol(t,e.options),t.stroke(s)}(t,e,i,n):function(t,e,i,n){const{segments:s,options:o}=e,r=Pl(e);for(const a of s)Ol(t,o,a.style),t.beginPath(),r(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class Il extends Da{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;$o(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const o=!!t._loop,{start:r,end:a}=function(t,e,i,n){let s=0,o=e-1;if(i&&!n)for(;s<e&&!t[s].skip;)s++;for(;s<e&&t[s].skip;)s++;for(s%=e,i&&(o+=s);o>s&&t[o%e].skip;)o--;return o%=e,{start:s,end:o}}(i,s,o,n);return fr(t,!0===n?[{start:r,end:a,loop:o}]:function(t,e,i,n){const s=t.length,o=[];let r,a=e,l=t[e];for(r=e+1;r<=i;++r){const i=t[r%s];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%s,end:(r-1)%s,loop:n}),e=a=i.stop?r:null):(a=r,l.skip&&(e=r)),l=i}return null!==a&&o.push({start:e%s,end:a%s,loop:n}),o}(i,r,a<r?a+s:a,!!t._fullLoop&&0===r&&a===s-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],s=this.points,o=ur(this,{property:e,start:n,end:n});if(!o.length)return;const r=[],a=function(t){return t.stepped?sr:t.tension||"monotone"===t.cubicInterpolationMode?or:nr}(i);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:h}=o[l],d=s[c],u=s[h];if(d===u){r.push(d);continue}const f=a(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Pl(this)(t,this,e,i)}path(t,e,i){const n=this.segments,s=Pl(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const r of n)o&=s(t,this,r,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),Dl(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Rl(t,e,i,n){const s=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<s.radius+s.hitRadius}function jl(t,e){const{x:i,y:n,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],e);let a,l,c,h,d;return t.horizontal?(d=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-d,h=n+d):(d=o/2,a=i-d,l=i+d,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Fl(t,e,i,n){return t?0:vs(e,i,n)}function zl(t){const e=jl(t),i=e.right-e.left,n=e.bottom-e.top,s=function(t,e,i){const n=t.options.borderWidth,s=t.borderSkipped,o=vo(n);return{t:Fl(s.top,o.top,0,i),r:Fl(s.right,o.right,0,e),b:Fl(s.bottom,o.bottom,0,i),l:Fl(s.left,o.left,0,e)}}(t,i/2,n/2),o=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=yo(s),r=Math.min(e,i),a=t.borderSkipped,l=n||Cn(s);return{topLeft:Fl(!l||a.top||a.left,o.topLeft,0,r),topRight:Fl(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Fl(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Fl(!l||a.bottom||a.right,o.bottomRight,0,r)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Bl(t,e,i,n){const s=null===e,o=null===i,r=t&&!(s&&o)&&jl(t,n);return r&&(s||ys(e,r.left,r.right))&&(o||ys(i,r.top,r.bottom))}function Nl(t,e){t.rect(e.x,e.y,e.w,e.h)}function Wl(t,e,i={}){const n=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,r=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+n,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}var Vl=Object.freeze({__proto__:null,ArcElement:class extends Da{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};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,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:o}=fs(n,{x:t,y:e}),{startAngle:r,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=Dn(h,a-r),f=bs(s,r,a)&&r!==a,p=u>=Kn||f,g=ys(o,l+d,c+d);return p&&g}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(o+r+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,s=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Kn?Math.floor(i/Kn):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*n,Math.sin(r)*n);const a=n*(1-Math.sin(Math.min(Gn,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,s){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){Sl(t,e,i,n,l,s);for(let e=0;e<o;++e)t.fill();isNaN(a)||(l=r+(a%Kn||Kn))}Sl(t,e,i,n,l,s),t.fill()}(t,this,a,s,o),Ml(t,this,a,s,o),t.restore()}},BarElement:class extends Da{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:s,outer:o}=zl(this),r=(a=o.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?uo:Nl;var a;t.save(),o.w===s.w&&o.h===s.h||(t.beginPath(),r(t,Wl(o,e,s)),t.clip(),r(t,Wl(s,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Wl(s,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Bl(this,t,e,i)}inXRange(t,e){return Bl(this,t,null,e)}inYRange(t,e){return Bl(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+n)/2:e,y:s?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:Il,PointElement:class extends Da{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return Rl(this,t,"x",e)}inYRange(t,e){return Rl(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!no(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,eo(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const Hl=["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)"],$l=Hl.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ul(t){return Hl[t%Hl.length]}function ql(t){return $l[t%$l.length]}function Yl(t){let e=0;return(i,n)=>{const s=t.getDatasetMeta(n).controller;s instanceof $r?e=function(t,e){return t.backgroundColor=t.data.map(()=>Ul(e++)),e}(i,e):s instanceof Ur?e=function(t,e){return t.backgroundColor=t.data.map(()=>ql(e++)),e}(i,e):s&&(e=function(t,e){return t.borderColor=Ul(e),t.backgroundColor=ql(e),++e}(i,e))}}function Xl(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Jl={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:n},options:s}=t.config,{elements:o}=s,r=Xl(n)||(a=s)&&(a.borderColor||a.backgroundColor)||o&&Xl(o)||"rgba(0,0,0,0.1)"!==Gs.borderColor||"rgba(0,0,0,0.1)"!==Gs.backgroundColor;var a;if(!i.forceOverride&&r)return;const l=Yl(t);n.forEach(l)}};function Gl(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Kl(t){t.data.datasets.forEach(t=>{Gl(t)})}var Ql={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Kl(t);const n=t.width;t.data.datasets.forEach((e,s)=>{const{_data:o,indexAxis:r}=e,a=t.getDatasetMeta(s),l=o||e.data;if("y"===wo([r,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const c=t.scales[a.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const i=e.length;let n,s=0;const{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=vs(_s(e,o.axis,r).lo,0,i-1)),n=c?vs(_s(e,o.axis,a).hi+1,s,i)-s:i-s,{start:s,count:n}}(a,l);if(d<=(i.threshold||4*n))return void Gl(e);let u;switch(An(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,s){const o=s.samples||n;if(o>=i)return t.slice(e,e+i);const r=[],a=(i-2)/(o-2);let l=0;const c=e+i-1;let h,d,u,f,p,g=e;for(r[l++]=t[g],h=0;h<o-2;h++){let n,s=0,o=0;const c=Math.floor((h+1)*a)+1+e,m=Math.min(Math.floor((h+2)*a)+1,i)+e,b=m-c;for(n=c;n<m;n++)s+=t[n].x,o+=t[n].y;s/=b,o/=b;const v=Math.floor(h*a)+1+e,y=Math.min(Math.floor((h+1)*a)+1,i)+e,{x,y:_}=t[g];for(u=f=-1,n=v;n<y;n++)f=.5*Math.abs((x-s)*(t[n].y-_)-(x-t[n].x)*(o-_)),f>u&&(u=f,d=t[n],p=n);r[l++]=d,g=p}return r[l++]=t[c],r}(l,h,d,n,i);break;case"min-max":u=function(t,e,i,n){let s,o,r,a,l,c,h,d,u,f,p=0,g=0;const m=[],b=e+i-1,v=t[e].x,y=t[b].x-v;for(s=e;s<e+i;++s){o=t[s],r=(o.x-v)/y*n,a=o.y;const e=0|r;if(e===l)a<u?(u=a,c=s):a>f&&(f=a,h=s),p=(g*p+o.x)/++g;else{const i=s-1;if(!An(c)&&!An(h)){const e=Math.min(c,h),n=Math.max(c,h);e!==d&&e!==i&&m.push({...t[e],x:p}),n!==d&&n!==i&&m.push({...t[n],x:p})}s>0&&i!==d&&m.push(t[i]),m.push(o),l=e,g=0,u=f=a,c=h=d=s}}return m}(l,h,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u})},destroy(t){Kl(t)}};function Zl(t,e,i,n){if(n)return;let s=e[t],o=i[t];return"angle"===t&&(s=ms(s),o=ms(o)),{property:t,start:s,end:o}}function tc(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ec(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function ic(t,e){let i=[],n=!1;return Tn(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},s=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=tc(t,e,s);const r=s[t],a=s[e];null!==n?(o.push({x:r.x,y:n}),o.push({x:a.x,y:n})):null!==i&&(o.push({x:i,y:r.y}),o.push({x:i,y:a.y}))}),o}(t,e),i.length?new Il({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function nc(t){return t&&!1!==t.fill}function sc(t,e,i){let n=t[e].fill;const s=[e];let o;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!Pn(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function oc(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=Dn(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Cn(n))return!isNaN(n.value)&&n;let s=parseFloat(n);return Pn(s)&&Math.floor(s)===s?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function rc(t,e,i){const n=[];for(let s=0;s<i.length;s++){const o=i[s],{first:r,last:a,point:l}=ac(o,e,"x");if(!(!l||r&&a))if(r)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function ac(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const s=n[i],o=t.segments,r=t.points;let a=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],n=r[e.start][i],c=r[e.end][i];if(ys(s,n,c)){a=s===n,l=s===c;break}}return{first:a,last:l,point:n}}class lc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:o}=this;return e=e||{start:0,end:Kn},t.arc(n,s,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function cc(t){const{chart:e,fill:i,line:n}=t;if(Pn(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,s=[],o=n.segments,r=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){const s=n[t];if(s.index===e)break;s.hidden||i.unshift(s.dataset)}return i}(e,i);a.push(ic({x:null,y:e.bottom},n));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)rc(s,r[t],a)}return new Il({points:s,options:{}})}(t);if("shape"===i)return!0;const s=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,n=e.options,s=e.getLabels().length,o=n.reverse?e.max:e.min,r=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:Cn(t)?t.value:e.getBaseValue(),n}(i,e,o),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,o);return new lc({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<s;++t)a.push(e.getPointPositionForValue(t,r));return a}(t);return function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:Cn(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(Pn(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return s instanceof lc?s:ic(s,n)}function hc(t,e,i){const n=cc(e),{chart:s,index:o,line:r,scale:a,axis:l}=e,c=r.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=s.getDatasetMeta(o),g=br(s,p);n&&r.points.length&&(so(t,i),function(t,e){const{line:i,target:n,above:s,below:o,area:r,scale:a,clip:l}=e,c=i._loop?"angle":e.axis;t.save();let h=o;o!==s&&("x"===c?(dc(t,n,r.top),fc(t,{line:i,target:n,color:s,scale:a,property:c,clip:l}),t.restore(),t.save(),dc(t,n,r.bottom)):"y"===c&&(uc(t,n,r.left),fc(t,{line:i,target:n,color:o,scale:a,property:c,clip:l}),t.restore(),t.save(),uc(t,n,r.right),h=s));fc(t,{line:i,target:n,color:h,scale:a,property:c,clip:l}),t.restore()}(t,{line:r,target:n,above:u,below:f,area:i,scale:a,axis:l,clip:g}),oo(t))}function dc(t,e,i){const{segments:n,points:s}=e;let o=!0,r=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[tc(n,l,s)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function uc(t,e,i){const{segments:n,points:s}=e;let o=!0,r=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[tc(n,l,s)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(i,c.y),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(i,h.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function fc(t,e){const{line:i,target:n,property:s,color:o,scale:r,clip:a}=e,l=function(t,e,i){const n=t.segments,s=t.points,o=e.points,r=[];for(const t of n){let{start:n,end:a}=t;a=tc(n,a,s);const l=Zl(i,s[n],s[a],t.loop);if(!e.segments){r.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=ur(e,l);for(const e of c){const n=Zl(i,o[e.start],o[e.end],e.loop),a=dr(t,s,n);for(const t of a)r.push({source:t,target:e,start:{[i]:ec(l,n,"start",Math.max)},end:{[i]:ec(l,n,"end",Math.min)}})}}return r}(i,n,s);for(const{source:e,target:c,start:h,end:d}of l){const{style:{backgroundColor:l=o}={}}=e,u=!0!==n;t.save(),t.fillStyle=l,pc(t,r,a,u&&Zl(s,h,d)),t.beginPath();const f=!!i.pathSegment(t,e);let p;if(u){f?t.closePath():gc(t,n,d,s);const e=!!n.pathSegment(t,c,{move:f,reverse:!0});p=f&&e,p||gc(t,n,h,s)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function pc(t,e,i,n){const s=e.chart.chartArea,{property:o,start:r,end:a}=n||{};if("x"===o||"y"===o){let e,n,l,c;"x"===o?(e=r,n=s.top,l=a,c=s.bottom):(e=s.left,n=r,l=s.right,c=a),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),n=Math.max(n,i.top),c=Math.min(c,i.bottom)),t.rect(e,n,l-e,c-n),t.clip()}}function gc(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}var mc={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<n;++r)o=t.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Il&&(l={visible:t.isDatasetVisible(r),index:r,fill:oc(a,r,n),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],l&&!1!==l.fill&&(l.fill=sc(s,r,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&i.fill&&hc(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;nc(i)&&hc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;nc(n)&&"beforeDatasetDraw"===i.drawTime&&hc(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bc=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class vc extends Da{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Rn(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=_o(i.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:a}=bc(i,s);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,s,r,a)+10):(c=this.maxHeight,l=this._fitCols(o,n,r,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:s,maxWidth:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;s.textAlign="left",s.textBaseline="middle";let d=-1,u=-c;return this.legendItems.forEach((t,f)=>{const p=i+e/2+s.measureText(t.text).width;(0===f||l[l.length-1]+p+2*r>o)&&(h+=c,l[l.length-(f>0?0:1)]=0,u+=c,d++),a[f]={left:0,top:u,row:d,width:p,height:n},l[l.length-1]+=p+r}),h}_fitCols(t,e,i,n){const{ctx:s,maxHeight:o,options:{labels:{padding:r}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let h=r,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,s){const o=function(t,e,i,n){let s=t.text;s&&"string"!=typeof s&&(s=s.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+n.measureText(s).width}(n,t,e,i),r=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=yc(e,i));return n}(s,n,e.lineHeight);return{itemWidth:o,itemHeight:r}}(i,e,s,t,n);o>0&&u+m+2*r>c&&(h+=d+r,l.push({width:d,height:u}),f+=d+r,p++,d=u=0),a[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+r}),h+=d,l.push({width:d,height:u}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:s}}=this,o=rr(s,this.left,this.width);if(this.isHorizontal()){let s=0,r=Ts(i,this.left+n,this.right-this.lineWidths[s]);for(const a of e)s!==a.row&&(s=a.row,r=Ts(i,this.left+n,this.right-this.lineWidths[s])),a.top+=this.top+t+n,a.left=o.leftForLtr(o.x(r),a.width),r+=a.width+n}else{let s=0,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height);for(const a of e)a.col!==s&&(s=a.col,r=Ts(i,this.top+t+n,this.bottom-this.columnSizes[s].height)),a.top=r,a.left+=this.left+n,a.left=o.leftForLtr(o.x(a.left),a.width),r+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;so(t,this),this._draw(),oo(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:s,labels:o}=t,r=Gs.color,a=rr(t.rtl,this.left,this.width),l=_o(o.font),{padding:c}=o,h=l.size,d=h/2;let u;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=bc(o,h),m=this.isHorizontal(),b=this._computeTitleHeight();u=m?{x:Ts(s,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:Ts(s,this.top+b+c,this.bottom-e[0].height),line:0},ar(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((y,x)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const _=n.measureText(y.text).width,w=a.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=f+d+_;let S=u.x,M=u.y;a.setWidth(this.width),m?x>0&&S+k+c>this.right&&(M=u.y+=v,u.line++,S=u.x=Ts(s,this.left+c,this.right-i[u.line])):x>0&&M+v>this.bottom&&(S=u.x=S+e[u.line].width+c,u.line++,M=u.y=Ts(s,this.top+b+c,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;n.save();const s=Dn(i.lineWidth,1);if(n.fillStyle=Dn(i.fillStyle,r),n.lineCap=Dn(i.lineCap,"butt"),n.lineDashOffset=Dn(i.lineDashOffset,0),n.lineJoin=Dn(i.lineJoin,"miter"),n.lineWidth=s,n.strokeStyle=Dn(i.strokeStyle,r),n.setLineDash(Dn(i.lineDash,[])),o.usePointStyle){const r={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l=a.xPlus(t,f/2);io(n,r,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((h-p)/2,0),r=a.leftForLtr(t,f),l=yo(i.borderRadius);n.beginPath(),Object.values(l).some(t=>0!==t)?uo(n,{x:r,y:o,w:f,h:p,radius:l}):n.rect(r,o,f,p),n.fill(),0!==s&&n.stroke()}n.restore()}(a.x(S),M,y),S=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,S+f+d,m?S+k:this.right,t.rtl),function(t,e,i){ho(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(S),M,y),m)u.x+=k+c;else if("string"!=typeof y.text){const t=l.lineHeight;u.y+=yc(y,t)+c}else u.y+=v}),lr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_o(e.font),n=xo(e.padding);if(!e.display)return;const s=rr(t.rtl,this.left,this.width),o=this.ctx,r=e.position,a=i.size/2,l=n.top+a;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=Ts(t.align,h,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Ts(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=Ts(r,h,h+d);o.textAlign=s.textAlign(As(r)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ho(o,e.text,u,c,i)}_computeTitleHeight(){const t=this.options.title,e=_o(t.font),i=xo(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,s;if(ys(t,this.left,this.right)&&ys(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(n=s[i],ys(t,n.left,n.left+n.width)&&ys(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,r=(s=i,null!==(n=o)&&null!==s&&n.datasetIndex===s.datasetIndex&&n.index===s.index);o&&!r&&Rn(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!r&&Rn(e.onHover,[t,i,this],this)}else i&&Rn(e.onClick,[t,i,this],this);var n,s}}function yc(t,e){return e*(t.text?t.text.length:0)}var xc={id:"legend",_element:vc,start(t,e,i){const n=t.legend=new vc({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n)},stop(t){ga.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;ga.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),e.hidden=!0):(s.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),c=xo(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _c extends Da{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=Tn(i.text)?i.text.length:1;this._padding=xo(i.padding);const s=n*_o(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:s,options:o}=this,r=o.align;let a,l,c,h=0;return this.isHorizontal()?(l=Ts(r,i,s),c=e+t,a=s-i):("left"===o.position?(l=i+t,c=Ts(r,n,e),h=-.5*Gn):(l=s-t,c=Ts(r,e,n),h=.5*Gn),a=n-e),{titleX:l,titleY:c,maxWidth:a,rotation:h}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_o(e.font),n=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:r,rotation:a}=this._drawArgs(n);ho(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:a,textAlign:As(e.align),textBaseline:"middle",translation:[s,o]})}}var wc={id:"title",_element:_c,start(t,e,i){!function(t,e){const i=new _c({ctx:t.ctx,options:e,chart:t});ga.configure(t,i,e),ga.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ga.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const kc=new WeakMap;var Sc={id:"subtitle",start(t,e,i){const n=new _c({ctx:t.ctx,options:i,chart:t});ga.configure(t,n,i),ga.addBox(t,n),kc.set(t,n)},stop(t){ga.removeBox(t,kc.get(t)),kc.delete(t)},beforeUpdate(t,e,i){const n=kc.get(t);ga.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mc={average(t){if(!t.length)return!1;let e,i,n=new Set,s=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n.add(t.x),s+=t.y,++o}}if(0===o||0===n.size)return!1;return{x:[...n].reduce((t,e)=>t+e)/n.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let i,n,s,o=e.x,r=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=ps(e,n.getCenterPoint());t<a&&(a=t,s=n)}}if(s){const t=s.tooltipPosition();o=t.x,r=t.y}return{x:o,y:r}}};function Oc(t,e){return e&&(Tn(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ec(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ac(t,e){const{element:i,datasetIndex:n,index:s}=e,o=t.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function Tc(t,e){const i=t.chart.ctx,{body:n,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=e,l=_o(e.bodyFont),c=_o(e.titleFont),h=_o(e.footerFont),d=o.length,u=s.length,f=n.length,p=xo(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){g+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let v=0;const y=function(t){m=Math.max(m,i.measureText(t).width+v)};return i.save(),i.font=c.string,jn(t.title,y),i.font=l.string,jn(t.beforeBody.concat(t.afterBody),y),v=e.displayColors?r+2+e.boxPadding:0,jn(n,t=>{jn(t.before,y),jn(t.lines,y),jn(t.after,y)}),v=0,i.font=h.string,jn(t.footer,y),i.restore(),m+=p.width,{width:m,height:g}}function Cc(t,e,i,n){const{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),function(t,e,i,n){const{x:s,width:o}=n,r=i.caretSize+i.caretPadding;return"left"===t&&s+o+r>e.width||"right"===t&&s-o-r<0||void 0}(c,t,e,i)&&(c="center"),c}function Pc(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Cc(t,e,i,n),yAlign:n}}function Lc(t,e,i,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(h,u)+s:"right"===a&&(p+=Math.max(d,f)+s),{x:vs(p,0,n.width-e.width),y:vs(g,0,n.height-e.height)}}function Dc(t,e,i){const n=xo(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Ic(t){return Oc([],Ec(t))}function Rc(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const jc={beforeTitle:On,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:On,beforeBody:On,beforeLabel:On,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return An(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:On,afterBody:On,beforeFooter:On,footer:On,afterFooter:On};function Fc(t,e,i,n){const s=t[e].call(i,n);return void 0===s?jc[e].call(i,n):s}class zc extends Da{static positioners=Mc;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new kr(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,ko(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=Fc(i,"beforeTitle",this,t),s=Fc(i,"title",this,t),o=Fc(i,"afterTitle",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}getBeforeBody(t,e){return Ic(Fc(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return jn(t,t=>{const e={before:[],lines:[],after:[]},s=Rc(i,t);Oc(e.before,Ec(Fc(s,"beforeLabel",this,t))),Oc(e.lines,Fc(s,"label",this,t)),Oc(e.after,Ec(Fc(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Ic(Fc(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Fc(i,"beforeFooter",this,t),s=Fc(i,"footer",this,t),o=Fc(i,"afterFooter",this,t);let r=[];return r=Oc(r,Ec(n)),r=Oc(r,Ec(s)),r=Oc(r,Ec(o)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],o=[];let r,a,l=[];for(r=0,a=e.length;r<a;++r)l.push(Ac(this.chart,e[r]));return t.filter&&(l=l.filter((e,n,s)=>t.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),jn(l,e=>{const i=Rc(t.callbacks,e);n.push(Fc(i,"labelColor",this,e)),s.push(Fc(i,"labelPointStyle",this,e)),o.push(Fc(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,o=[];if(n.length){const t=Mc[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Tc(this,i),r=Object.assign({},t,e),a=Pc(this.chart,i,r),l=Lc(i,r,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=yo(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,v,y,x;return"center"===s?(y=u+p/2,"left"===n?(g=d,m=g-o,v=y+o,x=y-o):(g=d+f,m=g+o,v=y-o,x=y+o),b=g):(m="left"===n?d+Math.max(a,c)+o:"right"===n?d+f-Math.max(l,h)-o:this.caretX,"top"===s?(v=u,y=v-o,g=m-o,b=m+o):(v=u+p,y=v+o,g=m+o,b=m-o),x=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:x}}drawTitle(t,e,i){const n=this.title,s=n.length;let o,r,a;if(s){const l=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=_o(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,a=0;a<s;++a)e.fillText(n[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r,a+1===s&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,s){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:l}=s,c=_o(s.bodyFont),h=Dc(this,"left",s),d=n.x(h),u=a<c.lineHeight?(c.lineHeight-a)/2:0,f=e.y+u;if(s.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(d,l)+l/2,c=f+a/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,eo(t,e,i,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,eo(t,e,i,c)}else{t.lineWidth=Cn(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=n.leftForLtr(d,l),i=n.leftForLtr(n.xPlus(d,1),l-2),r=yo(o.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,uo(t,{x:e,y:f,w:l,h:a,radius:r}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),uo(t,{x:i,y:f+1,w:l-2,h:a-2,radius:r}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,f,l,a),t.strokeRect(e,f,l,a),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=_o(i.bodyFont);let d=h.lineHeight,u=0;const f=rr(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},g=f.textAlign(o);let m,b,v,y,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=h.string,t.x=Dc(this,g,i),e.fillStyle=i.bodyColor,jn(this.beforeBody,p),u=r&&"right"!==g?"center"===o?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,jn(m.before,p),v=m.lines,r&&v.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),x=0,w=v.length;x<w;++x)p(v[x]),d=h.lineHeight;jn(m.after,p)}u=0,d=h.lineHeight,jn(this.afterBody,p),t.y-=s}drawFooter(t,e,i){const n=this.footer,s=n.length;let o,r;if(s){const a=rr(i.rtl,this.x,this.width);for(t.x=Dc(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",o=_o(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,r=0;r<s;++r)e.fillText(n[r],a.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:s,yAlign:o}=this,{x:r,y:a}=t,{width:l,height:c}=i,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=yo(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,a),"top"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+l-d,a),e.quadraticCurveTo(r+l,a,r+l,a+d),"center"===o&&"right"===s&&this.drawCaret(t,e,i,n),e.lineTo(r+l,a+c-f),e.quadraticCurveTo(r+l,a+c,r+l-f,a+c),"bottom"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+u,a+c),e.quadraticCurveTo(r,a+c,r,a+c-u),"center"===o&&"left"===s&&this.drawCaret(t,e,i,n),e.lineTo(r,a+h),e.quadraticCurveTo(r,a,r+h,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Mc[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Tc(this,t),r=Object.assign({},i,this._size),a=Pc(e,t,r),l=Lc(t,r,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=xo(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),ar(t,e.textDirection),s.y+=o.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),lr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!Fn(i,n),o=this._positionChanged(n,e);(s||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],o=this._getActiveElements(t,s,e,i),r=this._positionChanged(o,t),a=e||!Fn(o,s)||r;return a&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,o=Mc[s.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}var Bc={id:"tooltip",_element:zc,positioners:Mc,afterInit(t,e,i){i&&(t.tooltip=new zc({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Nc=Object.freeze({__proto__:null,Colors:Jl,Decimation:Ql,Filler:mc,Legend:xc,SubTitle:Sc,Title:wc,Tooltip:Bc});function Wc(t,e,i,n){const s=t.indexOf(e);if(-1===s)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return s!==t.lastIndexOf(e)?i:s}function Vc(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Hc(t,e){const i=[],{bounds:n,step:s,min:o,max:r,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:p,max:g}=e,m=!An(o),b=!An(r),v=!An(l),y=(g-p)/(h+1);let x,_,w,k,S=as((g-p)/f/u)*u;if(S<1e-14&&!m&&!b)return[{value:p},{value:g}];k=Math.ceil(g/S)-Math.floor(p/S),k>f&&(S=as(k*S/f/u)*u),An(a)||(x=Math.pow(10,a),S=Math.ceil(S*x)/x),"ticks"===n?(_=Math.floor(p/S)*S,w=Math.ceil(g/S)*S):(_=p,w=g),m&&b&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-o)/s,S/1e3)?(k=Math.round(Math.min((r-o)/S,c)),S=(r-o)/k,_=o,w=r):v?(_=m?o:_,w=b?r:w,k=l-1,S=(w-_)/k):(k=(w-_)/S,k=rs(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const M=Math.max(us(S),us(_));x=Math.pow(10,An(a)?M:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let O=0;for(m&&(d&&_!==o?(i.push({value:o}),_<o&&O++,rs(Math.round((_+O*S)*x)/x,o,$c(o,y,t))&&O++):_<o&&O++);O<k;++O){const t=Math.round((_+O*S)*x)/x;if(b&&t>r)break;i.push({value:t})}return b&&d&&w!==r?i.length&&rs(i[i.length-1].value,r,$c(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}function $c(t,e,{horizontal:i,minRotation:n}){const s=hs(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*e*(""+t).length;return Math.min(e/o,r)}class Uc extends Ha{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return An(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const o=t=>n=e?n:t,r=t=>s=i?s:t;if(t){const t=os(n),e=os(s);t<0&&e<0?r(0):t>0&&e>0&&o(0)}if(n===s){let e=0===s?1:Math.abs(.05*s);r(s+e),t||o(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=Hc({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&cs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vs(t,this.chart.options.locale,this.options.ticks.format)}}class qc extends Uc{static id="linear";static defaults={ticks:{callback:$s.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?t:0,this.max=Pn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=hs(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Yc=t=>Math.floor(ss(t)),Xc=(t,e)=>Math.pow(10,Yc(t)+e);function Jc(t){return 1===t/Math.pow(10,Yc(t))}function Gc(t,e,i){const n=Math.pow(10,i),s=Math.floor(t/n);return Math.ceil(e/n)-s}function Kc(t,{min:e,max:i}){e=Ln(t.min,e);const n=[],s=Yc(e);let o=function(t,e){let i=Yc(e-t);for(;Gc(t,e,i)>10;)i++;for(;Gc(t,e,i)<10;)i--;return Math.min(i,Yc(t))}(e,i),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Ln(t.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u<i;)n.push({value:u,major:Jc(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Ln(t.max,u);return n.push({value:f,major:Jc(f),significand:d}),n}class Qc extends Ha{static id="logarithmic";static defaults={ticks:{callback:$s.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Uc.prototype.parse.apply(this,[t,e]);if(0!==i)return Pn(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pn(t)?Math.max(0,t):null,this.max=Pn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pn(this._userMin)&&(this.min=t===Xc(this.min,0)?Xc(this.min,-1):Xc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,o=t=>n=e?n:t;i===n&&(i<=0?(s(1),o(10)):(s(Xc(i,-1)),o(Xc(n,1)))),i<=0&&s(Xc(n,-1)),n<=0&&o(Xc(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=Kc({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&cs(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Vs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ss(t),this._valueRange=ss(this.max)-ss(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(t){const e=t.ticks;if(e.display&&t.display){const t=xo(e.backdropPadding);return Dn(e.font&&e.font.size,Gs.font.size)+t.height}return 0}function th(t,e,i){return i=Tn(i)?i:[i],{w:Qs(t,e.string,i),h:i.length*e.lineHeight}}function eh(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:t<n||t>s?{start:e-i,end:e}:{start:e,end:e+i}}function ih(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?Gn/o:0;for(let l=0;l<o;l++){const o=r.setContext(t.getPointLabelContext(l));s[l]=o.padding;const c=t.getPointPosition(l,t.drawingArea+s[l],a),h=_o(o.font),d=th(t.ctx,h,t._pointLabels[l]);n[l]=d;const u=ms(t.getIndexAngle(l)+a),f=Math.round(ds(u));nh(i,e,u,eh(f,c.x,d.w,0,180),eh(f,c.y,d.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Zc(o)/2,additionalAngle:r?Gn/s:0};let c;for(let o=0;o<s;o++){l.padding=i[o],l.size=e[o];const s=sh(t,o,l);n.push(s),"auto"===a&&(s.visible=oh(s,c),s.visible&&(c=s))}return n}(t,n,s)}function nh(t,e,i,n,s){const o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/o,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),s.start<e.t?(l=(e.t-s.start)/r,t.t=Math.min(t.t,e.t-l)):s.end>e.b&&(l=(s.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function sh(t,e,i){const n=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=t.getPointPosition(e,n+s+r,o),c=Math.round(ds(ms(l.angle+es))),h=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,a.h,c),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function oh(t,e){if(!e)return!0;const{left:i,top:n,right:s,bottom:o}=t;return!(no({x:i,y:n},e)||no({x:i,y:o},e)||no({x:s,y:n},e)||no({x:s,y:o},e))}function rh(t,e,i){const{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=e;if(!An(a)){const i=yo(e.borderRadius),l=xo(e.backdropPadding);t.fillStyle=a;const c=n-l.left,h=s-l.top,d=o-n+l.width,u=r-s+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),uo(t,{x:c,y:h,w:d,h:u,radius:i}),t.fill()):t.fillRect(c,h,d,u)}}function ah(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,Kn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let o=1;o<n;o++)i=t.getPointPosition(o,e),s.lineTo(i.x,i.y)}}class lh extends Uc{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:$s.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xo(Zc(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pn(t)&&!isNaN(t)?t:0,this.max=Pn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Zc(this.options))}generateTickLabels(t){Uc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=Rn(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?ih(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return ms(t*(Kn/(this._pointLabels.length||1))+hs(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(An(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(An(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return ko(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-es+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ah(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:s}=e,o=this._pointLabels.length;let r,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let s=e-1;s>=0;s--){const e=t._pointLabelItems[s];if(!e.visible)continue;const o=n.setContext(t.getPointLabelContext(s));rh(i,o,e);const r=_o(o.font),{x:a,y:l,textAlign:c}=e;ho(i,t._pointLabels[s],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),r=n.setContext(i),l=s.setContext(i);!function(t,e,i,n,s){const o=t.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),ah(t,i,r,n),o.closePath(),o.stroke(),o.restore())}(this,r,a,o,l)}}),i.display){for(t.save(),r=o-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:o}=n;o&&s&&(t.lineWidth=o,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!e.reverse)return;const a=i.setContext(this.getContext(r)),l=_o(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[r].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=xo(a.backdropPadding);t.fillRect(-o/2-e.left,-s-l.size/2-e.top,o+e.width,l.size+e.height)}ho(t,n.label,0,-s,l,{color:a.color,strokeColor:a.textStrokeColor,strokeWidth:a.textStrokeWidth})}),t.restore()}drawTitle(){}}const ch={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}},hh=Object.keys(ch);function dh(t,e){return t-e}function uh(t,e){if(An(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:o}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),Pn(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(s&&(r="week"!==s||!ls(o)&&!0!==o?i.startOf(r,s):i.startOf(r,"isoWeek",o)),+r)}function fh(t,e,i,n){const s=hh.length;for(let o=hh.indexOf(t);o<s-1;++o){const t=ch[hh[o]],s=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(s*t.size))<=n)return hh[o]}return hh[s-1]}function ph(t,e,i){if(i){if(i.length){const{lo:n,hi:s}=xs(i,e);t[i[n]>=e?i[n]:i[s]]=!0}}else t[e]=!0}function gh(t,e,i){const n=[],s={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],s[a]=r,n.push({value:a,major:!1});return 0!==o&&i?function(t,e,i,n){const s=t._adapter,o=+s.startOf(e[0].value,n),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,s,i):n}class mh extends Ha{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new Jr(t.adapters.date);n.init(e),Vn(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:uh(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(s=Math.max(s,t.max))}o&&r||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=Pn(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=Pn(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,o=function(t,e,i){let n=0,s=t.length;for(;n<s&&t[n]<e;)n++;for(;s>n&&t[s-1]>i;)s--;return n>0||s<t.length?t.slice(n,s):t}(n,s,this.max);return this._unit=e.unit||(i.autoSkip?fh(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):function(t,e,i,n,s){for(let o=hh.length-1;o>=hh.indexOf(i);o--){const i=hh[o];if(ch[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return hh[i?hh.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=hh.indexOf(t)+1,i=hh.length;e<i;++e)if(ch[hh[e]].common)return hh[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&o.reverse(),gh(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,i,n=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vs(n,0,o),s=vs(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,s=n.time,o=s.unit||fh(s.minUnit,e,i,this._getLabelCapacity(e)),r=Dn(n.ticks.stepSize,1),a="week"===o&&s.isoWeekday,l=ls(a)||!0===a,c={};let h,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",a)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;h<i;h=+t.add(h,r,o),d++)ph(c,h,f);return h!==i&&"ticks"!==n.bounds&&1!==d||ph(c,h,f),Object.keys(c).sort(dh).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,n=this._unit,s=e||i[n];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,n){const s=this.options,o=s.ticks.callback;if(o)return Rn(o,[t,e,i],this);const r=s.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=i[e],u=l&&h&&d&&d.major;return this._adapter.format(t,n||(u?h:c))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=hs(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(n),o=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:i*s+r*o,h:i*o+r*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,gh(this,[t],this._majorUnit),n),o=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(uh(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ms(t.sort(dh))}}function bh(t,e,i){let n,s,o,r,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=_s(t,"pos",e)),({pos:n,time:o}=t[a]),({pos:s,time:r}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=_s(t,"time",e)),({time:n,pos:o}=t[a]),({time:s,pos:r}=t[l]));const c=s-n;return c?o+(r-o)*(e-n)/c:o}var vh=Object.freeze({__proto__:null,CategoryScale:class extends Ha{static id="category";static defaults={ticks:{callback:Vc}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(An(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:vs(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Wc(i,t,Dn(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){return Vc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:qc,LogarithmicScale:Qc,RadialLinearScale:lh,TimeScale:mh,TimeSeriesScale:class extends mh{static id="timeseries";static defaults=mh.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=bh(e,this.min),this._tableRange=bh(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let o,r,a,l,c;for(o=0,r=t.length;o<r;++o)l=t[o],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,r=n.length;o<r;++o)c=n[o+1],a=n[o-1],l=n[o],Math.round((c+a)/2)!==l&&s.push({time:l,pos:o/(r-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort((t,e)=>t-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(bh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return bh(this._table,i*this._tableRange+this._minPos,!0)}}});const yh=[qr,Vl,Nc,vh];xl.register(...yh);const xh=xl;var _h=i(998),wh=i.n(_h);const kh={data:{},nonce:"",context:null,init(t){this.context=t;const e=t.querySelectorAll("[data-progress]"),i=t.querySelectorAll("[data-chart]");[...e].forEach(t=>{t.dataset.url&&(this.data[t.dataset.url]||(this.data[t.dataset.url]={items:[],poll:null}),this.data[t.dataset.url].items.push(t)),"line"===t.dataset.progress?this.line(t):"circle"===t.dataset.progress&&this.circle(t),this.nonce||(this.nonce=t.dataset?.nonce)});for(const t in this.data)this.getValues(t);[...i].forEach(t=>{const e={labels:JSON.parse(t.dataset.dates),datasets:[{backgroundColor:t.dataset.color,borderColor:t.dataset.color,data:JSON.parse(t.dataset.data),cubicInterpolationMode:"monotone"}]};new xh(t,{type:"line",data:e,options:{responsive:!0,radius:0,interaction:{intersect:!1},plugins:{legend:{display:!1}},scales:{y:{suggestedMin:0,ticks:{color:"#999999",callback:(t,e)=>wh()(t,{decimals:2,scale:"SI"})},grid:{color:"#d3dce3"}},x:{ticks:{color:"#999999"},grid:{color:"#d3dce3"}}}}})})},line(t){new(Ui().Line)(t,{strokeWidth:2,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:2,svgStyle:{width:"100%",height:"100%",display:"block"}}).animate(t.dataset.value/100)},circle(t){t.dataset.basetext=t.dataset.text,t.dataset.text="";const e=t.dataset.value,i=this;if(t.bar=new(Ui().Circle)(t,{strokeWidth:3,easing:"easeInOut",duration:1400,color:t.dataset.color,trailColor:"#d3dce3",trailWidth:3,svgStyle:null,text:{autoStyleContainer:!1,style:{color:"#222222"}},step(e,n){const s=Math.floor(100*n.value());i.setText(n,parseFloat(s),t.dataset.text)}}),!t.dataset.url){const i=e/100;t.bar.animate(i)}},getValues(t){this.data[t].poll&&(clearTimeout(this.data[t].poll),this.data[t].poll=null),Pt({path:t,method:"GET",headers:{"X-WP-Nonce":this.nonce}}).then(e=>{this.data[t].items.forEach(i=>{void 0!==e[i.dataset.basetext]?i.dataset.text=e[i.dataset.basetext]:i.dataset.text=i.dataset.basetext,i.bar.animate(e[i.dataset.value]),i.dataset.poll&&!this.data[t].poll&&(this.data[t].poll=setTimeout(()=>{this.getValues(t)},1e4))});for(const t in e){const i=this.context.querySelectorAll(`[data-key="${t}"]`),n=this.context.querySelectorAll(`[data-text="${t}"]`);i.forEach(i=>{i.dataset.value=e[t],i.dispatchEvent(new Event("focus"))}),n.forEach(i=>{i.innerText=e[t],i.classList.contains("cld-toggle")&&(e[t]?i.classList.remove("hidden"):i.classList.add("hidden"))})}})},setText(t,e,i){if(!t)return;const n=document.createElement("span"),s=document.createElement("h2"),o=document.createTextNode(i);s.innerText=e+"%",n.appendChild(s),n.appendChild(o),t.setText(n)}},Sh=kh,Mh={key:"_cld_pending_state",data:null,pending:null,changed:!1,previous:{},init(){this.data=cldData.stateData?cldData.stateData:{};let t=localStorage.getItem(this.key);t&&(t=JSON.parse(t),this.data={...this.data,...t},this.sendStates()),this.previous=JSON.stringify(this.data)},_update(){this.pending&&(clearTimeout(this.pending),localStorage.removeItem(this.key)),this.previous!==JSON.stringify(this.data)&&(this.pending=setTimeout(()=>this.sendStates(),2e3),localStorage.setItem(this.key,JSON.stringify(this.data)))},set(t,e){this.data[t]&&this.data[t]===e||(this.data[t]=e,this._update())},get(t){let e=null;return this.data[t]&&(e=this.data[t]),e},sendStates(){fetch(cldData.stateURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":cldData.stateNonce},body:JSON.stringify(this.data)}).then(t=>t.json()).then(t=>{t.success&&(this.previous=JSON.stringify(t.state),localStorage.removeItem(this.key))})}},Oh={init(t){[...t.querySelectorAll("[data-remove]")].forEach(t=>{t.addEventListener("click",e=>{if(t.dataset.message&&!confirm(t.dataset.message))return;const i=document.getElementById(t.dataset.remove);i.parentNode.removeChild(i)})})}},Eh={values:{},inputs:{},context:null,init(t){this.context=t;t.querySelectorAll("[data-tags]").forEach(t=>this.bind(t))},bind(t){t.innerText=t.dataset.placeholder;const e=t.dataset.tags,i=document.getElementById(e),n=this.context.querySelectorAll(`[data-tags-delete="${e}"]`);this.values[e]=JSON.parse(i.value),this.inputs[e]=i,t.boundInput=e,t.boundDisplay=this.context.querySelector(`[data-tags-display="${e}"]`),t.boundDisplay.addEventListener("click",e=>{t.focus()}),t.addEventListener("focus",e=>{t.innerText=null}),t.addEventListener("blur",e=>{3<t.innerText.length&&this.captureTag(t,t.innerText),t.innerText=t.dataset.placeholder}),t.addEventListener("keydown",i=>{if("Tab"===i.key)3<t.innerText.length&&(i.preventDefault(),this.captureTag(t,t.innerText));else if("Escape"===i.key)t.blur();else if("Backspace"===i.key&&0===t.innerText.length){const i=t.boundDisplay.lastChild.previousSibling;i&&(i.parentNode.removeChild(i),this.values[e].pop(),this.updateInput(e))}}),t.addEventListener("keypress",e=>{"Comma"!==e.code&&"Enter"!==e.code&&"Tab"!==e.code&&"Space"!==e.code||(e.preventDefault(),3<t.innerText.length&&this.captureTag(t,t.innerText))}),n.forEach(t=>{t.parentNode.control=t,t.parentNode.style.width=getComputedStyle(t.parentNode).width,t.addEventListener("click",e=>{e.stopPropagation(),this.deleteTag(t)})})},deleteTag(t){const e=t.parentNode,i=e.dataset.inputId,n=this.values[i].indexOf(e.dataset.value);0<=n&&this.values[i].splice(n,1),e.style.width=0,e.style.opacity=0,e.style.padding=0,e.style.margin=0,setTimeout(()=>{e.parentNode.removeChild(e)},500),this.updateInput(i)},captureTag(t,e){if(this[t.dataset.format]&&"string"!=typeof(e=this[t.dataset.format](e)))return t.classList.add("pulse"),void setTimeout(()=>{t.classList.remove("pulse")},1e3);if(!this.validateUnique(t.boundDisplay,e)){const i=this.createTag(e);i.dataset.inputId=t.boundInput,this.values[t.boundInput].push(e),t.innerText=null,t.boundDisplay.insertBefore(i,t),i.style.width=getComputedStyle(i).width,i.style.opacity=1,this.updateInput(t.boundInput)}},createTag(t){const e=document.createElement("span"),i=document.createElement("span"),n=document.createElement("span");return e.classList.add("cld-input-tags-item"),i.classList.add("cld-input-tags-item-text"),n.className="cld-input-tags-item-delete dashicons dashicons-no-alt",n.addEventListener("click",()=>this.deleteTag(n)),i.innerText=t,e.appendChild(i),e.appendChild(n),e.dataset.value=t,e.style.opacity=0,e.control=n,e},validateUnique(t,e){const i=t.querySelector(`[data-value="${e}"]`);let n=!1;return i&&(i.classList.remove("pulse"),i.classList.add("pulse"),setTimeout(()=>{i.classList.remove("pulse")},500),n=!0),n},updateInput(t){this.inputs[t].value=JSON.stringify(this.values[t])},host(t){!1===/^(?:http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)/.test(t)&&(t="https://"+t);let e="";try{e=new URL(t)}catch(t){return t}return decodeURIComponent(e.host)}},Ah=Eh,Th={suffixInputs:null,init(t){this.suffixInputs=t.querySelectorAll("[data-suffix]"),[...this.suffixInputs].forEach(t=>this.bindInput(t))},bindInput(t){const e=document.getElementById(t.dataset.suffix),i=e.dataset.template.split("@value");this.setSuffix(e,i,t.value),t.addEventListener("change",()=>this.setSuffix(e,i,t.value)),t.addEventListener("input",()=>this.setSuffix(e,i,t.value))},setSuffix(t,e,i){t.innerHTML="",t.classList.add("hidden"),-1===["none","off",""].indexOf(i)&&t.classList.remove("hidden");const n=document.createTextNode(e.join(i));t.appendChild(n)}},Ch={wrappers:null,frame:null,error:'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="rgba(0,0,0,0.1)"/><text x="50%" y="50%" fill="red" text-anchor="middle" dominant-baseline="middle">%26%23x26A0%3B︎</text></svg>',init(t){this.wrappers=t.querySelectorAll(".cld-size-items"),this.wrappers.forEach(t=>{const e=t.querySelectorAll(".cld-size-selector-item");e.forEach(i=>{i.addEventListener("click",()=>{e.forEach(t=>{delete t.dataset.selected}),i.dataset.selected=!0,this.switchSizeContent(t,i.dataset.size)})});const i=t.querySelector(".cld-size-selector-item[data-selected]");i&&this.switchSizeContent(t,i.dataset.size)})},switchSizeContent(t,e){t.querySelectorAll(".cld-size-content").forEach(t=>{t.style.display="none"});const i=t.querySelector(`.cld-size-content[data-size="${e}"]`);i&&(i.style.display="block",this.buildImages(t,i))},buildImages(t,e){const i=t.dataset.base,n=e.querySelector(".regular-text"),s=e.querySelector(".disable-toggle");if(!n||!s)return;const o=e.querySelectorAll("img"),r=n.value.length?n.value.replace(" ",""):n.placeholder;if(o.forEach(t=>{const e=t.dataset.size,o=t.dataset.file;s.checked?(n.disabled=!0,t.src=`${i}/${e}/${o}`):(n.disabled=!1,t.src=`${i}/${e},${r}/${o}`),t.bound||(t.addEventListener("error",()=>{t.src=this.error}),t.bound=!0)}),!n.bound){let i=null;n.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{this.buildImages(t,e)},1e3)}),n.bound=!0}s.bound||(s.addEventListener("change",()=>{this.buildImages(t,e)}),s.bound=!0);const a=e.querySelector(".clear-crop-input");a&&!a.bound&&(a.addEventListener("click",()=>{n.value="",this.buildImages(t,e)}),a.bound=!0)}},Ph={bindings:{},parent_check_data:{},check_parents:{},_init(t){const e=t.querySelectorAll("[data-condition]"),i=t.querySelectorAll("[data-toggle]"),n=t.querySelectorAll("[data-for]"),s=t.querySelectorAll("[data-tooltip]"),o=t.querySelectorAll("[data-bind-trigger]"),r=t.querySelectorAll("[data-main]"),a=t.querySelectorAll("[data-file]"),l=t.querySelectorAll("[data-auto-suffix]"),c=t.querySelectorAll("[data-confirm]"),h={};Mh.init(),Hi.bind(r),l.forEach(t=>this._autoSuffix(t)),o.forEach(t=>this._trigger(t)),i.forEach(t=>this._toggle(t)),e.forEach(t=>this._bind(t)),n.forEach(t=>this._alias(t)),a.forEach(t=>this._files(t,h)),Bi(s,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>document.getElementById(t.dataset.tooltip).innerHTML}),[...o].forEach(t=>{t.dispatchEvent(new Event("input"))}),c.forEach(t=>{t.addEventListener("click",e=>{confirm(t.dataset.confirm)||(e.preventDefault(),e.stopPropagation())})}),Sh.init(t),Oh.init(t),Ah.init(t),Th.init(t),Ch.init(t)},_autoSuffix(t){const e=t.dataset.autoSuffix;let i="";const n=[...e.split(";")].map(t=>0===t.indexOf("*")?(i=t.replace("*",""),i):t);t.addEventListener("change",()=>{const e=t.value.replace(" ",""),s=e.replace(/[^0-9]/g,""),o=e.replace(/[0-9]/g,"").toLowerCase();s&&(-1===n.indexOf(o)?t.value=s+i:t.value=s+o)}),t.dispatchEvent(new Event("change"))},_files(t,e){const i=t.dataset.parent;i&&(this.check_parents[i]=document.getElementById(i),this.parent_check_data[i]||(this.parent_check_data[i]=this.check_parents[i].value?JSON.parse(this.check_parents[i].value):[]),t.addEventListener("change",()=>{const n=this.parent_check_data[i].indexOf(t.value);t.checked?this.parent_check_data[i].push(t.value):this.parent_check_data[i].splice(n,1),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(()=>{this._compileParent(i)},10)}))},_compileParent(t){this.check_parents[t].value=JSON.stringify(this.parent_check_data[t]),this.check_parents[t].dispatchEvent(new Event("change"))},_bind(t){t.condition=JSON.parse(t.dataset.condition);for(const e in t.condition)this.bindings[e]&&this.bindings[e].elements.push(t)},_trigger(t){const e=t.dataset.bindTrigger,i=this;i.bindings[e]={input:t,value:t.value,checked:!0,elements:[]},t.addEventListener("change",function(e){t.dispatchEvent(new Event("input"))}),t.addEventListener("input",function(){if(i.bindings[e].value=t.value,"checkbox"===t.type&&(i.bindings[e].checked=t.checked),"radio"!==t.type||!1!==t.checked)for(const n in i.bindings[e].elements)i.toggle(i.bindings[e].elements[n],t)})},_alias(t){t.addEventListener("click",function(){document.getElementById(t.dataset.for).dispatchEvent(new Event("click"))})},_toggle(t){const e=this,i=document.querySelector('[data-wrap="'+t.dataset.toggle+'"]');if(!i)return;const n=Mh.get(t.id);t.addEventListener("click",function(n){n.stopPropagation();const s=i.classList.contains("open")?"closed":"open";e.toggle(i,t,s)}),n!==t.dataset.state&&this.toggle(i,t,n)},toggle(t,e,i){if(!i){i="open";for(const e in t.condition){let n=this.bindings[e].value;const s=t.condition[e];"boolean"==typeof s&&(n=this.bindings[e].checked),s!==n&&(i="closed")}}"closed"===i?this.close(t,e):this.open(t,e),Mh.set(e.id,i)},open(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("closed"),t.classList.add("open"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-down-alt2"),e.classList.add("dashicons-arrow-up-alt2")),[...i].forEach(function(t){t.dataset.disabled=!1})},close(t,e){const i=t.getElementsByClassName("cld-ui-input");t.classList.remove("open"),t.classList.add("closed"),e&&e.classList.contains("dashicons")&&(e.classList.remove("dashicons-arrow-up-alt2"),e.classList.add("dashicons-arrow-down-alt2")),[...i].forEach(function(t){t.dataset.disabled=!0})}},Lh=document.querySelectorAll(".cld-settings,.cld-meta-box");Lh.length&&Lh.forEach(t=>{t&&window.addEventListener("load",Ph._init(t))});const Dh={config:null,init(){this.config||"undefined"!=typeof cldData&&cldData.analytics&&cldData.analytics.enabled&&(this.config=cldData.analytics,Pt.use(Pt.createNonceMiddleware(this.config.nonce)))},track(t,e={},i="activation_funnel",n=null){if(this.config||this.init(),this.config&&this.config.enabled&&t)try{Pt({url:this.config.endpoint,method:"POST",data:{event_name:t,event_category:i,funnel_step:n,params:e}}).catch(()=>{})}catch(t){}},trackReliable(t,e={},i="activation_funnel"){if(this.config||this.init(),this.config&&this.config.enabled&&t)if(navigator.sendBeacon)try{const n=this.config.endpoint.includes("?")?"&":"?",s=this.config.endpoint+n+"_wpnonce="+encodeURIComponent(this.config.nonce),o=new Blob([JSON.stringify({event_name:t,event_category:i,funnel_step:null,params:e})],{type:"application/json"});navigator.sendBeacon(s,o)}catch(t){}else this.track(t,e,i)}};window.addEventListener("load",()=>Dh.init());const Ih=Dh,Rh={storageKey:"_cld_wizard",testing:null,connectAttempts:0,startedEntry:!1,startedTracked:!1,next:document.querySelector('[data-navigate="next"]'),back:document.querySelector('[data-navigate="back"]'),lock:document.getElementById("pad-lock"),lockIcon:document.getElementById("lock-icon"),options:document.querySelectorAll('.cld-ui-input[type="checkbox"]'),settings:document.getElementById("optimize"),tabBar:document.getElementById("wizard-tabs"),tracking:document.getElementById("tracking"),complete:document.getElementById("complete-wizard"),tabs:{"tab-1":document.getElementById("tab-icon-1"),"tab-2":document.getElementById("tab-icon-2"),"tab-3":document.getElementById("tab-icon-3")},content:{"tab-1":document.getElementById("tab-1"),"tab-2":document.getElementById("tab-2"),"tab-3":document.getElementById("tab-3"),"tab-4":document.getElementById("tab-4")},connection:{error:document.getElementById("connection-error"),success:document.getElementById("connection-success"),working:document.getElementById("connection-working")},debounceConnect:null,updateConnection:document.getElementById("update-connection"),cancelUpdateConnection:document.getElementById("cancel-update-connection"),config:{},didSave:!1,init(){if(!cldData.wizard)return;this.config=cldData.wizard.config,window.localStorage.getItem(this.storageKey)&&(this.config=JSON.parse(window.localStorage.getItem(this.storageKey))),document.location.hash.length&&this.hashChange(),Pt.use(Pt.createNonceMiddleware(cldData.wizard.saveNonce));const t=document.querySelectorAll("[data-navigate]"),e=document.getElementById("connect.cloudinary_url");this.updateConnection.addEventListener("click",()=>{this.lockNext(),e.parentNode.classList.remove("hidden"),this.cancelUpdateConnection.classList.remove("hidden"),this.updateConnection.classList.add("hidden")}),this.cancelUpdateConnection.addEventListener("click",()=>{this.unlockNext(),e.parentNode.classList.add("hidden"),this.cancelUpdateConnection.classList.add("hidden"),this.updateConnection.classList.remove("hidden"),this.config.cldString=!0,e.value="",this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")}),[...t].forEach(t=>{t.addEventListener("click",()=>{this.navigate(t.dataset.navigate)})}),this.lock.addEventListener("click",()=>{this.lockIcon.classList.toggle("dashicons-unlock"),this.settings.classList.toggle("disabled"),this.options.forEach(t=>{t.disabled=t.disabled?"":"disabled"})}),e.addEventListener("input",t=>{this.lockNext(),this.startedEntry||(this.startedEntry=!0,Ih.track("credentials_entry_started",{},"activation_funnel",3));const i=e.value.replace("CLOUDINARY_URL=","");this.connection.error.classList.remove("active"),this.connection.success.classList.remove("active"),this.connection.working.classList.remove("active"),i.length&&(this.testing=i,this.debounceConnect&&clearTimeout(this.debounceConnect),this.debounceConnect=setTimeout(()=>{const t=this.evaluateConnectionString(i);Ih.track("credentials_format_validated",{format_valid:t,invalid_reason:t?"":this.invalidReason(i)},"activation_funnel",3),t?(this.connection.working.classList.add("active"),this.testConnection(i)):this.connection.error.classList.add("active")},500))}),this.config.cldString&&(e.parentNode.classList.add("hidden"),this.updateConnection.classList.remove("hidden"));const i=document.querySelector('a[href="https://cloudinary.com/signup"]');i&&i.addEventListener("click",()=>{Ih.track("wizard_signup_clicked",{},"activation_funnel",2)}),this.complete&&this.complete.addEventListener("click",()=>{Ih.track("wizard_dashboard_clicked",{},"activation_funnel",7)}),this.getTab(this.config.tab),this.initFeatures(),window.addEventListener("hashchange",t=>{this.hashChange()})},hashChange(){const t=parseInt(document.location.hash.replace("#",""));t&&0<t&&5>t&&this.getTab(t)},initFeatures(){const t=(t,e)=>{Ih.track("wizard_setting_toggled",{setting_key:t,enabled:e},"activation_funnel",4)},e=document.getElementById("media_library");e.checked=this.config.mediaLibrary,e.addEventListener("change",()=>{this.setConfig("mediaLibrary",e.checked),t("media_library",e.checked)});const i=document.getElementById("non_media");i.checked=this.config.nonMedia,i.addEventListener("change",()=>{this.setConfig("nonMedia",i.checked),t("non_media",i.checked)});const n=document.getElementById("advanced");n.checked=this.config.advanced,n.addEventListener("change",()=>{this.setConfig("advanced",n.checked),t("advanced",n.checked)})},getCurrent(){return this.content[`tab-${this.config.tab}`]},hideTabs(){Object.keys(this.content).forEach(t=>{this.hide(this.content[t])})},completeTab(t){this.incompleteTab(),Object.keys(this.tabs).forEach(e=>{const i=parseInt(this.tabs[e].dataset.tab);t>i?this.tabs[e].classList.add("complete"):t===i&&this.tabs[e].classList.add("active")})},incompleteTab(t){Object.keys(this.tabs).forEach(t=>{this.tabs[t].classList.remove("complete","active")})},getCurrentTab(){return this.tabs[`tab-icon-${this.config.tab}`]},getTab(t){if(4===t&&window.localStorage.getItem(this.storageKey)&&!this.didSave)return void this.saveConfig();const e=this.getCurrent(),i=document.getElementById(`tab-${t}`);switch(this.hideTabs(),this.completeTab(t),this.hide(document.getElementById(`tab-${this.config.tab}`)),e.classList.remove("active"),this.show(i),this.show(this.next),this.hide(this.lock),t){case 1:this.hide(this.back),this.unlockNext(),this.startedTracked||(this.startedTracked=!0,this.config.wizardStartedAt||this.setConfig("wizardStartedAt",Date.now()),Ih.track("wizard_started",{entry_point:this.getEntryPoint()},"activation_funnel",2));break;case 2:Ih.track("wizard_connect_viewed",{},"activation_funnel",3),this.show(this.back),this.config.cldString?this.showSuccess():(this.lockNext(),setTimeout(()=>{document.getElementById("connect.cloudinary_url").focus()},0)),this.updateConnection.classList.contains("hidden")&&this.lockNext();break;case 3:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_settings_viewed",{},"activation_funnel",4),this.show(this.lock),this.show(this.back);break;case 4:if(!this.config.cldString)return void(document.location.hash="1");Ih.track("wizard_completed",{time_to_complete_sec:this.timeToCompleteSec()},"activation_funnel",6),this.hide(this.tabBar),this.hide(this.next),this.hide(this.back)}this.setConfig("tab",t)},navigate(t){"next"===t?this.navigateNext():"back"===t&&this.navigateBack()},navigateBack(){document.location.hash=this.config.tab-1},navigateNext(){document.location.hash=this.config.tab+1},showError(){this.connection.error.classList.add("active"),this.connection.success.classList.remove("active")},showSuccess(){this.connection.error.classList.remove("active"),this.connection.success.classList.add("active")},show(t){t.classList.remove("hidden"),t.style.display=""},hide(t){t.classList.add("hidden"),t.style.display="none"},lockNext(){this.next.disabled="disabled"},unlockNext(){this.next.disabled=""},evaluateConnectionString:t=>new RegExp(/^(?:CLOUDINARY_URL=)?(cloudinary:\/\/){1}(\d*)[:]{1}([^@]*)[@]{1}([^@]*)$/gim).test(t),invalidReason(t){const e=t.replace("CLOUDINARY_URL=","");if(0!==e.indexOf("cloudinary://"))return"missing_scheme";if(-1===e.indexOf("@"))return"missing_cloud_name";const i=e.replace("cloudinary://","").split("@")[0];return-1===i.indexOf(":")?"missing_secret":/^\d+$/.test(i.split(":")[0])?"invalid_format":"invalid_api_key"},getEntryPoint:()=>-1!==document.referrer.indexOf("plugins.php")?"auto_redirect":"menu",timeToCompleteSec(){const t=this.config.wizardStartedAt;return t?Math.max(0,Math.round((Date.now()-t)/1e3)):null},testConnection(t){this.connectAttempts+=1,Ih.track("connection_test_started",{attempt_number:this.connectAttempts},"activation_funnel",3),Pt({path:cldData.wizard.testURL,data:{cloudinary_url:t,attempt_number:this.connectAttempts},method:"POST"}).then(e=>{e.url===this.testing&&(this.connection.working.classList.remove("active"),"connection_error"===e.type?this.showError():"connection_success"===e.type&&(this.showSuccess(),this.unlockNext(),this.setConfig("cldString",t)))})},setConfig(t,e){this.config[t]=e,window.localStorage.setItem(this.storageKey,JSON.stringify(this.config))},saveConfig(){this.lockNext(),this.next.innerText=$("Setting up Cloudinary","cloudinary"),this.didSave=!0,Pt({path:cldData.wizard.saveURL,data:this.config,method:"POST"}).then(t=>{this.next.innerText=$("Next","cloudinary"),this.unlockNext(),this.getTab(4),window.localStorage.removeItem(this.storageKey)}).fail(t=>{this.didSave=!1})}};window.addEventListener("load",()=>Rh.init());const jh={select:document.getElementById("connect.offload"),tooltip:null,descriptions:{},change(){[...this.descriptions].forEach(t=>{t.classList.remove("selected")}),this.tooltip.querySelector("."+this.select.value).classList.add("selected")},addEventListener(){this.select.addEventListener("change",this.change.bind(this))},_init(){this.select&&(this.addEventListener(),this.tooltip=this.select.parentNode.querySelector(".cld-tooltip"),this.descriptions=this.tooltip.querySelectorAll("li"),this.change())}};window.addEventListener("load",()=>jh._init());const Fh={pageReloader:document.getElementById("page-reloader"),init(){if(!cldData.extensions)return;Pt.use(Pt.createNonceMiddleware(cldData.extensions.nonce));[...document.querySelectorAll("[data-extension]")].forEach(t=>{t.addEventListener("change",e=>{t.spinner||(t.spinner=this.createSpinner(),t.parentNode.appendChild(t.spinner)),t.debounce&&clearTimeout(t.debounce),t.debounce=setTimeout(()=>{this.toggleExtension(t),t.debounce=null},1e3)})})},toggleExtension(t){const e=t.dataset.extension,i=t.checked;Ih.track("extension_toggled",{extension_id:e,enabled:i},"features"),Pt({path:cldData.extensions.url,data:{extension:e,enabled:i},method:"POST"}).then(e=>{t.spinner&&(t.parentNode.removeChild(t.spinner),delete t.spinner),Object.keys(e).forEach(t=>{document.querySelectorAll(`[data-text="${t}"]`).forEach(i=>{i.innerText=e[t]})}),this.pageReloader.style.display="block"})},createSpinner(){const t=document.createElement("span");return t.classList.add("spinner"),t.classList.add("cld-extension-spinner"),t}};window.addEventListener("load",()=>Fh.init());const zh={tabButtonSelectors:null,selectedTabID:"",deselectOldTab(){document.getElementById(this.selectedTabID).classList.remove("is-active"),this.filterActive([...this.tabButtonSelectors]).classList.remove("is-active")},selectCurrentTab(t){this.selectedTabID=t.dataset.tab,t.classList.add("is-active"),document.getElementById(this.selectedTabID).classList.add("is-active")},selectTab(t){t.preventDefault(),t.target.classList.contains("is-active")||(this.deselectOldTab(),this.selectCurrentTab(t.target))},filterTabs(){[...this.tabButtonSelectors].forEach(t=>{t.dataset.tab&&t.addEventListener("click",this.selectTab.bind(this))})},filterActive:t=>t.filter(t=>t.classList.contains("is-active")).pop(),init(){this.tabButtonSelectors=document.querySelectorAll(".cld-page-tabs-tab button"),0!==this.tabButtonSelectors.length&&(this.selectCurrentTab(this.filterActive([...this.tabButtonSelectors])),this.filterTabs())}};window.addEventListener("load",()=>zh.init());const Bh={init(){document.querySelectorAll(".cld-special-offer-link").forEach(t=>{t.addEventListener("click",()=>{Ih.track("special_offer_clicked",{offer_id:"small_plan_29"},"settings")})})}};window.addEventListener("load",()=>Bh.init());i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p,i.p;window.$=window.jQuery})()})();
//# sourceMappingURL=cloudinary.js.map