lorgg-v2-components 0.0.133 → 0.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -807,7 +807,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
807
807
 
808
808
  `,`1) content: element.innerHTML
809
809
  `,"2) content: () => element.cloneNode(true)"].join(" "))}var o=a.reduce(function(l,c){var u=c&&OI(c,r);return u&&l.push(u),l},[]);return Eo(e)?o[0]:o}et.defaultProps=Sn;et.setDefaultProps=QI;et.currentInput=hr;Object.assign({},qw,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});et.setDefaultProps({render:hb});const pb={cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},isRoot:{type:Boolean,required:!0},quantityNeeded:{type:Number,required:!1,default:void 0},deckList:{type:Object,required:!1,default(){return{}}},isDeckBuilder:{type:Boolean,required:!1,default:!1},userCardQuantity:{type:Object,required:!1,default:void 0},showTippyLocation:{type:String,required:!1,default:null}},MI=["alt","src"],NI={key:0,class:"quantity-ticks-container"},PI={key:0},HI={key:0,class:"card-info-quantity-possessed"},RI={key:1,class:"line"},VI={class:"card-info-title"},KI={class:"card-info-text"},$I={key:2,class:"line"},WI={key:3,class:"card-info-text"},GI={key:1,class:"associated-card-container"},zI=i.defineComponent({__name:"CardItem",props:pb,setup(e){const t=e,{t:n}=ne(),r=i.ref(null),a=i.ref(null);let A=null;const s=i.ref(!1),o=Ko(t.cardProp,t.cardCodeProp),l=i.computed(()=>o.value===void 0?null:t.quantityNeeded!=null&&t.userCardQuantity!=null&&o.value.cardCode in t.userCardQuantity&&t.quantityNeeded>t.userCardQuantity[o.value.cardCode]?"bad":null),c=i.computed(()=>{if(o.value===void 0)return[];const g=[];if(t.isRoot)for(const v of o.value.associatedCardRefs)g.push(qt().cardJsonObject[v]);return g}),u=i.computed(()=>{if(o.value===void 0)return[];const g=[];for(const v of o.value.keywordRefs){const _=we().dataJson.keywords.find(B=>B.nameRef===v);_&&g.push(_)}return g}),d=i.computed(()=>t.isRoot&&(t.userCardQuantity!=null||o.value&&(o.value.keywordRefs.length>0||o.value.associatedCardRefs.length>0))),f=i.computed(()=>{var g;return t.userCardQuantity==null||o.value&&!(o.value.cardCode in t.userCardQuantity)?0:t.userCardQuantity[((g=o.value)==null?void 0:g.cardCode)??0]}),h=i.computed(()=>o.value===void 0?null:t.isDeckBuilder&&t.deckList[o.value.cardCode]===3?"disabled":null);i.watch(()=>t.showTippyLocation,g=>{A&&(g?(A.setProps({placement:g}),A.show()):A.hide())});function p(){window.addEventListener("keyup",g=>{g.key=="Shift"&&(s.value=!1)})}function m(){window.addEventListener("keydown",g=>{g.key=="Shift"&&(s.value=!0)})}function y(g){return o.value===void 0?null:t.isDeckBuilder?!(o.value.cardCode in t.deckList)||g>t.deckList[o.value.cardCode]?"disabled":null:g>f.value?"disabled":null}return i.onMounted(()=>{(o.value===void 0||t.userCardQuantity!=null||o.value.keywordRefs.length>0||o.value.associatedCardRefs.length>0)&&(A=et(r.value,{allowHTML:!0,content:a.value,placement:"right-start",duration:0,role:"card-info",maxWidth:"50vw",touch:!1})),(o.value===void 0||o.value.associatedCardRefs.length>0)&&(p(),m())}),(g,v)=>{var B,w,b;const _=i.resolveComponent("CardItem",!0);return i.openBlock(),i.createElementBlock("div",{class:"card-item-container",onMouseover:v[0]||(v[0]=C=>!0),onMouseleave:v[1]||(v[1]=C=>!1)},[i.createElementVNode("img",{ref_key:"cardItem",ref:r,alt:(B=i.unref(o))==null?void 0:B.name,class:i.normalizeClass(["card-item",h.value]),src:i.unref(xe)().callbacks.cardImageCallback(((w=i.unref(o))==null?void 0:w.cardCode)??"",i.unref(Bt).Card)},null,10,MI),(g.isDeckBuilder||g.userCardQuantity!=null)&&((b=i.unref(o))!=null&&b.collectible)?(i.openBlock(),i.createElementBlock("div",NI,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(3,C=>i.createElementVNode("div",{key:C,class:i.normalizeClass(["quantity-tick",y(C)])},null,2)),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"cardInfo",ref:a,class:i.normalizeClass(s.value?null:"card-info")},[!s.value&&d.value&&i.unref(o)?(i.openBlock(),i.createElementBlock("div",PI,[f.value!==void 0?(i.openBlock(),i.createElementBlock("div",HI,[i.createTextVNode(i.toDisplayString(i.unref(n)("general.youHave"))+" ",1),i.createElementVNode("b",{class:i.normalizeClass(l.value)},i.toDisplayString(f.value+" / "+(g.quantityNeeded||3)),3)])):i.createCommentVNode("",!0),f.value!==void 0&&(i.unref(o).keywordRefs.length>0||i.unref(o).associatedCardRefs.length>0)?(i.openBlock(),i.createElementBlock("hr",RI)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,C=>(i.openBlock(),i.createElementBlock("div",{key:C.nameRef,class:"card-info-section"},[i.createElementVNode("h4",VI,i.toDisplayString(C.name),1),i.createElementVNode("p",KI,i.toDisplayString(C.description),1)]))),128)),i.unref(o).keywordRefs.length>0&&i.unref(o).associatedCardRefs.length>0?(i.openBlock(),i.createElementBlock("hr",$I)):i.createCommentVNode("",!0),i.unref(o).associatedCardRefs.length>0?(i.openBlock(),i.createElementBlock("div",WI,i.toDisplayString(i.unref(n)("general.holdShiftForAssociated")),1)):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",GI,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,C=>(i.openBlock(),i.createBlock(_,{key:C.cardCode,"card-code-prop":C.cardCode,"is-deck-builder":!1,"is-root":!1,class:"associated-card"},null,8,["card-code-prop"]))),128))]))],2)],32)}}});const M=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},za=M(zI,[["__scopeId","data-v-5ea850fb"]]),jI=i.defineComponent({__name:"RevealCarousel",props:r6,setup(e){var o;const t=e,n=[q5],r=i.ref(null),a=i.ref((o=r.value)==null?void 0:o.clientWidth),A=i.computed(()=>a.value===void 0?!0:a.value<400);function s(){var l;a.value=(l=r.value)==null?void 0:l.clientWidth}return i.onMounted(()=>{window.addEventListener("resize",s),s()}),i.onUnmounted(()=>{window.removeEventListener("resize",s)}),(l,c)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"revealCarousel",ref:r,class:"reveal-carousel"},[i.createVNode(i.unref(Gw),{"slides-per-view":"auto","space-between":15,"centered-slides":A.value,navigation:!0,modules:n},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.cardCodes,u=>(i.openBlock(),i.createBlock(i.unref(zw),{key:u},{default:i.withCtx(()=>[i.createVNode(za,{class:"card-item-called","card-code-prop":u,"is-root":!0},null,8,["card-code-prop"])]),_:2},1024))),128))]),_:1},8,["centered-slides"])],512))}});const gg=M(jI,[["__scopeId","data-v-430f2bb4"]]),gb={fetchSeachResult:{type:Function,required:!0,default:()=>[]}},YI={cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1,default:void 0},color:{type:String,required:!1,default:void 0},name:{type:String,required:!1,default:void 0},manaNumber:{type:Number,required:!1,default:void 0},routerLink:{type:Object,required:!1,default:"404"},quantityNumber:{type:Number,required:!1,default:void 0},maintainAspectRatio:{type:Boolean,required:!1,default:!0},showPlusMinus:{type:Boolean,required:!1,default:!1}},qI="data:image/svg+xml;base64,ICA8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDMxIDM2Ij4KICAgIDxkZWZzPgogICAgICA8bGluZWFyR3JhZGllbnQKICAgICAgICBpZD0iYSIKICAgICAgICB4MT0iLjA4IgogICAgICAgIHkxPSIuODIiCiAgICAgICAgeDI9IjEiCiAgICAgICAgeTI9Ii4xOSIKICAgICAgICBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIKICAgICAgPgogICAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzA0NjZjOCIgLz4KICAgICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDNhOWUiIC8+CiAgICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8L2RlZnM+CiAgICA8ZyB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxNS41IDE1LjUpIiBmaWxsPSJ1cmwoI2EpIj4KICAgICAgPHBhdGgKICAgICAgICBkPSJNMjMuNTUgMzAuNWgtMTEuMWE1LjUyIDUuNTIgMCAwIDEtNC43NS0yLjc0bC01LjUyLTkuNWE1LjUxIDUuNTEgMCAwIDEgMC01LjUybDUuNTItOS41QTUuNTIgNS41MiAwIDAgMSAxMi40NS41aDExLjFhNS41MiA1LjUyIDAgMCAxIDQuNzUgMi43NGw1LjUyIDkuNWMuOTkgMS43Ljk5IDMuODIgMCA1LjUybC01LjUyIDkuNWE1LjUyIDUuNTIgMCAwIDEtNC43NSAyLjc0WiIKICAgICAgLz4KICAgICAgPHBhdGgKICAgICAgICBkPSJNMTIuNDUgMWMtMS43NyAwLTMuNDMuOTUtNC4zMiAyLjQ5bC01LjUyIDkuNWE1LjAxIDUuMDEgMCAwIDAgMCA1LjAybDUuNTIgOS41QTUuMDIgNS4wMiAwIDAgMCAxMi40NSAzMGgxMS4xYzEuNzcgMCAzLjQzLS45NSA0LjMyLTIuNDlsNS41Mi05LjVjLjktMS41NS45LTMuNDcgMC01LjAybC01LjUyLTkuNUE1LjAyIDUuMDIgMCAwIDAgMjMuNTUgMWgtMTEuMW0wLTFoMTEuMWE2IDYgMCAwIDEgNS4xOCAyLjk5bDUuNTIgOS41YTYgNiAwIDAgMSAwIDYuMDJsLTUuNTIgOS41QTYgNiAwIDAgMSAyMy41NSAzMWgtMTEuMWE2IDYgMCAwIDEtNS4xOC0yLjk5bC01LjUyLTkuNWE2IDYgMCAwIDEgMC02LjAybDUuNTItOS41QTYgNiAwIDAgMSAxMi40NSAwWiIKICAgICAgICBmaWxsPSIjZmZjNTNlIgogICAgICAvPgogICAgPC9nPgogIDwvc3ZnPg==",XI=["src"],qo=i.defineComponent({__name:"ManaHexagonIcon",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("img",{src:i.unref(qI)},null,8,XI))}});function iv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iv(Object(n),!0).forEach(function(r){ln(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iv(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JI(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,A;for(A=0;A<r.length;A++)a=r[A],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function ZI(e,t){if(e==null)return{};var n=JI(e,t),r,a;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(a=0;a<A.length;a++)r=A[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Uh(e){return eU(e)||tU(e)||nU(e)||rU()}function eU(e){if(Array.isArray(e))return Qh(e)}function tU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nU(e,t){if(e){if(typeof e=="string")return Qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qh(e,t)}}function Qh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
810
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var aU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},mb={exports:{}};(function(e){(function(t){var n=function(g,v,_){if(!c(v)||d(v)||f(v)||h(v)||l(v))return v;var B,w=0,b=0;if(u(v))for(B=[],b=v.length;w<b;w++)B.push(n(g,v[w],_));else{B={};for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(B[g(C,_)]=n(g,v[C],_))}return B},r=function(g,v){v=v||{};var _=v.separator||"_",B=v.split||/(?=[A-Z])/;return g.split(B).join(_)},a=function(g){return p(g)?g:(g=g.replace(/[\-_\s]+(.)?/g,function(v,_){return _?_.toUpperCase():""}),g.substr(0,1).toLowerCase()+g.substr(1))},A=function(g){var v=a(g);return v.substr(0,1).toUpperCase()+v.substr(1)},s=function(g,v){return r(g,v).toLowerCase()},o=Object.prototype.toString,l=function(g){return typeof g=="function"},c=function(g){return g===Object(g)},u=function(g){return o.call(g)=="[object Array]"},d=function(g){return o.call(g)=="[object Date]"},f=function(g){return o.call(g)=="[object RegExp]"},h=function(g){return o.call(g)=="[object Boolean]"},p=function(g){return g=g-0,g===g},m=function(g,v){var _=v&&"process"in v?v.process:v;return typeof _!="function"?g:function(B,w){return _(B,g,w)}},y={camelize:a,decamelize:s,pascalize:A,depascalize:s,camelizeKeys:function(g,v){return n(m(a,v),g)},decamelizeKeys:function(g,v){return n(m(s,v),g,v)},pascalizeKeys:function(g,v){return n(m(A,v),g)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=y:t.humps=y})(aU)})(mb);var AU=mb.exports,sU=["class","style"];function iU(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),a=AU.camelize(n.slice(0,r)),A=n.slice(r+1).trim();return t[a]=A,t},{})}function oU(e){return e.split(/\s+/).reduce(function(t,n){return t[n]=!0,t},{})}function mg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return mg(l)}),a=Object.keys(e.attributes||{}).reduce(function(l,c){var u=e.attributes[c];switch(c){case"class":l.class=oU(u);break;case"style":l.style=iU(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var A=n.style,s=A===void 0?{}:A,o=ZI(n,sU);return i.h(e.tag,Xn(Xn(Xn({},t),{},{class:a.class,style:Xn(Xn({},a.style),s)},a.attrs),o),r)}var vb=!1;try{vb=process.env.NODE_ENV==="production"}catch{}function lU(){if(!vb&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Yi(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?ln({},e,t):{}}function cU(e){var t,n=(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip":e.flip===!0,"fa-flip-horizontal":e.flip==="horizontal"||e.flip==="both","fa-flip-vertical":e.flip==="vertical"||e.flip==="both"},ln(t,"fa-".concat(e.size),e.size!==null),ln(t,"fa-rotate-".concat(e.rotation),e.rotation!==null),ln(t,"fa-pull-".concat(e.pull),e.pull!==null),ln(t,"fa-swap-opacity",e.swapOpacity),ln(t,"fa-bounce",e.bounce),ln(t,"fa-shake",e.shake),ln(t,"fa-beat",e.beat),ln(t,"fa-fade",e.fade),ln(t,"fa-beat-fade",e.beatFade),ln(t,"fa-flash",e.flash),ln(t,"fa-spin-pulse",e.spinPulse),ln(t,"fa-spin-reverse",e.spinReverse),t);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function ov(e){if(e&&Au(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(tu.icon)return tu.icon(e);if(e===null)return null;if(Au(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}var Ee=i.defineComponent({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(t){return[!0,!1,"horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(Number.parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(t,n){var r=n.attrs,a=i.computed(function(){return ov(t.icon)}),A=i.computed(function(){return Yi("classes",cU(t))}),s=i.computed(function(){return Yi("transform",typeof t.transform=="string"?tu.transform(t.transform):t.transform)}),o=i.computed(function(){return Yi("mask",ov(t.mask))}),l=i.computed(function(){return vF(a.value,Xn(Xn(Xn(Xn({},A.value),s.value),o.value),{},{symbol:t.symbol,title:t.title}))});i.watch(l,function(u){if(!u)return lU("Could not find one or more icon(s)",a.value,o.value)},{immediate:!0});var c=i.computed(function(){return l.value?mg(l.value.abstract[0],{},r):null});return function(){return c.value}}});i.defineComponent({name:"FontAwesomeLayers",props:{fixedWidth:{type:Boolean,default:!1}},setup:function(t,n){var r=n.slots,a=Tw.familyPrefix,A=i.computed(function(){return["".concat(a,"-layers")].concat(Uh(t.fixedWidth?["".concat(a,"-fw")]:[]))});return function(){return i.h("div",{class:A.value},r.default?r.default():[])}}});i.defineComponent({name:"FontAwesomeLayersText",props:{value:{type:[String,Number],default:""},transform:{type:[String,Object],default:null},counter:{type:Boolean,default:!1},position:{type:String,default:null,validator:function(t){return["bottom-left","bottom-right","top-left","top-right"].indexOf(t)>-1}}},setup:function(t,n){var r=n.attrs,a=Tw.familyPrefix,A=i.computed(function(){return Yi("classes",[].concat(Uh(t.counter?["".concat(a,"-layers-counter")]:[]),Uh(t.position?["".concat(a,"-layers-").concat(t.position)]:[])))}),s=i.computed(function(){return Yi("transform",typeof t.transform=="string"?tu.transform(t.transform):t.transform)}),o=i.computed(function(){var c=BF(t.value.toString(),Xn(Xn({},s.value),A.value)),u=c.abstract;return t.counter&&(u[0].attributes.class=u[0].attributes.class.replace("fa-layers-text","")),u[0]}),l=i.computed(function(){return mg(o.value,{},r)});return function(){return l.value}}});const uU={class:"card-slice"},dU={key:0,class:"mana-hexagon"},fU={class:"mana-number"},hU={class:"card-name"},pU={key:1,class:"quantity"},gU={class:"quantity-background"},mU={class:"num-quantity"},vU={class:"plus-minus-content"},BU={class:"plus-minus-quantity"},yU=i.defineComponent({__name:"CardSliceItem",props:YI,emits:["update:card-quantity"],setup(e,{emit:t}){const n=e,r=Ko(n.cardProp,n.cardCodeProp,!1),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.ref(null),l=i.computed(()=>{let d=n.color;return!d&&r.value&&(d=vA(r.value,null,!0)),d||(d="var(--color-background-2-rgb)"),{"--color":d}}),c=i.computed(()=>r.value?xe().callbacks.cardImageCallback(r.value.cardCode,Bt.Slice):""),u=i.computed(()=>{const d=["card-slice-wrapper"];return n.maintainAspectRatio&&d.push("maintain-aspect-ratio"),d});return i.onMounted(()=>{n.ignoreCardItem||et(a.value,{content:s.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:d=>{const f=d.popper.innerHTML.includes("right")?"right-start":"left-start";o.value=f},onHidden:()=>{o.value=null}})}),(d,f)=>{const h=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(h,{to:n.routerLink},{default:i.withCtx(()=>{var p,m;return[i.createElementVNode("div",{ref_key:"cardSlice",ref:a,class:i.normalizeClass(u.value)},[i.createElementVNode("div",uU,[i.createElementVNode("div",{class:"card-image",style:i.normalizeStyle({backgroundImage:`url(${c.value})`})},null,4),i.createElementVNode("div",{class:"region-gradient",style:i.normalizeStyle(l.value)},null,4),i.unref(r)||n.manaNumber!==void 0&&n.manaNumber!==null?(i.openBlock(),i.createElementBlock("div",dU,[i.createVNode(qo,{class:"hexagon-icon"}),i.createElementVNode("div",fU,i.toDisplayString(n.manaNumber??((p=i.unref(r))==null?void 0:p.cost)),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",hU,i.toDisplayString(n.name??((m=i.unref(r))==null?void 0:m.name)),1),n.quantityNumber!==void 0&&n.quantityNumber!==null?(i.openBlock(),i.createElementBlock("div",pU,[i.createElementVNode("div",gU,[i.createElementVNode("p",mU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0),n.showPlusMinus?(i.openBlock(),i.createElementBlock("div",{key:2,class:"plus-minus",onClick:f[2]||(f[2]=i.withModifiers(()=>{},["prevent"]))},[i.createElementVNode("div",vU,[i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[0]||(f[0]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:-1})},["prevent"]))},[i.createVNode(i.unref(Ee),{icon:"minus",class:"icon"})]),i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[1]||(f[1]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:1})},["prevent"]))},[i.createVNode(i.unref(Ee),{icon:"plus",class:"icon"})]),i.createElementVNode("div",BU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0)])],2),i.createElementVNode("div",{ref_key:"cardItemWrapper",ref:s,class:"card-item-container"},[i.unref(r)&&!d.ignoreCardItem?(i.openBlock(),i.createBlock(za,{key:0,ref_key:"cardItem",ref:A,"is-root":!0,"card-prop":i.unref(r),"quantity-needed":n.quantityNumber,"show-tippy-location":o.value,class:"card-image-hover"},null,8,["card-prop","quantity-needed","show-tippy-location"])):i.createCommentVNode("",!0)],512)]}),_:1},8,["to"])}}});const hn=M(yU,[["__scopeId","data-v-3c0e2952"]]);function ur(e){return[null,void 0].indexOf(e)!==-1}function wU(e,t,n){const{object:r,valueProp:a,mode:A}=i.toRefs(e),s=i.getCurrentInstance().proxy,o=n.iv,l=(d,f=!0)=>{o.value=u(d);const h=c(d);t.emit("change",h,s),f&&(t.emit("input",h),t.emit("update:modelValue",h))},c=d=>r.value||ur(d)?d:Array.isArray(d)?d.map(f=>f[a.value]):d[a.value],u=d=>ur(d)?A.value==="single"?{}:[]:d;return{update:l}}function bU(e,t){const{value:n,modelValue:r,mode:a,valueProp:A}=i.toRefs(e),s=i.ref(a.value!=="single"?[]:{}),o=r&&r.value!==void 0?r:n,l=i.computed(()=>a.value==="single"?s.value[A.value]:s.value.map(u=>u[A.value])),c=i.computed(()=>a.value!=="single"?s.value.map(u=>u[A.value]).join(","):s.value[A.value]);return{iv:s,internalValue:s,ev:o,externalValue:o,textValue:c,plainValue:l}}function _U(e,t,n){const{regex:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=n.isOpen,s=n.open,o=i.ref(null),l=i.ref(null),c=()=>{o.value=""},u=h=>{o.value=h.target.value},d=h=>{if(r&&r.value){let p=r.value;typeof p=="string"&&(p=new RegExp(p)),h.key.match(p)||h.preventDefault()}},f=h=>{if(r&&r.value){let m=(h.clipboardData||window.clipboardData).getData("Text"),y=r.value;typeof y=="string"&&(y=new RegExp(y)),m.split("").every(g=>!!g.match(y))||h.preventDefault()}t.emit("paste",h,a)};return i.watch(o,h=>{!A.value&&h&&s(),t.emit("search-change",h,a)}),{search:o,input:l,clearSearch:c,handleSearchInput:u,handleKeypress:d,handlePaste:f}}function CU(e,t,n){const{groupSelect:r,mode:a,groups:A,disabledProp:s}=i.toRefs(e),o=i.ref(null),l=u=>{u===void 0||u!==null&&u[s.value]||A.value&&u&&u.group&&(a.value==="single"||!r.value)||(o.value=u)};return{pointer:o,setPointer:l,clearPointer:()=>{l(null)}}}function uf(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function kU(e){return Object.prototype.toString.call(e)==="[object Object]"}function EU(e,t){const n=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(r,a){return r===n[a]})}function SU(e,t,n){const{options:r,mode:a,trackBy:A,limit:s,hideSelected:o,createTag:l,createOption:c,label:u,appendNewTag:d,appendNewOption:f,multipleLabel:h,object:p,loading:m,delay:y,resolveOnLoad:g,minChars:v,filterResults:_,clearOnSearch:B,clearOnSelect:w,valueProp:b,allowAbsent:C,groupLabel:E,canDeselect:S,max:T,strict:U,closeOnSelect:F,closeOnDeselect:Q,groups:Y,reverse:X,infinite:j,groupOptions:K,groupHideEmpty:oe,groupSelect:$,onCreate:Ae,disabledProp:ce,searchStart:me,searchFilter:ke}=i.toRefs(e),fe=i.getCurrentInstance().proxy,re=n.iv,N=n.ev,te=n.search,He=n.clearSearch,lt=n.update,It=n.pointer,yt=n.clearPointer,Tn=n.focus,x=n.deactivate,k=n.close,D=n.localize,W=i.ref([]),ie=i.ref([]),he=i.ref(!1),Ut=i.ref(null),pt=i.ref(j.value&&s.value===-1?10:s.value),yn=i.computed(()=>l.value||c.value||!1),We=i.computed(()=>d.value!==void 0?d.value:f.value!==void 0?f.value:!0),O=i.computed(()=>{if(Y.value){let I=nt.value||[],G=[];return I.forEach(Ie=>{Wd(Ie[K.value]).forEach(wt=>{G.push(Object.assign({},wt,Ie[ce.value]?{[ce.value]:!0}:{}))})}),G}else{let I=Wd(ie.value||[]);return W.value.length&&(I=I.concat(W.value)),I}}),P=i.computed(()=>{let I=O.value;return X.value&&(I=I.reverse()),ua.value.length&&(I=ua.value.concat(I)),$d(I)}),tt=i.computed(()=>{let I=P.value;return pt.value>0&&(I=I.slice(0,pt.value)),I}),nt=i.computed(()=>{if(!Y.value)return[];let I=[],G=ie.value||[];return W.value.length&&I.push({[E.value]:" ",[K.value]:[...W.value],__CREATE__:!0}),I.concat(G)}),sr=i.computed(()=>{let I=[...nt.value].map(G=>({...G}));return ua.value.length&&(I[0]&&I[0].__CREATE__?I[0][K.value]=[...ua.value,...I[0][K.value]]:I=[{[E.value]:" ",[K.value]:[...ua.value],__CREATE__:!0}].concat(I)),I}),Dn=i.computed(()=>{if(!Y.value)return[];let I=sr.value;return ok((I||[]).map((G,Ie)=>{const wt=Wd(G[K.value]);return{...G,index:Ie,group:!0,[K.value]:$d(wt,!1).map(di=>Object.assign({},di,G[ce.value]?{[ce.value]:!0}:{})),__VISIBLE__:$d(wt).map(di=>Object.assign({},di,G[ce.value]?{[ce.value]:!0}:{}))}}))}),Ln=i.computed(()=>{switch(a.value){case"single":return!ur(re.value[b.value]);case"multiple":case"tags":return!ur(re.value)&&re.value.length>0}}),jn=i.computed(()=>h!==void 0&&h.value!==void 0?h.value(re.value,fe):re.value&&re.value.length>1?`${re.value.length} options selected`:"1 option selected"),li=i.computed(()=>!O.value.length&&!he.value&&!ua.value.length),es=i.computed(()=>O.value.length>0&&tt.value.length==0&&(te.value&&Y.value||!Y.value)),ua=i.computed(()=>yn.value===!1||!te.value?[]:Ak(te.value)!==-1?[]:[{[b.value]:te.value,[L.value]:te.value,[u.value]:te.value,__CREATE__:!0}]),L=i.computed(()=>A.value||u.value),ae=i.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),ue=i.computed(()=>m.value||he.value),Fe=I=>{switch(typeof I!="object"&&(I=Ur(I)),a.value){case"single":lt(I);break;case"multiple":case"tags":lt(re.value.concat(I));break}t.emit("select",Ot(I),I,fe)},ye=I=>{switch(typeof I!="object"&&(I=Ur(I)),a.value){case"single":ci();break;case"tags":case"multiple":lt(Array.isArray(I)?re.value.filter(G=>I.map(Ie=>Ie[b.value]).indexOf(G[b.value])===-1):re.value.filter(G=>G[b.value]!=I[b.value]));break}t.emit("deselect",Ot(I),I,fe)},Ot=I=>p.value?I:I[b.value],Zt=I=>{ye(I)},da=(I,G)=>{if(G.button!==0){G.preventDefault();return}Zt(I)},ci=()=>{t.emit("clear",fe),lt(ae.value)},Rt=I=>{if(I.group!==void 0)return a.value==="single"?!1:ak(I[K.value])&&I[K.value].length;switch(a.value){case"single":return!ur(re.value)&&re.value[b.value]==I[b.value];case"tags":case"multiple":return!ur(re.value)&&re.value.map(G=>G[b.value]).indexOf(I[b.value])!==-1}},iA=I=>I[ce.value]===!0,fa=()=>T===void 0||T.value===-1||!Ln.value&&T.value>0?!1:re.value.length>=T.value,ha=I=>{if(!iA(I)){if(Ae&&Ae.value&&!Rt(I)&&I.__CREATE__&&(I={...I},delete I.__CREATE__,I=Ae.value(I,fe),I instanceof Promise)){he.value=!0,I.then(G=>{he.value=!1,wl(G)});return}wl(I)}},wl=I=>{switch(I.__CREATE__&&(I={...I},delete I.__CREATE__),a.value){case"single":if(I&&Rt(I)){S.value&&ye(I),Q.value&&(yt(),k());return}I&&pa(I),w.value&&He(),F.value&&(yt(),k()),I&&Fe(I);break;case"multiple":if(I&&Rt(I)){ye(I),Q.value&&(yt(),k());return}if(fa()){t.emit("max",fe);return}I&&(pa(I),Fe(I)),w.value&&He(),o.value&&yt(),F.value&&k();break;case"tags":if(I&&Rt(I)){ye(I),Q.value&&(yt(),k());return}if(fa()){t.emit("max",fe);return}I&&pa(I),w.value&&He(),I&&Fe(I),o.value&&yt(),F.value&&k();break}F.value||Tn()},ui=I=>{if(!(iA(I)||a.value==="single"||!$.value)){switch(a.value){case"multiple":case"tags":rk(I[K.value])?ye(I[K.value]):Fe(I[K.value].filter(G=>re.value.map(Ie=>Ie[b.value]).indexOf(G[b.value])===-1).filter(G=>!G[ce.value]).filter((G,Ie)=>re.value.length+1+Ie<=T.value||T.value===-1));break}F.value&&x()}},pa=I=>{Ur(I[b.value])===void 0&&yn.value&&(t.emit("tag",I[b.value],fe),t.emit("option",I[b.value],fe),t.emit("create",I[b.value],fe),We.value&&ik(I),He())},nk=()=>{a.value!=="single"&&Fe(tt.value.filter(I=>!I.disabled&&!Rt(I)))},rk=I=>I.find(G=>!Rt(G)&&!G[ce.value])===void 0,ak=I=>I.find(G=>!Rt(G))===void 0,Ur=I=>O.value[O.value.map(G=>String(G[b.value])).indexOf(String(I))],Ak=(I,G=!0)=>O.value.map(Ie=>parseInt(Ie[L.value])==Ie[L.value]?parseInt(Ie[L.value]):Ie[L.value]).indexOf(parseInt(I)==I?parseInt(I):I),sk=I=>["tags","multiple"].indexOf(a.value)!==-1&&o.value&&Rt(I),ik=I=>{W.value.push(I)},ok=I=>oe.value?I.filter(G=>te.value?G.__VISIBLE__.length:G[K.value].length):I.filter(G=>te.value?G.__VISIBLE__.length:!0),$d=(I,G=!0)=>{let Ie=I;if(te.value&&_.value){let wt=ke.value;wt||(wt=(di,zoe)=>{let x1=uf(D(di[L.value]),U.value);return me.value?x1.startsWith(uf(te.value,U.value)):x1.indexOf(uf(te.value,U.value))!==-1}),Ie=Ie.filter(wt)}return o.value&&G&&(Ie=Ie.filter(wt=>!sk(wt))),Ie},Wd=I=>{let G=I;return kU(G)&&(G=Object.keys(G).map(Ie=>{let wt=G[Ie];return{[b.value]:Ie,[L.value]:wt,[u.value]:wt}})),G=G.map(Ie=>typeof Ie=="object"?Ie:{[b.value]:Ie,[L.value]:Ie,[u.value]:Ie}),G},bl=()=>{ur(N.value)||(re.value=Cl(N.value))},_l=I=>(he.value=!0,new Promise((G,Ie)=>{r.value(te.value,fe).then(wt=>{ie.value=wt||[],typeof I=="function"&&I(wt),he.value=!1}).catch(wt=>{console.error(wt),ie.value=[],he.value=!1}).finally(()=>{G()})})),Gd=()=>{if(Ln.value)if(a.value==="single"){let I=Ur(re.value[b.value]);if(I!==void 0){let G=I[u.value];re.value[u.value]=G,p.value&&(N.value[u.value]=G)}}else re.value.forEach((I,G)=>{let Ie=Ur(re.value[G][b.value]);if(Ie!==void 0){let wt=Ie[u.value];re.value[G][u.value]=wt,p.value&&(N.value[G][u.value]=wt)}})},lk=I=>{_l(I)},Cl=I=>ur(I)?a.value==="single"?{}:[]:p.value?I:a.value==="single"?Ur(I)||(C.value?{[u.value]:I,[b.value]:I,[L.value]:I}:{}):I.filter(G=>!!Ur(G)||C.value).map(G=>Ur(G)||{[u.value]:G,[b.value]:G,[L.value]:G}),S1=()=>{Ut.value=i.watch(te,I=>{I.length<v.value||!I&&v.value!==0||(he.value=!0,B.value&&(ie.value=[]),setTimeout(()=>{I==te.value&&r.value(te.value,fe).then(G=>{(I==te.value||!te.value)&&(ie.value=G,It.value=tt.value.filter(Ie=>Ie[ce.value]!==!0)[0]||null,he.value=!1)}).catch(G=>{console.error(G)})},y.value))},{flush:"sync"})};if(a.value!=="single"&&!ur(N.value)&&!Array.isArray(N.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return r&&typeof r.value=="function"?g.value?_l(bl):p.value==!0&&bl():(ie.value=r.value,bl()),y.value>-1&&S1(),i.watch(y,(I,G)=>{Ut.value&&Ut.value(),I>=0&&S1()}),i.watch(N,I=>{if(ur(I)){lt(Cl(I),!1);return}switch(a.value){case"single":(p.value?I[b.value]!=re.value[b.value]:I!=re.value[b.value])&&lt(Cl(I),!1);break;case"multiple":case"tags":EU(p.value?I.map(G=>G[b.value]):I,re.value.map(G=>G[b.value]))||lt(Cl(I),!1);break}},{deep:!0}),i.watch(r,(I,G)=>{typeof e.options=="function"?g.value&&(!G||I&&I.toString()!==G.toString())&&_l():(ie.value=e.options,Object.keys(re.value).length||bl(),Gd())}),i.watch(u,Gd),{pfo:P,fo:tt,filteredOptions:tt,hasSelected:Ln,multipleLabelText:jn,eo:O,extendedOptions:O,eg:nt,extendedGroups:nt,fg:Dn,filteredGroups:Dn,noOptions:li,noResults:es,resolving:he,busy:ue,offset:pt,select:Fe,deselect:ye,remove:Zt,selectAll:nk,clear:ci,isSelected:Rt,isDisabled:iA,isMax:fa,getOption:Ur,handleOptionClick:ha,handleGroupClick:ui,handleTagRemove:da,refreshOptions:lk,resolveOptions:_l,refreshLabels:Gd}}function xU(e,t,n){const{valueProp:r,showOptions:a,searchable:A,groupLabel:s,groups:o,mode:l,groupSelect:c,disabledProp:u,groupOptions:d}=i.toRefs(e),f=n.fo,h=n.fg,p=n.handleOptionClick,m=n.handleGroupClick,y=n.search,g=n.pointer,v=n.setPointer,_=n.clearPointer,B=n.multiselect,w=n.isOpen,b=i.computed(()=>f.value.filter(N=>!N[u.value])),C=i.computed(()=>h.value.filter(N=>!N[u.value])),E=i.computed(()=>l.value!=="single"&&c.value),S=i.computed(()=>g.value&&g.value.group),T=i.computed(()=>fe(g.value)),U=i.computed(()=>{const N=S.value?g.value:fe(g.value),te=C.value.map(lt=>lt[s.value]).indexOf(N[s.value]);let He=C.value[te-1];return He===void 0&&(He=Q.value),He}),F=i.computed(()=>{let N=C.value.map(te=>te.label).indexOf(S.value?g.value[s.value]:fe(g.value)[s.value])+1;return C.value.length<=N&&(N=0),C.value[N]}),Q=i.computed(()=>[...C.value].slice(-1)[0]),Y=i.computed(()=>g.value.__VISIBLE__.filter(N=>!N[u.value])[0]),X=i.computed(()=>{const N=T.value.__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])-1]}),j=i.computed(()=>{const N=fe(g.value).__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])+1]}),K=i.computed(()=>[...U.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),oe=i.computed(()=>[...Q.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),$=N=>g.value&&(!N.group&&g.value[r.value]===N[r.value]||N.group!==void 0&&g.value[s.value]===N[s.value])?!0:void 0,Ae=()=>{v(b.value[0]||null)},ce=()=>{!g.value||g.value[u.value]===!0||(S.value?m(g.value):p(g.value))},me=()=>{if(g.value===null)v((o.value&&E.value?C.value[0].__CREATE__?b.value[0]:C.value[0]:b.value[0])||null);else if(o.value&&E.value){let N=S.value?Y.value:j.value;N===void 0&&(N=F.value,N.__CREATE__&&(N=N[d.value][0])),v(N||null)}else{let N=b.value.map(te=>te[r.value]).indexOf(g.value[r.value])+1;b.value.length<=N&&(N=0),v(b.value[N]||null)}i.nextTick(()=>{re()})},ke=()=>{if(g.value===null){let N=b.value[b.value.length-1];o.value&&E.value&&(N=oe.value,N===void 0&&(N=Q.value)),v(N||null)}else if(o.value&&E.value){let N=S.value?K.value:X.value;N===void 0&&(N=S.value?U.value:T.value,N.__CREATE__&&(N=K.value,N===void 0&&(N=U.value))),v(N||null)}else{let N=b.value.map(te=>te[r.value]).indexOf(g.value[r.value])-1;N<0&&(N=b.value.length-1),v(b.value[N]||null)}i.nextTick(()=>{re()})},fe=N=>C.value.find(te=>te.__VISIBLE__.map(He=>He[r.value]).indexOf(N[r.value])!==-1),re=()=>{let N=B.value.querySelector("[data-pointed]");if(!N)return;let te=N.parentElement.parentElement;o.value&&(te=S.value?N.parentElement.parentElement.parentElement:N.parentElement.parentElement.parentElement.parentElement),N.offsetTop+N.offsetHeight>te.clientHeight+te.scrollTop&&(te.scrollTop=N.offsetTop+N.offsetHeight-te.clientHeight),N.offsetTop<te.scrollTop&&(te.scrollTop=N.offsetTop)};return i.watch(y,N=>{A.value&&(N.length&&a.value?Ae():_())}),i.watch(w,N=>{if(N){let te=B.value.querySelectorAll("[data-selected]")[0];if(!te)return;let He=te.parentElement.parentElement;i.nextTick(()=>{He.scrollTop>0||(He.scrollTop=te.offsetTop)})}}),{pointer:g,canPointGroups:E,isPointed:$,setPointerFirst:Ae,selectPointer:ce,forwardPointer:me,backwardPointer:ke}}function FU(e,t,n){const{disabled:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=i.ref(!1);return{isOpen:A,open:()=>{A.value||r.value||(A.value=!0,t.emit("open",a))},close:()=>{A.value&&(A.value=!1,t.emit("close",a))}}}function IU(e,t,n){const{searchable:r,disabled:a,clearOnBlur:A}=i.toRefs(e),s=n.input,o=n.open,l=n.close,c=n.clearSearch,u=n.isOpen,d=i.ref(null),f=i.ref(null),h=i.ref(null),p=i.ref(!1),m=i.ref(!1),y=i.computed(()=>r.value||a.value?-1:0),g=()=>{r.value&&s.value.blur(),f.value.blur()},v=()=>{r.value&&!a.value&&s.value.focus()},_=(S=!0)=>{a.value||(p.value=!0,S&&o())},B=()=>{p.value=!1,setTimeout(()=>{p.value||(l(),A.value&&c())},1)};return{multiselect:d,wrapper:f,tags:h,tabindex:y,isActive:p,mouseClicked:m,blur:g,focus:v,activate:_,deactivate:B,handleFocusIn:S=>{S.target.closest("[data-tags]")&&S.target.nodeName!=="INPUT"||S.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{B()},handleCaretClick:()=>{B(),g()},handleMousedown:S=>{m.value=!0,u.value&&(S.target.isEqualNode(f.value)||S.target.isEqualNode(h.value))?setTimeout(()=>{B()},0):document.activeElement.isEqualNode(f.value)&&!u.value&&_(),setTimeout(()=>{m.value=!1},0)}}}function UU(e,t,n){const{mode:r,addTagOn:a,openDirection:A,searchable:s,showOptions:o,valueProp:l,groups:c,addOptionOn:u,createTag:d,createOption:f,reverse:h}=i.toRefs(e),p=i.getCurrentInstance().proxy,m=n.iv,y=n.update,g=n.search,v=n.setPointer,_=n.selectPointer,B=n.backwardPointer,w=n.forwardPointer,b=n.multiselect,C=n.wrapper,E=n.tags,S=n.isOpen,T=n.open,U=n.blur,F=n.fo,Q=i.computed(()=>d.value||f.value||!1),Y=i.computed(()=>a.value!==void 0?a.value:u.value!==void 0?u.value:["enter"]),X=()=>{r.value==="tags"&&!o.value&&Q.value&&s.value&&!c.value&&v(F.value[F.value.map($=>$[l.value]).indexOf(g.value)])},j=$=>{let Ae=$.length-1;for(;Ae>=0&&($[Ae].remove===!1||$[Ae].disabled);)Ae--;return Ae<0||$.splice(Ae,1),$};return{handleKeydown:$=>{t.emit("keydown",$,p);let Ae,ce;switch(["ArrowLeft","ArrowRight","Enter"].indexOf($.key)!==-1&&r.value==="tags"&&(Ae=[...b.value.querySelectorAll("[data-tags] > *")].filter(me=>me!==E.value),ce=Ae.findIndex(me=>me===document.activeElement)),$.key){case"Backspace":if(r.value==="single"||s.value&&[null,""].indexOf(g.value)===-1||m.value.length===0)return;y(j([...m.value]));break;case"Enter":if($.preventDefault(),$.keyCode===229)return;if(ce!==-1&&ce!==void 0){y([...m.value].filter((me,ke)=>ke!==ce)),ce===Ae.length-1&&(Ae.length-1?Ae[Ae.length-2].focus():s.value?E.value.querySelector("input").focus():C.value.focus());return}if(Y.value.indexOf("enter")===-1&&Q.value)return;X(),_();break;case" ":if(!Q.value&&!s.value){$.preventDefault(),X(),_();return}if(!Q.value)return!1;if(Y.value.indexOf("space")===-1&&Q.value)return;$.preventDefault(),X(),_();break;case"Tab":case";":case",":if(Y.value.indexOf($.key.toLowerCase())===-1||!Q.value)return;X(),_(),$.preventDefault();break;case"Escape":U();break;case"ArrowUp":if($.preventDefault(),!o.value)return;S.value||T(),B();break;case"ArrowDown":if($.preventDefault(),!o.value)return;S.value||T(),w();break;case"ArrowLeft":if(s.value&&E.value&&E.value.querySelector("input").selectionStart||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ce===-1?Ae[Ae.length-1].focus():ce>0&&Ae[ce-1].focus();break;case"ArrowRight":if(ce===-1||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),Ae.length>ce+1?Ae[ce+1].focus():s.value?E.value.querySelector("input").focus():s.value||C.value.focus();break}},handleKeyup:$=>{t.emit("keyup",$,p)},preparePointer:X}}function QU(e,t,n){const{classes:r,disabled:a,openDirection:A,showOptions:s}=i.toRefs(e),o=n.isOpen,l=n.isPointed,c=n.isSelected,u=n.isDisabled,d=n.isActive,f=n.canPointGroups,h=n.resolving,p=n.fo,m=i.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),y=i.computed(()=>!!(o.value&&s.value&&(!h.value||h.value&&p.value.length)));return{classList:i.computed(()=>{const v=m.value;return{container:[v.container].concat(a.value?v.containerDisabled:[]).concat(y.value&&A.value==="top"?v.containerOpenTop:[]).concat(y.value&&A.value!=="top"?v.containerOpen:[]).concat(d.value?v.containerActive:[]),wrapper:v.wrapper,spacer:v.spacer,singleLabel:v.singleLabel,singleLabelText:v.singleLabelText,multipleLabel:v.multipleLabel,search:v.search,tags:v.tags,tag:[v.tag].concat(a.value?v.tagDisabled:[]),tagDisabled:v.tagDisabled,tagRemove:v.tagRemove,tagRemoveIcon:v.tagRemoveIcon,tagsSearchWrapper:v.tagsSearchWrapper,tagsSearch:v.tagsSearch,tagsSearchCopy:v.tagsSearchCopy,placeholder:v.placeholder,caret:[v.caret].concat(o.value?v.caretOpen:[]),clear:v.clear,clearIcon:v.clearIcon,spinner:v.spinner,inifinite:v.inifinite,inifiniteSpinner:v.inifiniteSpinner,dropdown:[v.dropdown].concat(A.value==="top"?v.dropdownTop:[]).concat(!o.value||!s.value||!y.value?v.dropdownHidden:[]),options:[v.options].concat(A.value==="top"?v.optionsTop:[]),group:v.group,groupLabel:_=>{let B=[v.groupLabel];return l(_)?B.push(c(_)?v.groupLabelSelectedPointed:v.groupLabelPointed):c(_)&&f.value?B.push(u(_)?v.groupLabelSelectedDisabled:v.groupLabelSelected):u(_)&&B.push(v.groupLabelDisabled),f.value&&B.push(v.groupLabelPointable),B},groupOptions:v.groupOptions,option:(_,B)=>{let w=[v.option];return l(_)?w.push(c(_)?v.optionSelectedPointed:v.optionPointed):c(_)?w.push(u(_)?v.optionSelectedDisabled:v.optionSelected):(u(_)||B&&u(B))&&w.push(v.optionDisabled),w},noOptions:v.noOptions,noResults:v.noResults,assist:v.assist,fakeInput:v.fakeInput}}),showDropdown:y}}function TU(e,t,n){const{limit:r,infinite:a}=i.toRefs(e),A=n.isOpen,s=n.offset,o=n.search,l=n.pfo,c=n.eo,u=i.ref(null),d=i.ref(null),f=i.computed(()=>s.value<l.value.length),h=m=>{const{isIntersecting:y,target:g}=m[0];if(y){const v=g.offsetParent,_=v.scrollTop;s.value+=r.value==-1?10:r.value,i.nextTick(()=>{v.scrollTop=_})}},p=()=>{A.value&&s.value<l.value.length?u.value.observe(d.value):!A.value&&u.value&&u.value.disconnect()};return i.watch(A,()=>{a.value&&p()}),i.watch(o,()=>{a.value&&(s.value=r.value,p())},{flush:"post"}),i.watch(c,()=>{a.value&&p()},{immediate:!1,flush:"post"}),i.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(h))}),{hasMore:f,infiniteLoader:d}}function DU(e,t,n){const{placeholder:r,id:a,valueProp:A,label:s,mode:o,groupLabel:l,aria:c,searchable:u}=i.toRefs(e),d=n.pointer,f=n.iv,h=n.hasSelected,p=n.multipleLabelText,m=i.ref(null),y=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("assist"),F.join("-")}),g=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("multiselect-options"),F.join("-")}),v=i.computed(()=>{let F=[];if(a&&a.value&&F.push(a.value),d.value)return F.push(d.value.group?"multiselect-group":"multiselect-option"),F.push(d.value.group?d.value.index:d.value[A.value]),F.join("-")}),_=i.computed(()=>r.value),B=i.computed(()=>o.value!=="single"),w=i.computed(()=>{let F="";return o.value==="single"&&h.value&&(F+=f.value[s.value]),o.value==="multiple"&&h.value&&(F+=p.value),o.value==="tags"&&h.value&&(F+=f.value.map(Q=>Q[s.value]).join(", ")),F}),b=i.computed(()=>{let F={...c.value};return u.value&&(F["aria-labelledby"]=F["aria-labelledby"]?`${y.value} ${F["aria-labelledby"]}`:y.value,w.value&&F["aria-label"]&&(F["aria-label"]=`${w.value}, ${F["aria-label"]}`)),F}),C=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-option"),Q.push(F[A.value]),Q.join("-")},E=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-group"),Q.push(F.index),Q.join("-")},S=F=>{let Q=[];return Q.push(F),Q.join(" ")},T=F=>{let Q=[];return Q.push(F),Q.join(" ")},U=F=>`${F} ❎`;return i.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let F=document.querySelector(`[for="${a.value}"]`);m.value=F?F.innerText:null}}),{arias:b,ariaLabel:w,ariaAssist:y,ariaControls:g,ariaPlaceholder:_,ariaMultiselectable:B,ariaActiveDescendant:v,ariaOptionId:C,ariaOptionLabel:S,ariaGroupId:E,ariaGroupLabel:T,ariaTagLabel:U}}function LU(e,t,n){const{locale:r,fallbackLocale:a}=i.toRefs(e);return{localize:s=>!s||typeof s!="object"?s:s&&s[r.value]?s[r.value]:s&&r.value&&s[r.value.toUpperCase()]?s[r.value.toUpperCase()]:s&&s[a.value]?s[a.value]:s&&a.value&&s[a.value.toUpperCase()]?s[a.value.toUpperCase()]:s&&Object.keys(s)[0]?s[Object.keys(s)[0]]:""}}function OU(e,t,n,r={}){return n.forEach(a=>{a&&(r={...r,...a(e,t,r)})}),r}var $t={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(e,t){return OU(e,t,[LU,bU,CU,FU,_U,wU,IU,SU,TU,xU,UU,QU,DU])}};const MU=["id","dir"],NU=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],PU=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],HU=["onKeyup","aria-label"],RU=["onClick"],VU=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],KU=["innerHTML"],$U=["id"],WU=["id","aria-label","aria-selected"],GU=["data-pointed","onMouseenter","onClick"],zU=["innerHTML"],jU=["aria-label"],YU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],qU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],XU=["innerHTML"],JU=["innerHTML"],ZU=["value"],eQ=["name","value"],tQ=["name","value"],nQ=["id"];function rQ(e,t,n,r,a,A){return i.openBlock(),i.createElementBlock("div",{ref:"multiselect",class:i.normalizeClass(e.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:t[10]||(t[10]=(...s)=>e.handleFocusIn&&e.handleFocusIn(...s)),onFocusout:t[11]||(t[11]=(...s)=>e.handleFocusOut&&e.handleFocusOut(...s)),onKeyup:t[12]||(t[12]=(...s)=>e.handleKeyup&&e.handleKeyup(...s)),onKeydown:t[13]||(t[13]=(...s)=>e.handleKeydown&&e.handleKeydown(...s))},[i.createElementVNode("div",i.mergeProps({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...s)=>e.handleMousedown&&e.handleMousedown(...s)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":n.searchable?void 0:e.ariaControls,"aria-placeholder":n.searchable?void 0:e.ariaPlaceholder,"aria-expanded":n.searchable?void 0:e.isOpen,"aria-activedescendant":n.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:e.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:e.arias),[i.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:t[0]||(t[0]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[1]||(t[1]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[2]||(t[2]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,PU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(e.classList.tags),"data-tags":""},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.iv,(s,o,l)=>i.renderSlot(e.$slots,"tag",{option:s,handleTagRemove:e.handleTagRemove,disabled:n.disabled},()=>[(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass([e.classList.tag,s.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:i.withKeys(c=>e.handleTagRemove(s,c),["enter"]),key:l,"aria-label":e.ariaTagLabel(e.localize(s[n.label]))},[i.createTextVNode(i.toDisplayString(e.localize(s[n.label]))+" ",1),!n.disabled&&!s.disabled?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(e.classList.tagRemove),onClick:i.withModifiers(c=>e.handleTagRemove(s,c),["stop"])},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagRemoveIcon)},null,2)],10,RU)):i.createCommentVNode("v-if",!0)],42,HU))])),256)),i.createElementVNode("div",{class:i.normalizeClass(e.classList.tagsSearchWrapper),ref:"tags"},[i.createCommentVNode(" Used for measuring search width "),i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagsSearchCopy)},i.toDisplayString(e.search),3),i.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:t[3]||(t[3]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[4]||(t[4]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[5]||(t[5]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,VU)):i.createCommentVNode("v-if",!0)],2)],2)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Single label "),n.mode=="single"&&e.hasSelected&&!e.search&&e.iv?i.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.singleLabel)},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.singleLabelText)},i.toDisplayString(e.localize(e.iv[n.label])),3)],2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Multiple label "),n.mode=="multiple"&&e.hasSelected&&!e.search?i.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,KU)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Placeholder "),n.placeholder&&!e.hasSelected&&!e.search?i.renderSlot(e.$slots,"placeholder",{key:4},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.placeholder),"aria-hidden":"true"},i.toDisplayString(n.placeholder),3)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Spinner "),n.loading||e.resolving?i.renderSlot(e.$slots,"spinner",{key:5},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.spinner),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Clear "),e.hasSelected&&!n.disabled&&n.canClear&&!e.busy?i.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},()=>[i.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:i.normalizeClass(e.classList.clear),onClick:t[6]||(t[6]=(...s)=>e.clear&&e.clear(...s)),onKeyup:t[7]||(t[7]=i.withKeys((...s)=>e.clear&&e.clear(...s),["enter"]))},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.clearIcon)},null,2)],34)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Caret "),n.caret&&n.showOptions?i.renderSlot(e.$slots,"caret",{key:7},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.caret),onClick:t[8]||(t[8]=(...s)=>e.handleCaretClick&&e.handleCaretClick(...s)),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0)],16,NU),i.createCommentVNode(" Options "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.dropdown),tabindex:"-1"},[i.renderSlot(e.$slots,"beforelist",{options:e.fo}),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.options),id:e.ariaControls,role:"listbox"},[n.groups?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(e.fg,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.group),key:l,id:e.ariaGroupId(s),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),"aria-selected":e.isSelected(s),role:"option"},[s.__CREATE__?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(e.classList.groupLabel(s)),"data-pointed":e.isPointed(s),onMouseenter:c=>e.setPointer(s,o),onClick:c=>e.handleGroupClick(s)},[i.renderSlot(e.$slots,"grouplabel",{group:s,isSelected:e.isSelected,isPointed:e.isPointed},()=>[i.createElementVNode("span",{innerHTML:e.localize(s[n.groupLabel])},null,8,zU)])],42,GU)),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),role:"group"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.__VISIBLE__,(c,u,d)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(c,s)),"data-pointed":e.isPointed(c),"data-selected":e.isSelected(c)||void 0,key:d,onMouseenter:f=>e.setPointer(c),onClick:f=>e.handleOptionClick(c),id:e.ariaOptionId(c),"aria-selected":e.isSelected(c),"aria-label":e.ariaOptionLabel(e.localize(c[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:c,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(c[n.label])),1)])],42,YU))),128))],10,jU)],10,WU))),128)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.fo,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(s)),"data-pointed":e.isPointed(s),"data-selected":e.isSelected(s)||void 0,key:l,onMouseenter:c=>e.setPointer(s),onClick:c=>e.handleOptionClick(s),id:e.ariaOptionId(s),"aria-selected":e.isSelected(s),"aria-label":e.ariaOptionLabel(e.localize(s[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:s,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(s[n.label])),1)])],42,qU))),128))],10,$U),e.noOptions?i.renderSlot(e.$slots,"nooptions",{key:0},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noOptions),innerHTML:e.localize(n.noOptionsText)},null,10,XU)]):i.createCommentVNode("v-if",!0),e.noResults?i.renderSlot(e.$slots,"noresults",{key:1},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noResults),innerHTML:e.localize(n.noResultsText)},null,10,JU)]):i.createCommentVNode("v-if",!0),n.infinite&&e.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.inifinite),ref:"infiniteLoader"},[i.renderSlot(e.$slots,"infinite",{},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.inifiniteSpinner)},null,2)])],2)):i.createCommentVNode("v-if",!0),i.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),i.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(i.openBlock(),i.createElementBlock("input",{key:0,class:i.normalizeClass(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ZU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Native input support "),n.nativeSupport?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.mode=="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,eQ)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.plainValue,(s,o)=>(i.openBlock(),i.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:s,key:o},null,8,tQ))),128))],64)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Screen reader assistive text "),n.searchable&&e.hasSelected?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},i.toDisplayString(e.ariaLabel),11,nQ)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Create height for empty input "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.spacer)},null,2)],42,MU)}$t.render=rQ;$t.__file="src/Multiselect.vue";const aQ={class:"search-bar"},AQ=i.defineComponent({__name:"SearchBar",props:gb,setup(e){const t=e,{t:n}=ne(),r=i.ref(""),a=mA.useRouter();function A(o,l,c){c.clear(),c.search=r.value,a.push(l.link)}function s(o){r.value=o}return(o,l)=>(i.openBlock(),i.createElementBlock("div",aQ,[i.createVNode(i.unref($t),{placeholder:i.unref(n)("navigation.searchPlaceholder"),"value-prop":"link","clear-on-blur":!1,"clear-on-search":!1,"clear-on-select":!1,"close-on-select":!0,delay:0,"filter-results":!1,groups:!0,"min-chars":0,"resolve-on-load":!1,searchable:!0,options:t.fetchSeachResult,onOpen:l[0]||(l[0]=c=>{c.noOptions&&c.resolveOptions()}),onSearchChange:s,onSelect:A},{option:i.withCtx(({option:c})=>[c.type==="card"?(i.openBlock(),i.createBlock(hn,{key:`card-${c.card.cardCode}`,class:"card-slice-item","maintain-aspect-ratio":!0,"card-prop":c.card,"router-link":c.link},null,8,["card-prop","router-link"])):(i.openBlock(),i.createBlock(hn,{key:`player-${c.link}`,class:"card-slice-item","maintain-aspect-ratio":!0,"ignore-card-item":!0,"card-code-prop":c.cardCode,color:c.color,name:c.name,"mana-number":c.rank,"router-link":c.link},null,8,["card-code-prop","color","name","mana-number","router-link"]))]),_:1},8,["placeholder","options"])]))}});const qu=M(AQ,[["__scopeId","data-v-2dff2569"]]),sQ={class:"social-links"},iQ=i.defineComponent({__name:"SocialLinks",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",sQ,[i.createVNode(i.unref(Ee),{class:"icon",icon:"fa-brands fa-discord"}),i.createVNode(i.unref(Ee),{class:"icon",icon:"fa-brands fa-twitter"})]))}});const vg=M(iQ,[["__scopeId","data-v-5517438c"]]),oQ={showModal:{type:Boolean,required:!0,default:!1}},lQ=["onClick"],cQ=i.defineComponent({__name:"ModalItem",props:oQ,emits:["update:showModal"],setup(e,{emit:t}){const n=e,r=i.ref(null);function a(){t("update:showModal",!1)}return i.onBeforeUnmount(()=>{var A;(A=r.value)==null||A.remove()}),i.watch(()=>n.showModal,()=>{n.showModal&&i.nextTick(()=>{r.value&&document.body.appendChild(r.value)})}),(A,s)=>n.showModal?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"modalItem",ref:r,class:"modal-item",onClick:i.withModifiers(a,["self"])},[i.renderSlot(A.$slots,"default",{},void 0,!0)],8,lQ)):i.createCommentVNode("",!0)}});const $A=M(cQ,[["__scopeId","data-v-5e715d99"]]),uQ={filterArray:{type:Array,required:!1,default:void 0},title:{type:String,required:!1,default:void 0}},dQ={class:"filter"},fQ={key:0,class:"top"},hQ={key:0,class:"title"},pQ=i.defineComponent({__name:"SidePanelSectionPane",props:uQ,emits:["clear:filterArray"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterArray&&n.filterArray.length>0?"clickable":null);function a(){t("clear:filterArray")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",dQ,[n.title||A.filterArray?(i.openBlock(),i.createElementBlock("div",fQ,[n.title?(i.openBlock(),i.createElementBlock("h2",hQ,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),A.filterArray?i.withDirectives((i.openBlock(),i.createElementBlock("p",{key:1,class:i.normalizeClass(["clear",r.value]),onClick:a},null,2)),[[o,"general.clear"]]):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const gt=M(pQ,[["__scopeId","data-v-741cceed"]]),gQ={filterArray:{type:Array,required:!0,default:[]}},mQ=["placeholder"],vQ=i.defineComponent({__name:"FilterSampleSize",props:gQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.ref("");let s=setTimeout(()=>{},0);a.value.length>0&&(A.value=a.value[0]),i.watch(a,()=>{t("update:filterArray",a.value)}),i.watch(A,()=>{s&&clearTimeout(s),s=setTimeout(()=>{a.value.splice(0),A.value&&a.value.push(A.value)},1e3)});function o(){a.value.splice(0),A.value=""}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.sampleSize"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),placeholder:i.unref(r)("general.minimumMatches"),type:"number",min:"10",step:"10"},null,8,mQ),[[i.vModelText,A.value]])]),_:1},8,["filter-array","title"]))}});const Js=M(vQ,[["__scopeId","data-v-d66d5f9d"]]),BQ={filterArray:{type:Array,required:!0,default:[]}},yQ={isSelected:{type:Boolean,required:!0,default:!1},icon:{type:String,required:!1,default:void 0},prompt:{type:String,required:!0,default:""}},wQ=["selected"],bQ={class:"checkbox-name"},_Q=i.defineComponent({__name:"CheckboxItem",props:yQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e,r=i.computed(()=>(console.log(n.icon),{content:n.icon}));function a(){t("update:isSelected",!n.isSelected)}return(A,s)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:a},[n.icon?(i.openBlock(),i.createElementBlock("div",{key:0,class:"checkbox-icon",style:i.normalizeStyle(r.value)},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",bQ,i.toDisplayString(n.prompt),1)],8,wQ))}});const rn=M(_Q,[["__scopeId","data-v-ab8b99a4"]]),CQ={selectedOption:{type:Number,required:!0,default:-1},options:{type:Array,required:!0,default:[]}},kQ=e=>(i.pushScopeId("data-v-d5d9745a"),e=e(),i.popScopeId(),e),EQ={class:"toggle-switch"},SQ=kQ(()=>i.createElementVNode("div",{class:"selection"},null,-1)),xQ=[SQ],FQ=["onClick"],IQ={class:"option flex-center"},UQ={class:"option-text"},QQ=i.defineComponent({__name:"ToggleSwitch",props:CQ,emits:["update:selectedOption"],setup(e,{emit:t}){const n=e,r=i.computed(()=>({left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${n.selectedOption})`,width:`calc((100% - calc(var(--spacing-1) * 2)) / ${n.options.length})`}));function a(s){return{cursor:n.selectedOption!=s?"pointer":"default",left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${s})`,width:`${1/n.options.length*100}%`}}function A(s){t("update:selectedOption",s)}return(s,o)=>(i.openBlock(),i.createElementBlock("div",EQ,[i.withDirectives(i.createElementVNode("div",{class:"selection-container",style:i.normalizeStyle(r.value)},xQ,4),[[i.vShow,s.selectedOption>-1]]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(l,c)=>(i.openBlock(),i.createElementBlock("div",{key:c,ref_for:!0,ref:"option-container",style:i.normalizeStyle(a(c)),class:"option-container",onClick:u=>A(c)},[i.createElementVNode("div",IQ,[i.createElementVNode("h1",UQ,i.toDisplayString(l),1)])],12,FQ))),128))]))}});const Xu=M(QQ,[["__scopeId","data-v-d5d9745a"]]),TQ={class:"checkboxes-container"},DQ=i.defineComponent({__name:"FilterRanks",props:BQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.ranks.sort((c,u)=>u.order-c.order)),A=i.reactive(n.filterArray),s=i.ref(0);i.watch(A,()=>{t("update:filterArray",A)}),i.watch(s,()=>{s.value===0?A.splice(0):s.value===1&&(A.splice(0),A.push("Platinum","Diamond","Masters"))});function o(){A.splice(0),s.value=0}function l(c){const u=A.indexOf(c);if(u===-1){A.push(c);return}A.splice(u,1)}return(c,u)=>(i.openBlock(),i.createBlock(gt,{"filter-array":A,title:i.unref(r)("general.ranks"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",TQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,d=>(i.openBlock(),i.createBlock(rn,{key:d.nameRef,icon:`url(${d.icon})`,prompt:d.name,"is-selected":A.includes(d.nameRef),"onUpdate:isSelected":f=>l(d.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(Xu,{"selected-option":s.value,"onUpdate:selectedOption":u[0]||(u[0]=d=>s.value=d),options:[i.unref(r)("general.allRanks"),i.unref(r)("general.platPlus")]},null,8,["selected-option","options"])])]),_:1},8,["filter-array","title"]))}});const Bb=M(DQ,[["__scopeId","data-v-af7bc2a0"]]),LQ={filterArray:{type:Array,required:!0,default:[]}},OQ={isSelected:{type:Boolean,required:!0,default:!1},prompt:{type:Number,required:!0,default:""}},MQ=["selected"],NQ={class:"prompt"},PQ=i.defineComponent({__name:"CheckboxItemManaCost",props:OQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e;function r(){t("update:isSelected",!n.isSelected)}return(a,A)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:r},[i.createVNode(qo),i.createElementVNode("div",NQ,i.toDisplayString(n.prompt===10?"+":n.prompt),1)],8,MQ))}});const su=M(PQ,[["__scopeId","data-v-2c74c2ed"]]),HQ={class:"checkbox-rows-container"},RQ={class:"top-row checkbox-items-container"},VQ={class:"bottom-row checkbox-items-container"},KQ=i.defineComponent({__name:"FilterManaCost",props:LQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=Array(6).fill(1).map((l,c)=>c),A=Array(5).fill(1).map((l,c)=>c+6);function s(l){let c;n.filterArray.includes(l)?c=n.filterArray.filter(u=>u!==l):c=[...n.filterArray,l],t("update:filterArray",c)}function o(){t("update:filterArray",[])}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":n.filterArray,title:i.unref(r)("general.manaCost"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",HQ,[i.createElementVNode("div",RQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(a),u=>(i.openBlock(),i.createBlock(su,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))]),i.createElementVNode("div",VQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(A),u=>(i.openBlock(),i.createBlock(su,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])])]),_:1},8,["filter-array","title"]))}});const Bg=M(KQ,[["__scopeId","data-v-a94d786a"]]),$Q={filterArray:{type:Array,required:!0,default:[]}},WQ={class:"checkboxes-container"},yg=i.defineComponent({__name:"FilterRarities",props:$Q,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.rarities.filter(l=>l.nameRef!=="None")),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":A,title:i.unref(r)("general.rarities"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",WQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),GQ={filterArray:{type:Array,required:!0,default:[]}},zQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},jQ=["src"],YQ={class:"multiselect-tag-remove"},qQ=["onMousedown"],XQ=["src"],wg=i.defineComponent({__name:"FilterSets",props:GQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray);i.watch(a,()=>{t("update:filterArray",a.value)});function A(){a.value.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.sets"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),placeholder:i.unref(r)("general.sets"),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.sets,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:l,handleTagRemove:c})=>[i.createElementVNode("span",zQ,[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,jQ),i.createElementVNode("span",YQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(u=>c(l,u),["prevent"])},null,40,qQ)])])]),option:i.withCtx(({option:l})=>[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,XQ),i.createTextVNode(" "+i.toDisplayString(l.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),JQ={filterArray:{type:Array,required:!0,default:[]}},ZQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},eT=["src"],tT={class:"multiselect-tag-remove"},nT=["onMousedown"],rT=["src"],bg=i.defineComponent({__name:"FilterKeywords",props:JQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.computed(()=>we().dataJson.keywords.filter(o=>o.showInFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.keywords"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:i.unref(r)("general.keywords"),class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:c,handleTagRemove:u})=>[i.createElementVNode("span",ZQ,[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,eT),i.createElementVNode("span",tT,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(d=>u(c,d),["prevent"])},null,40,nT)])])]),option:i.withCtx(({option:c})=>[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,rT),i.createTextVNode(" "+i.toDisplayString(c.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),aT={filterArray:{type:Array,required:!0,default:[]}},AT={class:"checkboxes-container"},Zs=i.defineComponent({__name:"FilterServers",props:aT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray);i.watch(a,()=>{t("update:filterArray",a)});function A(){a.splice(0)}function s(o){const l=a.indexOf(o);if(l===-1){a.push(o);return}a.splice(l,1)}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.servers"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createElementVNode("div",AT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.servers,c=>(i.openBlock(),i.createBlock(rn,{key:c.nameRef,prompt:c.name,"is-selected":a.includes(c.nameRef),"onUpdate:isSelected":u=>s(c.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),sT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},iT={class:"checkboxes-container"},oT=i.defineComponent({__name:"FilterTime",props:sT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray),A=i.ref(null),s=i.ref(null),o=a.find(h=>h.startsWith("patch_"));o&&(A.value=o);const l=a.find(h=>h.startsWith("season_"));l&&(s.value=l);const c=i.computed(()=>n.allowZero&&a.filter(h=>h.startsWith("patch")).length>0||!n.allowZero&&a.filter(h=>!h.startsWith("patch")).length===0);i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(h,p)=>{u(h,p)}),i.watch(s,(h,p)=>{u(h,p)});function u(h,p){console.log(p,h),p&&a.splice(a.indexOf(p),1),h&&a.push(h),console.log(a)}function d(){a.splice(0),A.value=null,s.value=null}function f(h){a.splice(0),(n.allowZero||h!=="patch")&&a.push(h),h==="patch"&&A.value&&a.push(A.value),h==="season"&&s.value&&a.push(s.value)}return(h,p)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.time"),"onClear:filterArray":d},{default:i.withCtx(()=>[i.createElementVNode("div",iT,[i.createVNode(rn,{prompt:i.unref(r)("general.patch"),"is-selected":c.value,"onUpdate:isSelected":p[0]||(p[0]=m=>f("patch"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.season"),"is-selected":a.includes("season"),"onUpdate:isSelected":p[1]||(p[1]=m=>f("season"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastDays",7),"is-selected":a.includes("past7days"),"onUpdate:isSelected":p[2]||(p[2]=m=>f("past7days"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastDays",3),"is-selected":a.includes("past3days"),"onUpdate:isSelected":p[3]||(p[3]=m=>f("past3days"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastHours",24),"is-selected":a.includes("past24hours"),"onUpdate:isSelected":p[4]||(p[4]=m=>f("past24hours"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastHour"),"is-selected":a.includes("pastHour"),"onUpdate:isSelected":p[5]||(p[5]=m=>f("pastHour"))},null,8,["prompt","is-selected"]),c.value?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:A.value,"onUpdate:modelValue":p[6]||(p[6]=m=>A.value=m),options:i.unref(we)().dataJson.patches,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0),a.includes("season")?(i.openBlock(),i.createBlock(i.unref($t),{key:1,modelValue:s.value,"onUpdate:modelValue":p[7]||(p[7]=m=>s.value=m),options:i.unref(we)().dataJson.seasons,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const WA=M(oT,[["__scopeId","data-v-78ab671a"]]),lT={filterArray:{type:Array,required:!0,default:[]}},cT={cardCodes:{type:Array,required:!0,default:[]},filterCallback:{type:Function,required:!1,default:()=>!0},mode:{type:String,required:!1,default:"tags"}},uT=i.defineComponent({__name:"CardMultiselect",props:cT,emits:["update:cardCodes"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.cardCodes),A=i.computed(()=>{let s=Dw().cardJson.sort((o,l)=>o.name.localeCompare(l.name));return n.filterCallback&&(s=s.filter(n.filterCallback)),s});return i.watch(a,()=>{t("update:cardCodes",a.value)}),(s,o)=>(i.openBlock(),i.createBlock(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),class:"multiselect",placeholder:i.unref(r)("cards.cards"),mode:n.mode,options:A.value,infinite:!0,limit:10,searchable:!0,label:"name","value-prop":"cardCode"},null,8,["modelValue","placeholder","mode","options"]))}});const _g=M(uT,[["__scopeId","data-v-968634df"]]),Ju=i.defineComponent({__name:"FilterCardCodes",props:lT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray);i.watch(a,()=>{console.log("watch(filterArray)",a.value),t("update:filterArray",a.value)});function A(){a.value.splice(0)}function s(o){return o.collectible}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("cards.cards"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(_g,{cardCodes:a.value,"onUpdate:cardCodes":l[0]||(l[0]=c=>a.value=c),mode:"tags","filter-callback":s},null,8,["cardCodes"])]),_:1},8,["filter-array","title"]))}}),dT={filterArray:{type:Array,required:!0,default:[]}},fT={class:"checkboxes-container"},hT=i.defineComponent({__name:"FilterRegions",props:dT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray),A=i.ref([]);A.value.push(...a.filter(l=>ho(l))),i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(l,c)=>{let u=l.find(d=>!c.includes(d));if(u||(u=c.find(d=>!l.includes(d)),u))return o(u)});function s(){a.splice(0),A.value.slice(0)}function o(l){const c=a.indexOf(l);if(c===-1){a.push(l),l==="Runeterra"&&a.push(...A.value);return}if(a.splice(c,1),l==="Runeterra")for(let u=0;u<a.length;u++)ho(a[u])&&a.splice(u--,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.regions"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",fT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.regions,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":a.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(rn,{class:"runeterra",prompt:"Runeterra","is-selected":a.includes("Runeterra"),"onUpdate:isSelected":c[0]||(c[0]=u=>o("Runeterra"))},null,8,["is-selected"]),a.includes("Runeterra")?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:A.value,"onUpdate:modelValue":c[1]||(c[1]=u=>A.value=u),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.runeterraChampions,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Xo=M(hT,[["__scopeId","data-v-c93a9e90"]]),pT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},gT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},mT={class:"checkboxes-container"},vT=i.defineComponent({__name:"FilterFormat",props:gT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>{const d=we().dataJson.queues;return Object.values(we().dataJson.formats).filter(f=>f.availableQueues.some(h=>!d[h].excludeInMassFilter))}),A=i.computed(()=>a.value.filter(d=>!d.inDropdown)),s=i.computed(()=>a.value.filter(d=>d.inDropdown)),o=i.reactive(n.filterArray),l=i.ref(null);i.onMounted(()=>{o.length>0&&s.value.map(d=>d.nameRef).includes(o[0])&&(l.value=o[0])}),i.watch(o,()=>{t("update:filterArray",o),o.length===0&&(l.value=null)}),i.watch(l,()=>{l.value&&(o.splice(0),o.push(l.value))});function c(d){l.value=null,o.splice(0),d!==Kr.Standard&&o.push(d)}function u(){o.splice(0)}return(d,f)=>(i.openBlock(),i.createBlock(gt,{"filter-array":o,title:i.unref(r)("general.format"),"onClear:filterArray":u},{default:i.withCtx(()=>[i.createElementVNode("div",mT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,h=>(i.openBlock(),i.createBlock(rn,{prompt:h.name,"is-selected":o.includes(h.nameRef)||!n.allowZero&&h.nameRef==="Standard"&&o.length===0,"onUpdate:isSelected":p=>c(h.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),256)),s.value.length>0?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=h=>l.value=h),options:s.value,searchable:!1,placeholder:i.unref(r)("general.otherFormats"),label:"name","value-prop":"nameRef",onClear:u},null,8,["modelValue","options","placeholder"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Cg=M(vT,[["__scopeId","data-v-22de9b40"]]),BT={filterArray:{type:Array,required:!0,default:[]},availableQueues:{type:Array,required:!0,default:[]}},kg=i.defineComponent({__name:"FilterQueues",props:BT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.computed(()=>Object.values(we().dataJson.queues).filter(o=>n.availableQueues.includes(o.nameRef)&&!o.excludeInMassFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>n.availableQueues.length>1?(i.openBlock(),i.createBlock(gt,{key:0,"filter-array":a.value,title:i.unref(r)("general.queues"),"onClear:filterArray":s},{default:i.withCtx(()=>{var c,u;return[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=d=>a.value=d),placeholder:(u=(c=A.value)==null?void 0:c.find(d=>d.nameRef===i.unref(F2).Ranked))==null?void 0:u.name,class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","placeholder","options"])]}),_:1},8,["filter-array","title"])):i.createCommentVNode("",!0)}}),yT={filterObject:{type:Object,required:!1,default:void 0},showClearAll:{type:Boolean,required:!1,default:!0}},wT={class:"filter"},bT={key:0,class:"top"},_T=i.defineComponent({__name:"SidePanel",props:yT,emits:["clear:filterObject"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterObject&&Object.values(n.filterObject).some(A=>A.length>0)?"clickable":null);function a(){t("clear:filterObject")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",wT,[n.showClearAll&&n.filterObject?(i.openBlock(),i.createElementBlock("div",bT,[i.withDirectives(i.createElementVNode("p",{class:i.normalizeClass(["clear",r.value]),onClick:a},null,2),[[o,"general.clearAll"]])])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const ei=M(_T,[["__scopeId","data-v-6a93fcc1"]]),yb=i.defineComponent({__name:"FilterDecks",props:pT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Xo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(Ju,{"filter-array":r.cardFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.cardFilters=l)},null,8,["filter-array"]),i.createVNode(Cg,{"filter-array":r.formatFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.formatFilters=l)},null,8,["filter-array"]),n.includeDataFilters?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(kg,{"filter-array":r.queueFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"]),i.createVNode(Js,{"filter-array":r.sampleSizeFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.sampleSizeFilters=l)},null,8,["filter-array"]),i.createVNode(WA,{"filter-array":r.timeFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.timeFilters=l)},null,8,["filter-array"]),i.createVNode(Zs,{"filter-array":r.serverFilters,"onUpdate:filterArray":o[6]||(o[6]=l=>r.serverFilters=l)},null,8,["filter-array"])],64)):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),CT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},kT={filterArray:{type:Array,required:!0,default:[]},placeholder:{type:String,required:!1},title:{type:String,required:!1,default:"Text"}},ET=["placeholder"],ST=i.defineComponent({__name:"FilterText",props:kT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,r=i.ref(n.filterArray),a=i.ref("");let A=setTimeout(()=>{},0);r.value.length>0&&(a.value=r.value[0]),i.watch(r,()=>{t("update:filterArray",r.value)}),i.watch(a,()=>{A&&clearTimeout(A),A=setTimeout(()=>{r.value.splice(0),a.value&&r.value.push(a.value)},1e3)});function s(){r.value.splice(0),a.value=""}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":r.value,title:n.title,"onClear:filterArray":s},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:n.placeholder,type:"text"},null,8,ET),[[i.vModelText,a.value]])]),_:1},8,["filter-array","title"]))}});const iu=M(ST,[["__scopeId","data-v-e9c34cae"]]),wb=i.defineComponent({__name:"FilterProfile",props:CT,emits:["update:filters"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filters);i.watch(a,()=>{t("update:filters",a)});const A=i.computed(()=>{var o;return a.formatFilters.length===0?[]:(o=we().dataJson.formats[a.formatFilters[0]??"Standard"])==null?void 0:o.availableQueues});function s(){for(const[,o]of Object.entries(a))o.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":s},{default:i.withCtx(()=>[i.createVNode(Xo,{"filter-array":a.regionFilters,"onUpdate:filterArray":l[0]||(l[0]=c=>a.regionFilters=c)},null,8,["filter-array"]),i.createVNode(Ju,{"filter-array":a.cardFilters,"onUpdate:filterArray":l[1]||(l[1]=c=>a.cardFilters=c)},null,8,["filter-array"]),i.createVNode(iu,{"filter-array":a.deckCodeFilters,"onUpdate:filterArray":l[2]||(l[2]=c=>a.deckCodeFilters=c),placeholder:i.unref(r)("general.deckCode"),title:i.unref(r)("general.deckCode")},null,8,["filter-array","placeholder","title"]),i.createVNode(iu,{"filter-array":a.playerFilters,"onUpdate:filterArray":l[3]||(l[3]=c=>a.playerFilters=c),placeholder:i.unref(r)("general.players"),title:i.unref(r)("general.players")},null,8,["filter-array","placeholder","title"]),i.createVNode(Js,{"filter-array":a.sampleSizeFilters,"onUpdate:filterArray":l[4]||(l[4]=c=>a.sampleSizeFilters=c)},null,8,["filter-array"]),i.createVNode(Cg,{"allow-zero":!0,"filter-array":a.formatFilters,"onUpdate:filterArray":l[5]||(l[5]=c=>a.formatFilters=c)},null,8,["filter-array"]),i.createVNode(kg,{"filter-array":a.queueFilters,"onUpdate:filterArray":l[6]||(l[6]=c=>a.queueFilters=c),"available-queues":A.value},null,8,["filter-array","available-queues"]),i.createVNode(WA,{"allow-zero":!0,"filter-array":a.timeFilters,"onUpdate:filterArray":l[7]||(l[7]=c=>a.timeFilters=c)},null,8,["filter-array"])]),_:1},8,["filter-object"]))}}),xT={filterValue:{type:Object,required:!0,default:{attribute:"attack",equality:">",number:0}}},FT={class:"advanced-filter-item"},IT=["value"],UT=i.defineComponent({__name:"AdvancedFilterItem",props:xT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=[{value:"attack",label:r("cards.attack")},{value:"health",label:r("cards.health")},{value:"cost",label:r("cards.cost")},{value:"quantityOwned",label:r("cards.quantityOwned")}],A=i.ref(n.filterValue.attribute);i.watch(A,()=>{t("update:filterValue",{attribute:A.value,equality:n.filterValue.equality,number:n.filterValue.number})});function s(){let l=">";n.filterValue.equality===">"?l="<":n.filterValue.equality==="<"&&(l="="),t("update:filterValue",{attribute:n.filterValue.attribute,equality:l,number:n.filterValue.number})}function o(l){t("update:filterValue",{attribute:n.filterValue.attribute,equality:n.filterValue.equality,number:Number(l.target.value)})}return(l,c)=>(i.openBlock(),i.createElementBlock("div",FT,[i.createVNode(i.unref($t),{modelValue:A.value,"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),class:"advanced-attribute",options:a,"can-clear":!1,label:"label","value-prop":"value"},null,8,["modelValue"]),i.createElementVNode("div",{class:"equality-button",onClick:s},i.toDisplayString(n.filterValue.equality),1),i.createElementVNode("input",{type:"number",class:"equality-number",value:n.filterValue.number,onInput:o},null,40,IT)]))}});const Eg=M(UT,[["__scopeId","data-v-eb2d535d"]]),QT={filterValue:{type:Array,required:!0,default:[]}},TT=i.defineComponent({__name:"FilterAdvanced",props:QT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterValue);i.watch(a,()=>{t("update:filterValue",a)});function A(){a.splice(0)}function s(){a.push({attribute:"attack",equality:">",number:0})}return(o,l)=>(i.openBlock(),i.createBlock(gt,{class:"advanced-filters","filter-array":a,title:i.unref(r)("general.advanced"),"onClear:filterArray":A},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a,(c,u)=>(i.openBlock(),i.createBlock(Eg,{key:u,"filter-value":a[u],"onUpdate:filterValue":d=>a[u]=d,class:"advanced-filter-item"},null,8,["filter-value","onUpdate:filterValue"]))),128)),i.createElementVNode("div",{class:"new-advanced-filter",onClick:s},i.toDisplayString(i.unref(r)("general.newAdvancedFilter")),1)]),_:1},8,["filter-array","title"]))}});const Sg=M(TT,[["__scopeId","data-v-6c23ee29"]]),DT={filterArray:{type:Array,required:!0,default:[]}},LT={class:"checkboxes-container"},xg=i.defineComponent({__name:"FilterTypes",props:DT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.types.filter(l=>["Unit","Spell","Landmark","Equipment"].includes(l.nameRef))),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":n.filterArray,title:i.unref(r)("general.types"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",LT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),OT={filters:{type:Object,required:!0,default:{advancedFilters:[],regionFilters:[],manaCostFilters:[],typeFilters:[],rarityFilters:[],setFilters:[],keywordFilters:[]}}},bb=i.defineComponent({__name:"FilterCards",props:OT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return"formatFilters"in r?(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues:[]});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Bg,{"filter-array":r.manaCostFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.manaCostFilters=l)},null,8,["filter-array"]),i.createVNode(Xo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(xg,{"filter-array":r.typeFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.typeFilters=l)},null,8,["filter-array"]),i.createVNode(yg,{"filter-array":r.rarityFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.rarityFilters=l)},null,8,["filter-array"]),i.createVNode(wg,{"filter-array":r.setFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.setFilters=l)},null,8,["filter-array"]),i.createVNode(bg,{"filter-array":r.keywordFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.keywordFilters=l)},null,8,["filter-array"]),i.createVNode(Sg,{"filter-value":r.advancedFilters,"onUpdate:filterValue":o[6]||(o[6]=l=>r.advancedFilters=l)},null,8,["filter-value"]),"serverFilters"in r?(i.openBlock(),i.createBlock(i.unref(Zs),{key:0,"filter-array":r.serverFilters,"onUpdate:filterArray":o[7]||(o[7]=l=>r.serverFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"timeFilters"in r?(i.openBlock(),i.createBlock(WA,{key:1,"filter-array":r.timeFilters,"onUpdate:filterArray":o[8]||(o[8]=l=>r.timeFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"formatFilters"in r?(i.openBlock(),i.createBlock(Cg,{key:2,"filter-array":r.formatFilters,"onUpdate:filterArray":o[9]||(o[9]=l=>r.formatFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"queueFilters"in r?(i.openBlock(),i.createBlock(kg,{key:3,"filter-array":r.queueFilters,"onUpdate:filterArray":o[10]||(o[10]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"])):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),MT={regionRef:{type:String,required:!0,default:"Ionia"}},NT={text:{type:String,required:!0,default:""}},PT=["innerHTML"],HT=i.defineComponent({__name:"TippyText",props:NT,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:"tippy-text",innerHTML:t.text},null,8,PT))}});const Zu=M(HT,[["__scopeId","data-v-715107fe"]]),RT={class:"region-item"},VT=["alt","src"],KT=i.defineComponent({__name:"RegionItem",props:MT,setup(e){const t=e,n=i.ref(null),r=i.ref(null),a=i.computed(()=>we().dataJson.regions.find(A=>A.nameRef==t.regionRef)??we().dataJson.runeterraChampions.find(A=>A.nameRef===t.regionRef));return i.onMounted(()=>{et(n.value,{content:r.value,arrow:!0})}),(A,s)=>{var o,l,c;return i.openBlock(),i.createElementBlock("div",RT,[i.createElementVNode("img",{ref_key:"regionImg",ref:n,alt:(o=a.value)==null?void 0:o.name,src:(l=a.value)==null?void 0:l.icon,class:"region-img"},null,8,VT),i.createElementVNode("div",{ref_key:"regionTippy",ref:r},[i.createVNode(Zu,{text:(c=a.value)==null?void 0:c.name},null,8,["text"])],512)])}}});const Jo=M(KT,[["__scopeId","data-v-3d756f50"]]),$T={deckCode:{type:String,required:!0,default:""},deck:{type:Object,required:!1},cards:{type:Array,required:!1},describeRegions:{type:Boolean,required:!1,default:!1}},WT={class:"regions-line"},GT={key:0,class:"describe-regions"},zT={class:"lines"},jT=i.defineComponent({__name:"RegionsLine",props:$T,setup(e){const t=e,{t:n}=ne(),r=i.computed(()=>t.deck?t.deck:Ft(t.deckCode)),a=i.computed(()=>t.cards?t.cards:an(r.value)),A=i.computed(()=>{const o={};for(const l of Mu(r.value))o[l]=0;for(const l of a.value)for(const c of l.regionRefs)c in o&&(o[c]+=r.value[l.cardCode]);return o});function s(o,l){return{flexGrow:o,backgroundColor:`var(--color-${l}, var(--color-Runeterra))`}}return(o,l)=>(i.openBlock(),i.createElementBlock("div",WT,[t.describeRegions?(i.openBlock(),i.createElementBlock("div",GT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,class:"region-description"},[i.createVNode(Jo,{"region-ref":u,class:"icon"},null,8,["region-ref"]),i.createElementVNode("span",null,i.toDisplayString(`${c} ${i.unref(n)("general.cards")}`),1)]))),128))])):i.createCommentVNode("",!0),i.createElementVNode("div",zT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,style:i.normalizeStyle(s(c,u)),class:"region-line"},null,4))),128))])]))}});const Fg=M(jT,[["__scopeId","data-v-f1f94f8b"]]),YT={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardCode:{type:String,required:!0,default:"01IO001"},toggledStats:{type:Object,required:!0,default:{matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!1,kept:!1,drawnWinrate:!1,turnsHeld:!1,turnPlayed:!1}},index:{type:Number,required:!0,default:1},matches:{type:Number,required:!0,default:1},region:{type:String,required:!0,default:""},wins:{type:Number,required:!0,default:1},inclusion:{type:Number,required:!0,default:.5},avgCopies:{type:Number,required:!0,default:1},mulliganWinrate:{type:Number,required:!1,default:void 0},keptInMulligan:{type:Number,required:!1,default:void 0},drawnWinrate:{type:Number,required:!1,default:void 0},turnsHeld:{type:Number,required:!1,default:void 0},turnPlayed:{type:Number,required:!1,default:void 0}},qT={class:"cards-row-background-wrapper"},XT={class:"cards-row-background"},JT={class:"cards-row wrapper"},ZT={key:0,class:"column-content"},eD={key:2,class:"column-content"},tD={key:3,class:"column-content"},nD={key:5,class:"column-content"},rD={key:7,class:"column-content"},aD={key:8,class:"column-content"},AD=i.defineComponent({__name:"CardsRow",props:YT,setup(e){const t=e,n=i.computed(()=>["",xe().callbacks.cardImageCallback(t.cardCode,Bt.Banner)]);return(r,a)=>{const A=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(A,{to:t.routerLink,class:"wrapper"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"cards-row-wrapper wrapper",style:i.normalizeStyle({"--index":t.index})},[i.createElementVNode("div",qT,[i.createElementVNode("div",XT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"background-card",style:i.normalizeStyle({"--background-image":`url(${s})`})},null,4))),128))])]),i.createElementVNode("div",JT,[i.createElementVNode("div",{class:"column-content deck-highlight-wrapper",onClick:a[0]||(a[0]=i.withModifiers(()=>{},["stop","prevent"]))},[i.createVNode(hn,{class:"card-slice-item","card-code-prop":t.cardCode,"maintain-aspect-ratio":!1,color:`var(--color-${t.region}-rgb, var(--color-primary-2-rgb))`,"router-link":t.routerLink},null,8,["card-code-prop","color","router-link"])]),t.toggledStats.matches?(i.openBlock(),i.createElementBlock("div",ZT,i.toDisplayString(i.unref(De)(t.matches)),1)):i.createCommentVNode("",!0),t.toggledStats.winrate?(i.openBlock(),i.createElementBlock("div",{key:1,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.wins/t.matches)})`})},i.toDisplayString(i.unref(De)(t.wins/t.matches*100,2,3)+"%"),5)):i.createCommentVNode("",!0),t.toggledStats.inclusion?(i.openBlock(),i.createElementBlock("div",eD,i.toDisplayString(i.unref(De)(t.inclusion*100,2,3)+"%"),1)):i.createCommentVNode("",!0),t.toggledStats.avgCopies?(i.openBlock(),i.createElementBlock("div",tD,i.toDisplayString(i.unref(De)(t.avgCopies,2,3)),1)):i.createCommentVNode("",!0),t.toggledStats.mulliganWinrate?(i.openBlock(),i.createElementBlock("div",{key:4,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.mulliganWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.mulliganWinrate?i.unref(De)(t.mulliganWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.keptInMulligan?(i.openBlock(),i.createElementBlock("div",nD,i.toDisplayString(t.keptInMulligan?i.unref(De)(t.keptInMulligan*100,2,3)+"%":"-"),1)):i.createCommentVNode("",!0),t.toggledStats.drawnWinrate?(i.openBlock(),i.createElementBlock("div",{key:6,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.drawnWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.drawnWinrate?i.unref(De)(t.drawnWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.turnPlayed?(i.openBlock(),i.createElementBlock("div",rD,i.toDisplayString(t.turnPlayed?i.unref(De)(t.turnPlayed,2,3):"-"),1)):i.createCommentVNode("",!0),t.toggledStats.turnsHeld?(i.openBlock(),i.createElementBlock("div",aD,i.toDisplayString(t.turnsHeld?i.unref(De)(t.turnsHeld,2,3):"-"),1)):i.createCommentVNode("",!0)])],4)]),_:1},8,["to"])}}});const Ig=M(AD,[["__scopeId","data-v-e0c98d3c"]]),sD={cardRows:{type:Array,required:!0,default:[]},cardsRowToggle:{type:Object,requied:!0,default:{card:!0,matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!0,keptInMulligan:!0,drawnWinrate:!0,turnsHeld:!0,turnPlayed:!0}},loading:{type:Boolean,required:!1,default:!1}};var be=(e=>(e.UP="sort-up",e.DOWN="sort-down",e.NEITHER="sort-neither",e.NOT_SORTABLE="not-sortable",e))(be||{});const iD={headingItems:{type:Array,required:!0,default:[]},loading:{type:Boolean,required:!1,default:!1}};const oD={},lD={class:"loader"};function cD(e,t){return i.openBlock(),i.createElementBlock("div",lD)}const Ug=M(oD,[["render",cD],["__scopeId","data-v-91218ab0"]]),Qg=e=>(i.pushScopeId("data-v-a525533d"),e=e(),i.popScopeId(),e),uD={class:"table-wrapper"},dD={class:"table no-scrollbar"},fD=Qg(()=>i.createElementVNode("div",{class:"heading-background-outer"},[i.createElementVNode("div",{class:"heading-background-absolute"}),i.createElementVNode("div",{class:"heading-background-inner"})],-1)),hD={class:"heading wrapper"},pD=["onClick"],gD={class:"sort-icons"},mD={key:0,class:"no-content loading"},vD=Qg(()=>i.createElementVNode("h2",null," No Results ",-1)),BD=Qg(()=>i.createElementVNode("h4",null," Adjust filters and try again. ",-1)),yD=[vD,BD],wD=i.defineComponent({__name:"LargeTable",props:iD,emits:["toggleSort"],setup(e,{emit:t}){const n=e,r={"--background-image":`url(${xe().callbacks.cardImageCallback("01FR008",Bt.Full)})`},a=i.computed(()=>n.headingItems.filter(A=>A.isShown));return(A,s)=>(i.openBlock(),i.createElementBlock("div",uD,[i.createElementVNode("div",dD,[fD,i.createElementVNode("div",hD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,o=>(i.openBlock(),i.createElementBlock("div",{key:o.title,class:i.normalizeClass(["heading-cell column-content",o.sortDirection]),onClick:l=>t("toggleSort",o.id)},[i.createElementVNode("div",null,i.toDisplayString(o.title),1),i.createElementVNode("div",gD,[i.createVNode(i.unref(Ee),{icon:"sort-up",class:"sort-icon"}),i.createVNode(i.unref(Ee),{icon:"sort-down",class:"sort-icon"})])],10,pD))),128))]),i.renderSlot(A.$slots,"default",{},()=>[n.loading?(i.openBlock(),i.createElementBlock("div",mD,[i.createVNode(Ug)])):(i.openBlock(),i.createElementBlock("div",{key:1,class:"no-content no-results",style:r},yD))],!0)])]))}});const aA=M(wD,[["__scopeId","data-v-a525533d"]]);function ti(e,t){const n=t.value.find(a=>a.id===e);if(!n||n.sortDirection===be.NOT_SORTABLE)return null;const r=n.sortDirection;return bD(t),r===be.NEITHER?n.sortDirection=be.DOWN:r===be.DOWN?n.sortDirection=be.UP:n.sortDirection=be.DOWN,n}function bD(e){e.value.forEach(t=>{t.sortDirection!==be.NOT_SORTABLE&&(t.sortDirection=be.NEITHER)})}const _D=i.defineComponent({__name:"CardsTable",props:sD,emits:["sort-updated"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=[{id:"card",isAlwaysShown:!0,isSortable:!1,title:r("general.card")},{id:"matches",isAlwaysShown:!1,isSortable:!0,title:r("general.matches")},{id:"winrate",isAlwaysShown:!1,isSortable:!0,title:r("general.winrate")},{id:"inclusion",isAlwaysShown:!1,isSortable:!0,title:r("general.inclusion")},{id:"avgCopies",isAlwaysShown:!1,isSortable:!0,title:r("general.avgCopies")},{id:"mulliganWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.mulliganWinrate")},{id:"keptInMulligan",isAlwaysShown:!1,isSortable:!0,title:r("general.keptInMulligan")},{id:"drawnWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.drawnWinrate")},{id:"turnsHeld",isAlwaysShown:!1,isSortable:!0,title:r("general.turnsHeld")},{id:"turnPlayed",isAlwaysShown:!1,isSortable:!0,title:r("general.turnPlayed")}];let A=!1;const s=i.ref(a.map(c=>{let u=be.NEITHER;return c.isSortable||(u=be.NOT_SORTABLE),!A&&c.isSortable&&(u=be.DOWN,A=!0),{id:c.id,isShown:n.cardsRowToggle[c.id],sortDirection:u,title:c.title}})),o=i.computed(()=>({"--table-grid-template-columns":`repeat(${Object.values(n.cardsRowToggle).reduce((u,d)=>d?u+1:u,0)}, 1fr)`}));function l(c){const u=ti(c,s);u&&t("sort-updated",u)}return(c,u)=>(i.openBlock(),i.createBlock(aA,{class:"large-table",loading:n.loading,"heading-items":s.value,style:i.normalizeStyle(o.value),onToggleSort:l},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.cardRows,(d,f)=>(i.openBlock(),i.createBlock(Ig,{key:d.cardCode+d.region,"card-code":d.cardCode,matches:d.matches,wins:d.wins,index:f+2,"avg-copies":d.avgCopies,"drawn-winrate":d.drawnWinrate,"kept-in-mulligan":d.keptInMulligan,"mulligan-winrate":d.mulliganWinrate,inclusion:d.inclusion,"turns-held":d.turnsHeld,"turn-played":d.turnPlayed,"toggled-stats":n.cardsRowToggle,region:d.region,"router-link":i.unref(xe)().callbacks.cardCodeRouterLinkCallback(d.cardCode)},null,8,["card-code","matches","wins","index","avg-copies","drawn-winrate","kept-in-mulligan","mulligan-winrate","inclusion","turns-held","turn-played","toggled-stats","region","router-link"]))),128))]),_:1},8,["loading","heading-items","style"]))}});const _b=M(_D,[["__scopeId","data-v-1894b267"]]),CD={regions:{type:Array,required:!0,default:[]}},kD={class:"deck-highlight-regions"},ED=i.defineComponent({__name:"DeckHighlightRegions",props:CD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",kD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.regions,a=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"region-item-wrapper"},[i.createVNode(Jo,{class:"region-item","region-ref":a},null,8,["region-ref"])]))),128))]))}});const Zo=M(ED,[["__scopeId","data-v-d28f95f4"]]),SD={},xD={xmlns:"http://www.w3.org/2000/svg",viewBox:"215.7 48.9 276.9 496"},FD=i.createStaticVNode('<path fill="#146743" d="m271 136-54 90 150 316 14-50 29-312-51-130-88 86Z"></path><path fill="#419a4a" d="m356 121-75 105 86 316 14-50 29-312-54-59Z"></path><path fill="#baffb6" d="M410 180 359 50l-3 71 54 59Z"></path><path fill="#437f41" d="m359 50-88 86 10 90 75-105 3-71ZM281 360l86 182-86-316v134Z"></path><path fill="#419a4a" d="m454 332 28 33-33 85-4-13-8-85 17-20Z"></path>',5),ID=[FD];function UD(e,t){return i.openBlock(),i.createElementBlock("svg",xD,ID)}const Tg=M(SD,[["render",UD]]),QD={deck:{type:Object,required:!0,default:{}}},TD=e=>(i.pushScopeId("data-v-25f680e9"),e=e(),i.popScopeId(),e),DD={class:"gems-text"},LD={class:"gems-cost-title"},OD={class:"gems-cost-value"},MD=TD(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),ND={class:"gems-cost-title"},PD={class:"gems-cost-value"},HD=i.defineComponent({__name:"GemsCost",props:QD,setup(e){const t=e,{t:n}=ne(),r=i.ref(null),a=i.ref(null),A=i.computed(()=>qc(t.deck,!1)),s=i.computed(()=>qc(t.deck,!0));return i.onMounted(()=>{et(r.value,{content:a.value,arrow:!0,duration:0})}),(o,l)=>{var c,u,d;return i.openBlock(),i.createElementBlock("div",{ref_key:"gemsCostDiv",ref:r,class:"gems-cost"},[i.createVNode(Tg,{class:"shards-icon"}),i.createElementVNode("div",DD,i.toDisplayString((c=s.value!==null?s.value:A.value)==null?void 0:c.toLocaleString()),1),i.createElementVNode("div",{ref_key:"gemsCostTippyDiv",ref:a,class:"gems-cost-tippy"},[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",LD,i.toDisplayString(i.unref(n)("deck.personalCost")),1),i.createElementVNode("div",OD,i.toDisplayString((u=s.value)==null?void 0:u.toLocaleString()),1),MD],64)):i.createCommentVNode("",!0),i.createElementVNode("div",ND,i.toDisplayString(i.unref(n)("deck.originalCost")),1),i.createElementVNode("div",PD,i.toDisplayString((d=A.value)==null?void 0:d.toLocaleString()),1)],512)],512)}}});const Dg=M(HD,[["__scopeId","data-v-25f680e9"]]),RD={class:"language-selection"},VD={class:"selection-panel"},KD=i.defineComponent({__name:"LanguageSelection",setup(e){const{locale:t,availableLocales:n}=ne(),r={en:"English",de:"Deutsch",es:"Español",fr:"Français",it:"Italiano",ja:"日本語",ko:"한국어",pl:"Polski",pt:"Português",th:"ไทย",tr:"Türkçe",ru:"Русский",zh:"中文"},a=mA.useRoute(),A=i.ref(!1),s=i.computed(()=>n.sort(l=>l===t.value?-1:1));function o(){A.value=!0}return(l,c)=>{const u=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",RD,[i.createVNode(i.unref(Ee),{ref:"languageIcon",icon:"language",class:"icon",onClick:o},null,512),i.createVNode($A,{"show-modal":A.value,"onUpdate:showModal":c[0]||(c[0]=d=>A.value=d)},{default:i.withCtx(()=>[i.createElementVNode("div",VD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,d=>(i.openBlock(),i.createBlock(u,{class:i.normalizeClass(i.unref(t)===d?"selected":""),locale:d,key:d,to:{...i.unref(a),params:{...i.unref(a).params,lang:d}}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r[d]),1)]),_:2},1032,["class","locale","to"]))),128))])]),_:1},8,["show-modal"])])}}});const Lg=M(KD,[["__scopeId","data-v-8a6f5e0d"]]),$D={cardCodes:{type:Array,required:!0,default:[]},regions:{type:Array,required:!0,default:[]}},Cb={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1},regions:{type:Array,required:!1,default:void 0},colorOverride:{type:String,required:!1,default:void 0}},WD={class:"circle-card-item"},GD=["alt","src"],zD=i.defineComponent({__name:"CircleCardItem",props:Cb,setup(e){const t=e,n=Ko(t.cardProp,t.cardCodeProp,!0),r=i.ref(null),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.computed(()=>{var c;return xe().callbacks.cardImageCallback(((c=n.value)==null?void 0:c.cardCode)??"",Bt.Icon)}),l=i.computed(()=>n.value===void 0?"--color-primary-2":vA(n.value,t.regions));return i.onMounted(()=>{t.ignoreCardItem||et(r.value,{content:a.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:c=>{const u=c.popper.innerHTML.includes("right")?"right-start":"left-start";s.value=u},onHidden:()=>{s.value=null}})}),(c,u)=>{const d=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",WD,[i.createVNode(d,{to:t.routerLink,class:"circle-card-link",onClick:u[0]||(u[0]=i.withModifiers(()=>{},["stop","prevent"]))},{default:i.withCtx(()=>{var f;return[i.createElementVNode("img",{ref_key:"circleCardImg",ref:r,alt:(f=i.unref(n))==null?void 0:f.name,src:o.value,class:"circle-card-img",style:i.normalizeStyle({borderColor:t.colorOverride??l.value})},null,12,GD)]}),_:1},8,["to"]),i.createElementVNode("div",{ref_key:"circleCardTippy",ref:a,class:"circle-card-tippy"},[!c.ignoreCardItem&&i.unref(n)?(i.openBlock(),i.createBlock(za,{key:0,ref_key:"cardItem",ref:A,"card-code-prop":i.unref(n).cardCode,"is-deck-builder":!1,"is-root":!0,"show-tippy-location":s.value},null,8,["card-code-prop","show-tippy-location"])):i.createCommentVNode("",!0)],512)])}}});const ia=M(zD,[["__scopeId","data-v-3ea9e838"]]),jD={cards:{type:Array,required:!1,default:void 0},cardCodes:{type:Array,required:!1,default:void 0},regions:{type:Array,required:!1,default:[]}},YD={class:"deck-highlight-cards"},qD=i.defineComponent({__name:"DeckHighlightCards",props:jD,setup(e){const t=e,n=i.computed(()=>{if(t.cards)return t.cards;if(t.cardCodes)return t.cardCodes.map(r=>qt().cardJsonObject[r]).filter(r=>r!==void 0);throw new Error("Cards or CardCodes must be defined.")});return(r,a)=>(i.openBlock(),i.createElementBlock("div",YD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(A,s)=>(i.openBlock(),i.createElementBlock("div",{key:A.cardCode??s,class:"circle-card-item-wrapper"},[i.createVNode(ia,{class:"circle-card-item","card-prop":A,regions:t.regions,"router-link":i.unref(xe)().callbacks.cardCodeRouterLinkCallback(A.cardCode)},null,8,["card-prop","regions","router-link"])]))),128))]))}});const el=M(qD,[["__scopeId","data-v-021c3530"]]),XD=i.defineComponent({__name:"ArchetypeSidePanelHighlight",props:$D,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createBlock(gt,{class:"archetype-side-panel-highlight"},{default:i.withCtx(()=>[i.createVNode(Zo,{class:"deck-highlight-regions",regions:t.regions},null,8,["regions"]),i.createVNode(el,{class:i.normalizeClass(["deck-highlight-cards",t.cardCodes.length===1?"single":""]),"card-codes":t.cardCodes},null,8,["class","card-codes"])]),_:1}))}});const ed=M(XD,[["__scopeId","data-v-ff538f6f"]]),JD={deckcode:{type:String,required:!0,default:""},filters:{type:Object,required:!0,default:{sampleSizeFilters:[],serverFilters:[],timeFilters:[]}},builtDeckProps:{type:Object,required:!1,default:void 0}},ZD={deckCode:{type:String,required:!0,default:""},info:{type:String,required:!0,default:"typeRef"}};/*!
810
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var aU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},mb={exports:{}};(function(e){(function(t){var n=function(g,v,_){if(!c(v)||d(v)||f(v)||h(v)||l(v))return v;var B,w=0,b=0;if(u(v))for(B=[],b=v.length;w<b;w++)B.push(n(g,v[w],_));else{B={};for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(B[g(C,_)]=n(g,v[C],_))}return B},r=function(g,v){v=v||{};var _=v.separator||"_",B=v.split||/(?=[A-Z])/;return g.split(B).join(_)},a=function(g){return p(g)?g:(g=g.replace(/[\-_\s]+(.)?/g,function(v,_){return _?_.toUpperCase():""}),g.substr(0,1).toLowerCase()+g.substr(1))},A=function(g){var v=a(g);return v.substr(0,1).toUpperCase()+v.substr(1)},s=function(g,v){return r(g,v).toLowerCase()},o=Object.prototype.toString,l=function(g){return typeof g=="function"},c=function(g){return g===Object(g)},u=function(g){return o.call(g)=="[object Array]"},d=function(g){return o.call(g)=="[object Date]"},f=function(g){return o.call(g)=="[object RegExp]"},h=function(g){return o.call(g)=="[object Boolean]"},p=function(g){return g=g-0,g===g},m=function(g,v){var _=v&&"process"in v?v.process:v;return typeof _!="function"?g:function(B,w){return _(B,g,w)}},y={camelize:a,decamelize:s,pascalize:A,depascalize:s,camelizeKeys:function(g,v){return n(m(a,v),g)},decamelizeKeys:function(g,v){return n(m(s,v),g,v)},pascalizeKeys:function(g,v){return n(m(A,v),g)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=y:t.humps=y})(aU)})(mb);var AU=mb.exports,sU=["class","style"];function iU(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),a=AU.camelize(n.slice(0,r)),A=n.slice(r+1).trim();return t[a]=A,t},{})}function oU(e){return e.split(/\s+/).reduce(function(t,n){return t[n]=!0,t},{})}function mg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return mg(l)}),a=Object.keys(e.attributes||{}).reduce(function(l,c){var u=e.attributes[c];switch(c){case"class":l.class=oU(u);break;case"style":l.style=iU(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var A=n.style,s=A===void 0?{}:A,o=ZI(n,sU);return i.h(e.tag,Xn(Xn(Xn({},t),{},{class:a.class,style:Xn(Xn({},a.style),s)},a.attrs),o),r)}var vb=!1;try{vb=process.env.NODE_ENV==="production"}catch{}function lU(){if(!vb&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Yi(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?ln({},e,t):{}}function cU(e){var t,n=(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip":e.flip===!0,"fa-flip-horizontal":e.flip==="horizontal"||e.flip==="both","fa-flip-vertical":e.flip==="vertical"||e.flip==="both"},ln(t,"fa-".concat(e.size),e.size!==null),ln(t,"fa-rotate-".concat(e.rotation),e.rotation!==null),ln(t,"fa-pull-".concat(e.pull),e.pull!==null),ln(t,"fa-swap-opacity",e.swapOpacity),ln(t,"fa-bounce",e.bounce),ln(t,"fa-shake",e.shake),ln(t,"fa-beat",e.beat),ln(t,"fa-fade",e.fade),ln(t,"fa-beat-fade",e.beatFade),ln(t,"fa-flash",e.flash),ln(t,"fa-spin-pulse",e.spinPulse),ln(t,"fa-spin-reverse",e.spinReverse),t);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function ov(e){if(e&&Au(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(tu.icon)return tu.icon(e);if(e===null)return null;if(Au(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}var Ee=i.defineComponent({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(t){return[!0,!1,"horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(Number.parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(t,n){var r=n.attrs,a=i.computed(function(){return ov(t.icon)}),A=i.computed(function(){return Yi("classes",cU(t))}),s=i.computed(function(){return Yi("transform",typeof t.transform=="string"?tu.transform(t.transform):t.transform)}),o=i.computed(function(){return Yi("mask",ov(t.mask))}),l=i.computed(function(){return vF(a.value,Xn(Xn(Xn(Xn({},A.value),s.value),o.value),{},{symbol:t.symbol,title:t.title}))});i.watch(l,function(u){if(!u)return lU("Could not find one or more icon(s)",a.value,o.value)},{immediate:!0});var c=i.computed(function(){return l.value?mg(l.value.abstract[0],{},r):null});return function(){return c.value}}});i.defineComponent({name:"FontAwesomeLayers",props:{fixedWidth:{type:Boolean,default:!1}},setup:function(t,n){var r=n.slots,a=Tw.familyPrefix,A=i.computed(function(){return["".concat(a,"-layers")].concat(Uh(t.fixedWidth?["".concat(a,"-fw")]:[]))});return function(){return i.h("div",{class:A.value},r.default?r.default():[])}}});i.defineComponent({name:"FontAwesomeLayersText",props:{value:{type:[String,Number],default:""},transform:{type:[String,Object],default:null},counter:{type:Boolean,default:!1},position:{type:String,default:null,validator:function(t){return["bottom-left","bottom-right","top-left","top-right"].indexOf(t)>-1}}},setup:function(t,n){var r=n.attrs,a=Tw.familyPrefix,A=i.computed(function(){return Yi("classes",[].concat(Uh(t.counter?["".concat(a,"-layers-counter")]:[]),Uh(t.position?["".concat(a,"-layers-").concat(t.position)]:[])))}),s=i.computed(function(){return Yi("transform",typeof t.transform=="string"?tu.transform(t.transform):t.transform)}),o=i.computed(function(){var c=BF(t.value.toString(),Xn(Xn({},s.value),A.value)),u=c.abstract;return t.counter&&(u[0].attributes.class=u[0].attributes.class.replace("fa-layers-text","")),u[0]}),l=i.computed(function(){return mg(o.value,{},r)});return function(){return l.value}}});const uU={class:"card-slice"},dU={key:0,class:"mana-hexagon"},fU={class:"mana-number"},hU={class:"card-name"},pU={key:1,class:"quantity"},gU={class:"quantity-background"},mU={class:"num-quantity"},vU={class:"plus-minus-content"},BU={class:"plus-minus-quantity"},yU=i.defineComponent({__name:"CardSliceItem",props:YI,emits:["update:card-quantity"],setup(e,{emit:t}){const n=e,r=Ko(n.cardProp,n.cardCodeProp,!1),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.ref(null),l=i.computed(()=>{let d=n.color;return!d&&r.value&&(d=vA(r.value,null,!0)),d||(d="var(--color-background-2-rgb)"),{"--color":d}}),c=i.computed(()=>r.value?xe().callbacks.cardImageCallback(r.value.cardCode,Bt.Slice):""),u=i.computed(()=>{const d=["card-slice-wrapper"];return n.maintainAspectRatio&&d.push("maintain-aspect-ratio"),d});return i.onMounted(()=>{n.ignoreCardItem||et(a.value,{content:s.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:d=>{const f=d.popper.innerHTML.includes("right")?"right-start":"left-start";o.value=f},onHidden:()=>{o.value=null}})}),(d,f)=>{const h=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(h,{to:n.routerLink},{default:i.withCtx(()=>{var p,m;return[i.createElementVNode("div",{ref_key:"cardSlice",ref:a,class:i.normalizeClass(u.value)},[i.createElementVNode("div",uU,[i.createElementVNode("div",{class:"card-image",style:i.normalizeStyle({backgroundImage:`url(${c.value})`})},null,4),i.createElementVNode("div",{class:"region-gradient",style:i.normalizeStyle(l.value)},null,4),i.unref(r)||n.manaNumber!==void 0&&n.manaNumber!==null?(i.openBlock(),i.createElementBlock("div",dU,[i.createVNode(qo,{class:"hexagon-icon"}),i.createElementVNode("div",fU,i.toDisplayString(n.manaNumber??((p=i.unref(r))==null?void 0:p.cost)),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",hU,i.toDisplayString(n.name??((m=i.unref(r))==null?void 0:m.name)),1),n.quantityNumber!==void 0&&n.quantityNumber!==null?(i.openBlock(),i.createElementBlock("div",pU,[i.createElementVNode("div",gU,[i.createElementVNode("p",mU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0),n.showPlusMinus?(i.openBlock(),i.createElementBlock("div",{key:2,class:"plus-minus",onClick:f[2]||(f[2]=i.withModifiers(()=>{},["prevent"]))},[i.createElementVNode("div",vU,[i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[0]||(f[0]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:-1})},["prevent"]))},[i.createVNode(i.unref(Ee),{icon:"minus",class:"icon"})]),i.createElementVNode("div",{class:"plus-minus-icon",onClick:f[1]||(f[1]=i.withModifiers(y=>{var g;return t("update:card-quantity",{cardCode:((g=i.unref(r))==null?void 0:g.cardCode)??"",quantity:1})},["prevent"]))},[i.createVNode(i.unref(Ee),{icon:"plus",class:"icon"})]),i.createElementVNode("div",BU,i.toDisplayString(n.quantityNumber),1)])])):i.createCommentVNode("",!0)])],2),i.createElementVNode("div",{ref_key:"cardItemWrapper",ref:s,class:"card-item-container"},[i.unref(r)&&!d.ignoreCardItem?(i.openBlock(),i.createBlock(za,{key:0,ref_key:"cardItem",ref:A,"is-root":!0,"card-prop":i.unref(r),"quantity-needed":n.quantityNumber,"show-tippy-location":o.value,class:"card-image-hover"},null,8,["card-prop","quantity-needed","show-tippy-location"])):i.createCommentVNode("",!0)],512)]}),_:1},8,["to"])}}});const hn=M(yU,[["__scopeId","data-v-3c0e2952"]]);function ur(e){return[null,void 0].indexOf(e)!==-1}function wU(e,t,n){const{object:r,valueProp:a,mode:A}=i.toRefs(e),s=i.getCurrentInstance().proxy,o=n.iv,l=(d,f=!0)=>{o.value=u(d);const h=c(d);t.emit("change",h,s),f&&(t.emit("input",h),t.emit("update:modelValue",h))},c=d=>r.value||ur(d)?d:Array.isArray(d)?d.map(f=>f[a.value]):d[a.value],u=d=>ur(d)?A.value==="single"?{}:[]:d;return{update:l}}function bU(e,t){const{value:n,modelValue:r,mode:a,valueProp:A}=i.toRefs(e),s=i.ref(a.value!=="single"?[]:{}),o=r&&r.value!==void 0?r:n,l=i.computed(()=>a.value==="single"?s.value[A.value]:s.value.map(u=>u[A.value])),c=i.computed(()=>a.value!=="single"?s.value.map(u=>u[A.value]).join(","):s.value[A.value]);return{iv:s,internalValue:s,ev:o,externalValue:o,textValue:c,plainValue:l}}function _U(e,t,n){const{regex:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=n.isOpen,s=n.open,o=i.ref(null),l=i.ref(null),c=()=>{o.value=""},u=h=>{o.value=h.target.value},d=h=>{if(r&&r.value){let p=r.value;typeof p=="string"&&(p=new RegExp(p)),h.key.match(p)||h.preventDefault()}},f=h=>{if(r&&r.value){let m=(h.clipboardData||window.clipboardData).getData("Text"),y=r.value;typeof y=="string"&&(y=new RegExp(y)),m.split("").every(g=>!!g.match(y))||h.preventDefault()}t.emit("paste",h,a)};return i.watch(o,h=>{!A.value&&h&&s(),t.emit("search-change",h,a)}),{search:o,input:l,clearSearch:c,handleSearchInput:u,handleKeypress:d,handlePaste:f}}function CU(e,t,n){const{groupSelect:r,mode:a,groups:A,disabledProp:s}=i.toRefs(e),o=i.ref(null),l=u=>{u===void 0||u!==null&&u[s.value]||A.value&&u&&u.group&&(a.value==="single"||!r.value)||(o.value=u)};return{pointer:o,setPointer:l,clearPointer:()=>{l(null)}}}function uf(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function kU(e){return Object.prototype.toString.call(e)==="[object Object]"}function EU(e,t){const n=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(r,a){return r===n[a]})}function SU(e,t,n){const{options:r,mode:a,trackBy:A,limit:s,hideSelected:o,createTag:l,createOption:c,label:u,appendNewTag:d,appendNewOption:f,multipleLabel:h,object:p,loading:m,delay:y,resolveOnLoad:g,minChars:v,filterResults:_,clearOnSearch:B,clearOnSelect:w,valueProp:b,allowAbsent:C,groupLabel:E,canDeselect:S,max:T,strict:U,closeOnSelect:F,closeOnDeselect:Q,groups:Y,reverse:X,infinite:j,groupOptions:K,groupHideEmpty:oe,groupSelect:$,onCreate:Ae,disabledProp:ce,searchStart:me,searchFilter:ke}=i.toRefs(e),fe=i.getCurrentInstance().proxy,re=n.iv,N=n.ev,te=n.search,He=n.clearSearch,lt=n.update,It=n.pointer,yt=n.clearPointer,Tn=n.focus,x=n.deactivate,k=n.close,D=n.localize,W=i.ref([]),ie=i.ref([]),he=i.ref(!1),Ut=i.ref(null),pt=i.ref(j.value&&s.value===-1?10:s.value),yn=i.computed(()=>l.value||c.value||!1),We=i.computed(()=>d.value!==void 0?d.value:f.value!==void 0?f.value:!0),O=i.computed(()=>{if(Y.value){let I=nt.value||[],G=[];return I.forEach(Ie=>{Wd(Ie[K.value]).forEach(wt=>{G.push(Object.assign({},wt,Ie[ce.value]?{[ce.value]:!0}:{}))})}),G}else{let I=Wd(ie.value||[]);return W.value.length&&(I=I.concat(W.value)),I}}),P=i.computed(()=>{let I=O.value;return X.value&&(I=I.reverse()),ua.value.length&&(I=ua.value.concat(I)),$d(I)}),tt=i.computed(()=>{let I=P.value;return pt.value>0&&(I=I.slice(0,pt.value)),I}),nt=i.computed(()=>{if(!Y.value)return[];let I=[],G=ie.value||[];return W.value.length&&I.push({[E.value]:" ",[K.value]:[...W.value],__CREATE__:!0}),I.concat(G)}),sr=i.computed(()=>{let I=[...nt.value].map(G=>({...G}));return ua.value.length&&(I[0]&&I[0].__CREATE__?I[0][K.value]=[...ua.value,...I[0][K.value]]:I=[{[E.value]:" ",[K.value]:[...ua.value],__CREATE__:!0}].concat(I)),I}),Dn=i.computed(()=>{if(!Y.value)return[];let I=sr.value;return ok((I||[]).map((G,Ie)=>{const wt=Wd(G[K.value]);return{...G,index:Ie,group:!0,[K.value]:$d(wt,!1).map(di=>Object.assign({},di,G[ce.value]?{[ce.value]:!0}:{})),__VISIBLE__:$d(wt).map(di=>Object.assign({},di,G[ce.value]?{[ce.value]:!0}:{}))}}))}),Ln=i.computed(()=>{switch(a.value){case"single":return!ur(re.value[b.value]);case"multiple":case"tags":return!ur(re.value)&&re.value.length>0}}),jn=i.computed(()=>h!==void 0&&h.value!==void 0?h.value(re.value,fe):re.value&&re.value.length>1?`${re.value.length} options selected`:"1 option selected"),li=i.computed(()=>!O.value.length&&!he.value&&!ua.value.length),es=i.computed(()=>O.value.length>0&&tt.value.length==0&&(te.value&&Y.value||!Y.value)),ua=i.computed(()=>yn.value===!1||!te.value?[]:Ak(te.value)!==-1?[]:[{[b.value]:te.value,[L.value]:te.value,[u.value]:te.value,__CREATE__:!0}]),L=i.computed(()=>A.value||u.value),ae=i.computed(()=>{switch(a.value){case"single":return null;case"multiple":case"tags":return[]}}),ue=i.computed(()=>m.value||he.value),Fe=I=>{switch(typeof I!="object"&&(I=Ur(I)),a.value){case"single":lt(I);break;case"multiple":case"tags":lt(re.value.concat(I));break}t.emit("select",Ot(I),I,fe)},ye=I=>{switch(typeof I!="object"&&(I=Ur(I)),a.value){case"single":ci();break;case"tags":case"multiple":lt(Array.isArray(I)?re.value.filter(G=>I.map(Ie=>Ie[b.value]).indexOf(G[b.value])===-1):re.value.filter(G=>G[b.value]!=I[b.value]));break}t.emit("deselect",Ot(I),I,fe)},Ot=I=>p.value?I:I[b.value],Zt=I=>{ye(I)},da=(I,G)=>{if(G.button!==0){G.preventDefault();return}Zt(I)},ci=()=>{t.emit("clear",fe),lt(ae.value)},Rt=I=>{if(I.group!==void 0)return a.value==="single"?!1:ak(I[K.value])&&I[K.value].length;switch(a.value){case"single":return!ur(re.value)&&re.value[b.value]==I[b.value];case"tags":case"multiple":return!ur(re.value)&&re.value.map(G=>G[b.value]).indexOf(I[b.value])!==-1}},iA=I=>I[ce.value]===!0,fa=()=>T===void 0||T.value===-1||!Ln.value&&T.value>0?!1:re.value.length>=T.value,ha=I=>{if(!iA(I)){if(Ae&&Ae.value&&!Rt(I)&&I.__CREATE__&&(I={...I},delete I.__CREATE__,I=Ae.value(I,fe),I instanceof Promise)){he.value=!0,I.then(G=>{he.value=!1,wl(G)});return}wl(I)}},wl=I=>{switch(I.__CREATE__&&(I={...I},delete I.__CREATE__),a.value){case"single":if(I&&Rt(I)){S.value&&ye(I),Q.value&&(yt(),k());return}I&&pa(I),w.value&&He(),F.value&&(yt(),k()),I&&Fe(I);break;case"multiple":if(I&&Rt(I)){ye(I),Q.value&&(yt(),k());return}if(fa()){t.emit("max",fe);return}I&&(pa(I),Fe(I)),w.value&&He(),o.value&&yt(),F.value&&k();break;case"tags":if(I&&Rt(I)){ye(I),Q.value&&(yt(),k());return}if(fa()){t.emit("max",fe);return}I&&pa(I),w.value&&He(),I&&Fe(I),o.value&&yt(),F.value&&k();break}F.value||Tn()},ui=I=>{if(!(iA(I)||a.value==="single"||!$.value)){switch(a.value){case"multiple":case"tags":rk(I[K.value])?ye(I[K.value]):Fe(I[K.value].filter(G=>re.value.map(Ie=>Ie[b.value]).indexOf(G[b.value])===-1).filter(G=>!G[ce.value]).filter((G,Ie)=>re.value.length+1+Ie<=T.value||T.value===-1));break}F.value&&x()}},pa=I=>{Ur(I[b.value])===void 0&&yn.value&&(t.emit("tag",I[b.value],fe),t.emit("option",I[b.value],fe),t.emit("create",I[b.value],fe),We.value&&ik(I),He())},nk=()=>{a.value!=="single"&&Fe(tt.value.filter(I=>!I.disabled&&!Rt(I)))},rk=I=>I.find(G=>!Rt(G)&&!G[ce.value])===void 0,ak=I=>I.find(G=>!Rt(G))===void 0,Ur=I=>O.value[O.value.map(G=>String(G[b.value])).indexOf(String(I))],Ak=(I,G=!0)=>O.value.map(Ie=>parseInt(Ie[L.value])==Ie[L.value]?parseInt(Ie[L.value]):Ie[L.value]).indexOf(parseInt(I)==I?parseInt(I):I),sk=I=>["tags","multiple"].indexOf(a.value)!==-1&&o.value&&Rt(I),ik=I=>{W.value.push(I)},ok=I=>oe.value?I.filter(G=>te.value?G.__VISIBLE__.length:G[K.value].length):I.filter(G=>te.value?G.__VISIBLE__.length:!0),$d=(I,G=!0)=>{let Ie=I;if(te.value&&_.value){let wt=ke.value;wt||(wt=(di,zoe)=>{let x1=uf(D(di[L.value]),U.value);return me.value?x1.startsWith(uf(te.value,U.value)):x1.indexOf(uf(te.value,U.value))!==-1}),Ie=Ie.filter(wt)}return o.value&&G&&(Ie=Ie.filter(wt=>!sk(wt))),Ie},Wd=I=>{let G=I;return kU(G)&&(G=Object.keys(G).map(Ie=>{let wt=G[Ie];return{[b.value]:Ie,[L.value]:wt,[u.value]:wt}})),G=G.map(Ie=>typeof Ie=="object"?Ie:{[b.value]:Ie,[L.value]:Ie,[u.value]:Ie}),G},bl=()=>{ur(N.value)||(re.value=Cl(N.value))},_l=I=>(he.value=!0,new Promise((G,Ie)=>{r.value(te.value,fe).then(wt=>{ie.value=wt||[],typeof I=="function"&&I(wt),he.value=!1}).catch(wt=>{console.error(wt),ie.value=[],he.value=!1}).finally(()=>{G()})})),Gd=()=>{if(Ln.value)if(a.value==="single"){let I=Ur(re.value[b.value]);if(I!==void 0){let G=I[u.value];re.value[u.value]=G,p.value&&(N.value[u.value]=G)}}else re.value.forEach((I,G)=>{let Ie=Ur(re.value[G][b.value]);if(Ie!==void 0){let wt=Ie[u.value];re.value[G][u.value]=wt,p.value&&(N.value[G][u.value]=wt)}})},lk=I=>{_l(I)},Cl=I=>ur(I)?a.value==="single"?{}:[]:p.value?I:a.value==="single"?Ur(I)||(C.value?{[u.value]:I,[b.value]:I,[L.value]:I}:{}):I.filter(G=>!!Ur(G)||C.value).map(G=>Ur(G)||{[u.value]:G,[b.value]:G,[L.value]:G}),S1=()=>{Ut.value=i.watch(te,I=>{I.length<v.value||!I&&v.value!==0||(he.value=!0,B.value&&(ie.value=[]),setTimeout(()=>{I==te.value&&r.value(te.value,fe).then(G=>{(I==te.value||!te.value)&&(ie.value=G,It.value=tt.value.filter(Ie=>Ie[ce.value]!==!0)[0]||null,he.value=!1)}).catch(G=>{console.error(G)})},y.value))},{flush:"sync"})};if(a.value!=="single"&&!ur(N.value)&&!Array.isArray(N.value))throw new Error(`v-model must be an array when using "${a.value}" mode`);return r&&typeof r.value=="function"?g.value?_l(bl):p.value==!0&&bl():(ie.value=r.value,bl()),y.value>-1&&S1(),i.watch(y,(I,G)=>{Ut.value&&Ut.value(),I>=0&&S1()}),i.watch(N,I=>{if(ur(I)){lt(Cl(I),!1);return}switch(a.value){case"single":(p.value?I[b.value]!=re.value[b.value]:I!=re.value[b.value])&&lt(Cl(I),!1);break;case"multiple":case"tags":EU(p.value?I.map(G=>G[b.value]):I,re.value.map(G=>G[b.value]))||lt(Cl(I),!1);break}},{deep:!0}),i.watch(r,(I,G)=>{typeof e.options=="function"?g.value&&(!G||I&&I.toString()!==G.toString())&&_l():(ie.value=e.options,Object.keys(re.value).length||bl(),Gd())}),i.watch(u,Gd),{pfo:P,fo:tt,filteredOptions:tt,hasSelected:Ln,multipleLabelText:jn,eo:O,extendedOptions:O,eg:nt,extendedGroups:nt,fg:Dn,filteredGroups:Dn,noOptions:li,noResults:es,resolving:he,busy:ue,offset:pt,select:Fe,deselect:ye,remove:Zt,selectAll:nk,clear:ci,isSelected:Rt,isDisabled:iA,isMax:fa,getOption:Ur,handleOptionClick:ha,handleGroupClick:ui,handleTagRemove:da,refreshOptions:lk,resolveOptions:_l,refreshLabels:Gd}}function xU(e,t,n){const{valueProp:r,showOptions:a,searchable:A,groupLabel:s,groups:o,mode:l,groupSelect:c,disabledProp:u,groupOptions:d}=i.toRefs(e),f=n.fo,h=n.fg,p=n.handleOptionClick,m=n.handleGroupClick,y=n.search,g=n.pointer,v=n.setPointer,_=n.clearPointer,B=n.multiselect,w=n.isOpen,b=i.computed(()=>f.value.filter(N=>!N[u.value])),C=i.computed(()=>h.value.filter(N=>!N[u.value])),E=i.computed(()=>l.value!=="single"&&c.value),S=i.computed(()=>g.value&&g.value.group),T=i.computed(()=>fe(g.value)),U=i.computed(()=>{const N=S.value?g.value:fe(g.value),te=C.value.map(lt=>lt[s.value]).indexOf(N[s.value]);let He=C.value[te-1];return He===void 0&&(He=Q.value),He}),F=i.computed(()=>{let N=C.value.map(te=>te.label).indexOf(S.value?g.value[s.value]:fe(g.value)[s.value])+1;return C.value.length<=N&&(N=0),C.value[N]}),Q=i.computed(()=>[...C.value].slice(-1)[0]),Y=i.computed(()=>g.value.__VISIBLE__.filter(N=>!N[u.value])[0]),X=i.computed(()=>{const N=T.value.__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])-1]}),j=i.computed(()=>{const N=fe(g.value).__VISIBLE__.filter(te=>!te[u.value]);return N[N.map(te=>te[r.value]).indexOf(g.value[r.value])+1]}),K=i.computed(()=>[...U.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),oe=i.computed(()=>[...Q.value.__VISIBLE__.filter(N=>!N[u.value])].slice(-1)[0]),$=N=>g.value&&(!N.group&&g.value[r.value]===N[r.value]||N.group!==void 0&&g.value[s.value]===N[s.value])?!0:void 0,Ae=()=>{v(b.value[0]||null)},ce=()=>{!g.value||g.value[u.value]===!0||(S.value?m(g.value):p(g.value))},me=()=>{if(g.value===null)v((o.value&&E.value?C.value[0].__CREATE__?b.value[0]:C.value[0]:b.value[0])||null);else if(o.value&&E.value){let N=S.value?Y.value:j.value;N===void 0&&(N=F.value,N.__CREATE__&&(N=N[d.value][0])),v(N||null)}else{let N=b.value.map(te=>te[r.value]).indexOf(g.value[r.value])+1;b.value.length<=N&&(N=0),v(b.value[N]||null)}i.nextTick(()=>{re()})},ke=()=>{if(g.value===null){let N=b.value[b.value.length-1];o.value&&E.value&&(N=oe.value,N===void 0&&(N=Q.value)),v(N||null)}else if(o.value&&E.value){let N=S.value?K.value:X.value;N===void 0&&(N=S.value?U.value:T.value,N.__CREATE__&&(N=K.value,N===void 0&&(N=U.value))),v(N||null)}else{let N=b.value.map(te=>te[r.value]).indexOf(g.value[r.value])-1;N<0&&(N=b.value.length-1),v(b.value[N]||null)}i.nextTick(()=>{re()})},fe=N=>C.value.find(te=>te.__VISIBLE__.map(He=>He[r.value]).indexOf(N[r.value])!==-1),re=()=>{let N=B.value.querySelector("[data-pointed]");if(!N)return;let te=N.parentElement.parentElement;o.value&&(te=S.value?N.parentElement.parentElement.parentElement:N.parentElement.parentElement.parentElement.parentElement),N.offsetTop+N.offsetHeight>te.clientHeight+te.scrollTop&&(te.scrollTop=N.offsetTop+N.offsetHeight-te.clientHeight),N.offsetTop<te.scrollTop&&(te.scrollTop=N.offsetTop)};return i.watch(y,N=>{A.value&&(N.length&&a.value?Ae():_())}),i.watch(w,N=>{if(N){let te=B.value.querySelectorAll("[data-selected]")[0];if(!te)return;let He=te.parentElement.parentElement;i.nextTick(()=>{He.scrollTop>0||(He.scrollTop=te.offsetTop)})}}),{pointer:g,canPointGroups:E,isPointed:$,setPointerFirst:Ae,selectPointer:ce,forwardPointer:me,backwardPointer:ke}}function FU(e,t,n){const{disabled:r}=i.toRefs(e),a=i.getCurrentInstance().proxy,A=i.ref(!1);return{isOpen:A,open:()=>{A.value||r.value||(A.value=!0,t.emit("open",a))},close:()=>{A.value&&(A.value=!1,t.emit("close",a))}}}function IU(e,t,n){const{searchable:r,disabled:a,clearOnBlur:A}=i.toRefs(e),s=n.input,o=n.open,l=n.close,c=n.clearSearch,u=n.isOpen,d=i.ref(null),f=i.ref(null),h=i.ref(null),p=i.ref(!1),m=i.ref(!1),y=i.computed(()=>r.value||a.value?-1:0),g=()=>{r.value&&s.value.blur(),f.value.blur()},v=()=>{r.value&&!a.value&&s.value.focus()},_=(S=!0)=>{a.value||(p.value=!0,S&&o())},B=()=>{p.value=!1,setTimeout(()=>{p.value||(l(),A.value&&c())},1)};return{multiselect:d,wrapper:f,tags:h,tabindex:y,isActive:p,mouseClicked:m,blur:g,focus:v,activate:_,deactivate:B,handleFocusIn:S=>{S.target.closest("[data-tags]")&&S.target.nodeName!=="INPUT"||S.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{B()},handleCaretClick:()=>{B(),g()},handleMousedown:S=>{m.value=!0,u.value&&(S.target.isEqualNode(f.value)||S.target.isEqualNode(h.value))?setTimeout(()=>{B()},0):document.activeElement.isEqualNode(f.value)&&!u.value&&_(),setTimeout(()=>{m.value=!1},0)}}}function UU(e,t,n){const{mode:r,addTagOn:a,openDirection:A,searchable:s,showOptions:o,valueProp:l,groups:c,addOptionOn:u,createTag:d,createOption:f,reverse:h}=i.toRefs(e),p=i.getCurrentInstance().proxy,m=n.iv,y=n.update,g=n.search,v=n.setPointer,_=n.selectPointer,B=n.backwardPointer,w=n.forwardPointer,b=n.multiselect,C=n.wrapper,E=n.tags,S=n.isOpen,T=n.open,U=n.blur,F=n.fo,Q=i.computed(()=>d.value||f.value||!1),Y=i.computed(()=>a.value!==void 0?a.value:u.value!==void 0?u.value:["enter"]),X=()=>{r.value==="tags"&&!o.value&&Q.value&&s.value&&!c.value&&v(F.value[F.value.map($=>$[l.value]).indexOf(g.value)])},j=$=>{let Ae=$.length-1;for(;Ae>=0&&($[Ae].remove===!1||$[Ae].disabled);)Ae--;return Ae<0||$.splice(Ae,1),$};return{handleKeydown:$=>{t.emit("keydown",$,p);let Ae,ce;switch(["ArrowLeft","ArrowRight","Enter"].indexOf($.key)!==-1&&r.value==="tags"&&(Ae=[...b.value.querySelectorAll("[data-tags] > *")].filter(me=>me!==E.value),ce=Ae.findIndex(me=>me===document.activeElement)),$.key){case"Backspace":if(r.value==="single"||s.value&&[null,""].indexOf(g.value)===-1||m.value.length===0)return;y(j([...m.value]));break;case"Enter":if($.preventDefault(),$.keyCode===229)return;if(ce!==-1&&ce!==void 0){y([...m.value].filter((me,ke)=>ke!==ce)),ce===Ae.length-1&&(Ae.length-1?Ae[Ae.length-2].focus():s.value?E.value.querySelector("input").focus():C.value.focus());return}if(Y.value.indexOf("enter")===-1&&Q.value)return;X(),_();break;case" ":if(!Q.value&&!s.value){$.preventDefault(),X(),_();return}if(!Q.value)return!1;if(Y.value.indexOf("space")===-1&&Q.value)return;$.preventDefault(),X(),_();break;case"Tab":case";":case",":if(Y.value.indexOf($.key.toLowerCase())===-1||!Q.value)return;X(),_(),$.preventDefault();break;case"Escape":U();break;case"ArrowUp":if($.preventDefault(),!o.value)return;S.value||T(),B();break;case"ArrowDown":if($.preventDefault(),!o.value)return;S.value||T(),w();break;case"ArrowLeft":if(s.value&&E.value&&E.value.querySelector("input").selectionStart||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),ce===-1?Ae[Ae.length-1].focus():ce>0&&Ae[ce-1].focus();break;case"ArrowRight":if(ce===-1||$.shiftKey||r.value!=="tags"||!m.value||!m.value.length)return;$.preventDefault(),Ae.length>ce+1?Ae[ce+1].focus():s.value?E.value.querySelector("input").focus():s.value||C.value.focus();break}},handleKeyup:$=>{t.emit("keyup",$,p)},preparePointer:X}}function QU(e,t,n){const{classes:r,disabled:a,openDirection:A,showOptions:s}=i.toRefs(e),o=n.isOpen,l=n.isPointed,c=n.isSelected,u=n.isDisabled,d=n.isActive,f=n.canPointGroups,h=n.resolving,p=n.fo,m=i.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),y=i.computed(()=>!!(o.value&&s.value&&(!h.value||h.value&&p.value.length)));return{classList:i.computed(()=>{const v=m.value;return{container:[v.container].concat(a.value?v.containerDisabled:[]).concat(y.value&&A.value==="top"?v.containerOpenTop:[]).concat(y.value&&A.value!=="top"?v.containerOpen:[]).concat(d.value?v.containerActive:[]),wrapper:v.wrapper,spacer:v.spacer,singleLabel:v.singleLabel,singleLabelText:v.singleLabelText,multipleLabel:v.multipleLabel,search:v.search,tags:v.tags,tag:[v.tag].concat(a.value?v.tagDisabled:[]),tagDisabled:v.tagDisabled,tagRemove:v.tagRemove,tagRemoveIcon:v.tagRemoveIcon,tagsSearchWrapper:v.tagsSearchWrapper,tagsSearch:v.tagsSearch,tagsSearchCopy:v.tagsSearchCopy,placeholder:v.placeholder,caret:[v.caret].concat(o.value?v.caretOpen:[]),clear:v.clear,clearIcon:v.clearIcon,spinner:v.spinner,inifinite:v.inifinite,inifiniteSpinner:v.inifiniteSpinner,dropdown:[v.dropdown].concat(A.value==="top"?v.dropdownTop:[]).concat(!o.value||!s.value||!y.value?v.dropdownHidden:[]),options:[v.options].concat(A.value==="top"?v.optionsTop:[]),group:v.group,groupLabel:_=>{let B=[v.groupLabel];return l(_)?B.push(c(_)?v.groupLabelSelectedPointed:v.groupLabelPointed):c(_)&&f.value?B.push(u(_)?v.groupLabelSelectedDisabled:v.groupLabelSelected):u(_)&&B.push(v.groupLabelDisabled),f.value&&B.push(v.groupLabelPointable),B},groupOptions:v.groupOptions,option:(_,B)=>{let w=[v.option];return l(_)?w.push(c(_)?v.optionSelectedPointed:v.optionPointed):c(_)?w.push(u(_)?v.optionSelectedDisabled:v.optionSelected):(u(_)||B&&u(B))&&w.push(v.optionDisabled),w},noOptions:v.noOptions,noResults:v.noResults,assist:v.assist,fakeInput:v.fakeInput}}),showDropdown:y}}function TU(e,t,n){const{limit:r,infinite:a}=i.toRefs(e),A=n.isOpen,s=n.offset,o=n.search,l=n.pfo,c=n.eo,u=i.ref(null),d=i.ref(null),f=i.computed(()=>s.value<l.value.length),h=m=>{const{isIntersecting:y,target:g}=m[0];if(y){const v=g.offsetParent,_=v.scrollTop;s.value+=r.value==-1?10:r.value,i.nextTick(()=>{v.scrollTop=_})}},p=()=>{A.value&&s.value<l.value.length?u.value.observe(d.value):!A.value&&u.value&&u.value.disconnect()};return i.watch(A,()=>{a.value&&p()}),i.watch(o,()=>{a.value&&(s.value=r.value,p())},{flush:"post"}),i.watch(c,()=>{a.value&&p()},{immediate:!1,flush:"post"}),i.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(h))}),{hasMore:f,infiniteLoader:d}}function DU(e,t,n){const{placeholder:r,id:a,valueProp:A,label:s,mode:o,groupLabel:l,aria:c,searchable:u}=i.toRefs(e),d=n.pointer,f=n.iv,h=n.hasSelected,p=n.multipleLabelText,m=i.ref(null),y=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("assist"),F.join("-")}),g=i.computed(()=>{let F=[];return a&&a.value&&F.push(a.value),F.push("multiselect-options"),F.join("-")}),v=i.computed(()=>{let F=[];if(a&&a.value&&F.push(a.value),d.value)return F.push(d.value.group?"multiselect-group":"multiselect-option"),F.push(d.value.group?d.value.index:d.value[A.value]),F.join("-")}),_=i.computed(()=>r.value),B=i.computed(()=>o.value!=="single"),w=i.computed(()=>{let F="";return o.value==="single"&&h.value&&(F+=f.value[s.value]),o.value==="multiple"&&h.value&&(F+=p.value),o.value==="tags"&&h.value&&(F+=f.value.map(Q=>Q[s.value]).join(", ")),F}),b=i.computed(()=>{let F={...c.value};return u.value&&(F["aria-labelledby"]=F["aria-labelledby"]?`${y.value} ${F["aria-labelledby"]}`:y.value,w.value&&F["aria-label"]&&(F["aria-label"]=`${w.value}, ${F["aria-label"]}`)),F}),C=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-option"),Q.push(F[A.value]),Q.join("-")},E=F=>{let Q=[];return a&&a.value&&Q.push(a.value),Q.push("multiselect-group"),Q.push(F.index),Q.join("-")},S=F=>{let Q=[];return Q.push(F),Q.join(" ")},T=F=>{let Q=[];return Q.push(F),Q.join(" ")},U=F=>`${F} ❎`;return i.onMounted(()=>{if(a&&a.value&&document&&document.querySelector){let F=document.querySelector(`[for="${a.value}"]`);m.value=F?F.innerText:null}}),{arias:b,ariaLabel:w,ariaAssist:y,ariaControls:g,ariaPlaceholder:_,ariaMultiselectable:B,ariaActiveDescendant:v,ariaOptionId:C,ariaOptionLabel:S,ariaGroupId:E,ariaGroupLabel:T,ariaTagLabel:U}}function LU(e,t,n){const{locale:r,fallbackLocale:a}=i.toRefs(e);return{localize:s=>!s||typeof s!="object"?s:s&&s[r.value]?s[r.value]:s&&r.value&&s[r.value.toUpperCase()]?s[r.value.toUpperCase()]:s&&s[a.value]?s[a.value]:s&&a.value&&s[a.value.toUpperCase()]?s[a.value.toUpperCase()]:s&&Object.keys(s)[0]?s[Object.keys(s)[0]]:""}}function OU(e,t,n,r={}){return n.forEach(a=>{a&&(r={...r,...a(e,t,r)})}),r}var $t={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(e,t){return OU(e,t,[LU,bU,CU,FU,_U,wU,IU,SU,TU,xU,UU,QU,DU])}};const MU=["id","dir"],NU=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],PU=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],HU=["onKeyup","aria-label"],RU=["onClick"],VU=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],KU=["innerHTML"],$U=["id"],WU=["id","aria-label","aria-selected"],GU=["data-pointed","onMouseenter","onClick"],zU=["innerHTML"],jU=["aria-label"],YU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],qU=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],XU=["innerHTML"],JU=["innerHTML"],ZU=["value"],eQ=["name","value"],tQ=["name","value"],nQ=["id"];function rQ(e,t,n,r,a,A){return i.openBlock(),i.createElementBlock("div",{ref:"multiselect",class:i.normalizeClass(e.classList.container),id:n.searchable?void 0:n.id,dir:n.rtl?"rtl":void 0,onFocusin:t[10]||(t[10]=(...s)=>e.handleFocusIn&&e.handleFocusIn(...s)),onFocusout:t[11]||(t[11]=(...s)=>e.handleFocusOut&&e.handleFocusOut(...s)),onKeyup:t[12]||(t[12]=(...s)=>e.handleKeyup&&e.handleKeyup(...s)),onKeydown:t[13]||(t[13]=(...s)=>e.handleKeydown&&e.handleKeydown(...s))},[i.createElementVNode("div",i.mergeProps({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...s)=>e.handleMousedown&&e.handleMousedown(...s)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":n.searchable?void 0:e.ariaControls,"aria-placeholder":n.searchable?void 0:e.ariaPlaceholder,"aria-expanded":n.searchable?void 0:e.isOpen,"aria-activedescendant":n.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":n.searchable?void 0:e.ariaMultiselectable,role:n.searchable?void 0:"combobox"},n.searchable?{}:e.arias),[i.createCommentVNode(" Search "),n.mode!=="tags"&&n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:n.autocomplete,id:n.searchable?n.id:void 0,onInput:t[0]||(t[0]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[1]||(t[1]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[2]||(t[2]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,PU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Tags (with search) "),n.mode=="tags"?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(e.classList.tags),"data-tags":""},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.iv,(s,o,l)=>i.renderSlot(e.$slots,"tag",{option:s,handleTagRemove:e.handleTagRemove,disabled:n.disabled},()=>[(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass([e.classList.tag,s.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:i.withKeys(c=>e.handleTagRemove(s,c),["enter"]),key:l,"aria-label":e.ariaTagLabel(e.localize(s[n.label]))},[i.createTextVNode(i.toDisplayString(e.localize(s[n.label]))+" ",1),!n.disabled&&!s.disabled?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(e.classList.tagRemove),onClick:i.withModifiers(c=>e.handleTagRemove(s,c),["stop"])},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagRemoveIcon)},null,2)],10,RU)):i.createCommentVNode("v-if",!0)],42,HU))])),256)),i.createElementVNode("div",{class:i.normalizeClass(e.classList.tagsSearchWrapper),ref:"tags"},[i.createCommentVNode(" Used for measuring search width "),i.createElementVNode("span",{class:i.normalizeClass(e.classList.tagsSearchCopy)},i.toDisplayString(e.search),3),i.createCommentVNode(" Actual search input "),n.searchable&&!n.disabled?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:0,type:n.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:n.searchable?n.id:void 0,autocomplete:n.autocomplete,onInput:t[3]||(t[3]=(...s)=>e.handleSearchInput&&e.handleSearchInput(...s)),onKeypress:t[4]||(t[4]=(...s)=>e.handleKeypress&&e.handleKeypress(...s)),onPaste:t[5]||(t[5]=i.withModifiers((...s)=>e.handlePaste&&e.handlePaste(...s),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...n.attrs,...e.arias}),null,16,VU)):i.createCommentVNode("v-if",!0)],2)],2)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Single label "),n.mode=="single"&&e.hasSelected&&!e.search&&e.iv?i.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.singleLabel)},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.singleLabelText)},i.toDisplayString(e.localize(e.iv[n.label])),3)],2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Multiple label "),n.mode=="multiple"&&e.hasSelected&&!e.search?i.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,KU)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Placeholder "),n.placeholder&&!e.hasSelected&&!e.search?i.renderSlot(e.$slots,"placeholder",{key:4},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.placeholder),"aria-hidden":"true"},i.toDisplayString(n.placeholder),3)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Spinner "),n.loading||e.resolving?i.renderSlot(e.$slots,"spinner",{key:5},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.spinner),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Clear "),e.hasSelected&&!n.disabled&&n.canClear&&!e.busy?i.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},()=>[i.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:i.normalizeClass(e.classList.clear),onClick:t[6]||(t[6]=(...s)=>e.clear&&e.clear(...s)),onKeyup:t[7]||(t[7]=i.withKeys((...s)=>e.clear&&e.clear(...s),["enter"]))},[i.createElementVNode("span",{class:i.normalizeClass(e.classList.clearIcon)},null,2)],34)]):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Caret "),n.caret&&n.showOptions?i.renderSlot(e.$slots,"caret",{key:7},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.caret),onClick:t[8]||(t[8]=(...s)=>e.handleCaretClick&&e.handleCaretClick(...s)),"aria-hidden":"true"},null,2)]):i.createCommentVNode("v-if",!0)],16,NU),i.createCommentVNode(" Options "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.dropdown),tabindex:"-1"},[i.renderSlot(e.$slots,"beforelist",{options:e.fo}),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.options),id:e.ariaControls,role:"listbox"},[n.groups?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(e.fg,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.group),key:l,id:e.ariaGroupId(s),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),"aria-selected":e.isSelected(s),role:"option"},[s.__CREATE__?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(e.classList.groupLabel(s)),"data-pointed":e.isPointed(s),onMouseenter:c=>e.setPointer(s,o),onClick:c=>e.handleGroupClick(s)},[i.renderSlot(e.$slots,"grouplabel",{group:s,isSelected:e.isSelected,isPointed:e.isPointed},()=>[i.createElementVNode("span",{innerHTML:e.localize(s[n.groupLabel])},null,8,zU)])],42,GU)),i.createElementVNode("ul",{class:i.normalizeClass(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(s[n.groupLabel])),role:"group"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.__VISIBLE__,(c,u,d)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(c,s)),"data-pointed":e.isPointed(c),"data-selected":e.isSelected(c)||void 0,key:d,onMouseenter:f=>e.setPointer(c),onClick:f=>e.handleOptionClick(c),id:e.ariaOptionId(c),"aria-selected":e.isSelected(c),"aria-label":e.ariaOptionLabel(e.localize(c[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:c,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(c[n.label])),1)])],42,YU))),128))],10,jU)],10,WU))),128)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.fo,(s,o,l)=>(i.openBlock(),i.createElementBlock("li",{class:i.normalizeClass(e.classList.option(s)),"data-pointed":e.isPointed(s),"data-selected":e.isSelected(s)||void 0,key:l,onMouseenter:c=>e.setPointer(s),onClick:c=>e.handleOptionClick(s),id:e.ariaOptionId(s),"aria-selected":e.isSelected(s),"aria-label":e.ariaOptionLabel(e.localize(s[n.label])),role:"option"},[i.renderSlot(e.$slots,"option",{option:s,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},()=>[i.createElementVNode("span",null,i.toDisplayString(e.localize(s[n.label])),1)])],42,qU))),128))],10,$U),e.noOptions?i.renderSlot(e.$slots,"nooptions",{key:0},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noOptions),innerHTML:e.localize(n.noOptionsText)},null,10,XU)]):i.createCommentVNode("v-if",!0),e.noResults?i.renderSlot(e.$slots,"noresults",{key:1},()=>[i.createElementVNode("div",{class:i.normalizeClass(e.classList.noResults),innerHTML:e.localize(n.noResultsText)},null,10,JU)]):i.createCommentVNode("v-if",!0),n.infinite&&e.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.inifinite),ref:"infiniteLoader"},[i.renderSlot(e.$slots,"infinite",{},()=>[i.createElementVNode("span",{class:i.normalizeClass(e.classList.inifiniteSpinner)},null,2)])],2)):i.createCommentVNode("v-if",!0),i.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),i.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(i.openBlock(),i.createElementBlock("input",{key:0,class:i.normalizeClass(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ZU)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Native input support "),n.nativeSupport?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.mode=="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:e.plainValue!==void 0?e.plainValue:""},null,8,eQ)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(e.plainValue,(s,o)=>(i.openBlock(),i.createElementBlock("input",{type:"hidden",name:`${n.name}[]`,value:s,key:o},null,8,tQ))),128))],64)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Screen reader assistive text "),n.searchable&&e.hasSelected?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},i.toDisplayString(e.ariaLabel),11,nQ)):i.createCommentVNode("v-if",!0),i.createCommentVNode(" Create height for empty input "),i.createElementVNode("div",{class:i.normalizeClass(e.classList.spacer)},null,2)],42,MU)}$t.render=rQ;$t.__file="src/Multiselect.vue";const aQ={class:"search-bar"},AQ=i.defineComponent({__name:"SearchBar",props:gb,setup(e){const t=e,{t:n}=ne(),r=i.ref(""),a=mA.useRouter();function A(o,l,c){c.clear(),c.search=r.value,a.push(l.link)}function s(o){r.value=o}return(o,l)=>(i.openBlock(),i.createElementBlock("div",aQ,[i.createVNode(i.unref($t),{placeholder:i.unref(n)("navigation.searchPlaceholder"),"value-prop":"link","clear-on-blur":!1,"clear-on-search":!1,"clear-on-select":!1,"close-on-select":!0,delay:0,"filter-results":!1,groups:!0,"min-chars":0,"resolve-on-load":!1,searchable:!0,options:t.fetchSeachResult,onOpen:l[0]||(l[0]=c=>{c.noOptions&&c.resolveOptions()}),onSearchChange:s,onSelect:A},{option:i.withCtx(({option:c})=>[c.type==="card"?(i.openBlock(),i.createBlock(hn,{key:`card-${c.card.cardCode}`,class:"card-slice-item","maintain-aspect-ratio":!0,"card-prop":c.card,"router-link":c.link},null,8,["card-prop","router-link"])):(i.openBlock(),i.createBlock(hn,{key:`player-${c.link}`,class:"card-slice-item","maintain-aspect-ratio":!0,"ignore-card-item":!0,"card-code-prop":c.cardCode,color:c.color,name:c.name,"mana-number":c.rank,"router-link":c.link},null,8,["card-code-prop","color","name","mana-number","router-link"]))]),_:1},8,["placeholder","options"])]))}});const qu=M(AQ,[["__scopeId","data-v-2dff2569"]]),sQ={class:"social-links"},iQ=i.defineComponent({__name:"SocialLinks",setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",sQ,[i.createVNode(i.unref(Ee),{class:"icon",icon:"fa-brands fa-discord"}),i.createVNode(i.unref(Ee),{class:"icon",icon:"fa-brands fa-twitter"})]))}});const vg=M(iQ,[["__scopeId","data-v-5517438c"]]),oQ={showModal:{type:Boolean,required:!0,default:!1}},lQ=["onClick"],cQ=i.defineComponent({__name:"ModalItem",props:oQ,emits:["update:showModal"],setup(e,{emit:t}){const n=e,r=i.ref(null);function a(){t("update:showModal",!1)}return i.onBeforeUnmount(()=>{var A;(A=r.value)==null||A.remove()}),i.watch(()=>n.showModal,()=>{n.showModal&&i.nextTick(()=>{r.value&&document.body.appendChild(r.value)})}),(A,s)=>n.showModal?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"modalItem",ref:r,class:"modal-item",onClick:i.withModifiers(a,["self"])},[i.renderSlot(A.$slots,"default",{},void 0,!0)],8,lQ)):i.createCommentVNode("",!0)}});const $A=M(cQ,[["__scopeId","data-v-5e715d99"]]),uQ={filterArray:{type:Array,required:!1,default:void 0},title:{type:String,required:!1,default:void 0}},dQ={class:"filter"},fQ={key:0,class:"top"},hQ={key:0,class:"title"},pQ=i.defineComponent({__name:"SidePanelSectionPane",props:uQ,emits:["clear:filterArray"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterArray&&n.filterArray.length>0?"clickable":null);function a(){t("clear:filterArray")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",dQ,[n.title||A.filterArray?(i.openBlock(),i.createElementBlock("div",fQ,[n.title?(i.openBlock(),i.createElementBlock("h2",hQ,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),A.filterArray?i.withDirectives((i.openBlock(),i.createElementBlock("p",{key:1,class:i.normalizeClass(["clear",r.value]),onClick:a},null,2)),[[o,"general.clear"]]):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const gt=M(pQ,[["__scopeId","data-v-741cceed"]]),gQ={filterArray:{type:Array,required:!0,default:[]}},mQ=["placeholder"],vQ=i.defineComponent({__name:"FilterSampleSize",props:gQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.ref("");let s=setTimeout(()=>{},0);a.value.length>0&&(A.value=a.value[0]),i.watch(a,()=>{t("update:filterArray",a.value)}),i.watch(A,()=>{s&&clearTimeout(s),s=setTimeout(()=>{a.value.splice(0),A.value&&a.value.push(A.value)},1e3)});function o(){a.value.splice(0),A.value=""}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.sampleSize"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),placeholder:i.unref(r)("general.minimumMatches"),type:"number",min:"10",step:"10"},null,8,mQ),[[i.vModelText,A.value]])]),_:1},8,["filter-array","title"]))}});const Js=M(vQ,[["__scopeId","data-v-d66d5f9d"]]),BQ={filterArray:{type:Array,required:!0,default:[]}},yQ={isSelected:{type:Boolean,required:!0,default:!1},icon:{type:String,required:!1,default:void 0},prompt:{type:String,required:!0,default:""}},wQ=["selected"],bQ={class:"checkbox-name"},_Q=i.defineComponent({__name:"CheckboxItem",props:yQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e,r=i.computed(()=>(console.log(n.icon),{content:n.icon}));function a(){t("update:isSelected",!n.isSelected)}return(A,s)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:a},[n.icon?(i.openBlock(),i.createElementBlock("div",{key:0,class:"checkbox-icon",style:i.normalizeStyle(r.value)},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",bQ,i.toDisplayString(n.prompt),1)],8,wQ))}});const rn=M(_Q,[["__scopeId","data-v-ab8b99a4"]]),CQ={selectedOption:{type:Number,required:!0,default:-1},options:{type:Array,required:!0,default:[]}},kQ=e=>(i.pushScopeId("data-v-d5d9745a"),e=e(),i.popScopeId(),e),EQ={class:"toggle-switch"},SQ=kQ(()=>i.createElementVNode("div",{class:"selection"},null,-1)),xQ=[SQ],FQ=["onClick"],IQ={class:"option flex-center"},UQ={class:"option-text"},QQ=i.defineComponent({__name:"ToggleSwitch",props:CQ,emits:["update:selectedOption"],setup(e,{emit:t}){const n=e,r=i.computed(()=>({left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${n.selectedOption})`,width:`calc((100% - calc(var(--spacing-1) * 2)) / ${n.options.length})`}));function a(s){return{cursor:n.selectedOption!=s?"pointer":"default",left:`calc(var(--spacing-1) + (100% - calc(var(--spacing-1) * 2)) / ${n.options.length} * ${s})`,width:`${1/n.options.length*100}%`}}function A(s){t("update:selectedOption",s)}return(s,o)=>(i.openBlock(),i.createElementBlock("div",EQ,[i.withDirectives(i.createElementVNode("div",{class:"selection-container",style:i.normalizeStyle(r.value)},xQ,4),[[i.vShow,s.selectedOption>-1]]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(l,c)=>(i.openBlock(),i.createElementBlock("div",{key:c,ref_for:!0,ref:"option-container",style:i.normalizeStyle(a(c)),class:"option-container",onClick:u=>A(c)},[i.createElementVNode("div",IQ,[i.createElementVNode("h1",UQ,i.toDisplayString(l),1)])],12,FQ))),128))]))}});const Xu=M(QQ,[["__scopeId","data-v-d5d9745a"]]),TQ={class:"checkboxes-container"},DQ=i.defineComponent({__name:"FilterRanks",props:BQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.ranks.sort((c,u)=>u.order-c.order)),A=i.reactive(n.filterArray),s=i.ref(0);i.watch(A,()=>{t("update:filterArray",A)}),i.watch(s,()=>{s.value===0?A.splice(0):s.value===1&&(A.splice(0),A.push("Platinum","Diamond","Masters"))});function o(){A.splice(0),s.value=0}function l(c){const u=A.indexOf(c);if(u===-1){A.push(c);return}A.splice(u,1)}return(c,u)=>(i.openBlock(),i.createBlock(gt,{"filter-array":A,title:i.unref(r)("general.ranks"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",TQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,d=>(i.openBlock(),i.createBlock(rn,{key:d.nameRef,icon:`url(${d.icon})`,prompt:d.name,"is-selected":A.includes(d.nameRef),"onUpdate:isSelected":f=>l(d.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(Xu,{"selected-option":s.value,"onUpdate:selectedOption":u[0]||(u[0]=d=>s.value=d),options:[i.unref(r)("general.allRanks"),i.unref(r)("general.platPlus")]},null,8,["selected-option","options"])])]),_:1},8,["filter-array","title"]))}});const Bb=M(DQ,[["__scopeId","data-v-af7bc2a0"]]),LQ={filterArray:{type:Array,required:!0,default:[]}},OQ={isSelected:{type:Boolean,required:!0,default:!1},prompt:{type:Number,required:!0,default:""}},MQ=["selected"],NQ={class:"prompt"},PQ=i.defineComponent({__name:"CheckboxItemManaCost",props:OQ,emits:["update:isSelected"],setup(e,{emit:t}){const n=e;function r(){t("update:isSelected",!n.isSelected)}return(a,A)=>(i.openBlock(),i.createElementBlock("button",{class:"checkbox-item",selected:n.isSelected,onClick:r},[i.createVNode(qo),i.createElementVNode("div",NQ,i.toDisplayString(n.prompt===10?"+":n.prompt),1)],8,MQ))}});const su=M(PQ,[["__scopeId","data-v-2c74c2ed"]]),HQ={class:"checkbox-rows-container"},RQ={class:"top-row checkbox-items-container"},VQ={class:"bottom-row checkbox-items-container"},KQ=i.defineComponent({__name:"FilterManaCost",props:LQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=Array(6).fill(1).map((l,c)=>c),A=Array(5).fill(1).map((l,c)=>c+6);function s(l){let c;n.filterArray.includes(l)?c=n.filterArray.filter(u=>u!==l):c=[...n.filterArray,l],t("update:filterArray",c)}function o(){t("update:filterArray",[])}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":n.filterArray,title:i.unref(r)("general.manaCost"),"onClear:filterArray":o},{default:i.withCtx(()=>[i.createElementVNode("div",HQ,[i.createElementVNode("div",RQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(a),u=>(i.openBlock(),i.createBlock(su,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))]),i.createElementVNode("div",VQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(A),u=>(i.openBlock(),i.createBlock(su,{key:u,class:"checkbox-item-mana-cost",prompt:u,"is-selected":n.filterArray.includes(u),"onUpdate:isSelected":d=>s(u)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])])]),_:1},8,["filter-array","title"]))}});const Bg=M(KQ,[["__scopeId","data-v-a94d786a"]]),$Q={filterArray:{type:Array,required:!0,default:[]}},WQ={class:"checkboxes-container"},yg=i.defineComponent({__name:"FilterRarities",props:$Q,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.rarities.filter(l=>l.nameRef!=="None")),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":A,title:i.unref(r)("general.rarities"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",WQ,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),GQ={filterArray:{type:Array,required:!0,default:[]}},zQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},jQ=["src"],YQ={class:"multiselect-tag-remove"},qQ=["onMousedown"],XQ=["src"],wg=i.defineComponent({__name:"FilterSets",props:GQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray);i.watch(a,()=>{t("update:filterArray",a.value)});function A(){a.value.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.sets"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),placeholder:i.unref(r)("general.sets"),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.sets,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:l,handleTagRemove:c})=>[i.createElementVNode("span",zQ,[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,jQ),i.createElementVNode("span",YQ,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(u=>c(l,u),["prevent"])},null,40,qQ)])])]),option:i.withCtx(({option:l})=>[i.createElementVNode("img",{class:"label-icon",src:l.icon},null,8,XQ),i.createTextVNode(" "+i.toDisplayString(l.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),JQ={filterArray:{type:Array,required:!0,default:[]}},ZQ={class:"multiselect-tag",tabindex:"-1","aria-label":"{{option.name}} ❎"},eT=["src"],tT={class:"multiselect-tag-remove"},nT=["onMousedown"],rT=["src"],bg=i.defineComponent({__name:"FilterKeywords",props:JQ,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.computed(()=>we().dataJson.keywords.filter(o=>o.showInFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("general.keywords"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:i.unref(r)("general.keywords"),class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},{tag:i.withCtx(({option:c,handleTagRemove:u})=>[i.createElementVNode("span",ZQ,[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,eT),i.createElementVNode("span",tT,[i.createElementVNode("span",{class:"multiselect-tag-remove-icon",onMousedown:i.withModifiers(d=>u(c,d),["prevent"])},null,40,nT)])])]),option:i.withCtx(({option:c})=>[i.createElementVNode("img",{class:"label-icon",src:c.icon},null,8,rT),i.createTextVNode(" "+i.toDisplayString(c.name),1)]),_:1},8,["modelValue","placeholder","options"])]),_:1},8,["filter-array","title"]))}}),aT={filterArray:{type:Array,required:!0,default:[]}},AT={class:"checkboxes-container"},Zs=i.defineComponent({__name:"FilterServers",props:aT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray);i.watch(a,()=>{t("update:filterArray",a)});function A(){a.splice(0)}function s(o){const l=a.indexOf(o);if(l===-1){a.push(o);return}a.splice(l,1)}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.servers"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createElementVNode("div",AT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.servers,c=>(i.openBlock(),i.createBlock(rn,{key:c.nameRef,prompt:c.name,"is-selected":a.includes(c.nameRef),"onUpdate:isSelected":u=>s(c.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),sT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},iT={class:"checkboxes-container"},oT=i.defineComponent({__name:"FilterTime",props:sT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray),A=i.ref(null),s=i.ref(null),o=a.find(h=>h.startsWith("patch_"));o&&(A.value=o);const l=a.find(h=>h.startsWith("season_"));l&&(s.value=l);const c=i.computed(()=>n.allowZero&&a.filter(h=>h.startsWith("patch")).length>0||!n.allowZero&&a.filter(h=>!h.startsWith("patch")).length===0);i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(h,p)=>{u(h,p)}),i.watch(s,(h,p)=>{u(h,p)});function u(h,p){console.log(p,h),p&&a.splice(a.indexOf(p),1),h&&a.push(h),console.log(a)}function d(){a.splice(0),A.value=null,s.value=null}function f(h){a.splice(0),(n.allowZero||h!=="patch")&&a.push(h),h==="patch"&&A.value&&a.push(A.value),h==="season"&&s.value&&a.push(s.value)}return(h,p)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.time"),"onClear:filterArray":d},{default:i.withCtx(()=>[i.createElementVNode("div",iT,[i.createVNode(rn,{prompt:i.unref(r)("general.patch"),"is-selected":c.value,"onUpdate:isSelected":p[0]||(p[0]=m=>f("patch"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.season"),"is-selected":a.includes("season"),"onUpdate:isSelected":p[1]||(p[1]=m=>f("season"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastDays",7),"is-selected":a.includes("7days"),"onUpdate:isSelected":p[2]||(p[2]=m=>f("7days"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastDays",3),"is-selected":a.includes("3days"),"onUpdate:isSelected":p[3]||(p[3]=m=>f("3days"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastHours",24),"is-selected":a.includes("24hours"),"onUpdate:isSelected":p[4]||(p[4]=m=>f("24hours"))},null,8,["prompt","is-selected"]),i.createVNode(rn,{prompt:i.unref(r)("general.pastHour"),"is-selected":a.includes("1hour"),"onUpdate:isSelected":p[5]||(p[5]=m=>f("1hourr"))},null,8,["prompt","is-selected"]),c.value?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:A.value,"onUpdate:modelValue":p[6]||(p[6]=m=>A.value=m),options:i.unref(we)().dataJson.patches,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0),a.includes("season")?(i.openBlock(),i.createBlock(i.unref($t),{key:1,modelValue:s.value,"onUpdate:modelValue":p[7]||(p[7]=m=>s.value=m),options:i.unref(we)().dataJson.seasons,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const WA=M(oT,[["__scopeId","data-v-cdaddb3d"]]),lT={filterArray:{type:Array,required:!0,default:[]}},cT={cardCodes:{type:Array,required:!0,default:[]},filterCallback:{type:Function,required:!1,default:()=>!0},mode:{type:String,required:!1,default:"tags"}},uT=i.defineComponent({__name:"CardMultiselect",props:cT,emits:["update:cardCodes"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.cardCodes),A=i.computed(()=>{let s=Dw().cardJson.sort((o,l)=>o.name.localeCompare(l.name));return n.filterCallback&&(s=s.filter(n.filterCallback)),s});return i.watch(a,()=>{t("update:cardCodes",a.value)}),(s,o)=>(i.openBlock(),i.createBlock(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),class:"multiselect",placeholder:i.unref(r)("cards.cards"),mode:n.mode,options:A.value,infinite:!0,limit:10,searchable:!0,label:"name","value-prop":"cardCode"},null,8,["modelValue","placeholder","mode","options"]))}});const _g=M(uT,[["__scopeId","data-v-968634df"]]),Ju=i.defineComponent({__name:"FilterCardCodes",props:lT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray);i.watch(a,()=>{console.log("watch(filterArray)",a.value),t("update:filterArray",a.value)});function A(){a.value.splice(0)}function s(o){return o.collectible}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a.value,title:i.unref(r)("cards.cards"),"onClear:filterArray":A},{default:i.withCtx(()=>[i.createVNode(_g,{cardCodes:a.value,"onUpdate:cardCodes":l[0]||(l[0]=c=>a.value=c),mode:"tags","filter-callback":s},null,8,["cardCodes"])]),_:1},8,["filter-array","title"]))}}),dT={filterArray:{type:Array,required:!0,default:[]}},fT={class:"checkboxes-container"},hT=i.defineComponent({__name:"FilterRegions",props:dT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterArray),A=i.ref([]);A.value.push(...a.filter(l=>ho(l))),i.watch(a,()=>{t("update:filterArray",a)}),i.watch(A,(l,c)=>{let u=l.find(d=>!c.includes(d));if(u||(u=c.find(d=>!l.includes(d)),u))return o(u)});function s(){a.splice(0),A.value.slice(0)}function o(l){const c=a.indexOf(l);if(c===-1){a.push(l),l==="Runeterra"&&a.push(...A.value);return}if(a.splice(c,1),l==="Runeterra")for(let u=0;u<a.length;u++)ho(a[u])&&a.splice(u--,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":a,title:i.unref(r)("general.regions"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",fT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(we)().dataJson.regions,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":a.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128)),i.createVNode(rn,{class:"runeterra",prompt:"Runeterra","is-selected":a.includes("Runeterra"),"onUpdate:isSelected":c[0]||(c[0]=u=>o("Runeterra"))},null,8,["is-selected"]),a.includes("Runeterra")?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:A.value,"onUpdate:modelValue":c[1]||(c[1]=u=>A.value=u),class:"runeterra-select",mode:"tags",options:i.unref(we)().dataJson.runeterraChampions,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","options"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Xo=M(hT,[["__scopeId","data-v-c93a9e90"]]),pT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},gT={filterArray:{type:Array,required:!0,default:[]},allowZero:{type:Boolean,required:!1,default:!1}},mT={class:"checkboxes-container"},vT=i.defineComponent({__name:"FilterFormat",props:gT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>{const d=we().dataJson.queues;return Object.values(we().dataJson.formats).filter(f=>f.availableQueues.some(h=>!d[h].excludeInMassFilter))}),A=i.computed(()=>a.value.filter(d=>!d.inDropdown)),s=i.computed(()=>a.value.filter(d=>d.inDropdown)),o=i.reactive(n.filterArray),l=i.ref(null);i.onMounted(()=>{o.length>0&&s.value.map(d=>d.nameRef).includes(o[0])&&(l.value=o[0])}),i.watch(o,()=>{t("update:filterArray",o),o.length===0&&(l.value=null)}),i.watch(l,()=>{l.value&&(o.splice(0),o.push(l.value))});function c(d){l.value=null,o.splice(0),d!==Kr.Standard&&o.push(d)}function u(){o.splice(0)}return(d,f)=>(i.openBlock(),i.createBlock(gt,{"filter-array":o,title:i.unref(r)("general.format"),"onClear:filterArray":u},{default:i.withCtx(()=>[i.createElementVNode("div",mT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,h=>(i.openBlock(),i.createBlock(rn,{prompt:h.name,"is-selected":o.includes(h.nameRef)||!n.allowZero&&h.nameRef==="Standard"&&o.length===0,"onUpdate:isSelected":p=>c(h.nameRef)},null,8,["prompt","is-selected","onUpdate:isSelected"]))),256)),s.value.length>0?(i.openBlock(),i.createBlock(i.unref($t),{key:0,modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=h=>l.value=h),options:s.value,searchable:!1,placeholder:i.unref(r)("general.otherFormats"),label:"name","value-prop":"nameRef",onClear:u},null,8,["modelValue","options","placeholder"])):i.createCommentVNode("",!0)])]),_:1},8,["filter-array","title"]))}});const Cg=M(vT,[["__scopeId","data-v-22de9b40"]]),BT={filterArray:{type:Array,required:!0,default:[]},availableQueues:{type:Array,required:!0,default:[]}},kg=i.defineComponent({__name:"FilterQueues",props:BT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.ref(n.filterArray),A=i.computed(()=>Object.values(we().dataJson.queues).filter(o=>n.availableQueues.includes(o.nameRef)&&!o.excludeInMassFilter));i.watch(a,()=>{t("update:filterArray",a.value)});function s(){a.value.splice(0)}return(o,l)=>n.availableQueues.length>1?(i.openBlock(),i.createBlock(gt,{key:0,"filter-array":a.value,title:i.unref(r)("general.queues"),"onClear:filterArray":s},{default:i.withCtx(()=>{var c,u;return[i.createVNode(i.unref($t),{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=d=>a.value=d),placeholder:(u=(c=A.value)==null?void 0:c.find(d=>d.nameRef===i.unref(F2).Ranked))==null?void 0:u.name,class:"runeterra-select",mode:"tags",options:A.value,searchable:!0,label:"name","value-prop":"nameRef"},null,8,["modelValue","placeholder","options"])]}),_:1},8,["filter-array","title"])):i.createCommentVNode("",!0)}}),yT={filterObject:{type:Object,required:!1,default:void 0},showClearAll:{type:Boolean,required:!1,default:!0}},wT={class:"filter"},bT={key:0,class:"top"},_T=i.defineComponent({__name:"SidePanel",props:yT,emits:["clear:filterObject"],setup(e,{emit:t}){const n=e,r=i.computed(()=>n.filterObject&&Object.values(n.filterObject).some(A=>A.length>0)?"clickable":null);function a(){t("clear:filterObject")}return(A,s)=>{const o=i.resolveDirective("t");return i.openBlock(),i.createElementBlock("div",wT,[n.showClearAll&&n.filterObject?(i.openBlock(),i.createElementBlock("div",bT,[i.withDirectives(i.createElementVNode("p",{class:i.normalizeClass(["clear",r.value]),onClick:a},null,2),[[o,"general.clearAll"]])])):i.createCommentVNode("",!0),i.renderSlot(A.$slots,"default",{},void 0,!0)])}}});const ei=M(_T,[["__scopeId","data-v-6a93fcc1"]]),yb=i.defineComponent({__name:"FilterDecks",props:pT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Xo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(Ju,{"filter-array":r.cardFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.cardFilters=l)},null,8,["filter-array"]),i.createVNode(Cg,{"filter-array":r.formatFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.formatFilters=l)},null,8,["filter-array"]),n.includeDataFilters?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(kg,{"filter-array":r.queueFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"]),i.createVNode(Js,{"filter-array":r.sampleSizeFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.sampleSizeFilters=l)},null,8,["filter-array"]),i.createVNode(WA,{"filter-array":r.timeFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.timeFilters=l)},null,8,["filter-array"]),i.createVNode(Zs,{"filter-array":r.serverFilters,"onUpdate:filterArray":o[6]||(o[6]=l=>r.serverFilters=l)},null,8,["filter-array"])],64)):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),CT={filters:{type:Object,required:!0,default:{cardFilters:[],regionFilters:[],sampleSizeFilters:[],serverFilters:[],timeFilters:[],formatFilters:[],queueFilters:[]}},includeDataFilters:{type:Boolean,required:!1,default:!0}},kT={filterArray:{type:Array,required:!0,default:[]},placeholder:{type:String,required:!1},title:{type:String,required:!1,default:"Text"}},ET=["placeholder"],ST=i.defineComponent({__name:"FilterText",props:kT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,r=i.ref(n.filterArray),a=i.ref("");let A=setTimeout(()=>{},0);r.value.length>0&&(a.value=r.value[0]),i.watch(r,()=>{t("update:filterArray",r.value)}),i.watch(a,()=>{A&&clearTimeout(A),A=setTimeout(()=>{r.value.splice(0),a.value&&r.value.push(a.value)},1e3)});function s(){r.value.splice(0),a.value=""}return(o,l)=>(i.openBlock(),i.createBlock(gt,{"filter-array":r.value,title:n.title,"onClear:filterArray":s},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),placeholder:n.placeholder,type:"text"},null,8,ET),[[i.vModelText,a.value]])]),_:1},8,["filter-array","title"]))}});const iu=M(ST,[["__scopeId","data-v-e9c34cae"]]),wb=i.defineComponent({__name:"FilterProfile",props:CT,emits:["update:filters"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filters);i.watch(a,()=>{t("update:filters",a)});const A=i.computed(()=>{var o;return a.formatFilters.length===0?[]:(o=we().dataJson.formats[a.formatFilters[0]??"Standard"])==null?void 0:o.availableQueues});function s(){for(const[,o]of Object.entries(a))o.splice(0)}return(o,l)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":s},{default:i.withCtx(()=>[i.createVNode(Xo,{"filter-array":a.regionFilters,"onUpdate:filterArray":l[0]||(l[0]=c=>a.regionFilters=c)},null,8,["filter-array"]),i.createVNode(Ju,{"filter-array":a.cardFilters,"onUpdate:filterArray":l[1]||(l[1]=c=>a.cardFilters=c)},null,8,["filter-array"]),i.createVNode(iu,{"filter-array":a.deckCodeFilters,"onUpdate:filterArray":l[2]||(l[2]=c=>a.deckCodeFilters=c),placeholder:i.unref(r)("general.deckCode"),title:i.unref(r)("general.deckCode")},null,8,["filter-array","placeholder","title"]),i.createVNode(iu,{"filter-array":a.playerFilters,"onUpdate:filterArray":l[3]||(l[3]=c=>a.playerFilters=c),placeholder:i.unref(r)("general.players"),title:i.unref(r)("general.players")},null,8,["filter-array","placeholder","title"]),i.createVNode(Js,{"filter-array":a.sampleSizeFilters,"onUpdate:filterArray":l[4]||(l[4]=c=>a.sampleSizeFilters=c)},null,8,["filter-array"]),i.createVNode(Cg,{"allow-zero":!0,"filter-array":a.formatFilters,"onUpdate:filterArray":l[5]||(l[5]=c=>a.formatFilters=c)},null,8,["filter-array"]),i.createVNode(kg,{"filter-array":a.queueFilters,"onUpdate:filterArray":l[6]||(l[6]=c=>a.queueFilters=c),"available-queues":A.value},null,8,["filter-array","available-queues"]),i.createVNode(WA,{"allow-zero":!0,"filter-array":a.timeFilters,"onUpdate:filterArray":l[7]||(l[7]=c=>a.timeFilters=c)},null,8,["filter-array"])]),_:1},8,["filter-object"]))}}),xT={filterValue:{type:Object,required:!0,default:{attribute:"attack",equality:">",number:0}}},FT={class:"advanced-filter-item"},IT=["value"],UT=i.defineComponent({__name:"AdvancedFilterItem",props:xT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=[{value:"attack",label:r("cards.attack")},{value:"health",label:r("cards.health")},{value:"cost",label:r("cards.cost")},{value:"quantityOwned",label:r("cards.quantityOwned")}],A=i.ref(n.filterValue.attribute);i.watch(A,()=>{t("update:filterValue",{attribute:A.value,equality:n.filterValue.equality,number:n.filterValue.number})});function s(){let l=">";n.filterValue.equality===">"?l="<":n.filterValue.equality==="<"&&(l="="),t("update:filterValue",{attribute:n.filterValue.attribute,equality:l,number:n.filterValue.number})}function o(l){t("update:filterValue",{attribute:n.filterValue.attribute,equality:n.filterValue.equality,number:Number(l.target.value)})}return(l,c)=>(i.openBlock(),i.createElementBlock("div",FT,[i.createVNode(i.unref($t),{modelValue:A.value,"onUpdate:modelValue":c[0]||(c[0]=u=>A.value=u),class:"advanced-attribute",options:a,"can-clear":!1,label:"label","value-prop":"value"},null,8,["modelValue"]),i.createElementVNode("div",{class:"equality-button",onClick:s},i.toDisplayString(n.filterValue.equality),1),i.createElementVNode("input",{type:"number",class:"equality-number",value:n.filterValue.number,onInput:o},null,40,IT)]))}});const Eg=M(UT,[["__scopeId","data-v-eb2d535d"]]),QT={filterValue:{type:Array,required:!0,default:[]}},TT=i.defineComponent({__name:"FilterAdvanced",props:QT,emits:["update:filterValue"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.reactive(n.filterValue);i.watch(a,()=>{t("update:filterValue",a)});function A(){a.splice(0)}function s(){a.push({attribute:"attack",equality:">",number:0})}return(o,l)=>(i.openBlock(),i.createBlock(gt,{class:"advanced-filters","filter-array":a,title:i.unref(r)("general.advanced"),"onClear:filterArray":A},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a,(c,u)=>(i.openBlock(),i.createBlock(Eg,{key:u,"filter-value":a[u],"onUpdate:filterValue":d=>a[u]=d,class:"advanced-filter-item"},null,8,["filter-value","onUpdate:filterValue"]))),128)),i.createElementVNode("div",{class:"new-advanced-filter",onClick:s},i.toDisplayString(i.unref(r)("general.newAdvancedFilter")),1)]),_:1},8,["filter-array","title"]))}});const Sg=M(TT,[["__scopeId","data-v-6c23ee29"]]),DT={filterArray:{type:Array,required:!0,default:[]}},LT={class:"checkboxes-container"},xg=i.defineComponent({__name:"FilterTypes",props:DT,emits:["update:filterArray"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=i.computed(()=>we().dataJson.types.filter(l=>["Unit","Spell","Landmark","Equipment"].includes(l.nameRef))),A=i.reactive(n.filterArray);i.watch(A,()=>{t("update:filterArray",A)});function s(){A.splice(0)}function o(l){const c=A.indexOf(l);if(c===-1){A.push(l);return}A.splice(c,1)}return(l,c)=>(i.openBlock(),i.createBlock(gt,{"filter-array":n.filterArray,title:i.unref(r)("general.types"),"onClear:filterArray":s},{default:i.withCtx(()=>[i.createElementVNode("div",LT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,u=>(i.openBlock(),i.createBlock(rn,{key:u.nameRef,icon:`url(${u.icon})`,prompt:u.name,"is-selected":A.includes(u.nameRef),"onUpdate:isSelected":d=>o(u.nameRef)},null,8,["icon","prompt","is-selected","onUpdate:isSelected"]))),128))])]),_:1},8,["filter-array","title"]))}}),OT={filters:{type:Object,required:!0,default:{advancedFilters:[],regionFilters:[],manaCostFilters:[],typeFilters:[],rarityFilters:[],setFilters:[],keywordFilters:[]}}},bb=i.defineComponent({__name:"FilterCards",props:OT,emits:["update:filters"],setup(e,{emit:t}){const n=e,r=i.reactive(n.filters);i.watch(r,()=>{t("update:filters",r)});const a=i.computed(()=>{var s;return"formatFilters"in r?(s=we().dataJson.formats[r.formatFilters[0]??"Standard"])==null?void 0:s.availableQueues:[]});function A(){for(const[,s]of Object.entries(r))s.splice(0)}return(s,o)=>(i.openBlock(),i.createBlock(ei,{"filter-object":n.filters,"onClear:filterObject":A},{default:i.withCtx(()=>[i.createVNode(Bg,{"filter-array":r.manaCostFilters,"onUpdate:filterArray":o[0]||(o[0]=l=>r.manaCostFilters=l)},null,8,["filter-array"]),i.createVNode(Xo,{"filter-array":r.regionFilters,"onUpdate:filterArray":o[1]||(o[1]=l=>r.regionFilters=l)},null,8,["filter-array"]),i.createVNode(xg,{"filter-array":r.typeFilters,"onUpdate:filterArray":o[2]||(o[2]=l=>r.typeFilters=l)},null,8,["filter-array"]),i.createVNode(yg,{"filter-array":r.rarityFilters,"onUpdate:filterArray":o[3]||(o[3]=l=>r.rarityFilters=l)},null,8,["filter-array"]),i.createVNode(wg,{"filter-array":r.setFilters,"onUpdate:filterArray":o[4]||(o[4]=l=>r.setFilters=l)},null,8,["filter-array"]),i.createVNode(bg,{"filter-array":r.keywordFilters,"onUpdate:filterArray":o[5]||(o[5]=l=>r.keywordFilters=l)},null,8,["filter-array"]),i.createVNode(Sg,{"filter-value":r.advancedFilters,"onUpdate:filterValue":o[6]||(o[6]=l=>r.advancedFilters=l)},null,8,["filter-value"]),"serverFilters"in r?(i.openBlock(),i.createBlock(i.unref(Zs),{key:0,"filter-array":r.serverFilters,"onUpdate:filterArray":o[7]||(o[7]=l=>r.serverFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"timeFilters"in r?(i.openBlock(),i.createBlock(WA,{key:1,"filter-array":r.timeFilters,"onUpdate:filterArray":o[8]||(o[8]=l=>r.timeFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"formatFilters"in r?(i.openBlock(),i.createBlock(Cg,{key:2,"filter-array":r.formatFilters,"onUpdate:filterArray":o[9]||(o[9]=l=>r.formatFilters=l)},null,8,["filter-array"])):i.createCommentVNode("",!0),"queueFilters"in r?(i.openBlock(),i.createBlock(kg,{key:3,"filter-array":r.queueFilters,"onUpdate:filterArray":o[10]||(o[10]=l=>r.queueFilters=l),"available-queues":a.value},null,8,["filter-array","available-queues"])):i.createCommentVNode("",!0)]),_:1},8,["filter-object"]))}}),MT={regionRef:{type:String,required:!0,default:"Ionia"}},NT={text:{type:String,required:!0,default:""}},PT=["innerHTML"],HT=i.defineComponent({__name:"TippyText",props:NT,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:"tippy-text",innerHTML:t.text},null,8,PT))}});const Zu=M(HT,[["__scopeId","data-v-715107fe"]]),RT={class:"region-item"},VT=["alt","src"],KT=i.defineComponent({__name:"RegionItem",props:MT,setup(e){const t=e,n=i.ref(null),r=i.ref(null),a=i.computed(()=>we().dataJson.regions.find(A=>A.nameRef==t.regionRef)??we().dataJson.runeterraChampions.find(A=>A.nameRef===t.regionRef));return i.onMounted(()=>{et(n.value,{content:r.value,arrow:!0})}),(A,s)=>{var o,l,c;return i.openBlock(),i.createElementBlock("div",RT,[i.createElementVNode("img",{ref_key:"regionImg",ref:n,alt:(o=a.value)==null?void 0:o.name,src:(l=a.value)==null?void 0:l.icon,class:"region-img"},null,8,VT),i.createElementVNode("div",{ref_key:"regionTippy",ref:r},[i.createVNode(Zu,{text:(c=a.value)==null?void 0:c.name},null,8,["text"])],512)])}}});const Jo=M(KT,[["__scopeId","data-v-3d756f50"]]),$T={deckCode:{type:String,required:!0,default:""},deck:{type:Object,required:!1},cards:{type:Array,required:!1},describeRegions:{type:Boolean,required:!1,default:!1}},WT={class:"regions-line"},GT={key:0,class:"describe-regions"},zT={class:"lines"},jT=i.defineComponent({__name:"RegionsLine",props:$T,setup(e){const t=e,{t:n}=ne(),r=i.computed(()=>t.deck?t.deck:Ft(t.deckCode)),a=i.computed(()=>t.cards?t.cards:an(r.value)),A=i.computed(()=>{const o={};for(const l of Mu(r.value))o[l]=0;for(const l of a.value)for(const c of l.regionRefs)c in o&&(o[c]+=r.value[l.cardCode]);return o});function s(o,l){return{flexGrow:o,backgroundColor:`var(--color-${l}, var(--color-Runeterra))`}}return(o,l)=>(i.openBlock(),i.createElementBlock("div",WT,[t.describeRegions?(i.openBlock(),i.createElementBlock("div",GT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,class:"region-description"},[i.createVNode(Jo,{"region-ref":u,class:"icon"},null,8,["region-ref"]),i.createElementVNode("span",null,i.toDisplayString(`${c} ${i.unref(n)("general.cards")}`),1)]))),128))])):i.createCommentVNode("",!0),i.createElementVNode("div",zT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,(c,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,style:i.normalizeStyle(s(c,u)),class:"region-line"},null,4))),128))])]))}});const Fg=M(jT,[["__scopeId","data-v-f1f94f8b"]]),YT={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardCode:{type:String,required:!0,default:"01IO001"},toggledStats:{type:Object,required:!0,default:{matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!1,kept:!1,drawnWinrate:!1,turnsHeld:!1,turnPlayed:!1}},index:{type:Number,required:!0,default:1},matches:{type:Number,required:!0,default:1},region:{type:String,required:!0,default:""},wins:{type:Number,required:!0,default:1},inclusion:{type:Number,required:!0,default:.5},avgCopies:{type:Number,required:!0,default:1},mulliganWinrate:{type:Number,required:!1,default:void 0},keptInMulligan:{type:Number,required:!1,default:void 0},drawnWinrate:{type:Number,required:!1,default:void 0},turnsHeld:{type:Number,required:!1,default:void 0},turnPlayed:{type:Number,required:!1,default:void 0}},qT={class:"cards-row-background-wrapper"},XT={class:"cards-row-background"},JT={class:"cards-row wrapper"},ZT={key:0,class:"column-content"},eD={key:2,class:"column-content"},tD={key:3,class:"column-content"},nD={key:5,class:"column-content"},rD={key:7,class:"column-content"},aD={key:8,class:"column-content"},AD=i.defineComponent({__name:"CardsRow",props:YT,setup(e){const t=e,n=i.computed(()=>["",xe().callbacks.cardImageCallback(t.cardCode,Bt.Banner)]);return(r,a)=>{const A=i.resolveComponent("RouterLink");return i.openBlock(),i.createBlock(A,{to:t.routerLink,class:"wrapper"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"cards-row-wrapper wrapper",style:i.normalizeStyle({"--index":t.index})},[i.createElementVNode("div",qT,[i.createElementVNode("div",XT,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"background-card",style:i.normalizeStyle({"--background-image":`url(${s})`})},null,4))),128))])]),i.createElementVNode("div",JT,[i.createElementVNode("div",{class:"column-content deck-highlight-wrapper",onClick:a[0]||(a[0]=i.withModifiers(()=>{},["stop","prevent"]))},[i.createVNode(hn,{class:"card-slice-item","card-code-prop":t.cardCode,"maintain-aspect-ratio":!1,color:`var(--color-${t.region}-rgb, var(--color-primary-2-rgb))`,"router-link":t.routerLink},null,8,["card-code-prop","color","router-link"])]),t.toggledStats.matches?(i.openBlock(),i.createElementBlock("div",ZT,i.toDisplayString(i.unref(De)(t.matches)),1)):i.createCommentVNode("",!0),t.toggledStats.winrate?(i.openBlock(),i.createElementBlock("div",{key:1,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.wins/t.matches)})`})},i.toDisplayString(i.unref(De)(t.wins/t.matches*100,2,3)+"%"),5)):i.createCommentVNode("",!0),t.toggledStats.inclusion?(i.openBlock(),i.createElementBlock("div",eD,i.toDisplayString(i.unref(De)(t.inclusion*100,2,3)+"%"),1)):i.createCommentVNode("",!0),t.toggledStats.avgCopies?(i.openBlock(),i.createElementBlock("div",tD,i.toDisplayString(i.unref(De)(t.avgCopies,2,3)),1)):i.createCommentVNode("",!0),t.toggledStats.mulliganWinrate?(i.openBlock(),i.createElementBlock("div",{key:4,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.mulliganWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.mulliganWinrate?i.unref(De)(t.mulliganWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.keptInMulligan?(i.openBlock(),i.createElementBlock("div",nD,i.toDisplayString(t.keptInMulligan?i.unref(De)(t.keptInMulligan*100,2,3)+"%":"-"),1)):i.createCommentVNode("",!0),t.toggledStats.drawnWinrate?(i.openBlock(),i.createElementBlock("div",{key:6,class:"column-content",style:i.normalizeStyle({color:`var(${i.unref(er)(t.drawnWinrate,t.wins/t.matches)})`})},i.toDisplayString(t.drawnWinrate?i.unref(De)(t.drawnWinrate*100,2,3)+"%":"-"),5)):i.createCommentVNode("",!0),t.toggledStats.turnPlayed?(i.openBlock(),i.createElementBlock("div",rD,i.toDisplayString(t.turnPlayed?i.unref(De)(t.turnPlayed,2,3):"-"),1)):i.createCommentVNode("",!0),t.toggledStats.turnsHeld?(i.openBlock(),i.createElementBlock("div",aD,i.toDisplayString(t.turnsHeld?i.unref(De)(t.turnsHeld,2,3):"-"),1)):i.createCommentVNode("",!0)])],4)]),_:1},8,["to"])}}});const Ig=M(AD,[["__scopeId","data-v-e0c98d3c"]]),sD={cardRows:{type:Array,required:!0,default:[]},cardsRowToggle:{type:Object,requied:!0,default:{card:!0,matches:!0,winrate:!0,inclusion:!0,avgCopies:!0,mulliganWinrate:!0,keptInMulligan:!0,drawnWinrate:!0,turnsHeld:!0,turnPlayed:!0}},loading:{type:Boolean,required:!1,default:!1}};var be=(e=>(e.UP="sort-up",e.DOWN="sort-down",e.NEITHER="sort-neither",e.NOT_SORTABLE="not-sortable",e))(be||{});const iD={headingItems:{type:Array,required:!0,default:[]},loading:{type:Boolean,required:!1,default:!1}};const oD={},lD={class:"loader"};function cD(e,t){return i.openBlock(),i.createElementBlock("div",lD)}const Ug=M(oD,[["render",cD],["__scopeId","data-v-91218ab0"]]),Qg=e=>(i.pushScopeId("data-v-a525533d"),e=e(),i.popScopeId(),e),uD={class:"table-wrapper"},dD={class:"table no-scrollbar"},fD=Qg(()=>i.createElementVNode("div",{class:"heading-background-outer"},[i.createElementVNode("div",{class:"heading-background-absolute"}),i.createElementVNode("div",{class:"heading-background-inner"})],-1)),hD={class:"heading wrapper"},pD=["onClick"],gD={class:"sort-icons"},mD={key:0,class:"no-content loading"},vD=Qg(()=>i.createElementVNode("h2",null," No Results ",-1)),BD=Qg(()=>i.createElementVNode("h4",null," Adjust filters and try again. ",-1)),yD=[vD,BD],wD=i.defineComponent({__name:"LargeTable",props:iD,emits:["toggleSort"],setup(e,{emit:t}){const n=e,r={"--background-image":`url(${xe().callbacks.cardImageCallback("01FR008",Bt.Full)})`},a=i.computed(()=>n.headingItems.filter(A=>A.isShown));return(A,s)=>(i.openBlock(),i.createElementBlock("div",uD,[i.createElementVNode("div",dD,[fD,i.createElementVNode("div",hD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,o=>(i.openBlock(),i.createElementBlock("div",{key:o.title,class:i.normalizeClass(["heading-cell column-content",o.sortDirection]),onClick:l=>t("toggleSort",o.id)},[i.createElementVNode("div",null,i.toDisplayString(o.title),1),i.createElementVNode("div",gD,[i.createVNode(i.unref(Ee),{icon:"sort-up",class:"sort-icon"}),i.createVNode(i.unref(Ee),{icon:"sort-down",class:"sort-icon"})])],10,pD))),128))]),i.renderSlot(A.$slots,"default",{},()=>[n.loading?(i.openBlock(),i.createElementBlock("div",mD,[i.createVNode(Ug)])):(i.openBlock(),i.createElementBlock("div",{key:1,class:"no-content no-results",style:r},yD))],!0)])]))}});const aA=M(wD,[["__scopeId","data-v-a525533d"]]);function ti(e,t){const n=t.value.find(a=>a.id===e);if(!n||n.sortDirection===be.NOT_SORTABLE)return null;const r=n.sortDirection;return bD(t),r===be.NEITHER?n.sortDirection=be.DOWN:r===be.DOWN?n.sortDirection=be.UP:n.sortDirection=be.DOWN,n}function bD(e){e.value.forEach(t=>{t.sortDirection!==be.NOT_SORTABLE&&(t.sortDirection=be.NEITHER)})}const _D=i.defineComponent({__name:"CardsTable",props:sD,emits:["sort-updated"],setup(e,{emit:t}){const n=e,{t:r}=ne(),a=[{id:"card",isAlwaysShown:!0,isSortable:!1,title:r("general.card")},{id:"matches",isAlwaysShown:!1,isSortable:!0,title:r("general.matches")},{id:"winrate",isAlwaysShown:!1,isSortable:!0,title:r("general.winrate")},{id:"inclusion",isAlwaysShown:!1,isSortable:!0,title:r("general.inclusion")},{id:"avgCopies",isAlwaysShown:!1,isSortable:!0,title:r("general.avgCopies")},{id:"mulliganWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.mulliganWinrate")},{id:"keptInMulligan",isAlwaysShown:!1,isSortable:!0,title:r("general.keptInMulligan")},{id:"drawnWinrate",isAlwaysShown:!1,isSortable:!0,title:r("general.drawnWinrate")},{id:"turnsHeld",isAlwaysShown:!1,isSortable:!0,title:r("general.turnsHeld")},{id:"turnPlayed",isAlwaysShown:!1,isSortable:!0,title:r("general.turnPlayed")}];let A=!1;const s=i.ref(a.map(c=>{let u=be.NEITHER;return c.isSortable||(u=be.NOT_SORTABLE),!A&&c.isSortable&&(u=be.DOWN,A=!0),{id:c.id,isShown:n.cardsRowToggle[c.id],sortDirection:u,title:c.title}})),o=i.computed(()=>({"--table-grid-template-columns":`repeat(${Object.values(n.cardsRowToggle).reduce((u,d)=>d?u+1:u,0)}, 1fr)`}));function l(c){const u=ti(c,s);u&&t("sort-updated",u)}return(c,u)=>(i.openBlock(),i.createBlock(aA,{class:"large-table",loading:n.loading,"heading-items":s.value,style:i.normalizeStyle(o.value),onToggleSort:l},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.cardRows,(d,f)=>(i.openBlock(),i.createBlock(Ig,{key:d.cardCode+d.region,"card-code":d.cardCode,matches:d.matches,wins:d.wins,index:f+2,"avg-copies":d.avgCopies,"drawn-winrate":d.drawnWinrate,"kept-in-mulligan":d.keptInMulligan,"mulligan-winrate":d.mulliganWinrate,inclusion:d.inclusion,"turns-held":d.turnsHeld,"turn-played":d.turnPlayed,"toggled-stats":n.cardsRowToggle,region:d.region,"router-link":i.unref(xe)().callbacks.cardCodeRouterLinkCallback(d.cardCode)},null,8,["card-code","matches","wins","index","avg-copies","drawn-winrate","kept-in-mulligan","mulligan-winrate","inclusion","turns-held","turn-played","toggled-stats","region","router-link"]))),128))]),_:1},8,["loading","heading-items","style"]))}});const _b=M(_D,[["__scopeId","data-v-1894b267"]]),CD={regions:{type:Array,required:!0,default:[]}},kD={class:"deck-highlight-regions"},ED=i.defineComponent({__name:"DeckHighlightRegions",props:CD,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createElementBlock("div",kD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.regions,a=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"region-item-wrapper"},[i.createVNode(Jo,{class:"region-item","region-ref":a},null,8,["region-ref"])]))),128))]))}});const Zo=M(ED,[["__scopeId","data-v-d28f95f4"]]),SD={},xD={xmlns:"http://www.w3.org/2000/svg",viewBox:"215.7 48.9 276.9 496"},FD=i.createStaticVNode('<path fill="#146743" d="m271 136-54 90 150 316 14-50 29-312-51-130-88 86Z"></path><path fill="#419a4a" d="m356 121-75 105 86 316 14-50 29-312-54-59Z"></path><path fill="#baffb6" d="M410 180 359 50l-3 71 54 59Z"></path><path fill="#437f41" d="m359 50-88 86 10 90 75-105 3-71ZM281 360l86 182-86-316v134Z"></path><path fill="#419a4a" d="m454 332 28 33-33 85-4-13-8-85 17-20Z"></path>',5),ID=[FD];function UD(e,t){return i.openBlock(),i.createElementBlock("svg",xD,ID)}const Tg=M(SD,[["render",UD]]),QD={deck:{type:Object,required:!0,default:{}}},TD=e=>(i.pushScopeId("data-v-25f680e9"),e=e(),i.popScopeId(),e),DD={class:"gems-text"},LD={class:"gems-cost-title"},OD={class:"gems-cost-value"},MD=TD(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),ND={class:"gems-cost-title"},PD={class:"gems-cost-value"},HD=i.defineComponent({__name:"GemsCost",props:QD,setup(e){const t=e,{t:n}=ne(),r=i.ref(null),a=i.ref(null),A=i.computed(()=>qc(t.deck,!1)),s=i.computed(()=>qc(t.deck,!0));return i.onMounted(()=>{et(r.value,{content:a.value,arrow:!0,duration:0})}),(o,l)=>{var c,u,d;return i.openBlock(),i.createElementBlock("div",{ref_key:"gemsCostDiv",ref:r,class:"gems-cost"},[i.createVNode(Tg,{class:"shards-icon"}),i.createElementVNode("div",DD,i.toDisplayString((c=s.value!==null?s.value:A.value)==null?void 0:c.toLocaleString()),1),i.createElementVNode("div",{ref_key:"gemsCostTippyDiv",ref:a,class:"gems-cost-tippy"},[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",LD,i.toDisplayString(i.unref(n)("deck.personalCost")),1),i.createElementVNode("div",OD,i.toDisplayString((u=s.value)==null?void 0:u.toLocaleString()),1),MD],64)):i.createCommentVNode("",!0),i.createElementVNode("div",ND,i.toDisplayString(i.unref(n)("deck.originalCost")),1),i.createElementVNode("div",PD,i.toDisplayString((d=A.value)==null?void 0:d.toLocaleString()),1)],512)],512)}}});const Dg=M(HD,[["__scopeId","data-v-25f680e9"]]),RD={class:"language-selection"},VD={class:"selection-panel"},KD=i.defineComponent({__name:"LanguageSelection",setup(e){const{locale:t,availableLocales:n}=ne(),r={en:"English",de:"Deutsch",es:"Español",fr:"Français",it:"Italiano",ja:"日本語",ko:"한국어",pl:"Polski",pt:"Português",th:"ไทย",tr:"Türkçe",ru:"Русский",zh:"中文"},a=mA.useRoute(),A=i.ref(!1),s=i.computed(()=>n.sort(l=>l===t.value?-1:1));function o(){A.value=!0}return(l,c)=>{const u=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",RD,[i.createVNode(i.unref(Ee),{ref:"languageIcon",icon:"language",class:"icon",onClick:o},null,512),i.createVNode($A,{"show-modal":A.value,"onUpdate:showModal":c[0]||(c[0]=d=>A.value=d)},{default:i.withCtx(()=>[i.createElementVNode("div",VD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,d=>(i.openBlock(),i.createBlock(u,{class:i.normalizeClass(i.unref(t)===d?"selected":""),locale:d,key:d,to:{...i.unref(a),params:{...i.unref(a).params,lang:d}}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r[d]),1)]),_:2},1032,["class","locale","to"]))),128))])]),_:1},8,["show-modal"])])}}});const Lg=M(KD,[["__scopeId","data-v-8a6f5e0d"]]),$D={cardCodes:{type:Array,required:!0,default:[]},regions:{type:Array,required:!0,default:[]}},Cb={routerLink:{type:Object,required:!0,default:{path:"/404"}},cardProp:{type:Object,required:!1,default:void 0},cardCodeProp:{type:String,required:!1,default:void 0},ignoreCardItem:{type:Boolean,required:!1},regions:{type:Array,required:!1,default:void 0},colorOverride:{type:String,required:!1,default:void 0}},WD={class:"circle-card-item"},GD=["alt","src"],zD=i.defineComponent({__name:"CircleCardItem",props:Cb,setup(e){const t=e,n=Ko(t.cardProp,t.cardCodeProp,!0),r=i.ref(null),a=i.ref(null),A=i.ref(null),s=i.ref(null),o=i.computed(()=>{var c;return xe().callbacks.cardImageCallback(((c=n.value)==null?void 0:c.cardCode)??"",Bt.Icon)}),l=i.computed(()=>n.value===void 0?"--color-primary-2":vA(n.value,t.regions));return i.onMounted(()=>{t.ignoreCardItem||et(r.value,{content:a.value,placement:"right",arrow:!0,touch:!1,duration:0,role:"card-image",onShown:c=>{const u=c.popper.innerHTML.includes("right")?"right-start":"left-start";s.value=u},onHidden:()=>{s.value=null}})}),(c,u)=>{const d=i.resolveComponent("RouterLink");return i.openBlock(),i.createElementBlock("div",WD,[i.createVNode(d,{to:t.routerLink,class:"circle-card-link",onClick:u[0]||(u[0]=i.withModifiers(()=>{},["stop","prevent"]))},{default:i.withCtx(()=>{var f;return[i.createElementVNode("img",{ref_key:"circleCardImg",ref:r,alt:(f=i.unref(n))==null?void 0:f.name,src:o.value,class:"circle-card-img",style:i.normalizeStyle({borderColor:t.colorOverride??l.value})},null,12,GD)]}),_:1},8,["to"]),i.createElementVNode("div",{ref_key:"circleCardTippy",ref:a,class:"circle-card-tippy"},[!c.ignoreCardItem&&i.unref(n)?(i.openBlock(),i.createBlock(za,{key:0,ref_key:"cardItem",ref:A,"card-code-prop":i.unref(n).cardCode,"is-deck-builder":!1,"is-root":!0,"show-tippy-location":s.value},null,8,["card-code-prop","show-tippy-location"])):i.createCommentVNode("",!0)],512)])}}});const ia=M(zD,[["__scopeId","data-v-3ea9e838"]]),jD={cards:{type:Array,required:!1,default:void 0},cardCodes:{type:Array,required:!1,default:void 0},regions:{type:Array,required:!1,default:[]}},YD={class:"deck-highlight-cards"},qD=i.defineComponent({__name:"DeckHighlightCards",props:jD,setup(e){const t=e,n=i.computed(()=>{if(t.cards)return t.cards;if(t.cardCodes)return t.cardCodes.map(r=>qt().cardJsonObject[r]).filter(r=>r!==void 0);throw new Error("Cards or CardCodes must be defined.")});return(r,a)=>(i.openBlock(),i.createElementBlock("div",YD,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(A,s)=>(i.openBlock(),i.createElementBlock("div",{key:A.cardCode??s,class:"circle-card-item-wrapper"},[i.createVNode(ia,{class:"circle-card-item","card-prop":A,regions:t.regions,"router-link":i.unref(xe)().callbacks.cardCodeRouterLinkCallback(A.cardCode)},null,8,["card-prop","regions","router-link"])]))),128))]))}});const el=M(qD,[["__scopeId","data-v-021c3530"]]),XD=i.defineComponent({__name:"ArchetypeSidePanelHighlight",props:$D,setup(e){const t=e;return(n,r)=>(i.openBlock(),i.createBlock(gt,{class:"archetype-side-panel-highlight"},{default:i.withCtx(()=>[i.createVNode(Zo,{class:"deck-highlight-regions",regions:t.regions},null,8,["regions"]),i.createVNode(el,{class:i.normalizeClass(["deck-highlight-cards",t.cardCodes.length===1?"single":""]),"card-codes":t.cardCodes},null,8,["class","card-codes"])]),_:1}))}});const ed=M(XD,[["__scopeId","data-v-ff538f6f"]]),JD={deckcode:{type:String,required:!0,default:""},filters:{type:Object,required:!0,default:{sampleSizeFilters:[],serverFilters:[],timeFilters:[]}},builtDeckProps:{type:Object,required:!1,default:void 0}},ZD={deckCode:{type:String,required:!0,default:""},info:{type:String,required:!0,default:"typeRef"}};/*!
811
811
  * @kurkle/color v0.3.2
812
812
  * https://github.com/kurkle/color#readme
813
813
  * (c) 2023 Jukka Kurkela
@@ -822,9 +822,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
822
822
  * https://www.chartjs.org
823
823
  * (c) 2023 Chart.js Contributors
824
824
  * Released under the MIT License
825
- */class NO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,a){const A=n.listeners[a],s=n.duration;A.forEach(o=>o({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Db.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const A=r.items;let s=A.length-1,o=!1,l;for(;s>=0;--s)l=A[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(A[s]=A[A.length-1],A.pop());o&&(a.draw(),this._notify(a,r,t,"progress")),A.length||(r.running=!1,this._notify(a,r,t,"complete"),r.initial=!1),n+=A.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Nr=new NO;const Iv="transparent",PO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=yv(e||Iv),a=r.valid&&yv(t||Iv);return a&&a.valid?a.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class HO{constructor(t,n,r,a){const A=n[r];a=rt([t.to,a,A,t.from]);const s=rt([t.from,A,a]);this._active=!0,this._fn=t.fn||PO[t.type||typeof s],this._easing=Ji[t.easing]||Ji.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const a=this._target[this._prop],A=r-this._start,s=this._duration-A;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=A,this._loop=!!t.loop,this._to=rt([t.to,n,a,t.from]),this._from=rt([t.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,a=this._prop,A=this._from,s=this._loop,o=this._to;let l;if(this._active=A!==o&&(s||n<r),!this._active){this._target[a]=o,this._notify(!0);return}if(n<0){this._target[a]=A;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[a]=this._fn(A,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][n]()}}class Yg{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ve(t))return;const n=Object.keys(ft.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{const A=t[a];if(!ve(A))return;const s={};for(const o of n)s[o]=A[o];(Me(A.properties)&&A.properties||[a]).forEach(o=>{(o===a||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,n){const r=n.options,a=VO(t,r);if(!a)return[];const A=this._createAnimations(a,r);return r.$shared&&RO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),A}_createAnimations(t,n){const r=this._properties,a=[],A=t.$animations||(t.$animations={}),s=Object.keys(n),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){a.push(...this._animateOptions(t,n));continue}const u=n[c];let d=A[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}A[c]=d=new HO(f,t,c,u),a.push(d)}return a}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Nr.add(this._chart,r),!0}}function RO(e,t){const n=[],r=Object.keys(t);for(let a=0;a<r.length;a++){const A=e[r[a]];A&&A.active()&&n.push(A.wait())}return Promise.all(n)}function VO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Uv(e,t){const n=e&&e.options||{},r=n.reverse,a=n.min===void 0?t:0,A=n.max===void 0?t:0;return{start:r?A:a,end:r?a:A}}function KO(e,t,n){if(n===!1)return!1;const r=Uv(e,n),a=Uv(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function $O(e){let t,n,r,a;return ve(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a,disabled:e===!1}}function Zb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let a,A;for(a=0,A=r.length;a<A;++a)n.push(r[a].index);return n}function Qv(e,t,n,r={}){const a=e.keys,A=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=a.length;s<o;++s){if(l=+a[s],l===n){if(r.all)continue;break}c=e.values[l],dt(c)&&(A||t===0||Br(t)===Br(c))&&(t+=c)}return t}}function WO(e){const t=Object.keys(e),n=new Array(t.length);let r,a,A;for(r=0,a=t.length;r<a;++r)A=t[r],n[r]={x:A,y:e[A]};return n}function Tv(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function GO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function zO(e){const{min:t,max:n,minDefined:r,maxDefined:a}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function jO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Dv(e,t,n,r){for(const a of t.getMatchingVisibleMetas(r).reverse()){const A=e[a.index];if(n&&A>0||!n&&A<0)return a.index}return null}function Lv(e,t){const{chart:n,_cachedMeta:r}=e,a=n._stacks||(n._stacks={}),{iScale:A,vScale:s,index:o}=r,l=A.axis,c=s.axis,u=GO(A,s,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[l]:m,[c]:y}=p,g=p._stacks||(p._stacks={});f=g[c]=jO(a,u,m),f[o]=y,f._top=Dv(f,s,!0,r.type),f._bottom=Dv(f,s,!1,r.type);const v=f._visualValues||(f._visualValues={});v[o]=y}}function pf(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function YO(e,t){return AA(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qO(e,t,n){return AA(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function pi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const a of t){const A=a._stacks;if(!A||A[r]===void 0||A[r][n]===void 0)return;delete A[r][n],A[r]._visualValues!==void 0&&A[r]._visualValues[n]!==void 0&&delete A[r]._visualValues[n]}}}const gf=e=>e==="reset"||e==="none",Ov=(e,t)=>t?e:Object.assign({},e),XO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Zb(n,!0),values:null};class tr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Tv(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&&pi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),a=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,A=n.xAxisID=de(r.xAxisID,pf(t,"x")),s=n.yAxisID=de(r.yAxisID,pf(t,"y")),o=n.rAxisID=de(r.rAxisID,pf(t,"r")),l=n.indexAxis,c=n.iAxisID=a(l,A,s,o),u=n.vAxisID=a(l,s,A,o);n.xScale=this.getScaleForId(A),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mv(this._data,this),t._stacked&&pi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ve(n))this._data=WO(n);else if(r!==n){if(r){mv(r,this);const a=this._cachedMeta;pi(a),a._parsed=[]}n&&Object.isExtensible(n)&&OL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const A=n._stacked;n._stacked=Tv(n.vScale,n),n.stack!==r.stack&&(a=!0,pi(n),n.stack=r.stack),this._resyncElements(t),(a||A!==n._stacked)&&Lv(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:a}=this,{iScale:A,_stacked:s}=r,o=A.axis;let l=t===0&&n===a.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=a,r._sorted=!0,f=a;else{Me(a[t])?f=this.parseArrayData(r,a,t,n):ve(a[t])?f=this.parseObjectData(r,a,t,n):f=this.parsePrimitiveData(r,a,t,n);const h=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&Lv(this,f)}parsePrimitiveData(t,n,r,a){const{iScale:A,vScale:s}=t,o=A.axis,l=s.axis,c=A.getLabels(),u=A===s,d=new Array(a);let f,h,p;for(f=0,h=a;f<h;++f)p=f+r,d[f]={[o]:u||A.parse(c[p],p),[l]:s.parse(n[p],p)};return d}parseArrayData(t,n,r,a){const{xScale:A,yScale:s}=t,o=new Array(a);let l,c,u,d;for(l=0,c=a;l<c;++l)u=l+r,d=n[u],o[l]={x:A.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,n,r,a){const{xScale:A,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(a);let u,d,f,h;for(u=0,d=a;u<d;++u)f=u+r,h=n[f],c[u]={x:A.parse(ja(h,o),f),y:s.parse(ja(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const a=this.chart,A=this._cachedMeta,s=n[t.axis],o={keys:Zb(a,!0),values:n._stacks[t.axis]._visualValues};return Qv(o,s,A.index,{mode:r})}updateRangeFromParsed(t,n,r,a){const A=r[n.axis];let s=A===null?NaN:A;const o=a&&r._stacks[n.axis];a&&o&&(a.values=o,s=Qv(a,A,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,a=r._parsed,A=r._sorted&&t===r.iScale,s=a.length,o=this._getOtherScale(t),l=XO(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=zO(o);let f,h;function p(){h=a[f];const m=h[o.axis];return!dt(h[t.axis])||u>m||d<m}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),A));++f);if(A){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let a,A,s;for(a=0,A=n.length;a<A;++a)s=n[a][t.axis],dt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,a=n.vScale,A=this.getParsed(t);return{label:r?""+r.getLabelForValue(A[r.axis]):"",value:a?""+a.getLabelForValue(A[a.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=$O(de(this.options.clip,KO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],A=n.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||a.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,A,o,l),u=o;u<o+l;++u){const d=a[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,A))}for(u=0;u<s.length;++u)s[u].draw(t,A)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const a=this.getDataset();let A;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];A=s.$context||(s.$context=qO(this.getContext(),t,s)),A.parsed=this.getParsed(t),A.raw=a.data[t],A.index=A.dataIndex=t}else A=this.$context||(this.$context=YO(this.chart.getContext(),this.index)),A.dataset=a,A.index=A.datasetIndex=this.index;return A.active=!!n,A.mode=r,A}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const a=n==="active",A=this._cachedDataOpts,s=t+"-"+n,o=A[s],l=this.enableOptionSharing&&Bn(r);if(o)return Ov(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=a?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(ft.elements[t]),p=()=>this.getContext(r,a,n),m=c.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=l,A[s]=Object.freeze(Ov(m,l))),m}_resolveAnimations(t,n,r){const a=this.chart,A=this._cachedDataOpts,s=`animation-${n}`,o=A[s];if(o)return o;let l;if(a.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new Yg(a,l&&l.animations);return l&&l._cacheable&&(A[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||gf(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),a=this._sharedOptions,A=this.getSharedOptions(r),s=this.includeOptions(n,A)||A!==a;return this.updateSharedOptions(A,n,r),{sharedOptions:A,includeOptions:s}}updateElement(t,n,r,a){gf(a)?Object.assign(t,r):this._resolveAnimations(n,a).update(t,r)}updateSharedOptions(t,n,r){t&&!gf(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,a){t.active=a;const A=this.getStyle(n,a);this._resolveAnimations(n,r,a).update(t,{options:!a&&this.getSharedOptions(A)||A})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"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 n=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const a=r.length,A=n.length,s=Math.min(A,a);s&&this.parse(0,s),A>a?this._insertElements(a,A-a,t):A<a&&this._removeElements(A,a-A)}_insertElements(t,n,r=!0){const a=this._cachedMeta,A=a.data,s=t+n;let o;const l=c=>{for(c.length+=n,o=c.length-1;o>=s;o--)c[o]=c[o-n]};for(l(A),o=t;o<s;++o)A[o]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(t,n),r&&this.updateElements(A,t,n,"reset")}updateElements(t,n,r,a){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(t,n);r._stacked&&pi(r,a)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,a]=t;this[n](r,a)}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,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(tr,"defaults",{}),R(tr,"datasetElementType",null),R(tr,"dataElementType",null);function JO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let a=0,A=n.length;a<A;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Tb(r.sort((a,A)=>a-A))}return e._cache.$bar}function ZO(e){const t=e.iScale,n=JO(t,e.type);let r=t._length,a,A,s,o;const l=()=>{s===32767||s===-32768||(Bn(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(a=0,A=n.length;a<A;++a)s=t.getPixelForValue(n[a]),l();for(o=void 0,a=0,A=t.ticks.length;a<A;++a)s=t.getPixelForTick(a),l();return r}function e7(e,t,n,r){const a=n.barThickness;let A,s;return _e(a)?(A=t.min*n.categoryPercentage,s=n.barPercentage):(A=a*r,s=1),{chunk:A/r,ratio:s,start:t.pixels[e]-A/2}}function t7(e,t,n,r){const a=t.pixels,A=a[e];let s=e>0?a[e-1]:null,o=e<a.length-1?a[e+1]:null;const l=n.categoryPercentage;s===null&&(s=A-(o===null?t.end-t.start:o-A)),o===null&&(o=A+A-s);const c=A-(A-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:n.barPercentage,start:c}}function n7(e,t,n,r){const a=n.parse(e[0],r),A=n.parse(e[1],r),s=Math.min(a,A),o=Math.max(a,A);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:a,end:A,min:s,max:o}}function e_(e,t,n,r){return Me(e)?n7(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Mv(e,t,n,r){const a=e.iScale,A=e.vScale,s=a.getLabels(),o=a===A,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[a.axis]=o||a.parse(s[c],c),l.push(e_(f,d,A,c));return l}function mf(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function r7(e,t,n){return e!==0?Br(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function a7(e){let t,n,r,a,A;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",A="start"):(a="start",A="end"),{start:n,end:r,reverse:t,top:a,bottom:A}}function A7(e,t,n,r){let a=t.borderSkipped;const A={};if(!a){e.borderSkipped=A;return}if(a===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=a7(e);a==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=c:(n._bottom||0)===r?a=u:(A[Nv(u,s,o,l)]=!0,a=c)),A[Nv(a,s,o,l)]=!0,e.borderSkipped=A}function Nv(e,t,n,r){return r?(e=s7(e,t,n),e=Pv(e,n,t)):e=Pv(e,t,n),e}function s7(e,t,n){return e===t?n:e===n?t:e}function Pv(e,t,n){return e==="start"?t:e==="end"?n:e}function i7(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Dc extends tr{parsePrimitiveData(t,n,r,a){return Mv(t,n,r,a)}parseArrayData(t,n,r,a){return Mv(t,n,r,a)}parseObjectData(t,n,r,a){const{iScale:A,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=A.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,h,p,m;for(f=r,h=r+a;f<h;++f)m=n[f],p={},p[A.axis]=A.parse(ja(m,c),f),d.push(e_(ja(m,u),p,s,f));return d}updateRangeFromParsed(t,n,r,a){super.updateRangeFromParsed(t,n,r,a);const A=r._custom;A&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,A.min),t.max=Math.max(t.max,A.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:a}=n,A=this.getParsed(t),s=A._custom,o=mf(s)?"["+s.start+", "+s.end+"]":""+a.getLabelForValue(A[a.axis]);return{label:""+r.getLabelForValue(A[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,a){const A=a==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,a);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=A||_e(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[o.axis],v={horizontal:c,base:m.base,enableBorderRadius:!g||mf(p._custom)||s===g._top||s===g._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(v.options=d||this.resolveDataElementOptions(h,t[h].active?"active":a));const _=v.options||t[h].options;A7(v,_,g,s),i7(v,_,u.ratio),this.updateElement(t[h],h,v,a)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),A=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(_e(u)||isNaN(u))return!0};for(const l of a)if(!(n!==void 0&&o(l))&&((A===!1||s.indexOf(l.stack)===-1||A===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const a=this._getStacks(t,r),A=n!==void 0?a.indexOf(n):-1;return A===-1?a.length-1:A}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,a=[];let A,s;for(A=0,s=n.data.length;A<s;++A)a.push(r.getPixelForValue(this.getParsed(A)[r.axis],A));const o=t.barThickness;return{min:o||ZO(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:a},options:{base:A,minBarLength:s}}=this,o=A||0,l=this.getParsed(t),c=l._custom,u=mf(c);let d=l[n.axis],f=0,h=r?this.applyStack(n,l,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&Br(d)!==Br(c.barEnd)&&(f=0),f+=d);const y=!_e(A)&&!u?A:f;let g=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=g,m=p-g,Math.abs(m)<s){m=r7(m,n,o)*s,d===o&&(g-=m/2);const v=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),B=Math.min(v,_),w=Math.max(v,_);g=Math.max(Math.min(g,w),B),p=g+m,r&&!u&&(l._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(g))}if(g===n.getPixelForValue(o)){const v=Br(m)*n.getLineWidthForValue(o)/2;g+=v,m-=v}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,a=this.options,A=a.skipNull,s=de(a.maxBarThickness,1/0);let o,l;if(n.grouped){const c=A?this._getStackCount(t):n.stackCount,u=a.barThickness==="flex"?t7(t,n,a,c):e7(t,n,a,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,A?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,a=r.length;let A=0;for(;A<a;++A)this.getParsed(A)[n.axis]!==null&&r[A].draw(this._ctx)}}R(Dc,"id","bar"),R(Dc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(Dc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Lc extends tr{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,a){const A=super.parsePrimitiveData(t,n,r,a);for(let s=0;s<A.length;s++)A[s]._custom=this.resolveDataElementOptions(s+r).radius;return A}parseArrayData(t,n,r,a){const A=super.parseArrayData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o[2],this.resolveDataElementOptions(s+r).radius)}return A}parseObjectData(t,n,r,a){const A=super.parseObjectData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return A}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,a),u=s.axis,d=o.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!A&&this.getParsed(f),m={},y=m[u]=A?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),g=m[d]=A?o.getBasePixel():o.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(g),c&&(m.options=l||this.resolveDataElementOptions(f,h.active?"active":a),A&&(m.options.radius=0)),this.updateElement(h,f,m,a)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let a=super.resolveDataElementOptions(t,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const A=a.radius;return n!=="active"&&(a.radius=0),a.radius+=de(r&&r._custom,A),a}}R(Lc,"id","bubble"),R(Lc,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Lc,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function o7(e,t,n){let r=1,a=1,A=0,s=0;if(t<Je){const o=e,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),h=(_,B,w)=>Fo(_,o,l,!0)?1:Math.max(B,B*n,w,w*n),p=(_,B,w)=>Fo(_,o,l,!0)?-1:Math.min(B,B*n,w,w*n),m=h(0,c,d),y=h(Ze,u,f),g=p(Te,c,d),v=p(Te+Ze,u,f);r=(m-g)/2,a=(y-v)/2,A=-(m+g)/2,s=-(y+v)/2}return{ratioX:r,ratioY:a,offsetX:A,offsetY:s}}class bA extends tr{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let A=l=>+r[l];if(ve(r[t])){const{key:l="value"}=this._parsing;A=c=>+ja(r[c],l)}let s,o;for(s=t,o=t+n;s<o;++s)a._parsed[s]=A(s)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let t=Je,n=-Je;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,A=a._getRotation(),s=a._getCircumference();t=Math.min(t,A),n=Math.max(n,A+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,a=this._cachedMeta,A=a.data,s=this.getMaxBorderWidth()+this.getMaxOffset(A)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(_L(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=o7(d,u,l),y=(r.width-s)/f,g=(r.height-s)/h,v=Math.max(Math.min(y,g)/2,0),_=xb(this.options.radius,v),B=Math.max(_*l,0),w=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,a.total=this.calculateTotal(),this.outerRadius=_-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(A,0,A.length,t)}_circumference(t,n){const r=this.options,a=this._cachedMeta,A=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||a._parsed[t]===null||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*A/Je)}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=A&&c.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,a);let g=this._getRotation(),v;for(v=0;v<n;++v)g+=this._circumference(v,A);for(v=n;v<n+r;++v){const _=this._circumference(v,A),B=t[v],w={x:u+this.offsetX,y:d+this.offsetY,startAngle:g,endAngle:g+_,circumference:_,outerRadius:p,innerRadius:h};y&&(w.options=m||this.resolveDataElementOptions(v,B.active?"active":a)),g+=_,this.updateElement(B,v,w,a)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,a;for(a=0;a<n.length;a++){const A=t._parsed[a];A!==null&&!isNaN(A)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(r+=Math.abs(A))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Je*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=nl(n._parsed[t],r.options.locale);return{label:a[t]||"",value:A}}getMaxBorderWidth(t){let n=0;const r=this.chart;let a,A,s,o,l;if(!t){for(a=0,A=r.data.datasets.length;a<A;++a)if(r.isDatasetVisible(a)){s=r.getDatasetMeta(a),t=s.data,o=s.controller;break}}if(!t)return 0;for(a=0,A=t.length;a<A;++a)l=o.resolveDataElementOptions(a),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,a=t.length;r<a;++r){const A=this.resolveDataElementOptions(r);n=Math.max(n,A.offset||0,A.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(bA,"id","doughnut"),R(bA,"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"}),R(bA,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(bA,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Oc extends tr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:a=[],_dataset:A}=n,s=this.chart._animationsDisabled;let{start:o,count:l}=Ob(n,a,s);this._drawStart=o,this._drawCount=l,Mb(n)&&(o=0,l=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=a;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(a,o,l,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,a),f=s.axis,h=o.axis,{spanGaps:p,segment:m}=this.options,y=Ya(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||A||a==="none",v=n+r,_=t.length;let B=n>0&&this.getParsed(n-1);for(let w=0;w<_;++w){const b=t[w],C=g?b:{};if(w<n||w>=v){C.skip=!0;continue}const E=this.getParsed(w),S=_e(E[h]),T=C[f]=s.getPixelForValue(E[f],w),U=C[h]=A||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,E,l):E[h],w);C.skip=isNaN(T)||isNaN(U)||S,C.stop=w>0&&Math.abs(E[f]-B[f])>y,m&&(C.parsed=E,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,b.active?"active":a)),g||this.updateElement(b,w,C,a),B=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,a=t.data||[];if(!a.length)return r;const A=a[0].size(this.resolveDataElementOptions(0)),s=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,A,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(Oc,"id","line"),R(Oc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(Oc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class eo extends tr{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=nl(n._parsed[t].r,r.options.locale);return{label:a[t]||"",value:A}}parseObjectData(t,n,r,a){return Wb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,a)=>{const A=this.getParsed(a).r;!isNaN(A)&&this.chart.getDataVisibility(a)&&(A<n.min&&(n.min=A),A>n.max&&(n.max=A))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top),A=Math.max(a/2,0),s=Math.max(r.cutoutPercentage?A/100*r.cutoutPercentage:1,0),o=(A-s)/t.getVisibleDatasetCount();this.outerRadius=A-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Te;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,a,m);for(p=n;p<n+r;p++){const y=t[p];let g=h,v=h+this._computeAngle(p,a,m),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=v,A&&(l.animateScale&&(_=0),l.animateRotate&&(g=v=f));const B={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:g,endAngle:v,options:this.resolveDataElementOptions(p,y.active?"active":a)};this.updateElement(y,p,B,a)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?St(this.resolveDataElementOptions(t,n).angle||r):0}}R(eo,"id","polarArea"),R(eo,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(eo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Oh extends bA{}R(Oh,"id","pie"),R(Oh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mc extends tr{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,a){return Wb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta,r=n.dataset,a=n.data||[],A=n.iScale.getLabels();if(r.points=a,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:A.length===a.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(a,0,a.length,t)}updateElements(t,n,r,a){const A=this._cachedMeta.rScale,s=a==="reset";for(let o=n;o<n+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":a),u=A.getPointPositionForValue(o,this.getParsed(o).r),d=s?A.xCenter:u.x,f=s?A.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,h,a)}}}R(Mc,"id","radar"),R(Mc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Mc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Nc extends tr{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,a=this.chart._animationsDisabled;let{start:A,count:s}=Ob(n,r,a);if(this._drawStart=A,this._drawCount=s,Mb(n)&&(A=0,s=r.length),this.options.showLine){const{dataset:o,_dataset:l}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!a,options:c},t)}this.updateElements(r,A,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,a),d=this.getSharedOptions(u),f=this.includeOptions(a,d),h=s.axis,p=o.axis,{spanGaps:m,segment:y}=this.options,g=Ya(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||A||a==="none";let _=n>0&&this.getParsed(n-1);for(let B=n;B<n+r;++B){const w=t[B],b=this.getParsed(B),C=v?w:{},E=_e(b[p]),S=C[h]=s.getPixelForValue(b[h],B),T=C[p]=A||E?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,b,l):b[p],B);C.skip=isNaN(S)||isNaN(T)||E,C.stop=B>0&&Math.abs(b[h]-_[h])>g,y&&(C.parsed=b,C.raw=c.data[B]),f&&(C.options=d||this.resolveDataElementOptions(B,w.active?"active":a)),v||this.updateElement(w,B,C,a),_=b}this.updateSharedOptions(d,a,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let l=n.length-1;l>=0;--l)o=Math.max(o,n[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!n.length)return a;const A=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,A,s)/2}}R(Nc,"id","scatter"),R(Nc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Nc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var l7=Object.freeze({__proto__:null,BarController:Dc,BubbleController:Lc,DoughnutController:bA,LineController:Oc,PieController:Oh,PolarAreaController:eo,RadarController:Mc,ScatterController:Nc});function lA(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class qg{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(qg.prototype,t)}init(){}formats(){return lA()}parse(){return lA()}format(){return lA()}add(){return lA()}diff(){return lA()}startOf(){return lA()}endOf(){return lA()}}var t_={_date:qg};function c7(e,t,n,r){const{controller:a,data:A,_sorted:s}=e,o=a._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&A.length){const l=o._reversePixels?DL:Gr;if(r){if(a._sharedOptions){const c=A[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(A,t,n-u),f=l(A,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(A,t,n)}return{lo:0,hi:A.length-1}}function Al(e,t,n,r,a){const A=e.getSortedVisibleDatasetMetas(),s=n[t];for(let o=0,l=A.length;o<l;++o){const{index:c,data:u}=A[o],{lo:d,hi:f}=c7(A[o],t,s,a);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,c,h)}}}function u7(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,a){const A=t?Math.abs(r.x-a.x):0,s=n?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(A,2)+Math.pow(s,2))}}function vf(e,t,n,r,a){const A=[];return!a&&!e.isPointInArea(t)||Al(e,n,t,function(o,l,c){!a&&!zr(o,e.chartArea,0)||o.inRange(t.x,t.y,r)&&A.push({element:o,datasetIndex:l,index:c})},!0),A}function d7(e,t,n,r){let a=[];function A(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=Ub(s,{x:t.x,y:t.y});Fo(d,c,u)&&a.push({element:s,datasetIndex:o,index:l})}return Al(e,n,t,A),a}function f7(e,t,n,r,a,A){let s=[];const o=u7(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!A||e.isPointInArea(p))&&!h)return;const y=o(t,p);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return Al(e,n,t,c),s}function Bf(e,t,n,r,a,A){return!A&&!e.isPointInArea(t)?[]:n==="r"&&!r?d7(e,t,n,a):f7(e,t,n,r,a,A)}function Hv(e,t,n,r,a){const A=[],s=n==="x"?"inXRange":"inYRange";let o=!1;return Al(e,n,t,(l,c,u)=>{l[s](t[n],a)&&(A.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,a))}),r&&!o?[]:A}var h7={evaluateInteractionItems:Al,modes:{index(e,t,n,r){const a=hA(t,e),A=n.axis||"x",s=n.includeInvisible||!1,o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;let o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=e.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return vf(e,a,A,r,s)},nearest(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return Bf(e,a,A,n.intersect,r,s)},x(e,t,n,r){const a=hA(t,e);return Hv(e,a,"x",n.intersect,r)},y(e,t,n,r){const a=hA(t,e);return Hv(e,a,"y",n.intersect,r)}}};const n_=["left","top","right","bottom"];function gi(e,t){return e.filter(n=>n.pos===t)}function Rv(e,t){return e.filter(n=>n_.indexOf(n.pos)===-1&&n.box.axis===t)}function mi(e,t){return e.sort((n,r)=>{const a=t?r:n,A=t?n:r;return a.weight===A.weight?a.index-A.index:a.weight-A.weight})}function p7(e){const t=[];let n,r,a,A,s,o;for(n=0,r=(e||[]).length;n<r;++n)a=e[n],{position:A,options:{stack:s,stackWeight:o=1}}=a,t.push({index:n,box:a,pos:A,horizontal:a.isHorizontal(),weight:a.weight,stack:s&&A+s,stackWeight:o});return t}function g7(e){const t={};for(const n of e){const{stack:r,pos:a,stackWeight:A}=n;if(!r||!n_.includes(a))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=A}return t}function m7(e,t){const n=g7(e),{vBoxMaxWidth:r,hBoxMaxHeight:a}=t;let A,s,o;for(A=0,s=e.length;A<s;++A){o=e[A];const{fullSize:l}=o.box,c=n[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=a):(o.width=r,o.height=u?u*a:l&&t.availableHeight)}return n}function v7(e){const t=p7(e),n=mi(t.filter(c=>c.box.fullSize),!0),r=mi(gi(t,"left"),!0),a=mi(gi(t,"right")),A=mi(gi(t,"top"),!0),s=mi(gi(t,"bottom")),o=Rv(t,"x"),l=Rv(t,"y");return{fullSize:n,leftAndTop:r.concat(A),rightAndBottom:a.concat(l).concat(s).concat(o),chartArea:gi(t,"chartArea"),vertical:r.concat(a).concat(l),horizontal:A.concat(s).concat(o)}}function Vv(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function r_(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function B7(e,t,n,r){const{pos:a,box:A}=n,s=e.maxPadding;if(!ve(a)){n.size&&(e[a]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?A.height:A.width),n.size=d.size/d.count,e[a]+=n.size}A.getPadding&&r_(s,A.getPadding());const o=Math.max(0,t.outerWidth-Vv(s,e,"left","right")),l=Math.max(0,t.outerHeight-Vv(s,e,"top","bottom")),c=o!==e.w,u=l!==e.h;return e.w=o,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function y7(e){const t=e.maxPadding;function n(r){const a=Math.max(t[r]-e[r],0);return e[r]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function w7(e,t){const n=t.maxPadding;function r(a){const A={left:0,top:0,right:0,bottom:0};return a.forEach(s=>{A[s]=Math.max(t[s],n[s])}),A}return r(e?["left","right"]:["top","bottom"])}function Ui(e,t,n,r){const a=[];let A,s,o,l,c,u;for(A=0,s=e.length,c=0;A<s;++A){o=e[A],l=o.box,l.update(o.width||t.w,o.height||t.h,w7(o.horizontal,t));const{same:d,other:f}=B7(t,n,o,r);c|=d&&a.length,u=u||f,l.fullSize||a.push(o)}return c&&Ui(a,t,n,r)||u}function Wl(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function Kv(e,t,n,r){const a=n.padding;let{x:A,y:s}=t;for(const o of e){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;Bn(c.start)&&(s=c.start),l.fullSize?Wl(l,a.left,s,n.outerWidth-a.right-a.left,f):Wl(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;Bn(c.start)&&(A=c.start),l.fullSize?Wl(l,A,a.top,f,n.outerHeight-a.bottom-a.top):Wl(l,A,t.top+c.placed,f,d),c.start=A,c.placed+=d,A=l.right}}t.x=A,t.y=s}var jt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const a=kt(e.options.layout.padding),A=Math.max(t-a.width,0),s=Math.max(n-a.height,0),o=v7(e.boxes),l=o.vertical,c=o.horizontal;Ke(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:A,availableHeight:s,vBoxMaxWidth:A/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},a);r_(f,kt(r));const h=Object.assign({maxPadding:f,w:A,h:s,x:a.left,y:a.top},a),p=m7(l.concat(c),d);Ui(o.fullSize,h,d,p),Ui(l,h,d,p),Ui(c,h,d,p)&&Ui(l,h,d,p),y7(h),Kv(o.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,Kv(o.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ke(o.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class a_{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,a){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,a?Math.floor(n/a):r)}}isAttached(t){return!0}updateConfig(t){}}class b7 extends a_{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pc="$chartjs",_7={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$v=e=>e===null||e==="";function C7(e,t){const n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[Pc]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",$v(a)){const A=Ev(e,"width");A!==void 0&&(e.width=A)}if($v(r))if(e.style.height==="")e.height=e.width/(t||2);else{const A=Ev(e,"height");A!==void 0&&(e.height=A)}return e}const A_=SO?{passive:!0}:!1;function k7(e,t,n){e.addEventListener(t,n,A_)}function E7(e,t,n){e.canvas.removeEventListener(t,n,A_)}function S7(e,t){const n=_7[e.type]||e.type,{x:r,y:a}=hA(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:a!==void 0?a:null}}function hu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function x7(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||hu(o.addedNodes,r),s=s&&!hu(o.removedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function F7(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||hu(o.removedNodes,r),s=s&&!hu(o.addedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const Io=new Map;let Wv=0;function s_(){const e=window.devicePixelRatio;e!==Wv&&(Wv=e,Io.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function I7(e,t){Io.size||window.addEventListener("resize",s_),Io.set(e,t)}function U7(e){Io.delete(e),Io.size||window.removeEventListener("resize",s_)}function Q7(e,t,n){const r=e.canvas,a=r&&jg(r);if(!a)return;const A=Lb((o,l)=>{const c=a.clientWidth;n(o,l),c<a.clientWidth&&n()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||A(c,u)});return s.observe(a),I7(e,A),s}function yf(e,t,n){n&&n.disconnect(),t==="resize"&&U7(e)}function T7(e,t,n){const r=e.canvas,a=Lb(A=>{e.ctx!==null&&n(S7(A,e))},e);return k7(r,t,a),a}class D7 extends a_{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(C7(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Pc])return!1;const r=n[Pc].initial;["height","width"].forEach(A=>{const s=r[A];_e(s)?n.removeAttribute(A):n.setAttribute(A,s)});const a=r.style||{};return Object.keys(a).forEach(A=>{n.style[A]=a[A]}),n.width=n.width,delete n[Pc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const a=t.$proxies||(t.$proxies={}),s={attach:x7,detach:F7,resize:Q7}[n]||T7;a[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),a=r[n];if(!a)return;({attach:yf,detach:yf,resize:yf}[n]||E7)(t,n,a),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,a){return EO(t,n,r,a)}isAttached(t){const n=jg(t);return!!(n&&n.isConnected)}}function L7(e){return!zb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?b7:D7}var Fc;let An=(Fc=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ya(this.x)&&Ya(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const a={};return t.forEach(A=>{a[A]=r[A]&&r[A].active()?r[A]._to:this[A]}),a}},R(Fc,"defaults",{}),R(Fc,"defaultRoutes"),Fc);function O7(e,t){const n=e.options.ticks,r=M7(e),a=Math.min(n.maxTicksLimit||r,r),A=n.major.enabled?P7(t):[],s=A.length,o=A[0],l=A[s-1],c=[];if(s>a)return H7(t,c,A,s/a),c;const u=N7(A,t,a);if(s>0){let d,f;const h=s>1?Math.round((l-o)/(s-1)):null;for(Gl(t,c,u,_e(h)?0:o-h,o),d=0,f=s-1;d<f;d++)Gl(t,c,u,A[d],A[d+1]);return Gl(t,c,u,l,_e(h)?t.length:l+h),c}return Gl(t,c,u),c}function M7(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}function N7(e,t,n){const r=R7(e),a=t.length/n;if(!r)return Math.max(a,1);const A=IL(r);for(let s=0,o=A.length-1;s<o;s++){const l=A[s];if(l>a)return l}return Math.max(a,1)}function P7(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function H7(e,t,n,r){let a=0,A=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===A&&(t.push(e[s]),a++,A=n[a*r])}function Gl(e,t,n,r,a){const A=de(r,0),s=Math.min(de(a,e.length),e.length);let o=0,l,c,u;for(n=Math.ceil(n),a&&(l=a-r,n=l/Math.floor(l/n)),u=A;u<0;)o++,u=Math.round(A+o*n);for(c=Math.max(A,0);c<s;c++)c===u&&(t.push(e[c]),o++,u=Math.round(A+o*n))}function R7(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const V7=e=>e==="left"?"right":e==="right"?"left":e,Gv=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,zv=(e,t)=>Math.min(t||e,e);function jv(e,t){const n=[],r=e.length/t,a=e.length;let A=0;for(;A<a;A+=r)n.push(e[Math.floor(A)]);return n}function K7(e,t,n){const r=e.ticks.length,a=Math.min(t,r-1),A=e._startPixel,s=e._endPixel,o=1e-6;let l=e.getPixelForTick(a),c;if(!(n&&(r===1?c=Math.max(l-A,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(a-1))/2,l+=a<t?c:-c,l<A-o||l>s+o)))return l}function $7(e,t){Ke(e,n=>{const r=n.gc,a=r.length/2;let A;if(a>t){for(A=0;A<a;++A)delete n.data[r[A]];r.splice(0,a)}})}function vi(e){return e.drawTicks?e.tickLength:0}function Yv(e,t){if(!e.display)return 0;const n=ht(e.font,t),r=kt(e.padding);return(Me(e.text)?e.text.length:1)*n.lineHeight+r.height}function W7(e,t){return AA(e,{scale:t,type:"scale"})}function G7(e,t,n){return AA(e,{tick:n,index:t,type:"tick"})}function z7(e,t,n){let r=Vg(e);return(n&&t!=="right"||!n&&t==="right")&&(r=V7(r)),r}function j7(e,t,n,r){const{top:a,left:A,bottom:s,right:o,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,p;const m=s-a,y=o-A;if(e.isHorizontal()){if(h=Gt(r,A,o),ve(n)){const g=Object.keys(n)[0],v=n[g];p=u[g].getPixelForValue(v)+m-t}else n==="center"?p=(c.bottom+c.top)/2+m-t:p=Gv(e,n,t);f=o-A}else{if(ve(n)){const g=Object.keys(n)[0],v=n[g];h=u[g].getPixelForValue(v)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=Gv(e,n,t);p=Gt(r,s,a),d=n==="left"?-Ze:Ze}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class GA extends An{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:a}=this;return t=bn(t,Number.POSITIVE_INFINITY),n=bn(n,Number.NEGATIVE_INFINITY),r=bn(r,Number.POSITIVE_INFINITY),a=bn(a,Number.NEGATIVE_INFINITY),{min:bn(t,r),max:bn(n,a),minDefined:dt(t),maxDefined:dt(n)}}getMinMax(t){let{min:n,max:r,minDefined:a,maxDefined:A}=this.getUserBounds(),s;if(a&&A)return{min:n,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),a||(n=Math.min(n,s.min)),A||(r=Math.max(r,s.max));return n=A&&n>r?r:n,r=a&&n>r?n:r,{min:bn(n,bn(r,n)),max:bn(r,bn(n,r))}}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(){Re(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:a,grace:A,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=aO(this,A,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?jv(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=O7(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Re(this.options.afterUpdate,[this])}beforeSetDimensions(){Re(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(){Re(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Re(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Re(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,a,A;for(r=0,a=t.length;r<a;r++)A=t[r],A.label=Re(n.callback,[A.value,r,t],this)}afterTickToLabelConversion(){Re(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Re(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=zv(this.ticks.length,t.ticks.maxTicksLimit),a=n.minRotation||0,A=n.maxRotation;let s=a,o,l,c;if(!this._isVisible()||!n.display||a>=A||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Pt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:h/(r-1),d+6>o&&(o=h/(r-(t.offset?.5:1)),l=this.maxHeight-vi(t.grid)-n.padding-Yv(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=td(Math.min(Math.asin(Pt((u.highest.height+6)/o,-1,1)),Math.asin(Pt(l/c,-1,1))-Math.asin(Pt(f/c,-1,1)))),s=Math.max(a,Math.min(A,s))),this.labelRotation=s}afterCalculateLabelRotation(){Re(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Re(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:A}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Yv(a,n.options.font);if(o?(t.width=this.maxWidth,t.height=vi(A)+l):(t.height=this.maxHeight,t.width=vi(A)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=St(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(o){const g=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+g+h)}else{const g=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+g+h)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,a){const{ticks:{align:A,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=a*t.width,h=r*n.height):(f=r*t.height,h=a*n.width):A==="start"?h=n.width:A==="end"?f=t.width:A!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;A==="start"?(u=0,d=t.height):A==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Re(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)_e(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=jv(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:a,_longestTextCache:A}=this,s=[],o=[],l=Math.floor(n/zv(n,r));let c=0,u=0,d,f,h,p,m,y,g,v,_,B,w;for(d=0;d<n;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),a.font=y=m.string,g=A[y]=A[y]||{data:{},gc:[]},v=m.lineHeight,_=B=0,!_e(p)&&!Me(p))_=du(a,g.data,g.gc,_,p),B=v;else if(Me(p))for(f=0,h=p.length;f<h;++f)w=p[f],!_e(w)&&!Me(w)&&(_=du(a,g.data,g.gc,_,w),B+=v);s.push(_),o.push(B),c=Math.max(_,c),u=Math.max(B,u)}$7(A,n);const b=s.indexOf(c),C=o.indexOf(u),E=S=>({width:s[S]||0,height:o[S]||0});return{first:E(0),last:E(n-1),widest:E(b),highest:E(C),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return TL(this._alignToPixels?oA(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=G7(this.getContext(),t,r))}return this.$context||(this.$context=W7(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=St(this.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),A=this._getLabelSizes(),s=t.autoSkipPadding||0,o=A?A.widest.width+s:0,l=A?A.highest.height+s:0;return this.isHorizontal()?l*r>o*a?o/r:l/a:l*a<o*r?l/r:o/a}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,a=this.options,{grid:A,position:s,border:o}=a,l=A.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=vi(A),h=[],p=o.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,g=function(j){return oA(r,j,m)};let v,_,B,w,b,C,E,S,T,U,F,Q;if(s==="top")v=g(this.bottom),C=this.bottom-f,S=v-y,U=g(t.top)+y,Q=t.bottom;else if(s==="bottom")v=g(this.top),U=t.top,Q=g(t.bottom)-y,C=v+y,S=this.top+f;else if(s==="left")v=g(this.right),b=this.right-f,E=v-y,T=g(t.left)+y,F=t.right;else if(s==="right")v=g(this.left),T=t.left,F=g(t.right)-y,b=v+y,E=this.left+f;else if(n==="x"){if(s==="center")v=g((t.top+t.bottom)/2+.5);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}U=t.top,Q=t.bottom,C=v+y,S=C+f}else if(n==="y"){if(s==="center")v=g((t.left+t.right)/2);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}b=v-y,E=b-f,T=t.left,F=t.right}const Y=de(a.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/Y));for(_=0;_<d;_+=X){const j=this.getContext(_),K=A.setContext(j),oe=o.setContext(j),$=K.lineWidth,Ae=K.color,ce=oe.dash||[],me=oe.dashOffset,ke=K.tickWidth,fe=K.tickColor,re=K.tickBorderDash||[],N=K.tickBorderDashOffset;B=K7(this,_,l),B!==void 0&&(w=oA(r,B,$),c?b=E=T=F=w:C=S=U=Q=w,h.push({tx1:b,ty1:C,tx2:E,ty2:S,x1:T,y1:U,x2:F,y2:Q,width:$,color:Ae,borderDash:ce,borderDashOffset:me,tickWidth:ke,tickColor:fe,tickBorderDash:re,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:a,ticks:A}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=A,f=vi(r.grid),h=f+u,p=d?-u:h,m=-St(this.labelRotation),y=[];let g,v,_,B,w,b,C,E,S,T,U,F,Q="middle";if(a==="top")b=this.bottom-p,C=this._getXAxisLabelAlignment();else if(a==="bottom")b=this.top+p,C=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,w=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,w=X.x}else if(n==="x"){if(a==="center")b=(t.top+t.bottom)/2+h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];b=this.chart.scales[X].getPixelForValue(j)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")w=(t.left+t.right)/2-h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];w=this.chart.scales[X].getPixelForValue(j)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const Y=this._getLabelSizes();for(g=0,v=o.length;g<v;++g){_=o[g],B=_.label;const X=A.setContext(this.getContext(g));E=this.getPixelForTick(g)+A.labelOffset,S=this._resolveTickFontOptions(g),T=S.lineHeight,U=Me(B)?B.length:1;const j=U/2,K=X.color,oe=X.textStrokeColor,$=X.textStrokeWidth;let Ae=C;s?(w=E,C==="inner"&&(g===v-1?Ae=this.options.reverse?"left":"right":g===0?Ae=this.options.reverse?"right":"left":Ae="center"),a==="top"?c==="near"||m!==0?F=-U*T+T/2:c==="center"?F=-Y.highest.height/2-j*T+T:F=-Y.highest.height+T/2:c==="near"||m!==0?F=T/2:c==="center"?F=Y.highest.height/2-j*T:F=Y.highest.height-U*T,d&&(F*=-1),m!==0&&!X.showLabelBackdrop&&(w+=T/2*Math.sin(m))):(b=E,F=(1-U)*T/2);let ce;if(X.showLabelBackdrop){const me=kt(X.backdropPadding),ke=Y.heights[g],fe=Y.widths[g];let re=F-me.top,N=0-me.left;switch(Q){case"middle":re-=ke/2;break;case"bottom":re-=ke;break}switch(C){case"center":N-=fe/2;break;case"right":N-=fe;break}ce={left:N,top:re,width:fe+me.width,height:ke+me.height,color:X.backdropColor}}y.push({label:B,font:S,textOffset:F,options:{rotation:m,color:K,strokeColor:oe,strokeWidth:$,textAlign:Ae,textBaseline:Q,translation:[w,b],backdrop:ce}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-St(this.labelRotation))return t==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:a,padding:A}}=this.options,s=this._getLabelSizes(),o=t+A,l=s.widest.width;let c,u;return n==="left"?a?(u=this.right+A,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?a?(u=this.left+A,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:a,width:A,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,a,A,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(A=>A.value===t);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let A,s;const o=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(A=0,s=a.length;A<s;++A){const l=a[A];n.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:a}}=this,A=r.setContext(this.getContext()),s=r.display?A.width:0;if(!s)return;const o=a.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=oA(t,this.left,s)-s/2,u=oA(t,this.right,o)+o/2,d=f=l):(d=oA(t,this.top,s)-s/2,f=oA(t,this.bottom,o)+o/2,c=u=l),n.save(),n.lineWidth=A.width,n.strokeStyle=A.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&rl(r,a);const A=this.getLabelItems(t);for(const s of A){const o=s.options,l=s.font,c=s.label,u=s.textOffset;PA(r,c,0,u,l,o)}a&&al(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:a}}=this;if(!r.display)return;const A=ht(r.font),s=kt(r.padding),o=r.align;let l=A.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(l+=s.bottom,Me(r.text)&&(l+=A.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=j7(this,l,n,o);PA(t,r.text,0,0,A,{color:r.color,maxWidth:d,rotation:f,textAlign:z7(o,n,a),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),a=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==GA.prototype.draw?[{z:n,draw:A=>{this.draw(A)}}]:[{z:r,draw:A=>{this.drawBackground(),this.drawGrid(A),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:A=>{this.drawLabels(A)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let A,s;for(A=0,s=n.length;A<s;++A){const o=n[A];o[r]===this.id&&(!t||o.type===t)&&a.push(o)}return a}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ht(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class zl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;X7(n)&&(r=this.register(n));const a=this.items,A=t.id,s=this.scope+"."+A;if(!A)throw new Error("class does not have id: "+t);return A in a||(a[A]=t,Y7(t,s,r),this.override&&ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,a=this.scope;r in n&&delete n[r],a&&r in ft[a]&&(delete ft[a][r],this.override&&delete NA[r])}}function Y7(e,t,n){const r=br(Object.create(null),[n?ft.get(n):{},ft.get(t),e.defaults]);ft.set(t,r),e.defaultRoutes&&q7(t,e.defaultRoutes),e.descriptors&&ft.describe(t,e.descriptors)}function q7(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),a=r.pop(),A=[e].concat(r).join("."),s=t[n].split("."),o=s.pop(),l=s.join(".");ft.route(A,a,l,o)})}function X7(e){return"id"in e&&"defaults"in e}class J7{constructor(){this.controllers=new zl(tr,"datasets",!0),this.elements=new zl(An,"elements"),this.plugins=new zl(Object,"plugins"),this.scales=new zl(GA,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(a=>{const A=r||this._getRegistryForType(a);r||A.isForType(a)||A===this.plugins&&a.id?this._exec(t,A,a):Ke(a,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,n,r){const a=Pg(t);Re(r["before"+a],[],r),n[t](r),Re(r["after"+a],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const a=n.get(t);if(a===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return a}}var dr=new J7;class Z7{constructor(){this._init=[]}notify(t,n,r,a){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const A=a?this._descriptors(t).filter(a):this._descriptors(t),s=this._notify(A,t,n,r);return n==="afterDestroy"&&(this._notify(A,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,a){a=a||{};for(const A of t){const s=A.plugin,o=s[r],l=[n,a,A.options];if(Re(o,l,s)===!1&&a.cancelable)return!1}return!0}invalidate(){_e(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,a=de(r.options&&r.options.plugins,{}),A=eM(r);return a===!1&&!n?[]:nM(t,A,a,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,a=(A,s)=>A.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(a(n,r),t,"stop"),this._notify(a(r,n),t,"start")}}function eM(e){const t={},n=[],r=Object.keys(dr.plugins.items);for(let A=0;A<r.length;A++)n.push(dr.getPlugin(r[A]));const a=e.plugins||[];for(let A=0;A<a.length;A++){const s=a[A];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function tM(e,t){return!t&&e===!1?null:e===!0?{}:e}function nM(e,{plugins:t,localIds:n},r,a){const A=[],s=e.getContext();for(const o of t){const l=o.id,c=tM(r[l],a);c!==null&&A.push({plugin:o,options:rM(e.config,{plugin:o,local:n[l]},c,s)})}return A}function rM(e,{plugin:t,local:n},r,a){const A=e.pluginScopeKeys(t),s=e.getOptionScopes(r,A);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mh(e,t){const n=ft.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function aM(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function AM(e,t){return e===t?"_index_":"_value_"}function qv(e){if(e==="x"||e==="y"||e==="r")return e}function sM(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Nh(e,...t){if(qv(e))return e;for(const n of t){const r=n.axis||sM(n.position)||e.length>1&&qv(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Xv(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function iM(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Xv(e,"x",n[0])||Xv(e,"y",n[0])}return{}}function oM(e,t){const n=NA[e.type]||{scales:{}},r=t.scales||{},a=Mh(e.type,t),A=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!ve(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Nh(s,o,iM(s,e),ft.scales[o.type]),c=AM(l,a),u=n.scales||{};A[s]=qi(Object.create(null),[{axis:l},o,u[l],u[c]])}),e.data.datasets.forEach(s=>{const o=s.type||e.type,l=s.indexAxis||Mh(o,t),u=(NA[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=aM(d,l),h=s[f+"AxisID"]||f;A[h]=A[h]||Object.create(null),qi(A[h],[{axis:f},r[h],u[d]])})}),Object.keys(A).forEach(s=>{const o=A[s];qi(o,[ft.scales[o.type],ft.scale])}),A}function i_(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=oM(e,t)}function o_(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function lM(e){return e=e||{},e.data=o_(e.data),i_(e),e}const Jv=new Map,l_=new Set;function jl(e,t){let n=Jv.get(e);return n||(n=t(),Jv.set(e,n),l_.add(n)),n}const Bi=(e,t,n)=>{const r=ja(t,n);r!==void 0&&e.add(r)};class cM{constructor(t){this._config=lM(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=o_(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(),i_(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return jl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return jl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return jl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return jl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let a=r.get(t);return(!a||n)&&(a=new Map,r.set(t,a)),a}getOptionScopes(t,n,r){const{options:a,type:A}=this,s=this._cachedScopes(t,r),o=s.get(n);if(o)return o;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,a,d)),u.forEach(d=>Bi(l,NA[A]||{},d)),u.forEach(d=>Bi(l,ft,d)),u.forEach(d=>Bi(l,Dh,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),l_.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,NA[n]||{},ft.datasets[n]||{},{type:n},ft,Dh]}resolveNamedOptions(t,n,r,a=[""]){const A={$shared:!0},{resolver:s,subPrefixes:o}=Zv(this._resolverCache,t,a);let l=s;if(dM(s,n)){A.$shared=!1,r=vn(r)?r():r;const c=this.createResolver(t,r,o);l=Ks(s,r,c)}for(const c of n)A[c]=l[c];return A}createResolver(t,n,r=[""],a){const{resolver:A}=Zv(this._resolverCache,t,r);return ve(n)?Ks(A,n,void 0,a):A}}function Zv(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const a=n.join();let A=r.get(a);return A||(A={resolver:Wg(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},r.set(a,A)),A}const uM=e=>ve(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||vn(e[n]),!1);function dM(e,t){const{isScriptable:n,isIndexable:r}=Rb(e);for(const a of t){const A=n(a),s=r(a),o=(s||A)&&e[a];if(A&&(vn(o)||uM(o))||s&&Me(o))return!0}return!1}var fM="4.3.0";const hM=["top","bottom","left","right","chartArea"];function eB(e,t){return e==="top"||e==="bottom"||hM.indexOf(e)===-1&&t==="x"}function tB(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function nB(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Re(n&&n.onComplete,[e],t)}function pM(e){const t=e.chart,n=t.options.animation;Re(n&&n.onProgress,[e],t)}function c_(e){return zb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Hc={},rB=e=>{const t=c_(e);return Object.values(Hc).filter(n=>n.canvas===t).pop()};function gM(e,t,n){const r=Object.keys(e);for(const a of r){const A=+a;if(A>=t){const s=e[a];delete e[a],(n>0||A>t)&&(e[A+n]=s)}}}function mM(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function vM(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}class Oe{static register(...t){dr.add(...t),aB()}static unregister(...t){dr.remove(...t),aB()}constructor(t,n){const r=this.config=new cM(n),a=c_(t),A=rB(a);if(A)throw new Error("Canvas is already in use. Chart with ID '"+A.id+"' must be destroyed before the canvas with ID '"+A.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||L7(a)),this.platform.updateConfig(r);const o=this.platform.acquireContext(a,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=bL(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Z7,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ML(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Hc[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Nr.listen(this,"complete",nB),Nr.listen(this,"progress",pM),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:a,_aspectRatio:A}=this;return _e(t)?n&&A?A:a?r/a: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 dr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kv(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return bv(this.canvas,this.ctx),this}stop(){return Nr.stop(this),this}resize(t,n){Nr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,a=this.canvas,A=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(a,t,n,A),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,kv(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Re(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ke(n,(r,a)=>{r.id=a})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let A=[];n&&(A=A.concat(Object.keys(n).map(s=>{const o=n[s],l=Nh(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ke(A,s=>{const o=s.options,l=o.id,c=Nh(l,o),u=de(o.type,s.dtype);(o.position===void 0||eB(o.position,c)!==eB(s.dposition))&&(o.position=s.dposition),a[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=dr.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Ke(a,(s,o)=>{s||delete r[o]}),Ke(r,s=>{jt.configure(this,s,s.options),jt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((a,A)=>a.index-A.index),r>n){for(let a=n;a<r;++a)this._destroyDatasetMeta(a);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(tB("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,a)=>{n.filter(A=>A===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const A=n[r];let s=this.getDatasetMeta(r);const o=A.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=A.indexAxis||Mh(o,this.options),s.order=A.order||0,s.index=r,s.label=""+A.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=dr.getController(o),{datasetElementType:c,dataElementType:u}=ft.datasets[o];Object.assign(l,{dataElementType:dr.getElement(u),datasetElementType:c&&dr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ke(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const A=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!a&&A.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),a||Ke(A,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tB("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Ke(this.scales,t=>{jt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!hv(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:A}of n){const s=r==="_removeElements"?-A:A;gM(t,a,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=A=>new Set(t.filter(s=>s[0]===A).map((s,o)=>o+","+s.splice(1).join(","))),a=r(0);for(let A=1;A<n;A++)if(!hv(a,r(A)))return;return Array.from(a).map(A=>A.split(",")).map(A=>({method:A[1],start:+A[2],count:+A[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;jt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ke(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,A)=>{a._idx=A}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),a={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Nr.has(this)?this.attached&&!Nr.running(this)&&Nr.start(this):(this.draw(),nB({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resize(r,a),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let a,A;for(a=0,A=n.length;a<A;++a){const s=n[a];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,a=!r.disabled,A=vM(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(a&&rl(n,{left:r.left===!1?0:A.left-r.left,right:r.right===!1?this.width:A.right+r.right,top:r.top===!1?0:A.top-r.top,bottom:r.bottom===!1?this.height:A.bottom+r.bottom}),t.controller.draw(),a&&al(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return zr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,a){const A=h7.modes[n];return typeof A=="function"?A(this,t,r,a):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let a=r.filter(A=>A&&A._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=AA(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const a=r?"show":"hide",A=this.getDatasetMeta(t),s=A.controller._resolveAnimations(void 0,a);Bn(n)?(A.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(A,{visible:r}),this.update(o=>o.datasetIndex===t?a:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Nr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),bv(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Hc[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,n=this.platform,r=(A,s)=>{n.addEventListener(this,A,s),t[A]=s},a=(A,s,o)=>{A.offsetX=s,A.offsetY=o,this._eventHandler(A)};Ke(this.options.events,A=>r(A,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},a=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},A=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{a("attach",o),this.attached=!0,this.resize(),r("resize",A),r("detach",s)};s=()=>{this.attached=!1,a("resize",A),this._stop(),this._resize(0,0),r("attach",o)},n.isAttached(this.canvas)?o():s()}unbindEvents(){Ke(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ke(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const a=r?"set":"remove";let A,s,o,l;for(n==="dataset"&&(A=this.getDatasetMeta(t[0].datasetIndex),A.controller["_"+a+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:A,index:s})=>{const o=this.getDatasetMeta(A);if(!o)throw new Error("No dataset found at index "+A);return{datasetIndex:A,element:o.data[s],index:s}});!ou(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const a=this.options.hover,A=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=A(n,t),o=r?t:A(t,n);s.length&&this.updateHoverStyle(s,a.mode,!1),o.length&&a.mode&&this.updateHoverStyle(o,a.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},a=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const A=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(A||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:a=[],options:A}=this,s=n,o=this._getActiveElements(t,a,r,s),l=xL(t),c=mM(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Re(A.onHover,[t,o,this],this),l&&Re(A.onClick,[t,o,this],this));const u=!ou(o,a);return(u||n)&&(this._active=o,this._updateHoverStyles(o,a,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,a){if(t.type==="mouseout")return[];if(!r)return n;const A=this.options.hover;return this.getElementsAtEventForMode(t,A.mode,A,a)}}R(Oe,"defaults",ft),R(Oe,"instances",Hc),R(Oe,"overrides",NA),R(Oe,"registry",dr),R(Oe,"version",fM),R(Oe,"getChart",rB);function aB(){return Ke(Oe.instances,e=>e._plugins.invalidate())}function BM(e,t,n){const{startAngle:r,pixelMargin:a,x:A,y:s,outerRadius:o,innerRadius:l}=t;let c=a/o;e.beginPath(),e.arc(A,s,o,r-c,n+c),l>a?(c=a/l,e.arc(A,s,l,n+c,r-c,!0)):e.arc(A,s,a,n+Ze,r-Ze),e.closePath(),e.clip()}function yM(e){return $g(e,["outerStart","outerEnd","innerStart","innerEnd"])}function wM(e,t,n,r){const a=yM(e.options.borderRadius),A=(n-t)/2,s=Math.min(A,r*t/2),o=l=>{const c=(n-Math.min(A,l))*r/2;return Pt(l,0,Math.min(A,c))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:Pt(a.innerStart,0,s),innerEnd:Pt(a.innerEnd,0,s)}}function As(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pu(e,t,n,r,a,A){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let h=0;const p=a-l;if(r){const X=u>0?u-r:0,j=d>0?d-r:0,K=(X+j)/2,oe=K!==0?p*K/(K+r):p;h=(p-oe)/2}const m=Math.max(.001,p*d-n/Te)/d,y=(p-m)/2,g=l+y+h,v=a-y-h,{outerStart:_,outerEnd:B,innerStart:w,innerEnd:b}=wM(t,f,d,v-g),C=d-_,E=d-B,S=g+_/C,T=v-B/E,U=f+w,F=f+b,Q=g+w/U,Y=v-b/F;if(e.beginPath(),A){const X=(S+T)/2;if(e.arc(s,o,d,S,X),e.arc(s,o,d,X,T),B>0){const $=As(E,T,s,o);e.arc($.x,$.y,B,T,v+Ze)}const j=As(F,v,s,o);if(e.lineTo(j.x,j.y),b>0){const $=As(F,Y,s,o);e.arc($.x,$.y,b,v+Ze,Y+Math.PI)}const K=(v-b/f+(g+w/f))/2;if(e.arc(s,o,f,v-b/f,K,!0),e.arc(s,o,f,K,g+w/f,!0),w>0){const $=As(U,Q,s,o);e.arc($.x,$.y,w,Q+Math.PI,g-Ze)}const oe=As(C,g,s,o);if(e.lineTo(oe.x,oe.y),_>0){const $=As(C,S,s,o);e.arc($.x,$.y,_,g-Ze,S)}}else{e.moveTo(s,o);const X=Math.cos(S)*d+s,j=Math.sin(S)*d+o;e.lineTo(X,j);const K=Math.cos(T)*d+s,oe=Math.sin(T)*d+o;e.lineTo(K,oe)}e.closePath()}function bM(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o}=t;let l=t.endAngle;if(A){pu(e,t,n,r,l,a);for(let c=0;c<A;++c)e.fill();isNaN(o)||(l=s+(o%Je||Je))}return pu(e,t,n,r,l,a),e.fill(),l}function _M(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(A){pu(e,t,n,r,p,a);for(let m=0;m<A;++m)e.stroke();isNaN(o)||(p=s+(o%Je||Je))}h&&BM(e,t,p),A||(pu(e,t,n,r,p,a),e.stroke())}class ws extends An{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(this,"startAngle");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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.getProps(["x","y"],a),{angle:s,distance:o}=Ub(A,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,m=de(f,c-l)>=Je||Fo(s,l,c),y=Wr(o,u+h,d+h);return m&&y}getCenterPoint(n){const{x:r,y:a,startAngle:A,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(A+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:a+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:a}=this,A=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Je?Math.floor(a/Je):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*A,Math.sin(l)*A);const c=1-Math.sin(Math.min(Te,a||0)),u=A*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,bM(n,this,u,s,o),_M(n,this,u,s,o),n.restore()}}R(ws,"id","arc"),R(ws,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(ws,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ws,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function u_(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function CM(e,t,n){e.lineTo(n.x,n.y)}function kM(e){return e.stepped?YL:e.tension||e.cubicInterpolationMode==="monotone"?qL:CM}function d_(e,t,n={}){const r=e.length,{start:a=0,end:A=r-1}=n,{start:s,end:o}=t,l=Math.max(a,s),c=Math.min(A,o),u=a<s&&A<s||a>o&&A>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function EM(e,t,n,r){const{points:a,options:A}=t,{count:s,start:o,loop:l,ilen:c}=d_(a,n,r),u=kM(A);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=c;++h)p=a[(o+(f?c-h:h))%s],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,A.stepped),m=p);return l&&(p=a[(o+(f?c:0))%s],u(e,m,p,f,A.stepped)),!!l}function SM(e,t,n,r){const a=t.points,{count:A,start:s,ilen:o}=d_(a,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,p,m,y,g;const v=B=>(s+(c?o-B:B))%A,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,g))};for(l&&(h=a[v(0)],e.moveTo(h.x,h.y)),f=0;f<=o;++f){if(h=a[v(f)],h.skip)continue;const B=h.x,w=h.y,b=B|0;b===p?(w<m?m=w:w>y&&(y=w),u=(d*u+B)/++d):(_(),e.lineTo(B,w),p=b,d=0,m=y=w),g=w}_()}function Ph(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?SM:EM}function xM(e){return e.stepped?xO:e.tension||e.cubicInterpolationMode==="monotone"?FO:pA}function FM(e,t,n,r){let a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),u_(e,t.options),e.stroke(a)}function IM(e,t,n,r){const{segments:a,options:A}=t,s=Ph(t);for(const o of a)u_(e,A,o.style),e.beginPath(),s(e,t,o,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const UM=typeof Path2D=="function";function QM(e,t,n,r){UM&&!t.options.segment?FM(e,t,n,r):IM(e,t,n,r)}class xa extends An{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;yO(this._points,r,t,a,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=LO(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,a=t[n],A=this.points,s=Jb(this,{property:n,start:a,end:a});if(!s.length)return;const o=[],l=xM(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],h=A[d],p=A[f];if(h===p){o.push(h);continue}const m=Math.abs((a-h[n])/(p[n]-h[n])),y=l(h,p,m,r.stepped);y[n]=t[n],o.push(y)}return o.length===1?o[0]:o}pathSegment(t,n,r){return Ph(this)(t,this,n,r)}path(t,n,r){const a=this.segments,A=Ph(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const o of a)s&=A(t,this,o,{start:n,end:n+r-1});return!!s}draw(t,n,r,a){const A=this.options||{};(this.points||[]).length&&A.borderWidth&&(t.save(),QM(t,this,r,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(xa,"id","line"),R(xa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(xa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(xa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function AB(e,t,n,r){const a=e.options,{[n]:A}=e.getProps([n],r);return Math.abs(t-A)<a.radius+a.hitRadius}class to extends An{constructor(n){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.options,{x:s,y:o}=this.getProps(["x","y"],a);return Math.pow(n-s,2)+Math.pow(r-o,2)<Math.pow(A.hitRadius+A.radius,2)}inXRange(n,r){return AB(this,n,"x",r)}inYRange(n,r){return AB(this,n,"y",r)}getCenterPoint(n){const{x:r,y:a}=this.getProps(["x","y"],n);return{x:r,y:a}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const a=r&&n.borderWidth||0;return(r+a)*2}draw(n,r){const a=this.options;this.skip||a.radius<.1||!zr(this,r,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,Lh(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(to,"id","point"),R(to,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(to,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function f_(e,t){const{x:n,y:r,base:a,width:A,height:s}=e.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return e.horizontal?(d=s/2,o=Math.min(n,a),l=Math.max(n,a),c=r-d,u=r+d):(d=A/2,o=n-d,l=n+d,c=Math.min(r,a),u=Math.max(r,a)),{left:o,top:c,right:l,bottom:u}}function Fa(e,t,n,r){return e?0:Pt(t,n,r)}function TM(e,t,n){const r=e.options.borderWidth,a=e.borderSkipped,A=Hb(r);return{t:Fa(a.top,A.top,0,n),r:Fa(a.right,A.right,0,t),b:Fa(a.bottom,A.bottom,0,n),l:Fa(a.left,A.left,0,t)}}function DM(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),a=e.options.borderRadius,A=Oa(a),s=Math.min(t,n),o=e.borderSkipped,l=r||ve(a);return{topLeft:Fa(!l||o.top||o.left,A.topLeft,0,s),topRight:Fa(!l||o.top||o.right,A.topRight,0,s),bottomLeft:Fa(!l||o.bottom||o.left,A.bottomLeft,0,s),bottomRight:Fa(!l||o.bottom||o.right,A.bottomRight,0,s)}}function LM(e){const t=f_(e),n=t.right-t.left,r=t.bottom-t.top,a=TM(e,n/2,r/2),A=DM(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:A},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,A.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,A.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,A.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,A.bottomRight-Math.max(a.b,a.r))}}}}function wf(e,t,n,r){const a=t===null,A=n===null,o=e&&!(a&&A)&&f_(e,r);return o&&(a||Wr(t,o.left,o.right))&&(A||Wr(n,o.top,o.bottom))}function OM(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function MM(e,t){e.rect(t.x,t.y,t.w,t.h)}function bf(e,t,n={}){const r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,A=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+A,h:e.h+s,radius:e.radius}}class no extends An{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:n,options:{borderColor:r,backgroundColor:a}}=this,{inner:A,outer:s}=LM(this),o=OM(s.radius)?Vs:MM;t.save(),(s.w!==A.w||s.h!==A.h)&&(t.beginPath(),o(t,bf(s,n,A)),t.clip(),o(t,bf(A,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,bf(A,n)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,n,r){return wf(this,t,n,r)}inXRange(t,n){return wf(this,t,null,n)}inYRange(t,n){return wf(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:a,horizontal:A}=this.getProps(["x","y","base","horizontal"],t);return{x:A?(n+a)/2:n,y:A?r:(r+a)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(no,"id","bar"),R(no,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(no,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var NM=Object.freeze({__proto__:null,ArcElement:ws,BarElement:no,LineElement:xa,PointElement:to});const Hh=["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)"],sB=Hh.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function h_(e){return Hh[e%Hh.length]}function p_(e){return sB[e%sB.length]}function PM(e,t){return e.borderColor=h_(t),e.backgroundColor=p_(t),++t}function HM(e,t){return e.backgroundColor=e.data.map(()=>h_(t++)),t}function RM(e,t){return e.backgroundColor=e.data.map(()=>p_(t++)),t}function VM(e){let t=0;return(n,r)=>{const a=e.getDatasetMeta(r).controller;a instanceof bA?t=HM(n,t):a instanceof eo?t=RM(n,t):a&&(t=PM(n,t))}}function iB(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function KM(e){return e&&(e.borderColor||e.backgroundColor)}var $M={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:a}=e.config,{elements:A}=a;if(!n.forceOverride&&(iB(r)||KM(a)||A&&iB(A)))return;const s=VM(e);r.forEach(s)}};function WM(e,t,n,r,a){const A=a.samples||r;if(A>=n)return e.slice(t,t+n);const s=[],o=(n-2)/(A-2);let l=0;const c=t+n-1;let u=t,d,f,h,p,m;for(s[l++]=e[u],d=0;d<A-2;d++){let y=0,g=0,v;const _=Math.floor((d+1)*o)+1+t,B=Math.min(Math.floor((d+2)*o)+1,n)+t,w=B-_;for(v=_;v<B;v++)y+=e[v].x,g+=e[v].y;y/=w,g/=w;const b=Math.floor(d*o)+1+t,C=Math.min(Math.floor((d+1)*o)+1,n)+t,{x:E,y:S}=e[u];for(h=p=-1,v=b;v<C;v++)p=.5*Math.abs((E-y)*(e[v].y-S)-(E-e[v].x)*(g-S)),p>h&&(h=p,f=e[v],m=v);s[l++]=f,u=m}return s[l++]=e[c],s}function GM(e,t,n,r){let a=0,A=0,s,o,l,c,u,d,f,h,p,m;const y=[],g=t+n-1,v=e[t].x,B=e[g].x-v;for(s=t;s<t+n;++s){o=e[s],l=(o.x-v)/B*r,c=o.y;const w=l|0;if(w===u)c<p?(p=c,d=s):c>m&&(m=c,f=s),a=(A*a+o.x)/++A;else{const b=s-1;if(!_e(d)&&!_e(f)){const C=Math.min(d,f),E=Math.max(d,f);C!==h&&C!==b&&y.push({...e[C],x:a}),E!==h&&E!==b&&y.push({...e[E],x:a})}s>0&&b!==h&&y.push(e[b]),y.push(o),u=w,A=0,p=m=c,d=f=h=s}}return y}function g_(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function oB(e){e.data.datasets.forEach(t=>{g_(t)})}function zM(e,t){const n=t.length;let r=0,a;const{iScale:A}=e,{min:s,max:o,minDefined:l,maxDefined:c}=A.getUserBounds();return l&&(r=Pt(Gr(t,A.axis,s).lo,0,n-1)),c?a=Pt(Gr(t,A.axis,o).hi+1,r,n)-r:a=n-r,{start:r,count:a}}var jM={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){oB(e);return}const r=e.width;e.data.datasets.forEach((a,A)=>{const{_data:s,indexAxis:o}=a,l=e.getDatasetMeta(A),c=s||a.data;if(rt([o,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=zM(l,c);const h=n.threshold||4*r;if(f<=h){g_(a);return}_e(s)&&(a._data=c,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=WM(c,d,f,r,n);break;case"min-max":p=GM(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}a._decimated=p})},destroy(e){oB(e)}};function YM(e,t,n){const r=e.segments,a=e.points,A=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=Xg(l,c,a);const u=Rh(n,a[l],a[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:a[l],end:a[c]});continue}const d=Jb(t,u);for(const f of d){const h=Rh(n,A[f.start],A[f.end],f.loop),p=Xb(o,a,h);for(const m of p)s.push({source:m,target:f,start:{[n]:lB(u,h,"start",Math.max)},end:{[n]:lB(u,h,"end",Math.min)}})}}return s}function Rh(e,t,n,r){if(r)return;let a=t[e],A=n[e];return e==="angle"&&(a=Cn(a),A=Cn(A)),{property:e,start:a,end:A}}function qM(e,t){const{x:n=null,y:r=null}=e||{},a=t.points,A=[];return t.segments.forEach(({start:s,end:o})=>{o=Xg(s,o,a);const l=a[s],c=a[o];r!==null?(A.push({x:l.x,y:r}),A.push({x:c.x,y:r})):n!==null&&(A.push({x:n,y:l.y}),A.push({x:n,y:c.y}))}),A}function Xg(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function lB(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function m_(e,t){let n=[],r=!1;return Me(e)?(r=!0,n=e):n=qM(e,t),n.length?new xa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function cB(e){return e&&e.fill!==!1}function XM(e,t,n){let a=e[t].fill;const A=[t];let s;if(!n)return a;for(;a!==!1&&A.indexOf(a)===-1;){if(!dt(a))return a;if(s=e[a],!s)return!1;if(s.visible)return a;A.push(a),a=s.fill}return!1}function JM(e,t,n){const r=n9(e);if(ve(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return dt(a)&&Math.floor(a)===a?ZM(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function ZM(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function e9(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ve(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function t9(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ve(e)?r=e.value:r=t.getBaseValue(),r}function n9(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function r9(e){const{scale:t,index:n,line:r}=e,a=[],A=r.segments,s=r.points,o=a9(t,n);o.push(m_({x:null,y:t.bottom},r));for(let l=0;l<A.length;l++){const c=A[l];for(let u=c.start;u<=c.end;u++)A9(a,s[u],o)}return new xa({points:a,options:{}})}function a9(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const A=r[a];if(A.index===t)break;A.hidden||n.unshift(A.dataset)}return n}function A9(e,t,n){const r=[];for(let a=0;a<n.length;a++){const A=n[a],{first:s,last:o,point:l}=s9(A,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(e.push(l),!o)break}}e.push(...r)}function s9(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const a=r[n],A=e.segments,s=e.points;let o=!1,l=!1;for(let c=0;c<A.length;c++){const u=A[c],d=s[u.start][n],f=s[u.end][n];if(Wr(a,d,f)){o=a===d,l=a===f;break}}return{first:o,last:l,point:r}}class v_{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:a,y:A,radius:s}=this;return n=n||{start:0,end:Je},t.arc(a,A,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:a}=this,A=t.angle;return{x:n+Math.cos(A)*a,y:r+Math.sin(A)*a,angle:A}}}function i9(e){const{chart:t,fill:n,line:r}=e;if(dt(n))return o9(t,n);if(n==="stack")return r9(e);if(n==="shape")return!0;const a=l9(e);return a instanceof v_?a:m_(a,r)}function o9(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function l9(e){return(e.scale||{}).getPointPositionForValue?u9(e):c9(e)}function c9(e){const{scale:t={},fill:n}=e,r=e9(n,t);if(dt(r)){const a=t.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function u9(e){const{scale:t,fill:n}=e,r=t.options,a=t.getLabels().length,A=r.reverse?t.max:t.min,s=t9(n,t,A),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,A);return new v_({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<a;++l)o.push(t.getPointPositionForValue(l,s));return o}function _f(e,t,n){const r=i9(t),{line:a,scale:A,axis:s}=t,o=a.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&a.points.length&&(rl(e,n),d9(e,{line:a,target:r,above:u,below:d,area:n,scale:A,axis:s}),al(e))}function d9(e,t){const{line:n,target:r,above:a,below:A,area:s,scale:o}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&A!==a&&(uB(e,r,s.top),dB(e,{line:n,target:r,color:a,scale:o,property:l}),e.restore(),e.save(),uB(e,r,s.bottom)),dB(e,{line:n,target:r,color:A,scale:o,property:l}),e.restore()}function uB(e,t,n){const{segments:r,points:a}=t;let A=!0,s=!1;e.beginPath();for(const o of r){const{start:l,end:c}=o,u=a[l],d=a[Xg(l,c,a)];A?(e.moveTo(u.x,u.y),A=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,o,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function dB(e,t){const{line:n,target:r,property:a,color:A,scale:s}=t,o=YM(n,r,a);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=A}={}}=l,h=r!==!0;e.save(),e.fillStyle=f,f9(e,s,h&&Rh(a,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let m;if(h){p?e.closePath():fB(e,r,d,a);const y=!!r.pathSegment(e,c,{move:p,reverse:!0});m=p&&y,m||fB(e,r,u,a)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function f9(e,t,n){const{top:r,bottom:a}=t.chart.chartArea,{property:A,start:s,end:o}=n||{};A==="x"&&(e.beginPath(),e.rect(s,r,o-s,a-r),e.clip())}function fB(e,t,n,r){const a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var h9={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,a=[];let A,s,o,l;for(s=0;s<r;++s)A=e.getDatasetMeta(s),o=A.dataset,l=null,o&&o.options&&o instanceof xa&&(l={visible:e.isDatasetVisible(s),index:s,fill:JM(o,s,r),chart:e,axis:A.controller.options.indexAxis,scale:A.vScale,line:o}),A.$filler=l,a.push(l);for(s=0;s<r;++s)l=a[s],!(!l||l.fill===!1)&&(l.fill=XM(a,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",a=e.getSortedVisibleDatasetMetas(),A=e.chartArea;for(let s=a.length-1;s>=0;--s){const o=a[s].$filler;o&&(o.line.updateControlPoints(A,o.axis),r&&o.fill&&_f(e.ctx,o,A))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const A=r[a].$filler;cB(A)&&_f(e.ctx,A,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!cB(r)||n.drawTime!=="beforeDatasetDraw"||_f(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const hB=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},p9=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class pB extends An{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,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 n=Re(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,a)=>t.sort(r,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,a=ht(r.font),A=a.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=hB(r,A);let c,u;n.font=a.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,A,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,a,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,a){const{ctx:A,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=a+o;let d=t;A.textAlign="left",A.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+A.measureText(p.text).width;(m===0||c[c.length-1]+y+2*o>s)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:y,height:a},c[c.length-1]+=y+o}),d}_fitCols(t,n,r,a){const{ctx:A,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:v,itemHeight:_}=g9(r,n,A,y,a);g>0&&h+_+2*o>u&&(d+=f+o,c.push({width:f,height:h}),p+=f+o,m++,f=h=0),l[g]={left:p,top:h,col:m,width:v,height:_},f=Math.max(f,v),h+=_+o}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:A}}=this,s=ks(A,this.left,this.width);if(this.isHorizontal()){let o=0,l=Gt(r,this.left+a,this.right-this.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=Gt(r,this.left+a,this.right-this.lineWidths[o])),c.top+=this.top+t+a,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+a}else{let o=0,l=Gt(r,this.top+t+a,this.bottom-this.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=Gt(r,this.top+t+a,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+a,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;rl(t,this),this._draw(),al(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:a}=this,{align:A,labels:s}=t,o=ft.color,l=ks(t.rtl,this.left,this.width),c=ht(s.font),{padding:u}=s,d=c.size,f=d/2;let h;this.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=hB(s,d),g=function(b,C,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;a.save();const S=de(E.lineWidth,1);if(a.fillStyle=de(E.fillStyle,o),a.lineCap=de(E.lineCap,"butt"),a.lineDashOffset=de(E.lineDashOffset,0),a.lineJoin=de(E.lineJoin,"miter"),a.lineWidth=S,a.strokeStyle=de(E.strokeStyle,o),a.setLineDash(de(E.lineDash,[])),s.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:S},U=l.xPlus(b,p/2),F=C+f;Pb(a,T,U,F,s.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),U=l.leftForLtr(b,p),F=Oa(E.borderRadius);a.beginPath(),Object.values(F).some(Q=>Q!==0)?Vs(a,{x:U,y:T,w:p,h:m,radius:F}):a.rect(U,T,p,m),a.fill(),S!==0&&a.stroke()}a.restore()},v=function(b,C,E){PA(a,E.text,b,C+y/2,c,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?h={x:Gt(A,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:h={x:this.left+u,y:Gt(A,this.top+B+u,this.bottom-n[0].height),line:0},jb(this.ctx,t.textDirection);const w=y+u;this.legendItems.forEach((b,C)=>{a.strokeStyle=b.fontColor,a.fillStyle=b.fontColor;const E=a.measureText(b.text).width,S=l.textAlign(b.textAlign||(b.textAlign=s.textAlign)),T=p+f+E;let U=h.x,F=h.y;l.setWidth(this.width),_?C>0&&U+T+u>this.right&&(F=h.y+=w,h.line++,U=h.x=Gt(A,this.left+u,this.right-r[h.line])):C>0&&F+w>this.bottom&&(U=h.x=U+n[h.line].width+u,h.line++,F=h.y=Gt(A,this.top+B+u,this.bottom-n[h.line].height));const Q=l.x(U);if(g(Q,F,b),U=NL(S,U+p+f,_?U+T:this.right,t.rtl),v(l.x(U),F,b),_)h.x+=T+u;else if(typeof b.text!="string"){const Y=c.lineHeight;h.y+=B_(b,Y)}else h.y+=w}),Yb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ht(n.font),a=kt(n.padding);if(!n.display)return;const A=ks(t.rtl,this.left,this.width),s=this.ctx,o=n.position,l=r.size/2,c=a.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Gt(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Gt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=Gt(o,d,d+f);s.textAlign=A.textAlign(Vg(o)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,PA(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ht(t.font),r=kt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,a,A;if(Wr(t,this.left,this.right)&&Wr(n,this.top,this.bottom)){for(A=this.legendHitBoxes,r=0;r<A.length;++r)if(a=A[r],Wr(t,a.left,a.left+a.width)&&Wr(n,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!B9(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const a=this._hoveredItem,A=p9(a,r);a&&!A&&Re(n.onLeave,[t,a,this],this),this._hoveredItem=r,r&&!A&&Re(n.onHover,[t,r,this],this)}else r&&Re(n.onClick,[t,r,this],this)}}function g9(e,t,n,r,a){const A=m9(r,e,t,n),s=v9(a,r,t.lineHeight);return{itemWidth:A,itemHeight:s}}function m9(e,t,n,r){let a=e.text;return a&&typeof a!="string"&&(a=a.reduce((A,s)=>A.length>s.length?A:s)),t+n.size/2+r.measureText(a).width}function v9(e,t,n){let r=e;return typeof t.text!="string"&&(r=B_(t,n)),r}function B_(e,t){const n=e.text?e.text.length+.5:0;return t*n}function B9(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var y9={id:"legend",_element:pB,start(e,t,n){const r=e.legend=new pB({ctx:e.ctx,options:n,chart:e});jt.configure(e,r,n),jt.addBox(e,r)},stop(e){jt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;jt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:A,useBorderRadius:s,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:A,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:a||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Jg extends An{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const a=Me(r.text)?r.text.length:1;this._padding=kt(r.padding);const A=a*ht(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=A:this.width=A}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:a,right:A,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Gt(o,r,A),d=n+t,c=A-r):(s.position==="left"?(u=r+t,d=Gt(o,a,n),l=Te*-.5):(u=A-t,d=Gt(o,n,a),l=Te*.5),c=a-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ht(n.font),A=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(A);PA(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Vg(n.align),textBaseline:"middle",translation:[s,o]})}}function w9(e,t){const n=new Jg({ctx:e.ctx,options:t,chart:e});jt.configure(e,n,t),jt.addBox(e,n),e.titleBlock=n}var b9={id:"title",_element:Jg,start(e,t,n){w9(e,n)},stop(e){const t=e.titleBlock;jt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;jt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yl=new WeakMap;var _9={id:"subtitle",start(e,t,n){const r=new Jg({ctx:e.ctx,options:n,chart:e});jt.configure(e,r,n),jt.addBox(e,r),Yl.set(e,r)},stop(e){jt.removeBox(e,Yl.get(e)),Yl.delete(e)},beforeUpdate(e,t,n){const r=Yl.get(e);jt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi={average(e){if(!e.length)return!1;let t,n,r=0,a=0,A=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,a+=o.y,++A}}return{x:r/A,y:a/A}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,a=Number.POSITIVE_INFINITY,A,s,o;for(A=0,s=e.length;A<s;++A){const l=e[A].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Rs(t,c);u<a&&(a=u,o=l)}}if(o){const l=o.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function cr(e,t){return t&&(Me(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Pr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
825
+ */class NO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,a){const A=n.listeners[a],s=n.duration;A.forEach(o=>o({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Db.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const A=r.items;let s=A.length-1,o=!1,l;for(;s>=0;--s)l=A[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(A[s]=A[A.length-1],A.pop());o&&(a.draw(),this._notify(a,r,t,"progress")),A.length||(r.running=!1,this._notify(a,r,t,"complete"),r.initial=!1),n+=A.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Nr=new NO;const Iv="transparent",PO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=yv(e||Iv),a=r.valid&&yv(t||Iv);return a&&a.valid?a.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class HO{constructor(t,n,r,a){const A=n[r];a=rt([t.to,a,A,t.from]);const s=rt([t.from,A,a]);this._active=!0,this._fn=t.fn||PO[t.type||typeof s],this._easing=Ji[t.easing]||Ji.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const a=this._target[this._prop],A=r-this._start,s=this._duration-A;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=A,this._loop=!!t.loop,this._to=rt([t.to,n,a,t.from]),this._from=rt([t.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,a=this._prop,A=this._from,s=this._loop,o=this._to;let l;if(this._active=A!==o&&(s||n<r),!this._active){this._target[a]=o,this._notify(!0);return}if(n<0){this._target[a]=A;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[a]=this._fn(A,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][n]()}}class Yg{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ve(t))return;const n=Object.keys(ft.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(a=>{const A=t[a];if(!ve(A))return;const s={};for(const o of n)s[o]=A[o];(Me(A.properties)&&A.properties||[a]).forEach(o=>{(o===a||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,n){const r=n.options,a=VO(t,r);if(!a)return[];const A=this._createAnimations(a,r);return r.$shared&&RO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),A}_createAnimations(t,n){const r=this._properties,a=[],A=t.$animations||(t.$animations={}),s=Object.keys(n),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){a.push(...this._animateOptions(t,n));continue}const u=n[c];let d=A[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}A[c]=d=new HO(f,t,c,u),a.push(d)}return a}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Nr.add(this._chart,r),!0}}function RO(e,t){const n=[],r=Object.keys(t);for(let a=0;a<r.length;a++){const A=e[r[a]];A&&A.active()&&n.push(A.wait())}return Promise.all(n)}function VO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Uv(e,t){const n=e&&e.options||{},r=n.reverse,a=n.min===void 0?t:0,A=n.max===void 0?t:0;return{start:r?A:a,end:r?a:A}}function KO(e,t,n){if(n===!1)return!1;const r=Uv(e,n),a=Uv(t,n);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function $O(e){let t,n,r,a;return ve(e)?(t=e.top,n=e.right,r=e.bottom,a=e.left):t=n=r=a=e,{top:t,right:n,bottom:r,left:a,disabled:e===!1}}function Zb(e,t){const n=[],r=e._getSortedDatasetMetas(t);let a,A;for(a=0,A=r.length;a<A;++a)n.push(r[a].index);return n}function Qv(e,t,n,r={}){const a=e.keys,A=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=a.length;s<o;++s){if(l=+a[s],l===n){if(r.all)continue;break}c=e.values[l],dt(c)&&(A||t===0||Br(t)===Br(c))&&(t+=c)}return t}}function WO(e){const t=Object.keys(e),n=new Array(t.length);let r,a,A;for(r=0,a=t.length;r<a;++r)A=t[r],n[r]={x:A,y:e[A]};return n}function Tv(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function GO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function zO(e){const{min:t,max:n,minDefined:r,maxDefined:a}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function jO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Dv(e,t,n,r){for(const a of t.getMatchingVisibleMetas(r).reverse()){const A=e[a.index];if(n&&A>0||!n&&A<0)return a.index}return null}function Lv(e,t){const{chart:n,_cachedMeta:r}=e,a=n._stacks||(n._stacks={}),{iScale:A,vScale:s,index:o}=r,l=A.axis,c=s.axis,u=GO(A,s,r),d=t.length;let f;for(let h=0;h<d;++h){const p=t[h],{[l]:m,[c]:y}=p,g=p._stacks||(p._stacks={});f=g[c]=jO(a,u,m),f[o]=y,f._top=Dv(f,s,!0,r.type),f._bottom=Dv(f,s,!1,r.type);const v=f._visualValues||(f._visualValues={});v[o]=y}}function pf(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function YO(e,t){return AA(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qO(e,t,n){return AA(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function pi(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const a of t){const A=a._stacks;if(!A||A[r]===void 0||A[r][n]===void 0)return;delete A[r][n],A[r]._visualValues!==void 0&&A[r]._visualValues[n]!==void 0&&delete A[r]._visualValues[n]}}}const gf=e=>e==="reset"||e==="none",Ov=(e,t)=>t?e:Object.assign({},e),XO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Zb(n,!0),values:null};class tr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Tv(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&&pi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),a=(d,f,h,p)=>d==="x"?f:d==="r"?p:h,A=n.xAxisID=de(r.xAxisID,pf(t,"x")),s=n.yAxisID=de(r.yAxisID,pf(t,"y")),o=n.rAxisID=de(r.rAxisID,pf(t,"r")),l=n.indexAxis,c=n.iAxisID=a(l,A,s,o),u=n.vAxisID=a(l,s,A,o);n.xScale=this.getScaleForId(A),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mv(this._data,this),t._stacked&&pi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ve(n))this._data=WO(n);else if(r!==n){if(r){mv(r,this);const a=this._cachedMeta;pi(a),a._parsed=[]}n&&Object.isExtensible(n)&&OL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const A=n._stacked;n._stacked=Tv(n.vScale,n),n.stack!==r.stack&&(a=!0,pi(n),n.stack=r.stack),this._resyncElements(t),(a||A!==n._stacked)&&Lv(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:a}=this,{iScale:A,_stacked:s}=r,o=A.axis;let l=t===0&&n===a.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=a,r._sorted=!0,f=a;else{Me(a[t])?f=this.parseArrayData(r,a,t,n):ve(a[t])?f=this.parseObjectData(r,a,t,n):f=this.parsePrimitiveData(r,a,t,n);const h=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&Lv(this,f)}parsePrimitiveData(t,n,r,a){const{iScale:A,vScale:s}=t,o=A.axis,l=s.axis,c=A.getLabels(),u=A===s,d=new Array(a);let f,h,p;for(f=0,h=a;f<h;++f)p=f+r,d[f]={[o]:u||A.parse(c[p],p),[l]:s.parse(n[p],p)};return d}parseArrayData(t,n,r,a){const{xScale:A,yScale:s}=t,o=new Array(a);let l,c,u,d;for(l=0,c=a;l<c;++l)u=l+r,d=n[u],o[l]={x:A.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,n,r,a){const{xScale:A,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(a);let u,d,f,h;for(u=0,d=a;u<d;++u)f=u+r,h=n[f],c[u]={x:A.parse(ja(h,o),f),y:s.parse(ja(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const a=this.chart,A=this._cachedMeta,s=n[t.axis],o={keys:Zb(a,!0),values:n._stacks[t.axis]._visualValues};return Qv(o,s,A.index,{mode:r})}updateRangeFromParsed(t,n,r,a){const A=r[n.axis];let s=A===null?NaN:A;const o=a&&r._stacks[n.axis];a&&o&&(a.values=o,s=Qv(a,A,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,a=r._parsed,A=r._sorted&&t===r.iScale,s=a.length,o=this._getOtherScale(t),l=XO(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=zO(o);let f,h;function p(){h=a[f];const m=h[o.axis];return!dt(h[t.axis])||u>m||d<m}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,h,l),A));++f);if(A){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let a,A,s;for(a=0,A=n.length;a<A;++a)s=n[a][t.axis],dt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,a=n.vScale,A=this.getParsed(t);return{label:r?""+r.getLabelForValue(A[r.axis]):"",value:a?""+a.getLabelForValue(A[a.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=$O(de(this.options.clip,KO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,a=r.data||[],A=n.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||a.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,A,o,l),u=o;u<o+l;++u){const d=a[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,A))}for(u=0;u<s.length;++u)s[u].draw(t,A)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const a=this.getDataset();let A;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];A=s.$context||(s.$context=qO(this.getContext(),t,s)),A.parsed=this.getParsed(t),A.raw=a.data[t],A.index=A.dataIndex=t}else A=this.$context||(this.$context=YO(this.chart.getContext(),this.index)),A.dataset=a,A.index=A.datasetIndex=this.index;return A.active=!!n,A.mode=r,A}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const a=n==="active",A=this._cachedDataOpts,s=t+"-"+n,o=A[s],l=this.enableOptionSharing&&Bn(r);if(o)return Ov(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=a?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(ft.elements[t]),p=()=>this.getContext(r,a,n),m=c.resolveNamedOptions(f,h,p,d);return m.$shared&&(m.$shared=l,A[s]=Object.freeze(Ov(m,l))),m}_resolveAnimations(t,n,r){const a=this.chart,A=this._cachedDataOpts,s=`animation-${n}`,o=A[s];if(o)return o;let l;if(a.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new Yg(a,l&&l.animations);return l&&l._cacheable&&(A[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||gf(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),a=this._sharedOptions,A=this.getSharedOptions(r),s=this.includeOptions(n,A)||A!==a;return this.updateSharedOptions(A,n,r),{sharedOptions:A,includeOptions:s}}updateElement(t,n,r,a){gf(a)?Object.assign(t,r):this._resolveAnimations(n,a).update(t,r)}updateSharedOptions(t,n,r){t&&!gf(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,a){t.active=a;const A=this.getStyle(n,a);this._resolveAnimations(n,r,a).update(t,{options:!a&&this.getSharedOptions(A)||A})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"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 n=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const a=r.length,A=n.length,s=Math.min(A,a);s&&this.parse(0,s),A>a?this._insertElements(a,A-a,t):A<a&&this._removeElements(A,a-A)}_insertElements(t,n,r=!0){const a=this._cachedMeta,A=a.data,s=t+n;let o;const l=c=>{for(c.length+=n,o=c.length-1;o>=s;o--)c[o]=c[o-n]};for(l(A),o=t;o<s;++o)A[o]=new this.dataElementType;this._parsing&&l(a._parsed),this.parse(t,n),r&&this.updateElements(A,t,n,"reset")}updateElements(t,n,r,a){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(t,n);r._stacked&&pi(r,a)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,a]=t;this[n](r,a)}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,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(tr,"defaults",{}),R(tr,"datasetElementType",null),R(tr,"dataElementType",null);function JO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let a=0,A=n.length;a<A;a++)r=r.concat(n[a].controller.getAllParsedValues(e));e._cache.$bar=Tb(r.sort((a,A)=>a-A))}return e._cache.$bar}function ZO(e){const t=e.iScale,n=JO(t,e.type);let r=t._length,a,A,s,o;const l=()=>{s===32767||s===-32768||(Bn(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(a=0,A=n.length;a<A;++a)s=t.getPixelForValue(n[a]),l();for(o=void 0,a=0,A=t.ticks.length;a<A;++a)s=t.getPixelForTick(a),l();return r}function eM(e,t,n,r){const a=n.barThickness;let A,s;return _e(a)?(A=t.min*n.categoryPercentage,s=n.barPercentage):(A=a*r,s=1),{chunk:A/r,ratio:s,start:t.pixels[e]-A/2}}function tM(e,t,n,r){const a=t.pixels,A=a[e];let s=e>0?a[e-1]:null,o=e<a.length-1?a[e+1]:null;const l=n.categoryPercentage;s===null&&(s=A-(o===null?t.end-t.start:o-A)),o===null&&(o=A+A-s);const c=A-(A-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:n.barPercentage,start:c}}function nM(e,t,n,r){const a=n.parse(e[0],r),A=n.parse(e[1],r),s=Math.min(a,A),o=Math.max(a,A);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:a,end:A,min:s,max:o}}function e_(e,t,n,r){return Me(e)?nM(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Mv(e,t,n,r){const a=e.iScale,A=e.vScale,s=a.getLabels(),o=a===A,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[a.axis]=o||a.parse(s[c],c),l.push(e_(f,d,A,c));return l}function mf(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function rM(e,t,n){return e!==0?Br(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function aM(e){let t,n,r,a,A;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(a="end",A="start"):(a="start",A="end"),{start:n,end:r,reverse:t,top:a,bottom:A}}function AM(e,t,n,r){let a=t.borderSkipped;const A={};if(!a){e.borderSkipped=A;return}if(a===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=aM(e);a==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?a=c:(n._bottom||0)===r?a=u:(A[Nv(u,s,o,l)]=!0,a=c)),A[Nv(a,s,o,l)]=!0,e.borderSkipped=A}function Nv(e,t,n,r){return r?(e=sM(e,t,n),e=Pv(e,n,t)):e=Pv(e,t,n),e}function sM(e,t,n){return e===t?n:e===n?t:e}function Pv(e,t,n){return e==="start"?t:e==="end"?n:e}function iM(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Dc extends tr{parsePrimitiveData(t,n,r,a){return Mv(t,n,r,a)}parseArrayData(t,n,r,a){return Mv(t,n,r,a)}parseObjectData(t,n,r,a){const{iScale:A,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=A.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,h,p,m;for(f=r,h=r+a;f<h;++f)m=n[f],p={},p[A.axis]=A.parse(ja(m,c),f),d.push(e_(ja(m,u),p,s,f));return d}updateRangeFromParsed(t,n,r,a){super.updateRangeFromParsed(t,n,r,a);const A=r._custom;A&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,A.min),t.max=Math.max(t.max,A.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:a}=n,A=this.getParsed(t),s=A._custom,o=mf(s)?"["+s.start+", "+s.end+"]":""+a.getLabelForValue(A[a.axis]);return{label:""+r.getLabelForValue(A[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,a){const A=a==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,a);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=A||_e(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[o.axis],v={horizontal:c,base:m.base,enableBorderRadius:!g||mf(p._custom)||s===g._top||s===g._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(v.options=d||this.resolveDataElementOptions(h,t[h].active?"active":a));const _=v.options||t[h].options;AM(v,_,g,s),iM(v,_,u.ratio),this.updateElement(t[h],h,v,a)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),A=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(_e(u)||isNaN(u))return!0};for(const l of a)if(!(n!==void 0&&o(l))&&((A===!1||s.indexOf(l.stack)===-1||A===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const a=this._getStacks(t,r),A=n!==void 0?a.indexOf(n):-1;return A===-1?a.length-1:A}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,a=[];let A,s;for(A=0,s=n.data.length;A<s;++A)a.push(r.getPixelForValue(this.getParsed(A)[r.axis],A));const o=t.barThickness;return{min:o||ZO(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:a},options:{base:A,minBarLength:s}}=this,o=A||0,l=this.getParsed(t),c=l._custom,u=mf(c);let d=l[n.axis],f=0,h=r?this.applyStack(n,l,r):d,p,m;h!==d&&(f=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&Br(d)!==Br(c.barEnd)&&(f=0),f+=d);const y=!_e(A)&&!u?A:f;let g=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+h):p=g,m=p-g,Math.abs(m)<s){m=rM(m,n,o)*s,d===o&&(g-=m/2);const v=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),B=Math.min(v,_),w=Math.max(v,_);g=Math.max(Math.min(g,w),B),p=g+m,r&&!u&&(l._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(g))}if(g===n.getPixelForValue(o)){const v=Br(m)*n.getLineWidthForValue(o)/2;g+=v,m-=v}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,a=this.options,A=a.skipNull,s=de(a.maxBarThickness,1/0);let o,l;if(n.grouped){const c=A?this._getStackCount(t):n.stackCount,u=a.barThickness==="flex"?tM(t,n,a,c):eM(t,n,a,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,A?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,a=r.length;let A=0;for(;A<a;++A)this.getParsed(A)[n.axis]!==null&&r[A].draw(this._ctx)}}R(Dc,"id","bar"),R(Dc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(Dc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Lc extends tr{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,a){const A=super.parsePrimitiveData(t,n,r,a);for(let s=0;s<A.length;s++)A[s]._custom=this.resolveDataElementOptions(s+r).radius;return A}parseArrayData(t,n,r,a){const A=super.parseArrayData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o[2],this.resolveDataElementOptions(s+r).radius)}return A}parseObjectData(t,n,r,a){const A=super.parseObjectData(t,n,r,a);for(let s=0;s<A.length;s++){const o=n[r+s];A[s]._custom=de(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return A}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,a),u=s.axis,d=o.axis;for(let f=n;f<n+r;f++){const h=t[f],p=!A&&this.getParsed(f),m={},y=m[u]=A?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),g=m[d]=A?o.getBasePixel():o.getPixelForValue(p[d]);m.skip=isNaN(y)||isNaN(g),c&&(m.options=l||this.resolveDataElementOptions(f,h.active?"active":a),A&&(m.options.radius=0)),this.updateElement(h,f,m,a)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let a=super.resolveDataElementOptions(t,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const A=a.radius;return n!=="active"&&(a.radius=0),a.radius+=de(r&&r._custom,A),a}}R(Lc,"id","bubble"),R(Lc,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Lc,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function oM(e,t,n){let r=1,a=1,A=0,s=0;if(t<Je){const o=e,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),h=(_,B,w)=>Fo(_,o,l,!0)?1:Math.max(B,B*n,w,w*n),p=(_,B,w)=>Fo(_,o,l,!0)?-1:Math.min(B,B*n,w,w*n),m=h(0,c,d),y=h(Ze,u,f),g=p(Te,c,d),v=p(Te+Ze,u,f);r=(m-g)/2,a=(y-v)/2,A=-(m+g)/2,s=-(y+v)/2}return{ratioX:r,ratioY:a,offsetX:A,offsetY:s}}class bA extends tr{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let A=l=>+r[l];if(ve(r[t])){const{key:l="value"}=this._parsing;A=c=>+ja(r[c],l)}let s,o;for(s=t,o=t+n;s<o;++s)a._parsed[s]=A(s)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let t=Je,n=-Je;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,A=a._getRotation(),s=a._getCircumference();t=Math.min(t,A),n=Math.max(n,A+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,a=this._cachedMeta,A=a.data,s=this.getMaxBorderWidth()+this.getMaxOffset(A)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(_L(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:p,offsetY:m}=oM(d,u,l),y=(r.width-s)/f,g=(r.height-s)/h,v=Math.max(Math.min(y,g)/2,0),_=xb(this.options.radius,v),B=Math.max(_*l,0),w=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=m*_,a.total=this.calculateTotal(),this.outerRadius=_-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(A,0,A.length,t)}_circumference(t,n){const r=this.options,a=this._cachedMeta,A=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||a._parsed[t]===null||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*A/Je)}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=A&&c.animateScale,h=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,a);let g=this._getRotation(),v;for(v=0;v<n;++v)g+=this._circumference(v,A);for(v=n;v<n+r;++v){const _=this._circumference(v,A),B=t[v],w={x:u+this.offsetX,y:d+this.offsetY,startAngle:g,endAngle:g+_,circumference:_,outerRadius:p,innerRadius:h};y&&(w.options=m||this.resolveDataElementOptions(v,B.active?"active":a)),g+=_,this.updateElement(B,v,w,a)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,a;for(a=0;a<n.length;a++){const A=t._parsed[a];A!==null&&!isNaN(A)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(r+=Math.abs(A))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Je*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=nl(n._parsed[t],r.options.locale);return{label:a[t]||"",value:A}}getMaxBorderWidth(t){let n=0;const r=this.chart;let a,A,s,o,l;if(!t){for(a=0,A=r.data.datasets.length;a<A;++a)if(r.isDatasetVisible(a)){s=r.getDatasetMeta(a),t=s.data,o=s.controller;break}}if(!t)return 0;for(a=0,A=t.length;a<A;++a)l=o.resolveDataElementOptions(a),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,a=t.length;r<a;++r){const A=this.resolveDataElementOptions(r);n=Math.max(n,A.offset||0,A.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(de(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(bA,"id","doughnut"),R(bA,"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"}),R(bA,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(bA,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Oc extends tr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:a=[],_dataset:A}=n,s=this.chart._animationsDisabled;let{start:o,count:l}=Ob(n,a,s);this._drawStart=o,this._drawCount=l,Mb(n)&&(o=0,l=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=a;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(a,o,l,t)}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,a),f=s.axis,h=o.axis,{spanGaps:p,segment:m}=this.options,y=Ya(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||A||a==="none",v=n+r,_=t.length;let B=n>0&&this.getParsed(n-1);for(let w=0;w<_;++w){const b=t[w],C=g?b:{};if(w<n||w>=v){C.skip=!0;continue}const E=this.getParsed(w),S=_e(E[h]),T=C[f]=s.getPixelForValue(E[f],w),U=C[h]=A||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,E,l):E[h],w);C.skip=isNaN(T)||isNaN(U)||S,C.stop=w>0&&Math.abs(E[f]-B[f])>y,m&&(C.parsed=E,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,b.active?"active":a)),g||this.updateElement(b,w,C,a),B=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,a=t.data||[];if(!a.length)return r;const A=a[0].size(this.resolveDataElementOptions(0)),s=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,A,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(Oc,"id","line"),R(Oc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(Oc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class eo extends tr{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,a=r.data.labels||[],A=nl(n._parsed[t].r,r.options.locale);return{label:a[t]||"",value:A}}parseObjectData(t,n,r,a){return Wb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,a)=>{const A=this.getParsed(a).r;!isNaN(A)&&this.chart.getDataVisibility(a)&&(A<n.min&&(n.min=A),A>n.max&&(n.max=A))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,a=Math.min(n.right-n.left,n.bottom-n.top),A=Math.max(a/2,0),s=Math.max(r.cutoutPercentage?A/100*r.cutoutPercentage:1,0),o=(A-s)/t.getVisibleDatasetCount();this.outerRadius=A-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,r,a){const A=a==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Te;let h=f,p;const m=360/this.countVisibleElements();for(p=0;p<n;++p)h+=this._computeAngle(p,a,m);for(p=n;p<n+r;p++){const y=t[p];let g=h,v=h+this._computeAngle(p,a,m),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;h=v,A&&(l.animateScale&&(_=0),l.animateRotate&&(g=v=f));const B={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:g,endAngle:v,options:this.resolveDataElementOptions(p,y.active?"active":a)};this.updateElement(y,p,B,a)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?St(this.resolveDataElementOptions(t,n).angle||r):0}}R(eo,"id","polarArea"),R(eo,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(eo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:a}}=t.legend.options;return n.labels.map((A,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:A,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:a,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Oh extends bA{}R(Oh,"id","pie"),R(Oh,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mc extends tr{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,a){return Wb.bind(this)(t,n,r,a)}update(t){const n=this._cachedMeta,r=n.dataset,a=n.data||[],A=n.iScale.getLabels();if(r.points=a,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:A.length===a.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(a,0,a.length,t)}updateElements(t,n,r,a){const A=this._cachedMeta.rScale,s=a==="reset";for(let o=n;o<n+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":a),u=A.getPointPositionForValue(o,this.getParsed(o).r),d=s?A.xCenter:u.x,f=s?A.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,h,a)}}}R(Mc,"id","radar"),R(Mc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Mc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Nc extends tr{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:a,yScale:A}=n,s=this.getParsed(t),o=a.getLabelForValue(s.x),l=A.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,a=this.chart._animationsDisabled;let{start:A,count:s}=Ob(n,r,a);if(this._drawStart=A,this._drawCount=s,Mb(n)&&(A=0,s=r.length),this.options.showLine){const{dataset:o,_dataset:l}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!a,options:c},t)}this.updateElements(r,A,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,a){const A=a==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,a),d=this.getSharedOptions(u),f=this.includeOptions(a,d),h=s.axis,p=o.axis,{spanGaps:m,segment:y}=this.options,g=Ya(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||A||a==="none";let _=n>0&&this.getParsed(n-1);for(let B=n;B<n+r;++B){const w=t[B],b=this.getParsed(B),C=v?w:{},E=_e(b[p]),S=C[h]=s.getPixelForValue(b[h],B),T=C[p]=A||E?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,b,l):b[p],B);C.skip=isNaN(S)||isNaN(T)||E,C.stop=B>0&&Math.abs(b[h]-_[h])>g,y&&(C.parsed=b,C.raw=c.data[B]),f&&(C.options=d||this.resolveDataElementOptions(B,w.active?"active":a)),v||this.updateElement(w,B,C,a),_=b}this.updateSharedOptions(d,a,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let l=n.length-1;l>=0;--l)o=Math.max(o,n[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!n.length)return a;const A=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,A,s)/2}}R(Nc,"id","scatter"),R(Nc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Nc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var lM=Object.freeze({__proto__:null,BarController:Dc,BubbleController:Lc,DoughnutController:bA,LineController:Oc,PieController:Oh,PolarAreaController:eo,RadarController:Mc,ScatterController:Nc});function lA(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class qg{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(qg.prototype,t)}init(){}formats(){return lA()}parse(){return lA()}format(){return lA()}add(){return lA()}diff(){return lA()}startOf(){return lA()}endOf(){return lA()}}var t_={_date:qg};function cM(e,t,n,r){const{controller:a,data:A,_sorted:s}=e,o=a._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&A.length){const l=o._reversePixels?DL:Gr;if(r){if(a._sharedOptions){const c=A[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(A,t,n-u),f=l(A,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(A,t,n)}return{lo:0,hi:A.length-1}}function Al(e,t,n,r,a){const A=e.getSortedVisibleDatasetMetas(),s=n[t];for(let o=0,l=A.length;o<l;++o){const{index:c,data:u}=A[o],{lo:d,hi:f}=cM(A[o],t,s,a);for(let h=d;h<=f;++h){const p=u[h];p.skip||r(p,c,h)}}}function uM(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,a){const A=t?Math.abs(r.x-a.x):0,s=n?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(A,2)+Math.pow(s,2))}}function vf(e,t,n,r,a){const A=[];return!a&&!e.isPointInArea(t)||Al(e,n,t,function(o,l,c){!a&&!zr(o,e.chartArea,0)||o.inRange(t.x,t.y,r)&&A.push({element:o,datasetIndex:l,index:c})},!0),A}function dM(e,t,n,r){let a=[];function A(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=Ub(s,{x:t.x,y:t.y});Fo(d,c,u)&&a.push({element:s,datasetIndex:o,index:l})}return Al(e,n,t,A),a}function fM(e,t,n,r,a,A){let s=[];const o=uM(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!A||e.isPointInArea(p))&&!h)return;const y=o(t,p);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return Al(e,n,t,c),s}function Bf(e,t,n,r,a,A){return!A&&!e.isPointInArea(t)?[]:n==="r"&&!r?dM(e,t,n,a):fM(e,t,n,r,a,A)}function Hv(e,t,n,r,a){const A=[],s=n==="x"?"inXRange":"inYRange";let o=!1;return Al(e,n,t,(l,c,u)=>{l[s](t[n],a)&&(A.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,a))}),r&&!o?[]:A}var hM={evaluateInteractionItems:Al,modes:{index(e,t,n,r){const a=hA(t,e),A=n.axis||"x",s=n.includeInvisible||!1,o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;let o=n.intersect?vf(e,a,A,r,s):Bf(e,a,A,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=e.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return vf(e,a,A,r,s)},nearest(e,t,n,r){const a=hA(t,e),A=n.axis||"xy",s=n.includeInvisible||!1;return Bf(e,a,A,n.intersect,r,s)},x(e,t,n,r){const a=hA(t,e);return Hv(e,a,"x",n.intersect,r)},y(e,t,n,r){const a=hA(t,e);return Hv(e,a,"y",n.intersect,r)}}};const n_=["left","top","right","bottom"];function gi(e,t){return e.filter(n=>n.pos===t)}function Rv(e,t){return e.filter(n=>n_.indexOf(n.pos)===-1&&n.box.axis===t)}function mi(e,t){return e.sort((n,r)=>{const a=t?r:n,A=t?n:r;return a.weight===A.weight?a.index-A.index:a.weight-A.weight})}function pM(e){const t=[];let n,r,a,A,s,o;for(n=0,r=(e||[]).length;n<r;++n)a=e[n],{position:A,options:{stack:s,stackWeight:o=1}}=a,t.push({index:n,box:a,pos:A,horizontal:a.isHorizontal(),weight:a.weight,stack:s&&A+s,stackWeight:o});return t}function gM(e){const t={};for(const n of e){const{stack:r,pos:a,stackWeight:A}=n;if(!r||!n_.includes(a))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=A}return t}function mM(e,t){const n=gM(e),{vBoxMaxWidth:r,hBoxMaxHeight:a}=t;let A,s,o;for(A=0,s=e.length;A<s;++A){o=e[A];const{fullSize:l}=o.box,c=n[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=a):(o.width=r,o.height=u?u*a:l&&t.availableHeight)}return n}function vM(e){const t=pM(e),n=mi(t.filter(c=>c.box.fullSize),!0),r=mi(gi(t,"left"),!0),a=mi(gi(t,"right")),A=mi(gi(t,"top"),!0),s=mi(gi(t,"bottom")),o=Rv(t,"x"),l=Rv(t,"y");return{fullSize:n,leftAndTop:r.concat(A),rightAndBottom:a.concat(l).concat(s).concat(o),chartArea:gi(t,"chartArea"),vertical:r.concat(a).concat(l),horizontal:A.concat(s).concat(o)}}function Vv(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function r_(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function BM(e,t,n,r){const{pos:a,box:A}=n,s=e.maxPadding;if(!ve(a)){n.size&&(e[a]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?A.height:A.width),n.size=d.size/d.count,e[a]+=n.size}A.getPadding&&r_(s,A.getPadding());const o=Math.max(0,t.outerWidth-Vv(s,e,"left","right")),l=Math.max(0,t.outerHeight-Vv(s,e,"top","bottom")),c=o!==e.w,u=l!==e.h;return e.w=o,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function yM(e){const t=e.maxPadding;function n(r){const a=Math.max(t[r]-e[r],0);return e[r]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function wM(e,t){const n=t.maxPadding;function r(a){const A={left:0,top:0,right:0,bottom:0};return a.forEach(s=>{A[s]=Math.max(t[s],n[s])}),A}return r(e?["left","right"]:["top","bottom"])}function Ui(e,t,n,r){const a=[];let A,s,o,l,c,u;for(A=0,s=e.length,c=0;A<s;++A){o=e[A],l=o.box,l.update(o.width||t.w,o.height||t.h,wM(o.horizontal,t));const{same:d,other:f}=BM(t,n,o,r);c|=d&&a.length,u=u||f,l.fullSize||a.push(o)}return c&&Ui(a,t,n,r)||u}function Wl(e,t,n,r,a){e.top=n,e.left=t,e.right=t+r,e.bottom=n+a,e.width=r,e.height=a}function Kv(e,t,n,r){const a=n.padding;let{x:A,y:s}=t;for(const o of e){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;Bn(c.start)&&(s=c.start),l.fullSize?Wl(l,a.left,s,n.outerWidth-a.right-a.left,f):Wl(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;Bn(c.start)&&(A=c.start),l.fullSize?Wl(l,A,a.top,f,n.outerHeight-a.bottom-a.top):Wl(l,A,t.top+c.placed,f,d),c.start=A,c.placed+=d,A=l.right}}t.x=A,t.y=s}var jt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const a=kt(e.options.layout.padding),A=Math.max(t-a.width,0),s=Math.max(n-a.height,0),o=vM(e.boxes),l=o.vertical,c=o.horizontal;Ke(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:A,availableHeight:s,vBoxMaxWidth:A/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},a);r_(f,kt(r));const h=Object.assign({maxPadding:f,w:A,h:s,x:a.left,y:a.top},a),p=mM(l.concat(c),d);Ui(o.fullSize,h,d,p),Ui(l,h,d,p),Ui(c,h,d,p)&&Ui(l,h,d,p),yM(h),Kv(o.leftAndTop,h,d,p),h.x+=h.w,h.y+=h.h,Kv(o.rightAndBottom,h,d,p),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ke(o.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class a_{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,a){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,a?Math.floor(n/a):r)}}isAttached(t){return!0}updateConfig(t){}}class bM extends a_{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pc="$chartjs",_M={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$v=e=>e===null||e==="";function CM(e,t){const n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[Pc]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",$v(a)){const A=Ev(e,"width");A!==void 0&&(e.width=A)}if($v(r))if(e.style.height==="")e.height=e.width/(t||2);else{const A=Ev(e,"height");A!==void 0&&(e.height=A)}return e}const A_=SO?{passive:!0}:!1;function kM(e,t,n){e.addEventListener(t,n,A_)}function EM(e,t,n){e.canvas.removeEventListener(t,n,A_)}function SM(e,t){const n=_M[e.type]||e.type,{x:r,y:a}=hA(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:a!==void 0?a:null}}function hu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function xM(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||hu(o.addedNodes,r),s=s&&!hu(o.removedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function FM(e,t,n){const r=e.canvas,a=new MutationObserver(A=>{let s=!1;for(const o of A)s=s||hu(o.removedNodes,r),s=s&&!hu(o.addedNodes,r);s&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const Io=new Map;let Wv=0;function s_(){const e=window.devicePixelRatio;e!==Wv&&(Wv=e,Io.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function IM(e,t){Io.size||window.addEventListener("resize",s_),Io.set(e,t)}function UM(e){Io.delete(e),Io.size||window.removeEventListener("resize",s_)}function QM(e,t,n){const r=e.canvas,a=r&&jg(r);if(!a)return;const A=Lb((o,l)=>{const c=a.clientWidth;n(o,l),c<a.clientWidth&&n()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||A(c,u)});return s.observe(a),IM(e,A),s}function yf(e,t,n){n&&n.disconnect(),t==="resize"&&UM(e)}function TM(e,t,n){const r=e.canvas,a=Lb(A=>{e.ctx!==null&&n(SM(A,e))},e);return kM(r,t,a),a}class DM extends a_{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(CM(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Pc])return!1;const r=n[Pc].initial;["height","width"].forEach(A=>{const s=r[A];_e(s)?n.removeAttribute(A):n.setAttribute(A,s)});const a=r.style||{};return Object.keys(a).forEach(A=>{n.style[A]=a[A]}),n.width=n.width,delete n[Pc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const a=t.$proxies||(t.$proxies={}),s={attach:xM,detach:FM,resize:QM}[n]||TM;a[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),a=r[n];if(!a)return;({attach:yf,detach:yf,resize:yf}[n]||EM)(t,n,a),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,a){return EO(t,n,r,a)}isAttached(t){const n=jg(t);return!!(n&&n.isConnected)}}function LM(e){return!zb()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?bM:DM}var Fc;let An=(Fc=class{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ya(this.x)&&Ya(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const a={};return t.forEach(A=>{a[A]=r[A]&&r[A].active()?r[A]._to:this[A]}),a}},R(Fc,"defaults",{}),R(Fc,"defaultRoutes"),Fc);function OM(e,t){const n=e.options.ticks,r=MM(e),a=Math.min(n.maxTicksLimit||r,r),A=n.major.enabled?PM(t):[],s=A.length,o=A[0],l=A[s-1],c=[];if(s>a)return HM(t,c,A,s/a),c;const u=NM(A,t,a);if(s>0){let d,f;const h=s>1?Math.round((l-o)/(s-1)):null;for(Gl(t,c,u,_e(h)?0:o-h,o),d=0,f=s-1;d<f;d++)Gl(t,c,u,A[d],A[d+1]);return Gl(t,c,u,l,_e(h)?t.length:l+h),c}return Gl(t,c,u),c}function MM(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(r,a))}function NM(e,t,n){const r=RM(e),a=t.length/n;if(!r)return Math.max(a,1);const A=IL(r);for(let s=0,o=A.length-1;s<o;s++){const l=A[s];if(l>a)return l}return Math.max(a,1)}function PM(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function HM(e,t,n,r){let a=0,A=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===A&&(t.push(e[s]),a++,A=n[a*r])}function Gl(e,t,n,r,a){const A=de(r,0),s=Math.min(de(a,e.length),e.length);let o=0,l,c,u;for(n=Math.ceil(n),a&&(l=a-r,n=l/Math.floor(l/n)),u=A;u<0;)o++,u=Math.round(A+o*n);for(c=Math.max(A,0);c<s;c++)c===u&&(t.push(e[c]),o++,u=Math.round(A+o*n))}function RM(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const VM=e=>e==="left"?"right":e==="right"?"left":e,Gv=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,zv=(e,t)=>Math.min(t||e,e);function jv(e,t){const n=[],r=e.length/t,a=e.length;let A=0;for(;A<a;A+=r)n.push(e[Math.floor(A)]);return n}function KM(e,t,n){const r=e.ticks.length,a=Math.min(t,r-1),A=e._startPixel,s=e._endPixel,o=1e-6;let l=e.getPixelForTick(a),c;if(!(n&&(r===1?c=Math.max(l-A,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(a-1))/2,l+=a<t?c:-c,l<A-o||l>s+o)))return l}function $M(e,t){Ke(e,n=>{const r=n.gc,a=r.length/2;let A;if(a>t){for(A=0;A<a;++A)delete n.data[r[A]];r.splice(0,a)}})}function vi(e){return e.drawTicks?e.tickLength:0}function Yv(e,t){if(!e.display)return 0;const n=ht(e.font,t),r=kt(e.padding);return(Me(e.text)?e.text.length:1)*n.lineHeight+r.height}function WM(e,t){return AA(e,{scale:t,type:"scale"})}function GM(e,t,n){return AA(e,{tick:n,index:t,type:"tick"})}function zM(e,t,n){let r=Vg(e);return(n&&t!=="right"||!n&&t==="right")&&(r=VM(r)),r}function jM(e,t,n,r){const{top:a,left:A,bottom:s,right:o,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,p;const m=s-a,y=o-A;if(e.isHorizontal()){if(h=Gt(r,A,o),ve(n)){const g=Object.keys(n)[0],v=n[g];p=u[g].getPixelForValue(v)+m-t}else n==="center"?p=(c.bottom+c.top)/2+m-t:p=Gv(e,n,t);f=o-A}else{if(ve(n)){const g=Object.keys(n)[0],v=n[g];h=u[g].getPixelForValue(v)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=Gv(e,n,t);p=Gt(r,s,a),d=n==="left"?-Ze:Ze}return{titleX:h,titleY:p,maxWidth:f,rotation:d}}class GA extends An{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:a}=this;return t=bn(t,Number.POSITIVE_INFINITY),n=bn(n,Number.NEGATIVE_INFINITY),r=bn(r,Number.POSITIVE_INFINITY),a=bn(a,Number.NEGATIVE_INFINITY),{min:bn(t,r),max:bn(n,a),minDefined:dt(t),maxDefined:dt(n)}}getMinMax(t){let{min:n,max:r,minDefined:a,maxDefined:A}=this.getUserBounds(),s;if(a&&A)return{min:n,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),a||(n=Math.min(n,s.min)),A||(r=Math.max(r,s.max));return n=A&&n>r?r:n,r=a&&n>r?n:r,{min:bn(n,bn(r,n)),max:bn(r,bn(n,r))}}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(){Re(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:a,grace:A,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=aO(this,A,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?jv(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=OM(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Re(this.options.afterUpdate,[this])}beforeSetDimensions(){Re(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(){Re(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Re(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Re(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,a,A;for(r=0,a=t.length;r<a;r++)A=t[r],A.label=Re(n.callback,[A.value,r,t],this)}afterTickToLabelConversion(){Re(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Re(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=zv(this.ticks.length,t.ticks.maxTicksLimit),a=n.minRotation||0,A=n.maxRotation;let s=a,o,l,c;if(!this._isVisible()||!n.display||a>=A||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=Pt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:h/(r-1),d+6>o&&(o=h/(r-(t.offset?.5:1)),l=this.maxHeight-vi(t.grid)-n.padding-Yv(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=td(Math.min(Math.asin(Pt((u.highest.height+6)/o,-1,1)),Math.asin(Pt(l/c,-1,1))-Math.asin(Pt(f/c,-1,1)))),s=Math.max(a,Math.min(A,s))),this.labelRotation=s}afterCalculateLabelRotation(){Re(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Re(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:a,grid:A}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Yv(a,n.options.font);if(o?(t.width=this.maxWidth,t.height=vi(A)+l):(t.height=this.maxHeight,t.width=vi(A)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,p=St(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(o){const g=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+g+h)}else{const g=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+g+h)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,a){const{ticks:{align:A,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=a*t.width,h=r*n.height):(f=r*t.height,h=a*n.width):A==="start"?h=n.width:A==="end"?f=t.width:A!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;A==="start"?(u=0,d=t.height):A==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Re(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)_e(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=jv(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:a,_longestTextCache:A}=this,s=[],o=[],l=Math.floor(n/zv(n,r));let c=0,u=0,d,f,h,p,m,y,g,v,_,B,w;for(d=0;d<n;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),a.font=y=m.string,g=A[y]=A[y]||{data:{},gc:[]},v=m.lineHeight,_=B=0,!_e(p)&&!Me(p))_=du(a,g.data,g.gc,_,p),B=v;else if(Me(p))for(f=0,h=p.length;f<h;++f)w=p[f],!_e(w)&&!Me(w)&&(_=du(a,g.data,g.gc,_,w),B+=v);s.push(_),o.push(B),c=Math.max(_,c),u=Math.max(B,u)}$M(A,n);const b=s.indexOf(c),C=o.indexOf(u),E=S=>({width:s[S]||0,height:o[S]||0});return{first:E(0),last:E(n-1),widest:E(b),highest:E(C),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return TL(this._alignToPixels?oA(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=GM(this.getContext(),t,r))}return this.$context||(this.$context=WM(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=St(this.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),A=this._getLabelSizes(),s=t.autoSkipPadding||0,o=A?A.widest.width+s:0,l=A?A.highest.height+s:0;return this.isHorizontal()?l*r>o*a?o/r:l/a:l*a<o*r?l/r:o/a}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,a=this.options,{grid:A,position:s,border:o}=a,l=A.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=vi(A),h=[],p=o.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,g=function(j){return oA(r,j,m)};let v,_,B,w,b,C,E,S,T,U,F,Q;if(s==="top")v=g(this.bottom),C=this.bottom-f,S=v-y,U=g(t.top)+y,Q=t.bottom;else if(s==="bottom")v=g(this.top),U=t.top,Q=g(t.bottom)-y,C=v+y,S=this.top+f;else if(s==="left")v=g(this.right),b=this.right-f,E=v-y,T=g(t.left)+y,F=t.right;else if(s==="right")v=g(this.left),T=t.left,F=g(t.right)-y,b=v+y,E=this.left+f;else if(n==="x"){if(s==="center")v=g((t.top+t.bottom)/2+.5);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}U=t.top,Q=t.bottom,C=v+y,S=C+f}else if(n==="y"){if(s==="center")v=g((t.left+t.right)/2);else if(ve(s)){const j=Object.keys(s)[0],K=s[j];v=g(this.chart.scales[j].getPixelForValue(K))}b=v-y,E=b-f,T=t.left,F=t.right}const Y=de(a.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/Y));for(_=0;_<d;_+=X){const j=this.getContext(_),K=A.setContext(j),oe=o.setContext(j),$=K.lineWidth,Ae=K.color,ce=oe.dash||[],me=oe.dashOffset,ke=K.tickWidth,fe=K.tickColor,re=K.tickBorderDash||[],N=K.tickBorderDashOffset;B=KM(this,_,l),B!==void 0&&(w=oA(r,B,$),c?b=E=T=F=w:C=S=U=Q=w,h.push({tx1:b,ty1:C,tx2:E,ty2:S,x1:T,y1:U,x2:F,y2:Q,width:$,color:Ae,borderDash:ce,borderDashOffset:me,tickWidth:ke,tickColor:fe,tickBorderDash:re,tickBorderDashOffset:N}))}return this._ticksLength=d,this._borderValue=v,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:a,ticks:A}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=A,f=vi(r.grid),h=f+u,p=d?-u:h,m=-St(this.labelRotation),y=[];let g,v,_,B,w,b,C,E,S,T,U,F,Q="middle";if(a==="top")b=this.bottom-p,C=this._getXAxisLabelAlignment();else if(a==="bottom")b=this.top+p,C=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,w=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(f);C=X.textAlign,w=X.x}else if(n==="x"){if(a==="center")b=(t.top+t.bottom)/2+h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];b=this.chart.scales[X].getPixelForValue(j)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")w=(t.left+t.right)/2-h;else if(ve(a)){const X=Object.keys(a)[0],j=a[X];w=this.chart.scales[X].getPixelForValue(j)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const Y=this._getLabelSizes();for(g=0,v=o.length;g<v;++g){_=o[g],B=_.label;const X=A.setContext(this.getContext(g));E=this.getPixelForTick(g)+A.labelOffset,S=this._resolveTickFontOptions(g),T=S.lineHeight,U=Me(B)?B.length:1;const j=U/2,K=X.color,oe=X.textStrokeColor,$=X.textStrokeWidth;let Ae=C;s?(w=E,C==="inner"&&(g===v-1?Ae=this.options.reverse?"left":"right":g===0?Ae=this.options.reverse?"right":"left":Ae="center"),a==="top"?c==="near"||m!==0?F=-U*T+T/2:c==="center"?F=-Y.highest.height/2-j*T+T:F=-Y.highest.height+T/2:c==="near"||m!==0?F=T/2:c==="center"?F=Y.highest.height/2-j*T:F=Y.highest.height-U*T,d&&(F*=-1),m!==0&&!X.showLabelBackdrop&&(w+=T/2*Math.sin(m))):(b=E,F=(1-U)*T/2);let ce;if(X.showLabelBackdrop){const me=kt(X.backdropPadding),ke=Y.heights[g],fe=Y.widths[g];let re=F-me.top,N=0-me.left;switch(Q){case"middle":re-=ke/2;break;case"bottom":re-=ke;break}switch(C){case"center":N-=fe/2;break;case"right":N-=fe;break}ce={left:N,top:re,width:fe+me.width,height:ke+me.height,color:X.backdropColor}}y.push({label:B,font:S,textOffset:F,options:{rotation:m,color:K,strokeColor:oe,strokeWidth:$,textAlign:Ae,textBaseline:Q,translation:[w,b],backdrop:ce}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-St(this.labelRotation))return t==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:a,padding:A}}=this.options,s=this._getLabelSizes(),o=t+A,l=s.widest.width;let c,u;return n==="left"?a?(u=this.right+A,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?a?(u=this.left+A,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:a,width:A,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,a,A,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(A=>A.value===t);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let A,s;const o=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(A=0,s=a.length;A<s;++A){const l=a[A];n.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:a}}=this,A=r.setContext(this.getContext()),s=r.display?A.width:0;if(!s)return;const o=a.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=oA(t,this.left,s)-s/2,u=oA(t,this.right,o)+o/2,d=f=l):(d=oA(t,this.top,s)-s/2,f=oA(t,this.bottom,o)+o/2,c=u=l),n.save(),n.lineWidth=A.width,n.strokeStyle=A.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&rl(r,a);const A=this.getLabelItems(t);for(const s of A){const o=s.options,l=s.font,c=s.label,u=s.textOffset;PA(r,c,0,u,l,o)}a&&al(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:a}}=this;if(!r.display)return;const A=ht(r.font),s=kt(r.padding),o=r.align;let l=A.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(l+=s.bottom,Me(r.text)&&(l+=A.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=jM(this,l,n,o);PA(t,r.text,0,0,A,{color:r.color,maxWidth:d,rotation:f,textAlign:zM(o,n,a),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=de(t.grid&&t.grid.z,-1),a=de(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==GA.prototype.draw?[{z:n,draw:A=>{this.draw(A)}}]:[{z:r,draw:A=>{this.drawBackground(),this.drawGrid(A),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:A=>{this.drawLabels(A)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let A,s;for(A=0,s=n.length;A<s;++A){const o=n[A];o[r]===this.id&&(!t||o.type===t)&&a.push(o)}return a}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ht(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class zl{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;XM(n)&&(r=this.register(n));const a=this.items,A=t.id,s=this.scope+"."+A;if(!A)throw new Error("class does not have id: "+t);return A in a||(a[A]=t,YM(t,s,r),this.override&&ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,a=this.scope;r in n&&delete n[r],a&&r in ft[a]&&(delete ft[a][r],this.override&&delete NA[r])}}function YM(e,t,n){const r=br(Object.create(null),[n?ft.get(n):{},ft.get(t),e.defaults]);ft.set(t,r),e.defaultRoutes&&qM(t,e.defaultRoutes),e.descriptors&&ft.describe(t,e.descriptors)}function qM(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),a=r.pop(),A=[e].concat(r).join("."),s=t[n].split("."),o=s.pop(),l=s.join(".");ft.route(A,a,l,o)})}function XM(e){return"id"in e&&"defaults"in e}class JM{constructor(){this.controllers=new zl(tr,"datasets",!0),this.elements=new zl(An,"elements"),this.plugins=new zl(Object,"plugins"),this.scales=new zl(GA,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(a=>{const A=r||this._getRegistryForType(a);r||A.isForType(a)||A===this.plugins&&a.id?this._exec(t,A,a):Ke(a,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,n,r){const a=Pg(t);Re(r["before"+a],[],r),n[t](r),Re(r["after"+a],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const a=n.get(t);if(a===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return a}}var dr=new JM;class ZM{constructor(){this._init=[]}notify(t,n,r,a){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const A=a?this._descriptors(t).filter(a):this._descriptors(t),s=this._notify(A,t,n,r);return n==="afterDestroy"&&(this._notify(A,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,a){a=a||{};for(const A of t){const s=A.plugin,o=s[r],l=[n,a,A.options];if(Re(o,l,s)===!1&&a.cancelable)return!1}return!0}invalidate(){_e(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,a=de(r.options&&r.options.plugins,{}),A=e7(r);return a===!1&&!n?[]:n7(t,A,a,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,a=(A,s)=>A.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(a(n,r),t,"stop"),this._notify(a(r,n),t,"start")}}function e7(e){const t={},n=[],r=Object.keys(dr.plugins.items);for(let A=0;A<r.length;A++)n.push(dr.getPlugin(r[A]));const a=e.plugins||[];for(let A=0;A<a.length;A++){const s=a[A];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function t7(e,t){return!t&&e===!1?null:e===!0?{}:e}function n7(e,{plugins:t,localIds:n},r,a){const A=[],s=e.getContext();for(const o of t){const l=o.id,c=t7(r[l],a);c!==null&&A.push({plugin:o,options:r7(e.config,{plugin:o,local:n[l]},c,s)})}return A}function r7(e,{plugin:t,local:n},r,a){const A=e.pluginScopeKeys(t),s=e.getOptionScopes(r,A);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Mh(e,t){const n=ft.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function a7(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function A7(e,t){return e===t?"_index_":"_value_"}function qv(e){if(e==="x"||e==="y"||e==="r")return e}function s7(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Nh(e,...t){if(qv(e))return e;for(const n of t){const r=n.axis||s7(n.position)||e.length>1&&qv(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Xv(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function i7(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Xv(e,"x",n[0])||Xv(e,"y",n[0])}return{}}function o7(e,t){const n=NA[e.type]||{scales:{}},r=t.scales||{},a=Mh(e.type,t),A=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!ve(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Nh(s,o,i7(s,e),ft.scales[o.type]),c=A7(l,a),u=n.scales||{};A[s]=qi(Object.create(null),[{axis:l},o,u[l],u[c]])}),e.data.datasets.forEach(s=>{const o=s.type||e.type,l=s.indexAxis||Mh(o,t),u=(NA[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=a7(d,l),h=s[f+"AxisID"]||f;A[h]=A[h]||Object.create(null),qi(A[h],[{axis:f},r[h],u[d]])})}),Object.keys(A).forEach(s=>{const o=A[s];qi(o,[ft.scales[o.type],ft.scale])}),A}function i_(e){const t=e.options||(e.options={});t.plugins=de(t.plugins,{}),t.scales=o7(e,t)}function o_(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function l7(e){return e=e||{},e.data=o_(e.data),i_(e),e}const Jv=new Map,l_=new Set;function jl(e,t){let n=Jv.get(e);return n||(n=t(),Jv.set(e,n),l_.add(n)),n}const Bi=(e,t,n)=>{const r=ja(t,n);r!==void 0&&e.add(r)};class c7{constructor(t){this._config=l7(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=o_(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(),i_(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return jl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return jl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return jl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return jl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let a=r.get(t);return(!a||n)&&(a=new Map,r.set(t,a)),a}getOptionScopes(t,n,r){const{options:a,type:A}=this,s=this._cachedScopes(t,r),o=s.get(n);if(o)return o;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,a,d)),u.forEach(d=>Bi(l,NA[A]||{},d)),u.forEach(d=>Bi(l,ft,d)),u.forEach(d=>Bi(l,Dh,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),l_.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,NA[n]||{},ft.datasets[n]||{},{type:n},ft,Dh]}resolveNamedOptions(t,n,r,a=[""]){const A={$shared:!0},{resolver:s,subPrefixes:o}=Zv(this._resolverCache,t,a);let l=s;if(d7(s,n)){A.$shared=!1,r=vn(r)?r():r;const c=this.createResolver(t,r,o);l=Ks(s,r,c)}for(const c of n)A[c]=l[c];return A}createResolver(t,n,r=[""],a){const{resolver:A}=Zv(this._resolverCache,t,r);return ve(n)?Ks(A,n,void 0,a):A}}function Zv(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const a=n.join();let A=r.get(a);return A||(A={resolver:Wg(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},r.set(a,A)),A}const u7=e=>ve(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||vn(e[n]),!1);function d7(e,t){const{isScriptable:n,isIndexable:r}=Rb(e);for(const a of t){const A=n(a),s=r(a),o=(s||A)&&e[a];if(A&&(vn(o)||u7(o))||s&&Me(o))return!0}return!1}var f7="4.3.0";const h7=["top","bottom","left","right","chartArea"];function eB(e,t){return e==="top"||e==="bottom"||h7.indexOf(e)===-1&&t==="x"}function tB(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function nB(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Re(n&&n.onComplete,[e],t)}function p7(e){const t=e.chart,n=t.options.animation;Re(n&&n.onProgress,[e],t)}function c_(e){return zb()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Hc={},rB=e=>{const t=c_(e);return Object.values(Hc).filter(n=>n.canvas===t).pop()};function g7(e,t,n){const r=Object.keys(e);for(const a of r){const A=+a;if(A>=t){const s=e[a];delete e[a],(n>0||A>t)&&(e[A+n]=s)}}}function m7(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function v7(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}class Oe{static register(...t){dr.add(...t),aB()}static unregister(...t){dr.remove(...t),aB()}constructor(t,n){const r=this.config=new c7(n),a=c_(t),A=rB(a);if(A)throw new Error("Canvas is already in use. Chart with ID '"+A.id+"' must be destroyed before the canvas with ID '"+A.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||LM(a)),this.platform.updateConfig(r);const o=this.platform.acquireContext(a,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=bL(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ZM,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ML(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Hc[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Nr.listen(this,"complete",nB),Nr.listen(this,"progress",p7),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:a,_aspectRatio:A}=this;return _e(t)?n&&A?A:a?r/a: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 dr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():kv(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return bv(this.canvas,this.ctx),this}stop(){return Nr.stop(this),this}resize(t,n){Nr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,a=this.canvas,A=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(a,t,n,A),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,kv(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Re(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ke(n,(r,a)=>{r.id=a})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,a=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let A=[];n&&(A=A.concat(Object.keys(n).map(s=>{const o=n[s],l=Nh(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ke(A,s=>{const o=s.options,l=o.id,c=Nh(l,o),u=de(o.type,s.dtype);(o.position===void 0||eB(o.position,c)!==eB(s.dposition))&&(o.position=s.dposition),a[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=dr.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Ke(a,(s,o)=>{s||delete r[o]}),Ke(r,s=>{jt.configure(this,s,s.options),jt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((a,A)=>a.index-A.index),r>n){for(let a=n;a<r;++a)this._destroyDatasetMeta(a);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(tB("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,a)=>{n.filter(A=>A===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=n.length;r<a;r++){const A=n[r];let s=this.getDatasetMeta(r);const o=A.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=A.indexAxis||Mh(o,this.options),s.order=A.order||0,s.index=r,s.label=""+A.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=dr.getController(o),{datasetElementType:c,dataElementType:u}=ft.datasets[o];Object.assign(l,{dataElementType:dr.getElement(u),datasetElementType:c&&dr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ke(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const A=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!a&&A.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),a||Ke(A,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tB("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Ke(this.scales,t=>{jt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!hv(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:A}of n){const s=r==="_removeElements"?-A:A;g7(t,a,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=A=>new Set(t.filter(s=>s[0]===A).map((s,o)=>o+","+s.splice(1).join(","))),a=r(0);for(let A=1;A<n;A++)if(!hv(a,r(A)))return;return Array.from(a).map(A=>A.split(",")).map(A=>({method:A[1],start:+A[2],count:+A[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;jt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ke(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,A)=>{a._idx=A}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),a={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Nr.has(this)?this.attached&&!Nr.running(this)&&Nr.start(this):(this.draw(),nB({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resize(r,a),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let a,A;for(a=0,A=n.length;a<A;++a){const s=n[a];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,a=!r.disabled,A=v7(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(a&&rl(n,{left:r.left===!1?0:A.left-r.left,right:r.right===!1?this.width:A.right+r.right,top:r.top===!1?0:A.top-r.top,bottom:r.bottom===!1?this.height:A.bottom+r.bottom}),t.controller.draw(),a&&al(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return zr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,a){const A=hM.modes[n];return typeof A=="function"?A(this,t,r,a):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let a=r.filter(A=>A&&A._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=AA(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const a=r?"show":"hide",A=this.getDatasetMeta(t),s=A.controller._resolveAnimations(void 0,a);Bn(n)?(A.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(A,{visible:r}),this.update(o=>o.datasetIndex===t?a:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Nr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),bv(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Hc[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,n=this.platform,r=(A,s)=>{n.addEventListener(this,A,s),t[A]=s},a=(A,s,o)=>{A.offsetX=s,A.offsetY=o,this._eventHandler(A)};Ke(this.options.events,A=>r(A,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},a=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},A=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{a("attach",o),this.attached=!0,this.resize(),r("resize",A),r("detach",s)};s=()=>{this.attached=!1,a("resize",A),this._stop(),this._resize(0,0),r("attach",o)},n.isAttached(this.canvas)?o():s()}unbindEvents(){Ke(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ke(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const a=r?"set":"remove";let A,s,o,l;for(n==="dataset"&&(A=this.getDatasetMeta(t[0].datasetIndex),A.controller["_"+a+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:A,index:s})=>{const o=this.getDatasetMeta(A);if(!o)throw new Error("No dataset found at index "+A);return{datasetIndex:A,element:o.data[s],index:s}});!ou(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const a=this.options.hover,A=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=A(n,t),o=r?t:A(t,n);s.length&&this.updateHoverStyle(s,a.mode,!1),o.length&&a.mode&&this.updateHoverStyle(o,a.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},a=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const A=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(A||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:a=[],options:A}=this,s=n,o=this._getActiveElements(t,a,r,s),l=xL(t),c=m7(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Re(A.onHover,[t,o,this],this),l&&Re(A.onClick,[t,o,this],this));const u=!ou(o,a);return(u||n)&&(this._active=o,this._updateHoverStyles(o,a,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,a){if(t.type==="mouseout")return[];if(!r)return n;const A=this.options.hover;return this.getElementsAtEventForMode(t,A.mode,A,a)}}R(Oe,"defaults",ft),R(Oe,"instances",Hc),R(Oe,"overrides",NA),R(Oe,"registry",dr),R(Oe,"version",f7),R(Oe,"getChart",rB);function aB(){return Ke(Oe.instances,e=>e._plugins.invalidate())}function B7(e,t,n){const{startAngle:r,pixelMargin:a,x:A,y:s,outerRadius:o,innerRadius:l}=t;let c=a/o;e.beginPath(),e.arc(A,s,o,r-c,n+c),l>a?(c=a/l,e.arc(A,s,l,n+c,r-c,!0)):e.arc(A,s,a,n+Ze,r-Ze),e.closePath(),e.clip()}function y7(e){return $g(e,["outerStart","outerEnd","innerStart","innerEnd"])}function w7(e,t,n,r){const a=y7(e.options.borderRadius),A=(n-t)/2,s=Math.min(A,r*t/2),o=l=>{const c=(n-Math.min(A,l))*r/2;return Pt(l,0,Math.min(A,c))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:Pt(a.innerStart,0,s),innerEnd:Pt(a.innerEnd,0,s)}}function As(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pu(e,t,n,r,a,A){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let h=0;const p=a-l;if(r){const X=u>0?u-r:0,j=d>0?d-r:0,K=(X+j)/2,oe=K!==0?p*K/(K+r):p;h=(p-oe)/2}const m=Math.max(.001,p*d-n/Te)/d,y=(p-m)/2,g=l+y+h,v=a-y-h,{outerStart:_,outerEnd:B,innerStart:w,innerEnd:b}=w7(t,f,d,v-g),C=d-_,E=d-B,S=g+_/C,T=v-B/E,U=f+w,F=f+b,Q=g+w/U,Y=v-b/F;if(e.beginPath(),A){const X=(S+T)/2;if(e.arc(s,o,d,S,X),e.arc(s,o,d,X,T),B>0){const $=As(E,T,s,o);e.arc($.x,$.y,B,T,v+Ze)}const j=As(F,v,s,o);if(e.lineTo(j.x,j.y),b>0){const $=As(F,Y,s,o);e.arc($.x,$.y,b,v+Ze,Y+Math.PI)}const K=(v-b/f+(g+w/f))/2;if(e.arc(s,o,f,v-b/f,K,!0),e.arc(s,o,f,K,g+w/f,!0),w>0){const $=As(U,Q,s,o);e.arc($.x,$.y,w,Q+Math.PI,g-Ze)}const oe=As(C,g,s,o);if(e.lineTo(oe.x,oe.y),_>0){const $=As(C,S,s,o);e.arc($.x,$.y,_,g-Ze,S)}}else{e.moveTo(s,o);const X=Math.cos(S)*d+s,j=Math.sin(S)*d+o;e.lineTo(X,j);const K=Math.cos(T)*d+s,oe=Math.sin(T)*d+o;e.lineTo(K,oe)}e.closePath()}function b7(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o}=t;let l=t.endAngle;if(A){pu(e,t,n,r,l,a);for(let c=0;c<A;++c)e.fill();isNaN(o)||(l=s+(o%Je||Je))}return pu(e,t,n,r,l,a),e.fill(),l}function _7(e,t,n,r,a){const{fullCircles:A,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(A){pu(e,t,n,r,p,a);for(let m=0;m<A;++m)e.stroke();isNaN(o)||(p=s+(o%Je||Je))}h&&B7(e,t,p),A||(pu(e,t,n,r,p,a),e.stroke())}class ws extends An{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(this,"startAngle");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,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.getProps(["x","y"],a),{angle:s,distance:o}=Ub(A,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,m=de(f,c-l)>=Je||Fo(s,l,c),y=Wr(o,u+h,d+h);return m&&y}getCenterPoint(n){const{x:r,y:a,startAngle:A,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(A+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:a+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:a}=this,A=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>Je?Math.floor(a/Je):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*A,Math.sin(l)*A);const c=1-Math.sin(Math.min(Te,a||0)),u=A*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,b7(n,this,u,s,o),_7(n,this,u,s,o),n.restore()}}R(ws,"id","arc"),R(ws,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),R(ws,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(ws,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function u_(e,t,n=t){e.lineCap=de(n.borderCapStyle,t.borderCapStyle),e.setLineDash(de(n.borderDash,t.borderDash)),e.lineDashOffset=de(n.borderDashOffset,t.borderDashOffset),e.lineJoin=de(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=de(n.borderWidth,t.borderWidth),e.strokeStyle=de(n.borderColor,t.borderColor)}function C7(e,t,n){e.lineTo(n.x,n.y)}function k7(e){return e.stepped?YL:e.tension||e.cubicInterpolationMode==="monotone"?qL:C7}function d_(e,t,n={}){const r=e.length,{start:a=0,end:A=r-1}=n,{start:s,end:o}=t,l=Math.max(a,s),c=Math.min(A,o),u=a<s&&A<s||a>o&&A>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function E7(e,t,n,r){const{points:a,options:A}=t,{count:s,start:o,loop:l,ilen:c}=d_(a,n,r),u=k7(A);let{move:d=!0,reverse:f}=r||{},h,p,m;for(h=0;h<=c;++h)p=a[(o+(f?c-h:h))%s],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,f,A.stepped),m=p);return l&&(p=a[(o+(f?c:0))%s],u(e,m,p,f,A.stepped)),!!l}function S7(e,t,n,r){const a=t.points,{count:A,start:s,ilen:o}=d_(a,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,p,m,y,g;const v=B=>(s+(c?o-B:B))%A,_=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,g))};for(l&&(h=a[v(0)],e.moveTo(h.x,h.y)),f=0;f<=o;++f){if(h=a[v(f)],h.skip)continue;const B=h.x,w=h.y,b=B|0;b===p?(w<m?m=w:w>y&&(y=w),u=(d*u+B)/++d):(_(),e.lineTo(B,w),p=b,d=0,m=y=w),g=w}_()}function Ph(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?S7:E7}function x7(e){return e.stepped?xO:e.tension||e.cubicInterpolationMode==="monotone"?FO:pA}function F7(e,t,n,r){let a=t._path;a||(a=t._path=new Path2D,t.path(a,n,r)&&a.closePath()),u_(e,t.options),e.stroke(a)}function I7(e,t,n,r){const{segments:a,options:A}=t,s=Ph(t);for(const o of a)u_(e,A,o.style),e.beginPath(),s(e,t,o,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const U7=typeof Path2D=="function";function Q7(e,t,n,r){U7&&!t.options.segment?F7(e,t,n,r):I7(e,t,n,r)}class xa extends An{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;yO(this._points,r,t,a,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=LO(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,a=t[n],A=this.points,s=Jb(this,{property:n,start:a,end:a});if(!s.length)return;const o=[],l=x7(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],h=A[d],p=A[f];if(h===p){o.push(h);continue}const m=Math.abs((a-h[n])/(p[n]-h[n])),y=l(h,p,m,r.stepped);y[n]=t[n],o.push(y)}return o.length===1?o[0]:o}pathSegment(t,n,r){return Ph(this)(t,this,n,r)}path(t,n,r){const a=this.segments,A=Ph(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const o of a)s&=A(t,this,o,{start:n,end:n+r-1});return!!s}draw(t,n,r,a){const A=this.options||{};(this.points||[]).length&&A.borderWidth&&(t.save(),Q7(t,this,r,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(xa,"id","line"),R(xa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(xa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(xa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function AB(e,t,n,r){const a=e.options,{[n]:A}=e.getProps([n],r);return Math.abs(t-A)<a.radius+a.hitRadius}class to extends An{constructor(n){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,a){const A=this.options,{x:s,y:o}=this.getProps(["x","y"],a);return Math.pow(n-s,2)+Math.pow(r-o,2)<Math.pow(A.hitRadius+A.radius,2)}inXRange(n,r){return AB(this,n,"x",r)}inYRange(n,r){return AB(this,n,"y",r)}getCenterPoint(n){const{x:r,y:a}=this.getProps(["x","y"],n);return{x:r,y:a}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const a=r&&n.borderWidth||0;return(r+a)*2}draw(n,r){const a=this.options;this.skip||a.radius<.1||!zr(this,r,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,Lh(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(to,"id","point"),R(to,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(to,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function f_(e,t){const{x:n,y:r,base:a,width:A,height:s}=e.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return e.horizontal?(d=s/2,o=Math.min(n,a),l=Math.max(n,a),c=r-d,u=r+d):(d=A/2,o=n-d,l=n+d,c=Math.min(r,a),u=Math.max(r,a)),{left:o,top:c,right:l,bottom:u}}function Fa(e,t,n,r){return e?0:Pt(t,n,r)}function T7(e,t,n){const r=e.options.borderWidth,a=e.borderSkipped,A=Hb(r);return{t:Fa(a.top,A.top,0,n),r:Fa(a.right,A.right,0,t),b:Fa(a.bottom,A.bottom,0,n),l:Fa(a.left,A.left,0,t)}}function D7(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),a=e.options.borderRadius,A=Oa(a),s=Math.min(t,n),o=e.borderSkipped,l=r||ve(a);return{topLeft:Fa(!l||o.top||o.left,A.topLeft,0,s),topRight:Fa(!l||o.top||o.right,A.topRight,0,s),bottomLeft:Fa(!l||o.bottom||o.left,A.bottomLeft,0,s),bottomRight:Fa(!l||o.bottom||o.right,A.bottomRight,0,s)}}function L7(e){const t=f_(e),n=t.right-t.left,r=t.bottom-t.top,a=T7(e,n/2,r/2),A=D7(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:A},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,A.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,A.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,A.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,A.bottomRight-Math.max(a.b,a.r))}}}}function wf(e,t,n,r){const a=t===null,A=n===null,o=e&&!(a&&A)&&f_(e,r);return o&&(a||Wr(t,o.left,o.right))&&(A||Wr(n,o.top,o.bottom))}function O7(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function M7(e,t){e.rect(t.x,t.y,t.w,t.h)}function bf(e,t,n={}){const r=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,A=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+r,y:e.y+a,w:e.w+A,h:e.h+s,radius:e.radius}}class no extends An{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:n,options:{borderColor:r,backgroundColor:a}}=this,{inner:A,outer:s}=L7(this),o=O7(s.radius)?Vs:M7;t.save(),(s.w!==A.w||s.h!==A.h)&&(t.beginPath(),o(t,bf(s,n,A)),t.clip(),o(t,bf(A,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,bf(A,n)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,n,r){return wf(this,t,n,r)}inXRange(t,n){return wf(this,t,null,n)}inYRange(t,n){return wf(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:a,horizontal:A}=this.getProps(["x","y","base","horizontal"],t);return{x:A?(n+a)/2:n,y:A?r:(r+a)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(no,"id","bar"),R(no,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(no,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var N7=Object.freeze({__proto__:null,ArcElement:ws,BarElement:no,LineElement:xa,PointElement:to});const Hh=["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)"],sB=Hh.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function h_(e){return Hh[e%Hh.length]}function p_(e){return sB[e%sB.length]}function P7(e,t){return e.borderColor=h_(t),e.backgroundColor=p_(t),++t}function H7(e,t){return e.backgroundColor=e.data.map(()=>h_(t++)),t}function R7(e,t){return e.backgroundColor=e.data.map(()=>p_(t++)),t}function V7(e){let t=0;return(n,r)=>{const a=e.getDatasetMeta(r).controller;a instanceof bA?t=H7(n,t):a instanceof eo?t=R7(n,t):a&&(t=P7(n,t))}}function iB(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function K7(e){return e&&(e.borderColor||e.backgroundColor)}var $7={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:a}=e.config,{elements:A}=a;if(!n.forceOverride&&(iB(r)||K7(a)||A&&iB(A)))return;const s=V7(e);r.forEach(s)}};function W7(e,t,n,r,a){const A=a.samples||r;if(A>=n)return e.slice(t,t+n);const s=[],o=(n-2)/(A-2);let l=0;const c=t+n-1;let u=t,d,f,h,p,m;for(s[l++]=e[u],d=0;d<A-2;d++){let y=0,g=0,v;const _=Math.floor((d+1)*o)+1+t,B=Math.min(Math.floor((d+2)*o)+1,n)+t,w=B-_;for(v=_;v<B;v++)y+=e[v].x,g+=e[v].y;y/=w,g/=w;const b=Math.floor(d*o)+1+t,C=Math.min(Math.floor((d+1)*o)+1,n)+t,{x:E,y:S}=e[u];for(h=p=-1,v=b;v<C;v++)p=.5*Math.abs((E-y)*(e[v].y-S)-(E-e[v].x)*(g-S)),p>h&&(h=p,f=e[v],m=v);s[l++]=f,u=m}return s[l++]=e[c],s}function G7(e,t,n,r){let a=0,A=0,s,o,l,c,u,d,f,h,p,m;const y=[],g=t+n-1,v=e[t].x,B=e[g].x-v;for(s=t;s<t+n;++s){o=e[s],l=(o.x-v)/B*r,c=o.y;const w=l|0;if(w===u)c<p?(p=c,d=s):c>m&&(m=c,f=s),a=(A*a+o.x)/++A;else{const b=s-1;if(!_e(d)&&!_e(f)){const C=Math.min(d,f),E=Math.max(d,f);C!==h&&C!==b&&y.push({...e[C],x:a}),E!==h&&E!==b&&y.push({...e[E],x:a})}s>0&&b!==h&&y.push(e[b]),y.push(o),u=w,A=0,p=m=c,d=f=h=s}}return y}function g_(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function oB(e){e.data.datasets.forEach(t=>{g_(t)})}function z7(e,t){const n=t.length;let r=0,a;const{iScale:A}=e,{min:s,max:o,minDefined:l,maxDefined:c}=A.getUserBounds();return l&&(r=Pt(Gr(t,A.axis,s).lo,0,n-1)),c?a=Pt(Gr(t,A.axis,o).hi+1,r,n)-r:a=n-r,{start:r,count:a}}var j7={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){oB(e);return}const r=e.width;e.data.datasets.forEach((a,A)=>{const{_data:s,indexAxis:o}=a,l=e.getDatasetMeta(A),c=s||a.data;if(rt([o,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=z7(l,c);const h=n.threshold||4*r;if(f<=h){g_(a);return}_e(s)&&(a._data=c,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=W7(c,d,f,r,n);break;case"min-max":p=G7(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}a._decimated=p})},destroy(e){oB(e)}};function Y7(e,t,n){const r=e.segments,a=e.points,A=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=Xg(l,c,a);const u=Rh(n,a[l],a[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:a[l],end:a[c]});continue}const d=Jb(t,u);for(const f of d){const h=Rh(n,A[f.start],A[f.end],f.loop),p=Xb(o,a,h);for(const m of p)s.push({source:m,target:f,start:{[n]:lB(u,h,"start",Math.max)},end:{[n]:lB(u,h,"end",Math.min)}})}}return s}function Rh(e,t,n,r){if(r)return;let a=t[e],A=n[e];return e==="angle"&&(a=Cn(a),A=Cn(A)),{property:e,start:a,end:A}}function q7(e,t){const{x:n=null,y:r=null}=e||{},a=t.points,A=[];return t.segments.forEach(({start:s,end:o})=>{o=Xg(s,o,a);const l=a[s],c=a[o];r!==null?(A.push({x:l.x,y:r}),A.push({x:c.x,y:r})):n!==null&&(A.push({x:n,y:l.y}),A.push({x:n,y:c.y}))}),A}function Xg(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function lB(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function m_(e,t){let n=[],r=!1;return Me(e)?(r=!0,n=e):n=q7(e,t),n.length?new xa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function cB(e){return e&&e.fill!==!1}function X7(e,t,n){let a=e[t].fill;const A=[t];let s;if(!n)return a;for(;a!==!1&&A.indexOf(a)===-1;){if(!dt(a))return a;if(s=e[a],!s)return!1;if(s.visible)return a;A.push(a),a=s.fill}return!1}function J7(e,t,n){const r=n9(e);if(ve(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return dt(a)&&Math.floor(a)===a?Z7(r[0],t,a,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Z7(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function e9(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ve(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function t9(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ve(e)?r=e.value:r=t.getBaseValue(),r}function n9(e){const t=e.options,n=t.fill;let r=de(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function r9(e){const{scale:t,index:n,line:r}=e,a=[],A=r.segments,s=r.points,o=a9(t,n);o.push(m_({x:null,y:t.bottom},r));for(let l=0;l<A.length;l++){const c=A[l];for(let u=c.start;u<=c.end;u++)A9(a,s[u],o)}return new xa({points:a,options:{}})}function a9(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const A=r[a];if(A.index===t)break;A.hidden||n.unshift(A.dataset)}return n}function A9(e,t,n){const r=[];for(let a=0;a<n.length;a++){const A=n[a],{first:s,last:o,point:l}=s9(A,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(e.push(l),!o)break}}e.push(...r)}function s9(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const a=r[n],A=e.segments,s=e.points;let o=!1,l=!1;for(let c=0;c<A.length;c++){const u=A[c],d=s[u.start][n],f=s[u.end][n];if(Wr(a,d,f)){o=a===d,l=a===f;break}}return{first:o,last:l,point:r}}class v_{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:a,y:A,radius:s}=this;return n=n||{start:0,end:Je},t.arc(a,A,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:a}=this,A=t.angle;return{x:n+Math.cos(A)*a,y:r+Math.sin(A)*a,angle:A}}}function i9(e){const{chart:t,fill:n,line:r}=e;if(dt(n))return o9(t,n);if(n==="stack")return r9(e);if(n==="shape")return!0;const a=l9(e);return a instanceof v_?a:m_(a,r)}function o9(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function l9(e){return(e.scale||{}).getPointPositionForValue?u9(e):c9(e)}function c9(e){const{scale:t={},fill:n}=e,r=e9(n,t);if(dt(r)){const a=t.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function u9(e){const{scale:t,fill:n}=e,r=t.options,a=t.getLabels().length,A=r.reverse?t.max:t.min,s=t9(n,t,A),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,A);return new v_({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<a;++l)o.push(t.getPointPositionForValue(l,s));return o}function _f(e,t,n){const r=i9(t),{line:a,scale:A,axis:s}=t,o=a.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&a.points.length&&(rl(e,n),d9(e,{line:a,target:r,above:u,below:d,area:n,scale:A,axis:s}),al(e))}function d9(e,t){const{line:n,target:r,above:a,below:A,area:s,scale:o}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&A!==a&&(uB(e,r,s.top),dB(e,{line:n,target:r,color:a,scale:o,property:l}),e.restore(),e.save(),uB(e,r,s.bottom)),dB(e,{line:n,target:r,color:A,scale:o,property:l}),e.restore()}function uB(e,t,n){const{segments:r,points:a}=t;let A=!0,s=!1;e.beginPath();for(const o of r){const{start:l,end:c}=o,u=a[l],d=a[Xg(l,c,a)];A?(e.moveTo(u.x,u.y),A=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,o,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function dB(e,t){const{line:n,target:r,property:a,color:A,scale:s}=t,o=Y7(n,r,a);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=A}={}}=l,h=r!==!0;e.save(),e.fillStyle=f,f9(e,s,h&&Rh(a,u,d)),e.beginPath();const p=!!n.pathSegment(e,l);let m;if(h){p?e.closePath():fB(e,r,d,a);const y=!!r.pathSegment(e,c,{move:p,reverse:!0});m=p&&y,m||fB(e,r,u,a)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function f9(e,t,n){const{top:r,bottom:a}=t.chart.chartArea,{property:A,start:s,end:o}=n||{};A==="x"&&(e.beginPath(),e.rect(s,r,o-s,a-r),e.clip())}function fB(e,t,n,r){const a=t.interpolate(n,r);a&&e.lineTo(a.x,a.y)}var h9={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,a=[];let A,s,o,l;for(s=0;s<r;++s)A=e.getDatasetMeta(s),o=A.dataset,l=null,o&&o.options&&o instanceof xa&&(l={visible:e.isDatasetVisible(s),index:s,fill:J7(o,s,r),chart:e,axis:A.controller.options.indexAxis,scale:A.vScale,line:o}),A.$filler=l,a.push(l);for(s=0;s<r;++s)l=a[s],!(!l||l.fill===!1)&&(l.fill=X7(a,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",a=e.getSortedVisibleDatasetMetas(),A=e.chartArea;for(let s=a.length-1;s>=0;--s){const o=a[s].$filler;o&&(o.line.updateControlPoints(A,o.axis),r&&o.fill&&_f(e.ctx,o,A))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const A=r[a].$filler;cB(A)&&_f(e.ctx,A,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!cB(r)||n.drawTime!=="beforeDatasetDraw"||_f(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const hB=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},p9=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class pB extends An{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,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 n=Re(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,a)=>t.sort(r,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,a=ht(r.font),A=a.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=hB(r,A);let c,u;n.font=a.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,A,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,a,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,a){const{ctx:A,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=a+o;let d=t;A.textAlign="left",A.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((p,m)=>{const y=r+n/2+A.measureText(p.text).width;(m===0||c[c.length-1]+y+2*o>s)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:y,height:a},c[c.length-1]+=y+o}),d}_fitCols(t,n,r,a){const{ctx:A,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,h=0,p=0,m=0;return this.legendItems.forEach((y,g)=>{const{itemWidth:v,itemHeight:_}=g9(r,n,A,y,a);g>0&&h+_+2*o>u&&(d+=f+o,c.push({width:f,height:h}),p+=f+o,m++,f=h=0),l[g]={left:p,top:h,col:m,width:v,height:_},f=Math.max(f,v),h+=_+o}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:a},rtl:A}}=this,s=ks(A,this.left,this.width);if(this.isHorizontal()){let o=0,l=Gt(r,this.left+a,this.right-this.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=Gt(r,this.left+a,this.right-this.lineWidths[o])),c.top+=this.top+t+a,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+a}else{let o=0,l=Gt(r,this.top+t+a,this.bottom-this.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=Gt(r,this.top+t+a,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+a,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;rl(t,this),this._draw(),al(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:a}=this,{align:A,labels:s}=t,o=ft.color,l=ks(t.rtl,this.left,this.width),c=ht(s.font),{padding:u}=s,d=c.size,f=d/2;let h;this.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=hB(s,d),g=function(b,C,E){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;a.save();const S=de(E.lineWidth,1);if(a.fillStyle=de(E.fillStyle,o),a.lineCap=de(E.lineCap,"butt"),a.lineDashOffset=de(E.lineDashOffset,0),a.lineJoin=de(E.lineJoin,"miter"),a.lineWidth=S,a.strokeStyle=de(E.strokeStyle,o),a.setLineDash(de(E.lineDash,[])),s.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:S},U=l.xPlus(b,p/2),F=C+f;Pb(a,T,U,F,s.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),U=l.leftForLtr(b,p),F=Oa(E.borderRadius);a.beginPath(),Object.values(F).some(Q=>Q!==0)?Vs(a,{x:U,y:T,w:p,h:m,radius:F}):a.rect(U,T,p,m),a.fill(),S!==0&&a.stroke()}a.restore()},v=function(b,C,E){PA(a,E.text,b,C+y/2,c,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?h={x:Gt(A,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:h={x:this.left+u,y:Gt(A,this.top+B+u,this.bottom-n[0].height),line:0},jb(this.ctx,t.textDirection);const w=y+u;this.legendItems.forEach((b,C)=>{a.strokeStyle=b.fontColor,a.fillStyle=b.fontColor;const E=a.measureText(b.text).width,S=l.textAlign(b.textAlign||(b.textAlign=s.textAlign)),T=p+f+E;let U=h.x,F=h.y;l.setWidth(this.width),_?C>0&&U+T+u>this.right&&(F=h.y+=w,h.line++,U=h.x=Gt(A,this.left+u,this.right-r[h.line])):C>0&&F+w>this.bottom&&(U=h.x=U+n[h.line].width+u,h.line++,F=h.y=Gt(A,this.top+B+u,this.bottom-n[h.line].height));const Q=l.x(U);if(g(Q,F,b),U=NL(S,U+p+f,_?U+T:this.right,t.rtl),v(l.x(U),F,b),_)h.x+=T+u;else if(typeof b.text!="string"){const Y=c.lineHeight;h.y+=B_(b,Y)}else h.y+=w}),Yb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ht(n.font),a=kt(n.padding);if(!n.display)return;const A=ks(t.rtl,this.left,this.width),s=this.ctx,o=n.position,l=r.size/2,c=a.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Gt(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Gt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const h=Gt(o,d,d+f);s.textAlign=A.textAlign(Vg(o)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,PA(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ht(t.font),r=kt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,a,A;if(Wr(t,this.left,this.right)&&Wr(n,this.top,this.bottom)){for(A=this.legendHitBoxes,r=0;r<A.length;++r)if(a=A[r],Wr(t,a.left,a.left+a.width)&&Wr(n,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!B9(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const a=this._hoveredItem,A=p9(a,r);a&&!A&&Re(n.onLeave,[t,a,this],this),this._hoveredItem=r,r&&!A&&Re(n.onHover,[t,r,this],this)}else r&&Re(n.onClick,[t,r,this],this)}}function g9(e,t,n,r,a){const A=m9(r,e,t,n),s=v9(a,r,t.lineHeight);return{itemWidth:A,itemHeight:s}}function m9(e,t,n,r){let a=e.text;return a&&typeof a!="string"&&(a=a.reduce((A,s)=>A.length>s.length?A:s)),t+n.size/2+r.measureText(a).width}function v9(e,t,n){let r=e;return typeof t.text!="string"&&(r=B_(t,n)),r}function B_(e,t){const n=e.text?e.text.length+.5:0;return t*n}function B9(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var y9={id:"legend",_element:pB,start(e,t,n){const r=e.legend=new pB({ctx:e.ctx,options:n,chart:e});jt.configure(e,r,n),jt.addBox(e,r)},stop(e){jt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;jt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,a=n.chart;a.isDatasetVisible(r)?(a.hide(r),t.hidden=!0):(a.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:a,color:A,useBorderRadius:s,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:A,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:a||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Jg extends An{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const a=Me(r.text)?r.text.length:1;this._padding=kt(r.padding);const A=a*ht(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=A:this.width=A}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:a,right:A,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Gt(o,r,A),d=n+t,c=A-r):(s.position==="left"?(u=r+t,d=Gt(o,a,n),l=Te*-.5):(u=A-t,d=Gt(o,n,a),l=Te*.5),c=a-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ht(n.font),A=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(A);PA(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Vg(n.align),textBaseline:"middle",translation:[s,o]})}}function w9(e,t){const n=new Jg({ctx:e.ctx,options:t,chart:e});jt.configure(e,n,t),jt.addBox(e,n),e.titleBlock=n}var b9={id:"title",_element:Jg,start(e,t,n){w9(e,n)},stop(e){const t=e.titleBlock;jt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;jt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yl=new WeakMap;var _9={id:"subtitle",start(e,t,n){const r=new Jg({ctx:e.ctx,options:n,chart:e});jt.configure(e,r,n),jt.addBox(e,r),Yl.set(e,r)},stop(e){jt.removeBox(e,Yl.get(e)),Yl.delete(e)},beforeUpdate(e,t,n){const r=Yl.get(e);jt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi={average(e){if(!e.length)return!1;let t,n,r=0,a=0,A=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,a+=o.y,++A}}return{x:r/A,y:a/A}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,a=Number.POSITIVE_INFINITY,A,s,o;for(A=0,s=e.length;A<s;++A){const l=e[A].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Rs(t,c);u<a&&(a=u,o=l)}}if(o){const l=o.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function cr(e,t){return t&&(Me(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Pr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
826
826
  `)>-1?e.split(`
827
- `):e}function C9(e,t){const{element:n,datasetIndex:r,index:a}=t,A=e.getDatasetMeta(r).controller,{label:s,value:o}=A.getLabelAndValue(a);return{chart:e,label:s,parsed:A.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:o,dataset:A.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function gB(e,t){const n=e.chart.ctx,{body:r,footer:a,title:A}=e,{boxWidth:s,boxHeight:o}=t,l=ht(t.bodyFont),c=ht(t.titleFont),u=ht(t.footerFont),d=A.length,f=a.length,h=r.length,p=kt(t.padding);let m=p.height,y=0,g=r.reduce((B,w)=>B+w.before.length+w.lines.length+w.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){const B=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;m+=h*B+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const _=function(B){y=Math.max(y,n.measureText(B).width+v)};return n.save(),n.font=c.string,Ke(e.title,_),n.font=l.string,Ke(e.beforeBody.concat(e.afterBody),_),v=t.displayColors?s+2+t.boxPadding:0,Ke(r,B=>{Ke(B.before,_),Ke(B.lines,_),Ke(B.after,_)}),v=0,n.font=u.string,Ke(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function k9(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function E9(e,t,n,r){const{x:a,width:A}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&a+A+s>t.width||e==="right"&&a-A-s<0)return!0}function S9(e,t,n,r){const{x:a,width:A}=n,{width:s,chartArea:{left:o,right:l}}=e;let c="center";return r==="center"?c=a<=(o+l)/2?"left":"right":a<=A/2?c="left":a>=s-A/2&&(c="right"),E9(c,e,t,n)&&(c="center"),c}function mB(e,t,n){const r=n.yAlign||t.yAlign||k9(e,n);return{xAlign:n.xAlign||t.xAlign||S9(e,t,n,r),yAlign:r}}function x9(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function F9(e,t,n){let{y:r,height:a}=e;return t==="top"?r+=n:t==="bottom"?r-=a+n:r-=a/2,r}function vB(e,t,n,r){const{caretSize:a,caretPadding:A,cornerRadius:s}=e,{xAlign:o,yAlign:l}=n,c=a+A,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Oa(s);let p=x9(t,o);const m=F9(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+a:o==="right"&&(p+=Math.max(d,h)+a),{x:Pt(p,0,r.width-t.width),y:Pt(m,0,r.height-t.height)}}function ql(e,t,n){const r=kt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function BB(e){return cr([],Pr(e))}function I9(e,t,n){return AA(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function yB(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const y_={beforeTitle:Tr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Tr,beforeBody:Tr,beforeLabel:Tr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return _e(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Tr,afterBody:Tr,beforeFooter:Tr,footer:Tr,afterFooter:Tr};function on(e,t,n,r){const a=e[t].call(n,r);return typeof a>"u"?y_[t].call(n,r):a}class Vh extends An{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 n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,A=new Yg(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(A)),A}getContext(){return this.$context||(this.$context=I9(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,a=on(r,"beforeTitle",this,t),A=on(r,"title",this,t),s=on(r,"afterTitle",this,t);let o=[];return o=cr(o,Pr(a)),o=cr(o,Pr(A)),o=cr(o,Pr(s)),o}getBeforeBody(t,n){return BB(on(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,a=[];return Ke(t,A=>{const s={before:[],lines:[],after:[]},o=yB(r,A);cr(s.before,Pr(on(o,"beforeLabel",this,A))),cr(s.lines,on(o,"label",this,A)),cr(s.after,Pr(on(o,"afterLabel",this,A))),a.push(s)}),a}getAfterBody(t,n){return BB(on(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,a=on(r,"beforeFooter",this,t),A=on(r,"footer",this,t),s=on(r,"afterFooter",this,t);let o=[];return o=cr(o,Pr(a)),o=cr(o,Pr(A)),o=cr(o,Pr(s)),o}_createItems(t){const n=this._active,r=this.chart.data,a=[],A=[],s=[];let o=[],l,c;for(l=0,c=n.length;l<c;++l)o.push(C9(this.chart,n[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Ke(o,u=>{const d=yB(t.callbacks,u);a.push(on(d,"labelColor",this,u)),A.push(on(d,"labelPointStyle",this,u)),s.push(on(d,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=A,this.labelTextColors=s,this.dataPoints=o,o}update(t,n){const r=this.options.setContext(this.getContext()),a=this._active;let A,s=[];if(!a.length)this.opacity!==0&&(A={opacity:0});else{const o=Qi[r.position].call(this,a,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=gB(this,r),c=Object.assign({},o,l),u=mB(this.chart,r,c),d=vB(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,A={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,A&&this._resolveAnimations().update(this,A),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,a){const A=this.getCaretPosition(t,r,a);n.lineTo(A.x1,A.y1),n.lineTo(A.x2,A.y2),n.lineTo(A.x3,A.y3)}getCaretPosition(t,n,r){const{xAlign:a,yAlign:A}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Oa(o),{x:f,y:h}=t,{width:p,height:m}=n;let y,g,v,_,B,w;return A==="center"?(B=h+m/2,a==="left"?(y=f,g=y-s,_=B+s,w=B-s):(y=f+p,g=y+s,_=B-s,w=B+s),v=y):(a==="left"?g=f+Math.max(l,u)+s:a==="right"?g=f+p-Math.max(c,d)-s:g=this.caretX,A==="top"?(_=h,B=_-s,y=g-s,v=g+s):(_=h+m,B=_+s,y=g+s,v=g-s),w=_),{x1:y,x2:g,x3:v,y1:_,y2:B,y3:w}}drawTitle(t,n,r){const a=this.title,A=a.length;let s,o,l;if(A){const c=ks(r.rtl,this.x,this.width);for(t.x=ql(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=ht(r.titleFont),o=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<A;++l)n.fillText(a[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===A&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,n,r,a,A){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=A,u=ht(A.bodyFont),d=ql(this,"left",A),f=a.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(A.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},y=a.leftForLtr(f,c)+c/2,g=p+l/2;t.strokeStyle=A.multiKeyBackground,t.fillStyle=A.multiKeyBackground,Lh(t,m,y,g),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Lh(t,m,y,g)}else{t.lineWidth=ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const m=a.leftForLtr(f,c),y=a.leftForLtr(a.xPlus(f,1),c-2),g=Oa(s.borderRadius);Object.values(g).some(v=>v!==0)?(t.beginPath(),t.fillStyle=A.multiKeyBackground,Vs(t,{x:m,y:p,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Vs(t,{x:y,y:p+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=A.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:a}=this,{bodySpacing:A,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ht(r.bodyFont);let f=d.lineHeight,h=0;const p=ks(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+A},y=p.textAlign(s);let g,v,_,B,w,b,C;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=ql(this,y,r),n.fillStyle=r.bodyColor,Ke(this.beforeBody,m),h=o&&y!=="right"?s==="center"?c/2+u:c+2+u:0,B=0,b=a.length;B<b;++B){for(g=a[B],v=this.labelTextColors[B],n.fillStyle=v,Ke(g.before,m),_=g.lines,o&&_.length&&(this._drawColorBox(n,t,B,p,r),f=Math.max(d.lineHeight,l)),w=0,C=_.length;w<C;++w)m(_[w]),f=d.lineHeight;Ke(g.after,m)}h=0,f=d.lineHeight,Ke(this.afterBody,m),t.y-=A}drawFooter(t,n,r){const a=this.footer,A=a.length;let s,o;if(A){const l=ks(r.rtl,this.x,this.width);for(t.x=ql(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=ht(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,o=0;o<A;++o)n.fillText(a[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,a){const{xAlign:A,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Oa(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(o+d,l),s==="top"&&this.drawCaret(t,n,r,a),n.lineTo(o+c-f,l),n.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&A==="right"&&this.drawCaret(t,n,r,a),n.lineTo(o+c,l+u-p),n.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,n,r,a),n.lineTo(o+h,l+u),n.quadraticCurveTo(o,l+u,o,l+u-h),s==="center"&&A==="left"&&this.drawCaret(t,n,r,a),n.lineTo(o,l+d),n.quadraticCurveTo(o,l,o+d,l),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,a=r&&r.x,A=r&&r.y;if(a||A){const s=Qi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=gB(this,t),l=Object.assign({},s,this._size),c=mB(n,t,l),u=vB(t,l,c,n);(a._to!==u.x||A._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},A={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=kt(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(A,t,a,n),jb(t,n.textDirection),A.y+=s.top,this.drawTitle(A,t,n),this.drawBody(A,t,n),this.drawFooter(A,t,n),Yb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,a=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),A=!ou(r,a),s=this._positionChanged(a,n);(A||s)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,A=this._active||[],s=this._getActiveElements(t,A,n,r),o=this._positionChanged(s,t),l=n||!ou(s,A)||o;return l&&(this._active=s,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,a){const A=this.options;if(t.type==="mouseout")return[];if(!a)return n;const s=this.chart.getElementsAtEventForMode(t,A.mode,A,r);return A.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:a,options:A}=this,s=Qi[A.position].call(this,t,n);return s!==!1&&(r!==s.x||a!==s.y)}}R(Vh,"positioners",Qi);var U9={id:"tooltip",_element:Vh,positioners:Qi,afterInit(e,t,n){n&&(e.tooltip=new Vh({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:y_},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Q9=Object.freeze({__proto__:null,Colors:$M,Decimation:jM,Filler:h9,Legend:y9,SubTitle:_9,Title:b9,Tooltip:U9});const T9=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function D9(e,t,n,r){const a=e.indexOf(t);if(a===-1)return T9(e,t,n,r);const A=e.lastIndexOf(t);return a!==A?n:a}const L9=(e,t)=>e===null?null:Pt(Math.round(e),0,t);function wB(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Kh extends GA{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:A}of n)r[a]===A&&r.splice(a,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(_e(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:D9(r,t,de(n,t),this._addedLabels),L9(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,a=[];let A=this.getLabels();A=t===0&&n===A.length-1?A:A.slice(t,n+1),this._valueRange=Math.max(A.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)a.push({value:s});return a}getLabelForValue(t){return wB.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Kh,"id","category"),R(Kh,"defaults",{ticks:{callback:wB}});function O9(e,t){const n=[],{bounds:a,step:A,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=A||1,p=u-1,{min:m,max:y}=t,g=!_e(s),v=!_e(o),_=!_e(c),B=(y-m)/(d+1);let w=pv((y-m)/p/h)*h,b,C,E,S;if(w<1e-14&&!g&&!v)return[{value:m},{value:y}];S=Math.ceil(y/w)-Math.floor(m/w),S>p&&(w=pv(S*w/p/h)*h),_e(l)||(b=Math.pow(10,l),w=Math.ceil(w*b)/b),a==="ticks"?(C=Math.floor(m/w)*w,E=Math.ceil(y/w)*w):(C=m,E=y),g&&v&&A&&UL((o-s)/A,w/1e3)?(S=Math.round(Math.min((o-s)/w,u)),w=(o-s)/S,C=s,E=o):_?(C=g?s:C,E=v?o:E,S=c-1,w=(E-C)/S):(S=(E-C)/w,Xi(S,Math.round(S),w/1e3)?S=Math.round(S):S=Math.ceil(S));const T=Math.max(gv(w),gv(C));b=Math.pow(10,_e(l)?T:l),C=Math.round(C*b)/b,E=Math.round(E*b)/b;let U=0;for(g&&(f&&C!==s?(n.push({value:s}),C<s&&U++,Xi(Math.round((C+U*w)*b)/b,s,bB(s,B,e))&&U++):C<s&&U++);U<S;++U){const F=Math.round((C+U*w)*b)/b;if(v&&F>o)break;n.push({value:F})}return v&&f&&E!==o?n.length&&Xi(n[n.length-1].value,o,bB(o,B,e))?n[n.length-1].value=o:n.push({value:o}):(!v||E===o)&&n.push({value:E}),n}function bB(e,t,{horizontal:n,minRotation:r}){const a=St(r),A=(n?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/A,s)}class gu extends GA{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return _e(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:A}=this;const s=l=>a=n?a:l,o=l=>A=r?A:l;if(t){const l=Br(a),c=Br(A);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(a===A){let l=A===0?1:Math.abs(A*.05);o(A+l),t||s(a-l)}this.min=a,this.max=A}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},A=this._range||this,s=O9(a,A);return t.bounds==="ticks"&&Ib(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const a=(r-n)/Math.max(t.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return nl(t,this.chart.options.locale,this.options.ticks.format)}}class $h extends gu{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=St(this.options.ticks.minRotation),a=(t?Math.sin(r):Math.cos(r))||.001,A=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,A.lineHeight/a))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R($h,"id","linear"),R($h,"defaults",{ticks:{callback:nd.formatters.numeric}});const Uo=e=>Math.floor(Sa(e)),cA=(e,t)=>Math.pow(10,Uo(e)+t);function _B(e){return e/Math.pow(10,Uo(e))===1}function CB(e,t,n){const r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}function M9(e,t){const n=t-e;let r=Uo(n);for(;CB(e,t,r)>10;)r++;for(;CB(e,t,r)<10;)r--;return Math.min(r,Uo(e))}function N9(e,{min:t,max:n}){t=bn(e.min,t);const r=[],a=Uo(t);let A=M9(t,n),s=A<0?Math.pow(10,Math.abs(A)):1;const o=Math.pow(10,A),l=a>A?Math.pow(10,a):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,A)),f=bn(e.min,Math.round((l+u+d*Math.pow(10,A))*s)/s);for(;f<n;)r.push({value:f,major:_B(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(A++,d=2,s=A>=0?1:s),f=Math.round((l+u+d*Math.pow(10,A))*s)/s;const h=bn(e.max,f);return r.push({value:h,major:_B(h),significand:d}),r}class Wh extends GA{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=gu.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return dt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===cA(this.min,0)?cA(this.min,-1):cA(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,a=this.max;const A=o=>r=t?r:o,s=o=>a=n?a:o;r===a&&(r<=0?(A(1),s(10)):(A(cA(r,-1)),s(cA(a,1)))),r<=0&&A(cA(a,-1)),a<=0&&s(cA(r,1)),this.min=r,this.max=a}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=N9(n,this);return t.bounds==="ticks"&&Ib(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":nl(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Sa(t),this._valueRange=Sa(this.max)-Sa(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Sa(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Wh,"id","logarithmic"),R(Wh,"defaults",{ticks:{callback:nd.formatters.logarithmic,major:{enabled:!0}}});function Gh(e){const t=e.ticks;if(t.display&&e.display){const n=kt(t.backdropPadding);return de(t.font&&t.font.size,ft.font.size)+n.height}return 0}function P9(e,t,n){return n=Me(n)?n:[n],{w:jL(e,t.string,n),h:n.length*t.lineHeight}}function kB(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function H9(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],a=[],A=e._pointLabels.length,s=e.options.pointLabels,o=s.centerPointLabels?Te/A:0;for(let l=0;l<A;l++){const c=s.setContext(e.getPointLabelContext(l));a[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+a[l],o),d=ht(c.font),f=P9(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Cn(e.getIndexAngle(l)+o),p=Math.round(td(h)),m=kB(p,u.x,f.w,0,180),y=kB(p,u.y,f.h,90,270);R9(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=$9(e,r,a)}function R9(e,t,n,r,a){const A=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/A,e.l=Math.min(e.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/A,e.r=Math.max(e.r,t.r+o)),a.start<t.t?(l=(t.t-a.start)/s,e.t=Math.min(e.t,t.t-l)):a.end>t.b&&(l=(a.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function V9(e,t,n){const r=e.drawingArea,{extra:a,additionalAngle:A,padding:s,size:o}=n,l=e.getPointPosition(t,r+a+s,A),c=Math.round(td(Cn(l.angle+Ze))),u=z9(l.y,o.h,c),d=W9(c),f=G9(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function K9(e,t){if(!t)return!0;const{left:n,top:r,right:a,bottom:A}=e;return!(zr({x:n,y:r},t)||zr({x:n,y:A},t)||zr({x:a,y:r},t)||zr({x:a,y:A},t))}function $9(e,t,n){const r=[],a=e._pointLabels.length,A=e.options,{centerPointLabels:s,display:o}=A.pointLabels,l={extra:Gh(A)/2,additionalAngle:s?Te/a:0};let c;for(let u=0;u<a;u++){l.padding=n[u],l.size=t[u];const d=V9(e,u,l);r.push(d),o==="auto"&&(d.visible=K9(d,c),d.visible&&(c=d))}return r}function W9(e){return e===0||e===180?"center":e<180?"left":"right"}function G9(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function z9(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function j9(e,t,n){const{left:r,top:a,right:A,bottom:s}=n,{backdropColor:o}=t;if(!_e(o)){const l=Oa(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=o;const u=r-c.left,d=a-c.top,f=A-r+c.width,h=s-a+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Vs(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function Y9(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let a=t-1;a>=0;a--){const A=e._pointLabelItems[a];if(!A.visible)continue;const s=r.setContext(e.getPointLabelContext(a));j9(n,s,A);const o=ht(s.font),{x:l,y:c,textAlign:u}=A;PA(n,e._pointLabels[a],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function w_(e,t,n,r){const{ctx:a}=e;if(n)a.arc(e.xCenter,e.yCenter,t,0,Je);else{let A=e.getPointPosition(0,t);a.moveTo(A.x,A.y);for(let s=1;s<r;s++)A=e.getPointPosition(s,t),a.lineTo(A.x,A.y)}}function q9(e,t,n,r,a){const A=e.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||n<0||(A.save(),A.strokeStyle=o,A.lineWidth=l,A.setLineDash(a.dash),A.lineDashOffset=a.dashOffset,A.beginPath(),w_(e,n,s,r),A.closePath(),A.stroke(),A.restore())}function X9(e,t,n){return AA(e,{label:n,index:t,type:"pointLabel"})}class Ti extends gu{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=kt(Gh(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=dt(t)&&!isNaN(t)?t:0,this.max=dt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gh(this.options))}generateTickLabels(t){gu.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const a=Re(this.options.pointLabels.callback,[n,r],this);return a||a===0?a:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?H9(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,a){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,a))}getIndexAngle(t){const n=Je/(this._pointLabels.length||1),r=this.options.startAngle||0;return Cn(t*n+St(r))}getDistanceFromCenterForValue(t){if(_e(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(_e(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return X9(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const a=this.getIndexAngle(t)-Ze+r;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:a,bottom:A}=this._pointLabelItems[t];return{left:n,top:r,right:a,bottom:A}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),w_(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:a,border:A}=n,s=this._pointLabels.length;let o,l,c;if(n.pointLabels.display&&Y9(this,s),a.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=a.setContext(f),p=A.setContext(f);q9(this,h,l,s,p)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const a=this.getIndexAngle(0);let A,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(a),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ht(c.font);if(A=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=kt(c.backdropPadding);t.fillRect(-s/2-d.left,-A-u.size/2-d.top,s+d.width,u.size+d.height)}PA(t,o.label,0,-A,u,{color:c.color})}),t.restore()}drawTitle(){}}R(Ti,"id","radialLinear"),R(Ti,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(Ti,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(Ti,"descriptors",{angleLines:{_fallback:"grid"}});const ad={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}},pn=Object.keys(ad);function J9(e,t){return e-t}function EB(e,t){if(_e(t))return null;const n=e._adapter,{parser:r,round:a,isoWeekday:A}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),dt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(a&&(s=a==="week"&&(Ya(A)||A===!0)?n.startOf(s,"isoWeek",A):n.startOf(s,a)),+s)}function SB(e,t,n,r){const a=pn.length;for(let A=pn.indexOf(e);A<a-1;++A){const s=ad[pn[A]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(o*s.size))<=r)return pn[A]}return pn[a-1]}function Z9(e,t,n,r,a){for(let A=pn.length-1;A>=pn.indexOf(n);A--){const s=pn[A];if(ad[s].common&&e._adapter.diff(a,r,s)>=t-1)return s}return pn[n?pn.indexOf(n):0]}function eN(e){for(let t=pn.indexOf(e)+1,n=pn.length;t<n;++t)if(ad[pn[t]].common)return pn[t]}function xB(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:a}=Rg(n,t),A=n[r]>=t?n[r]:n[a];e[A]=!0}}function tN(e,t,n,r){const a=e._adapter,A=+a.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=A;o<=s;o=+a.add(o,1,r))l=n[o],l>=0&&(t[l].major=!0);return t}function FB(e,t,n){const r=[],a={},A=t.length;let s,o;for(s=0;s<A;++s)o=t[s],a[o]=s,r.push({value:o,major:!1});return A===0||!n?r:tN(e,r,a,n)}class Qo extends GA{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),a=this._adapter=new t_._date(t.adapters.date);a.init(n),qi(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:EB(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:a,max:A,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(a=Math.min(a,c.min)),!o&&!isNaN(c.max)&&(A=Math.max(A,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),a=dt(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),A=dt(A)&&!isNaN(A)?A:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,A-1),this.max=Math.max(a+1,A)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const A=this.min,s=this.max,o=LL(a,A,s);return this._unit=n.unit||(r.autoSkip?SB(n.minUnit,this.min,this.max,this._getLabelCapacity(A)):Z9(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:eN(this._unit),this.initOffsets(a),t.reverse&&o.reverse(),FB(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,a,A;this.options.offset&&t.length&&(a=this.getDecimalForValue(t[0]),t.length===1?n=1-a:n=(this.getDecimalForValue(t[1])-a)/2,A=this.getDecimalForValue(t[t.length-1]),t.length===1?r=A:r=(A-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Pt(n,0,s),r=Pt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,a=this.options,A=a.time,s=A.unit||SB(A.minUnit,n,r,this._getLabelCapacity(n)),o=de(a.ticks.stepSize,1),l=s==="week"?A.isoWeekday:!1,c=Ya(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*o)throw new Error(n+" and "+r+" are too far apart with stepSize of "+o+" "+s);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,o,s),h++)xB(u,f,p);return(f===r||a.bounds==="ticks"||h===1)&&xB(u,f,p),Object.keys(u).sort((m,y)=>m-y).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const a=this.options.time.displayFormats,A=this._unit,s=n||a[A];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,a){const A=this.options,s=A.ticks.callback;if(s)return Re(s,[t,n,r],this);const o=A.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,a||(h?d:u))}generateTickLabels(t){let n,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],a.label=this._tickFormatFunction(a.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,a=St(this.isHorizontal()?n.maxRotation:n.minRotation),A=Math.cos(a),s=Math.sin(a),o=this._resolveTickFontOptions(0).size;return{w:r*A+o*s,h:r*s+o*A}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,A=this._tickFormatFunction(t,0,FB(this,[t],this._majorUnit),a),s=this._getLabelSize(A),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)t=t.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)t.push(EB(this,a[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Tb(t.sort(J9))}}R(Qo,"id","time"),R(Qo,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Xl(e,t,n){let r=0,a=e.length-1,A,s,o,l;n?(t>=e[r].pos&&t<=e[a].pos&&({lo:r,hi:a}=Gr(e,"pos",t)),{pos:A,time:o}=e[r],{pos:s,time:l}=e[a]):(t>=e[r].time&&t<=e[a].time&&({lo:r,hi:a}=Gr(e,"time",t)),{time:A,pos:o}=e[r],{time:s,pos:l}=e[a]);const c=s-A;return c?o+(l-o)*(t-A)/c:o}class zh extends Qo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Xl(n,this.min),this._tableRange=Xl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,a=[],A=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=n&&c<=r&&a.push(c);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,o=a.length;s<o;++s)u=a[s+1],l=a[s-1],c=a[s],Math.round((u+l)/2)!==c&&A.push({time:c,pos:s/(o-1)});return A}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Xl(this._table,r*this._tableRange+this._minPos,!0)}}R(zh,"id","timeseries"),R(zh,"defaults",Qo.defaults);var nN=Object.freeze({__proto__:null,CategoryScale:Kh,LinearScale:$h,LogarithmicScale:Wh,RadialLinearScale:Ti,TimeScale:Qo,TimeSeriesScale:zh});const kr=[l7,NM,Q9,nN];var rN=typeof global=="object"&&global&&global.Object===Object&&global;const b_=rN;var aN=typeof self=="object"&&self&&self.Object===Object&&self,AN=b_||aN||Function("return this")();const Er=AN;var sN=Er.Symbol;const qa=sN;var __=Object.prototype,iN=__.hasOwnProperty,oN=__.toString,yi=qa?qa.toStringTag:void 0;function lN(e){var t=iN.call(e,yi),n=e[yi];try{e[yi]=void 0;var r=!0}catch{}var a=oN.call(e);return r&&(t?e[yi]=n:delete e[yi]),a}var cN=Object.prototype,uN=cN.toString;function dN(e){return uN.call(e)}var fN="[object Null]",hN="[object Undefined]",IB=qa?qa.toStringTag:void 0;function sl(e){return e==null?e===void 0?hN:fN:IB&&IB in Object(e)?lN(e):dN(e)}function HA(e){return e!=null&&typeof e=="object"}var pN=Array.isArray;const Ws=pN;function il(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gN="[object AsyncFunction]",mN="[object Function]",vN="[object GeneratorFunction]",BN="[object Proxy]";function C_(e){if(!il(e))return!1;var t=sl(e);return t==mN||t==vN||t==gN||t==BN}var yN=Er["__core-js_shared__"];const Cf=yN;var UB=function(){var e=/[^.]+$/.exec(Cf&&Cf.keys&&Cf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wN(e){return!!UB&&UB in e}var bN=Function.prototype,_N=bN.toString;function zA(e){if(e!=null){try{return _N.call(e)}catch{}try{return e+""}catch{}}return""}var CN=/[\\^$.*+?()[\]{}|]/g,kN=/^\[object .+?Constructor\]$/,EN=Function.prototype,SN=Object.prototype,xN=EN.toString,FN=SN.hasOwnProperty,IN=RegExp("^"+xN.call(FN).replace(CN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UN(e){if(!il(e)||wN(e))return!1;var t=C_(e)?IN:kN;return t.test(zA(e))}function QN(e,t){return e==null?void 0:e[t]}function jA(e,t){var n=QN(e,t);return UN(n)?n:void 0}var TN=jA(Er,"WeakMap");const jh=TN;var QB=Object.create,DN=function(){function e(){}return function(t){if(!il(t))return{};if(QB)return QB(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const LN=DN;function ON(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var MN=function(){try{var e=jA(Object,"defineProperty");return e({},"",{}),e}catch{}}();const TB=MN;function NN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var PN=9007199254740991,HN=/^(?:0|[1-9]\d*)$/;function RN(e,t){var n=typeof e;return t=t??PN,!!t&&(n=="number"||n!="symbol"&&HN.test(e))&&e>-1&&e%1==0&&e<t}function k_(e,t,n){t=="__proto__"&&TB?TB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zg(e,t){return e===t||e!==e&&t!==t}var VN=Object.prototype,KN=VN.hasOwnProperty;function E_(e,t,n){var r=e[t];(!(KN.call(e,t)&&Zg(r,n))||n===void 0&&!(t in e))&&k_(e,t,n)}function Ad(e,t,n,r){var a=!n;n||(n={});for(var A=-1,s=t.length;++A<s;){var o=t[A],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),a?k_(n,o,l):E_(n,o,l)}return n}var $N=9007199254740991;function S_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$N}function em(e){return e!=null&&S_(e.length)&&!C_(e)}var WN=Object.prototype;function sd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WN;return e===n}function GN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var zN="[object Arguments]";function DB(e){return HA(e)&&sl(e)==zN}var x_=Object.prototype,jN=x_.hasOwnProperty,YN=x_.propertyIsEnumerable,qN=DB(function(){return arguments}())?DB:function(e){return HA(e)&&jN.call(e,"callee")&&!YN.call(e,"callee")};const F_=qN;function XN(){return!1}var I_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,LB=I_&&typeof module=="object"&&module&&!module.nodeType&&module,JN=LB&&LB.exports===I_,OB=JN?Er.Buffer:void 0,ZN=OB?OB.isBuffer:void 0,eP=ZN||XN;const To=eP;var tP="[object Arguments]",nP="[object Array]",rP="[object Boolean]",aP="[object Date]",AP="[object Error]",sP="[object Function]",iP="[object Map]",oP="[object Number]",lP="[object Object]",cP="[object RegExp]",uP="[object Set]",dP="[object String]",fP="[object WeakMap]",hP="[object ArrayBuffer]",pP="[object DataView]",gP="[object Float32Array]",mP="[object Float64Array]",vP="[object Int8Array]",BP="[object Int16Array]",yP="[object Int32Array]",wP="[object Uint8Array]",bP="[object Uint8ClampedArray]",_P="[object Uint16Array]",CP="[object Uint32Array]",at={};at[gP]=at[mP]=at[vP]=at[BP]=at[yP]=at[wP]=at[bP]=at[_P]=at[CP]=!0;at[tP]=at[nP]=at[hP]=at[rP]=at[pP]=at[aP]=at[AP]=at[sP]=at[iP]=at[oP]=at[lP]=at[cP]=at[uP]=at[dP]=at[fP]=!1;function kP(e){return HA(e)&&S_(e.length)&&!!at[sl(e)]}function tm(e){return function(t){return e(t)}}var U_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ro=U_&&typeof module=="object"&&module&&!module.nodeType&&module,EP=ro&&ro.exports===U_,kf=EP&&b_.process,SP=function(){try{var e=ro&&ro.require&&ro.require("util").types;return e||kf&&kf.binding&&kf.binding("util")}catch{}}();const Gs=SP;var MB=Gs&&Gs.isTypedArray,xP=MB?tm(MB):kP;const nm=xP;var FP=Object.prototype,IP=FP.hasOwnProperty;function Q_(e,t){var n=Ws(e),r=!n&&F_(e),a=!n&&!r&&To(e),A=!n&&!r&&!a&&nm(e),s=n||r||a||A,o=s?GN(e.length,String):[],l=o.length;for(var c in e)(t||IP.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||A&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||RN(c,l)))&&o.push(c);return o}function T_(e,t){return function(n){return e(t(n))}}var UP=T_(Object.keys,Object);const QP=UP;var TP=Object.prototype,DP=TP.hasOwnProperty;function D_(e){if(!sd(e))return QP(e);var t=[];for(var n in Object(e))DP.call(e,n)&&n!="constructor"&&t.push(n);return t}function rm(e){return em(e)?Q_(e):D_(e)}function LP(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OP=Object.prototype,MP=OP.hasOwnProperty;function NP(e){if(!il(e))return LP(e);var t=sd(e),n=[];for(var r in e)r=="constructor"&&(t||!MP.call(e,r))||n.push(r);return n}function am(e){return em(e)?Q_(e,!0):NP(e)}var PP=jA(Object,"create");const Do=PP;function HP(){this.__data__=Do?Do(null):{},this.size=0}function RP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VP="__lodash_hash_undefined__",KP=Object.prototype,$P=KP.hasOwnProperty;function WP(e){var t=this.__data__;if(Do){var n=t[e];return n===VP?void 0:n}return $P.call(t,e)?t[e]:void 0}var GP=Object.prototype,zP=GP.hasOwnProperty;function jP(e){var t=this.__data__;return Do?t[e]!==void 0:zP.call(t,e)}var YP="__lodash_hash_undefined__";function qP(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Do&&t===void 0?YP:t,this}function RA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}RA.prototype.clear=HP;RA.prototype.delete=RP;RA.prototype.get=WP;RA.prototype.has=jP;RA.prototype.set=qP;function XP(){this.__data__=[],this.size=0}function id(e,t){for(var n=e.length;n--;)if(Zg(e[n][0],t))return n;return-1}var JP=Array.prototype,ZP=JP.splice;function eH(e){var t=this.__data__,n=id(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ZP.call(t,n,1),--this.size,!0}function tH(e){var t=this.__data__,n=id(t,e);return n<0?void 0:t[n][1]}function nH(e){return id(this.__data__,e)>-1}function rH(e,t){var n=this.__data__,r=id(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function oa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}oa.prototype.clear=XP;oa.prototype.delete=eH;oa.prototype.get=tH;oa.prototype.has=nH;oa.prototype.set=rH;var aH=jA(Er,"Map");const Lo=aH;function AH(){this.size=0,this.__data__={hash:new RA,map:new(Lo||oa),string:new RA}}function sH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function od(e,t){var n=e.__data__;return sH(t)?n[typeof t=="string"?"string":"hash"]:n.map}function iH(e){var t=od(this,e).delete(e);return this.size-=t?1:0,t}function oH(e){return od(this,e).get(e)}function lH(e){return od(this,e).has(e)}function cH(e,t){var n=od(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function YA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}YA.prototype.clear=AH;YA.prototype.delete=iH;YA.prototype.get=oH;YA.prototype.has=lH;YA.prototype.set=cH;function L_(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var uH=T_(Object.getPrototypeOf,Object);const O_=uH;function dH(){this.__data__=new oa,this.size=0}function fH(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hH(e){return this.__data__.get(e)}function pH(e){return this.__data__.has(e)}var gH=200;function mH(e,t){var n=this.__data__;if(n instanceof oa){var r=n.__data__;if(!Lo||r.length<gH-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new YA(r)}return n.set(e,t),this.size=n.size,this}function Xr(e){var t=this.__data__=new oa(e);this.size=t.size}Xr.prototype.clear=dH;Xr.prototype.delete=fH;Xr.prototype.get=hH;Xr.prototype.has=pH;Xr.prototype.set=mH;function vH(e,t){return e&&Ad(t,rm(t),e)}function BH(e,t){return e&&Ad(t,am(t),e)}var M_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,NB=M_&&typeof module=="object"&&module&&!module.nodeType&&module,yH=NB&&NB.exports===M_,PB=yH?Er.Buffer:void 0,HB=PB?PB.allocUnsafe:void 0;function wH(e,t){if(t)return e.slice();var n=e.length,r=HB?HB(n):new e.constructor(n);return e.copy(r),r}function bH(e,t){for(var n=-1,r=e==null?0:e.length,a=0,A=[];++n<r;){var s=e[n];t(s,n,e)&&(A[a++]=s)}return A}function N_(){return[]}var _H=Object.prototype,CH=_H.propertyIsEnumerable,RB=Object.getOwnPropertySymbols,kH=RB?function(e){return e==null?[]:(e=Object(e),bH(RB(e),function(t){return CH.call(e,t)}))}:N_;const Am=kH;function EH(e,t){return Ad(e,Am(e),t)}var SH=Object.getOwnPropertySymbols,xH=SH?function(e){for(var t=[];e;)L_(t,Am(e)),e=O_(e);return t}:N_;const P_=xH;function FH(e,t){return Ad(e,P_(e),t)}function H_(e,t,n){var r=t(e);return Ws(e)?r:L_(r,n(e))}function Yh(e){return H_(e,rm,Am)}function IH(e){return H_(e,am,P_)}var UH=jA(Er,"DataView");const qh=UH;var QH=jA(Er,"Promise");const Xh=QH;var TH=jA(Er,"Set");const Jh=TH;var VB="[object Map]",DH="[object Object]",KB="[object Promise]",$B="[object Set]",WB="[object WeakMap]",GB="[object DataView]",LH=zA(qh),OH=zA(Lo),MH=zA(Xh),NH=zA(Jh),PH=zA(jh),gA=sl;(qh&&gA(new qh(new ArrayBuffer(1)))!=GB||Lo&&gA(new Lo)!=VB||Xh&&gA(Xh.resolve())!=KB||Jh&&gA(new Jh)!=$B||jh&&gA(new jh)!=WB)&&(gA=function(e){var t=sl(e),n=t==DH?e.constructor:void 0,r=n?zA(n):"";if(r)switch(r){case LH:return GB;case OH:return VB;case MH:return KB;case NH:return $B;case PH:return WB}return t});const zs=gA;var HH=Object.prototype,RH=HH.hasOwnProperty;function VH(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&RH.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var KH=Er.Uint8Array;const mu=KH;function sm(e){var t=new e.constructor(e.byteLength);return new mu(t).set(new mu(e)),t}function $H(e,t){var n=t?sm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var WH=/\w*$/;function GH(e){var t=new e.constructor(e.source,WH.exec(e));return t.lastIndex=e.lastIndex,t}var zB=qa?qa.prototype:void 0,jB=zB?zB.valueOf:void 0;function zH(e){return jB?Object(jB.call(e)):{}}function jH(e,t){var n=t?sm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var YH="[object Boolean]",qH="[object Date]",XH="[object Map]",JH="[object Number]",ZH="[object RegExp]",eR="[object Set]",tR="[object String]",nR="[object Symbol]",rR="[object ArrayBuffer]",aR="[object DataView]",AR="[object Float32Array]",sR="[object Float64Array]",iR="[object Int8Array]",oR="[object Int16Array]",lR="[object Int32Array]",cR="[object Uint8Array]",uR="[object Uint8ClampedArray]",dR="[object Uint16Array]",fR="[object Uint32Array]";function hR(e,t,n){var r=e.constructor;switch(t){case rR:return sm(e);case YH:case qH:return new r(+e);case aR:return $H(e,n);case AR:case sR:case iR:case oR:case lR:case cR:case uR:case dR:case fR:return jH(e,n);case XH:return new r;case JH:case tR:return new r(e);case ZH:return GH(e);case eR:return new r;case nR:return zH(e)}}function pR(e){return typeof e.constructor=="function"&&!sd(e)?LN(O_(e)):{}}var gR="[object Map]";function mR(e){return HA(e)&&zs(e)==gR}var YB=Gs&&Gs.isMap,vR=YB?tm(YB):mR;const BR=vR;var yR="[object Set]";function wR(e){return HA(e)&&zs(e)==yR}var qB=Gs&&Gs.isSet,bR=qB?tm(qB):wR;const _R=bR;var CR=1,kR=2,ER=4,R_="[object Arguments]",SR="[object Array]",xR="[object Boolean]",FR="[object Date]",IR="[object Error]",V_="[object Function]",UR="[object GeneratorFunction]",QR="[object Map]",TR="[object Number]",K_="[object Object]",DR="[object RegExp]",LR="[object Set]",OR="[object String]",MR="[object Symbol]",NR="[object WeakMap]",PR="[object ArrayBuffer]",HR="[object DataView]",RR="[object Float32Array]",VR="[object Float64Array]",KR="[object Int8Array]",$R="[object Int16Array]",WR="[object Int32Array]",GR="[object Uint8Array]",zR="[object Uint8ClampedArray]",jR="[object Uint16Array]",YR="[object Uint32Array]",qe={};qe[R_]=qe[SR]=qe[PR]=qe[HR]=qe[xR]=qe[FR]=qe[RR]=qe[VR]=qe[KR]=qe[$R]=qe[WR]=qe[QR]=qe[TR]=qe[K_]=qe[DR]=qe[LR]=qe[OR]=qe[MR]=qe[GR]=qe[zR]=qe[jR]=qe[YR]=!0;qe[IR]=qe[V_]=qe[NR]=!1;function Rc(e,t,n,r,a,A){var s,o=t&CR,l=t&kR,c=t&ER;if(n&&(s=a?n(e,r,a,A):n(e)),s!==void 0)return s;if(!il(e))return e;var u=Ws(e);if(u){if(s=VH(e),!o)return ON(e,s)}else{var d=zs(e),f=d==V_||d==UR;if(To(e))return wH(e,o);if(d==K_||d==R_||f&&!a){if(s=l||f?{}:pR(e),!o)return l?FH(e,BH(s,e)):EH(e,vH(s,e))}else{if(!qe[d])return a?e:{};s=hR(e,d,o)}}A||(A=new Xr);var h=A.get(e);if(h)return h;A.set(e,s),_R(e)?e.forEach(function(y){s.add(Rc(y,t,n,y,e,A))}):BR(e)&&e.forEach(function(y,g){s.set(g,Rc(y,t,n,g,e,A))});var p=c?l?IH:Yh:l?am:rm,m=u?void 0:p(e);return NN(m||e,function(y,g){m&&(g=y,y=e[g]),E_(s,g,Rc(y,t,n,g,e,A))}),s}var qR=1,XR=4;function wi(e){return Rc(e,qR|XR)}var JR="__lodash_hash_undefined__";function ZR(e){return this.__data__.set(e,JR),this}function eV(e){return this.__data__.has(e)}function vu(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new YA;++t<n;)this.add(e[t])}vu.prototype.add=vu.prototype.push=ZR;vu.prototype.has=eV;function tV(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function nV(e,t){return e.has(t)}var rV=1,aV=2;function $_(e,t,n,r,a,A){var s=n&rV,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=A.get(e),u=A.get(t);if(c&&u)return c==t&&u==e;var d=-1,f=!0,h=n&aV?new vu:void 0;for(A.set(e,t),A.set(t,e);++d<o;){var p=e[d],m=t[d];if(r)var y=s?r(m,p,d,t,e,A):r(p,m,d,e,t,A);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!tV(t,function(g,v){if(!nV(h,v)&&(p===g||a(p,g,n,r,A)))return h.push(v)})){f=!1;break}}else if(!(p===m||a(p,m,n,r,A))){f=!1;break}}return A.delete(e),A.delete(t),f}function AV(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function sV(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var iV=1,oV=2,lV="[object Boolean]",cV="[object Date]",uV="[object Error]",dV="[object Map]",fV="[object Number]",hV="[object RegExp]",pV="[object Set]",gV="[object String]",mV="[object Symbol]",vV="[object ArrayBuffer]",BV="[object DataView]",XB=qa?qa.prototype:void 0,Ef=XB?XB.valueOf:void 0;function yV(e,t,n,r,a,A,s){switch(n){case BV:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vV:return!(e.byteLength!=t.byteLength||!A(new mu(e),new mu(t)));case lV:case cV:case fV:return Zg(+e,+t);case uV:return e.name==t.name&&e.message==t.message;case hV:case gV:return e==t+"";case dV:var o=AV;case pV:var l=r&iV;if(o||(o=sV),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=oV,s.set(e,t);var u=$_(o(e),o(t),r,a,A,s);return s.delete(e),u;case mV:if(Ef)return Ef.call(e)==Ef.call(t)}return!1}var wV=1,bV=Object.prototype,_V=bV.hasOwnProperty;function CV(e,t,n,r,a,A){var s=n&wV,o=Yh(e),l=o.length,c=Yh(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in t:_V.call(t,f)))return!1}var h=A.get(e),p=A.get(t);if(h&&p)return h==t&&p==e;var m=!0;A.set(e,t),A.set(t,e);for(var y=s;++d<l;){f=o[d];var g=e[f],v=t[f];if(r)var _=s?r(v,g,f,t,e,A):r(g,v,f,e,t,A);if(!(_===void 0?g===v||a(g,v,n,r,A):_)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var B=e.constructor,w=t.constructor;B!=w&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof w=="function"&&w instanceof w)&&(m=!1)}return A.delete(e),A.delete(t),m}var kV=1,JB="[object Arguments]",ZB="[object Array]",Jl="[object Object]",EV=Object.prototype,ey=EV.hasOwnProperty;function SV(e,t,n,r,a,A){var s=Ws(e),o=Ws(t),l=s?ZB:zs(e),c=o?ZB:zs(t);l=l==JB?Jl:l,c=c==JB?Jl:c;var u=l==Jl,d=c==Jl,f=l==c;if(f&&To(e)){if(!To(t))return!1;s=!0,u=!1}if(f&&!u)return A||(A=new Xr),s||nm(e)?$_(e,t,n,r,a,A):yV(e,t,l,n,r,a,A);if(!(n&kV)){var h=u&&ey.call(e,"__wrapped__"),p=d&&ey.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,y=p?t.value():t;return A||(A=new Xr),a(m,y,n,r,A)}}return f?(A||(A=new Xr),CV(e,t,n,r,a,A)):!1}function W_(e,t,n,r,a){return e===t?!0:e==null||t==null||!HA(e)&&!HA(t)?e!==e&&t!==t:SV(e,t,n,r,W_,a)}var xV="[object Map]",FV="[object Set]",IV=Object.prototype,UV=IV.hasOwnProperty;function QV(e){if(e==null)return!0;if(em(e)&&(Ws(e)||typeof e=="string"||typeof e.splice=="function"||To(e)||nm(e)||F_(e)))return!e.length;var t=zs(e);if(t==xV||t==FV)return!e.size;if(sd(e))return!D_(e).length;for(var n in e)if(UV.call(e,n))return!1;return!0}function ty(e,t){return W_(e,t)}var TV=Object.defineProperty,DV=Object.defineProperties,LV=Object.getOwnPropertyDescriptors,ny=Object.getOwnPropertySymbols,OV=Object.prototype.hasOwnProperty,MV=Object.prototype.propertyIsEnumerable,ry=(e,t,n)=>t in e?TV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NV=(e,t)=>{for(var n in t||(t={}))OV.call(t,n)&&ry(e,n,t[n]);if(ny)for(var n of ny(t))MV.call(t,n)&&ry(e,n,t[n]);return e},PV=(e,t)=>DV(e,LV(t));function HV(e){return(e.match(/[a-zA-Z0-9]+/g)||[]).map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join("")}var sA=(e,t)=>{const n={chartData:{type:Object,required:!0},options:{type:Object,required:!1},chartId:{default:e,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=HV(e);return i.defineComponent({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":a=>!0,"chart:destroy":()=>!0,"chart:render":a=>!0},setup(a,{emit:A,expose:s}){const o=i.ref(null),l=`${a.chartId}`;let c=i.shallowRef(null);i.watch(()=>a.chartData,u,{deep:!0}),i.watch(()=>a.options,y=>{c.value&&y&&(c.value.options=wi(y),p())},{deep:!0});function u(y){if(c.value){let g=c.value;ty(y.labels,c.value.data.labels)||(g.data.labels=y.labels,f()),ty(y.datasets,c.value.data.datasets)||y.datasets.forEach((v,_)=>{var B,w;if(QV(v))g.data.datasets=[];else{const b=wi(g.data),C=Object.keys((w=(B=b.datasets)==null?void 0:B[_])!=null?w:{}),E=Object.keys(v);C.filter(T=>T!=="_meta"&&E.indexOf(T)===-1).forEach(T=>{g.data.datasets[_]&&delete g.data.datasets[_][T]});for(const T in v){const U=wi(v[T]);g.data.datasets[_]||(g.data.datasets[_]={}),v.hasOwnProperty(T)&&U!=null&&g&&(g.data.datasets[_][T]=U)}}}),p()}else c.value&&m(),d()}function d(){o.value?(c.value=new Oe(o.value,{data:wi(a.chartData),type:t,options:wi(a.options),plugins:a.plugins}),h()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function f(){A("labels:update"),a.onLabelsUpdate&&a.onLabelsUpdate()}function h(){c.value&&(A("chart:render",c.value),a.onChartRender&&a.onChartRender(c.value))}function p(){c.value&&(c.value.update(),A("chart:update",c.value),a.onChartUpdate&&a.onChartUpdate(c.value))}function m(){c.value&&c.value.destroy(),A("chart:destroy"),a.onChartDestroy&&a.onChartDestroy()}return i.onMounted(d),i.onBeforeUnmount(()=>{c.value&&c.value.destroy()}),s({canvasRef:o,renderChart:d,chartInstance:c,canvasId:l,update:p}),()=>i.h("div",{style:PV(NV({maxWidth:"100%"},a.styles),{position:"relative"}),class:a.cssClasses},[i.h("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},id:l,width:a.width,height:a.height,ref:o})])}})},ld=sA("bar-chart","bar"),cd=sA("doughnut-chart","doughnut"),G_=sA("line-chart","line");sA("pie-chart","pie");sA("polar-chart","polarArea");sA("radar-chart","radar");sA("bubble-chart","bubble");sA("scatter-chart","scatter");const Bu=i.defineComponent({__name:"InfoDoughnutChart",props:ZD,setup(e){const t=e,n=i.ref(null);Oe.register(...kr);const r=i.computed(()=>{const A=t.info==="typeRef"?"types":"rarities",s={},o=Ft(t.deckCode);for(const c in o){const u=qt().cardJsonObject[c];if(u===void 0)continue;let d=u[t.info];d==="Unit"&&(d=u.supertype==="Champion"?"Champion":"Follower"),s[d]===void 0&&(s[d]=0),s[d]+=o[c]}const l=[];for(const c in s){const u=we().dataJson[A].find(f=>f.nameRef===c),d={key:c,value:s[c],color:u==null?void 0:u.color,name:u==null?void 0:u.name,order:u==null?void 0:u.order};l.push(d)}return console.log(l),l.sort((c,u)=>c.order-u.order),{labels:l.map(c=>c.name),datasets:[{data:l.map(c=>c.value),backgroundColor:l.map(c=>c.color)}]}}),a={cutout:55,layout:{padding:{top:10,bottom:10}},elements:{arc:{borderWidth:0}},plugins:{legend:{display:!0,position:"right",labels:{usePointStyle:!0,generateLabels(A){const s=[],o=A.data.labels;for(let l=0;l<A.data.labels.length;l++)s.push({text:`${o[l]} (${A.data.datasets[0].data[l]})`,borderRadius:999,datasetIndex:0,index:l,fontColor:Va("--color-0"),fillStyle:A.data.datasets[0].backgroundColor[l]});return s}}},datalabels:{display:!1}}};return(A,s)=>(i.openBlock(),i.createBlock(i.unref(cd),{ref_key:"chart",ref:n,"chart-data":r.value,options:a},null,8,["chart-data"]))}}),RV={deck:{type:Object,required:!1,default:void 0},deckCode:{type:String,required:!1,default:void 0},paddingTop:{type:Number,required:!1,default:10},showDataLabels:{type:Boolean,required:!1,default:!0},dataLabelsOffset:{type:Number,required:!1,default:-10},tooltipsEnabled:{type:Boolean,required:!1,default:!0},displayXScale:{type:Boolean,required:!1,default:!0},animation:{type:Boolean,required:!1}};//! moment.js
827
+ `):e}function C9(e,t){const{element:n,datasetIndex:r,index:a}=t,A=e.getDatasetMeta(r).controller,{label:s,value:o}=A.getLabelAndValue(a);return{chart:e,label:s,parsed:A.getParsed(a),raw:e.data.datasets[r].data[a],formattedValue:o,dataset:A.getDataset(),dataIndex:a,datasetIndex:r,element:n}}function gB(e,t){const n=e.chart.ctx,{body:r,footer:a,title:A}=e,{boxWidth:s,boxHeight:o}=t,l=ht(t.bodyFont),c=ht(t.titleFont),u=ht(t.footerFont),d=A.length,f=a.length,h=r.length,p=kt(t.padding);let m=p.height,y=0,g=r.reduce((B,w)=>B+w.before.length+w.lines.length+w.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),g){const B=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;m+=h*B+(g-h)*l.lineHeight+(g-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const _=function(B){y=Math.max(y,n.measureText(B).width+v)};return n.save(),n.font=c.string,Ke(e.title,_),n.font=l.string,Ke(e.beforeBody.concat(e.afterBody),_),v=t.displayColors?s+2+t.boxPadding:0,Ke(r,B=>{Ke(B.before,_),Ke(B.lines,_),Ke(B.after,_)}),v=0,n.font=u.string,Ke(e.footer,_),n.restore(),y+=p.width,{width:y,height:m}}function k9(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function E9(e,t,n,r){const{x:a,width:A}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&a+A+s>t.width||e==="right"&&a-A-s<0)return!0}function S9(e,t,n,r){const{x:a,width:A}=n,{width:s,chartArea:{left:o,right:l}}=e;let c="center";return r==="center"?c=a<=(o+l)/2?"left":"right":a<=A/2?c="left":a>=s-A/2&&(c="right"),E9(c,e,t,n)&&(c="center"),c}function mB(e,t,n){const r=n.yAlign||t.yAlign||k9(e,n);return{xAlign:n.xAlign||t.xAlign||S9(e,t,n,r),yAlign:r}}function x9(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function F9(e,t,n){let{y:r,height:a}=e;return t==="top"?r+=n:t==="bottom"?r-=a+n:r-=a/2,r}function vB(e,t,n,r){const{caretSize:a,caretPadding:A,cornerRadius:s}=e,{xAlign:o,yAlign:l}=n,c=a+A,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Oa(s);let p=x9(t,o);const m=F9(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+a:o==="right"&&(p+=Math.max(d,h)+a),{x:Pt(p,0,r.width-t.width),y:Pt(m,0,r.height-t.height)}}function ql(e,t,n){const r=kt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function BB(e){return cr([],Pr(e))}function I9(e,t,n){return AA(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function yB(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const y_={beforeTitle:Tr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Tr,beforeBody:Tr,beforeLabel:Tr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return _e(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Tr,afterBody:Tr,beforeFooter:Tr,footer:Tr,afterFooter:Tr};function on(e,t,n,r){const a=e[t].call(n,r);return typeof a>"u"?y_[t].call(n,r):a}class Vh extends An{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 n=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&n.options.animation&&r.animations,A=new Yg(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(A)),A}getContext(){return this.$context||(this.$context=I9(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,a=on(r,"beforeTitle",this,t),A=on(r,"title",this,t),s=on(r,"afterTitle",this,t);let o=[];return o=cr(o,Pr(a)),o=cr(o,Pr(A)),o=cr(o,Pr(s)),o}getBeforeBody(t,n){return BB(on(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,a=[];return Ke(t,A=>{const s={before:[],lines:[],after:[]},o=yB(r,A);cr(s.before,Pr(on(o,"beforeLabel",this,A))),cr(s.lines,on(o,"label",this,A)),cr(s.after,Pr(on(o,"afterLabel",this,A))),a.push(s)}),a}getAfterBody(t,n){return BB(on(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,a=on(r,"beforeFooter",this,t),A=on(r,"footer",this,t),s=on(r,"afterFooter",this,t);let o=[];return o=cr(o,Pr(a)),o=cr(o,Pr(A)),o=cr(o,Pr(s)),o}_createItems(t){const n=this._active,r=this.chart.data,a=[],A=[],s=[];let o=[],l,c;for(l=0,c=n.length;l<c;++l)o.push(C9(this.chart,n[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Ke(o,u=>{const d=yB(t.callbacks,u);a.push(on(d,"labelColor",this,u)),A.push(on(d,"labelPointStyle",this,u)),s.push(on(d,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=A,this.labelTextColors=s,this.dataPoints=o,o}update(t,n){const r=this.options.setContext(this.getContext()),a=this._active;let A,s=[];if(!a.length)this.opacity!==0&&(A={opacity:0});else{const o=Qi[r.position].call(this,a,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=gB(this,r),c=Object.assign({},o,l),u=mB(this.chart,r,c),d=vB(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,A={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,A&&this._resolveAnimations().update(this,A),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,a){const A=this.getCaretPosition(t,r,a);n.lineTo(A.x1,A.y1),n.lineTo(A.x2,A.y2),n.lineTo(A.x3,A.y3)}getCaretPosition(t,n,r){const{xAlign:a,yAlign:A}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Oa(o),{x:f,y:h}=t,{width:p,height:m}=n;let y,g,v,_,B,w;return A==="center"?(B=h+m/2,a==="left"?(y=f,g=y-s,_=B+s,w=B-s):(y=f+p,g=y+s,_=B-s,w=B+s),v=y):(a==="left"?g=f+Math.max(l,u)+s:a==="right"?g=f+p-Math.max(c,d)-s:g=this.caretX,A==="top"?(_=h,B=_-s,y=g-s,v=g+s):(_=h+m,B=_+s,y=g+s,v=g-s),w=_),{x1:y,x2:g,x3:v,y1:_,y2:B,y3:w}}drawTitle(t,n,r){const a=this.title,A=a.length;let s,o,l;if(A){const c=ks(r.rtl,this.x,this.width);for(t.x=ql(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=ht(r.titleFont),o=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<A;++l)n.fillText(a[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===A&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,n,r,a,A){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=A,u=ht(A.bodyFont),d=ql(this,"left",A),f=a.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+h;if(A.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},y=a.leftForLtr(f,c)+c/2,g=p+l/2;t.strokeStyle=A.multiKeyBackground,t.fillStyle=A.multiKeyBackground,Lh(t,m,y,g),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Lh(t,m,y,g)}else{t.lineWidth=ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const m=a.leftForLtr(f,c),y=a.leftForLtr(a.xPlus(f,1),c-2),g=Oa(s.borderRadius);Object.values(g).some(v=>v!==0)?(t.beginPath(),t.fillStyle=A.multiKeyBackground,Vs(t,{x:m,y:p,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Vs(t,{x:y,y:p+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=A.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:a}=this,{bodySpacing:A,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ht(r.bodyFont);let f=d.lineHeight,h=0;const p=ks(r.rtl,this.x,this.width),m=function(E){n.fillText(E,p.x(t.x+h),t.y+f/2),t.y+=f+A},y=p.textAlign(s);let g,v,_,B,w,b,C;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=ql(this,y,r),n.fillStyle=r.bodyColor,Ke(this.beforeBody,m),h=o&&y!=="right"?s==="center"?c/2+u:c+2+u:0,B=0,b=a.length;B<b;++B){for(g=a[B],v=this.labelTextColors[B],n.fillStyle=v,Ke(g.before,m),_=g.lines,o&&_.length&&(this._drawColorBox(n,t,B,p,r),f=Math.max(d.lineHeight,l)),w=0,C=_.length;w<C;++w)m(_[w]),f=d.lineHeight;Ke(g.after,m)}h=0,f=d.lineHeight,Ke(this.afterBody,m),t.y-=A}drawFooter(t,n,r){const a=this.footer,A=a.length;let s,o;if(A){const l=ks(r.rtl,this.x,this.width);for(t.x=ql(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=ht(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,o=0;o<A;++o)n.fillText(a[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,a){const{xAlign:A,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Oa(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(o+d,l),s==="top"&&this.drawCaret(t,n,r,a),n.lineTo(o+c-f,l),n.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&A==="right"&&this.drawCaret(t,n,r,a),n.lineTo(o+c,l+u-p),n.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,n,r,a),n.lineTo(o+h,l+u),n.quadraticCurveTo(o,l+u,o,l+u-h),s==="center"&&A==="left"&&this.drawCaret(t,n,r,a),n.lineTo(o,l+d),n.quadraticCurveTo(o,l,o+d,l),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,a=r&&r.x,A=r&&r.y;if(a||A){const s=Qi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=gB(this,t),l=Object.assign({},s,this._size),c=mB(n,t,l),u=vB(t,l,c,n);(a._to!==u.x||A._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},A={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=kt(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(A,t,a,n),jb(t,n.textDirection),A.y+=s.top,this.drawTitle(A,t,n),this.drawBody(A,t,n),this.drawFooter(A,t,n),Yb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,a=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),A=!ou(r,a),s=this._positionChanged(a,n);(A||s)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,A=this._active||[],s=this._getActiveElements(t,A,n,r),o=this._positionChanged(s,t),l=n||!ou(s,A)||o;return l&&(this._active=s,(a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,a){const A=this.options;if(t.type==="mouseout")return[];if(!a)return n;const s=this.chart.getElementsAtEventForMode(t,A.mode,A,r);return A.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:a,options:A}=this,s=Qi[A.position].call(this,t,n);return s!==!1&&(r!==s.x||a!==s.y)}}R(Vh,"positioners",Qi);var U9={id:"tooltip",_element:Vh,positioners:Qi,afterInit(e,t,n){n&&(e.tooltip=new Vh({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:y_},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Q9=Object.freeze({__proto__:null,Colors:$7,Decimation:j7,Filler:h9,Legend:y9,SubTitle:_9,Title:b9,Tooltip:U9});const T9=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function D9(e,t,n,r){const a=e.indexOf(t);if(a===-1)return T9(e,t,n,r);const A=e.lastIndexOf(t);return a!==A?n:a}const L9=(e,t)=>e===null?null:Pt(Math.round(e),0,t);function wB(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Kh extends GA{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:a,label:A}of n)r[a]===A&&r.splice(a,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(_e(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:D9(r,t,de(n,t),this._addedLabels),L9(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,a=[];let A=this.getLabels();A=t===0&&n===A.length-1?A:A.slice(t,n+1),this._valueRange=Math.max(A.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)a.push({value:s});return a}getLabelForValue(t){return wB.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Kh,"id","category"),R(Kh,"defaults",{ticks:{callback:wB}});function O9(e,t){const n=[],{bounds:a,step:A,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=A||1,p=u-1,{min:m,max:y}=t,g=!_e(s),v=!_e(o),_=!_e(c),B=(y-m)/(d+1);let w=pv((y-m)/p/h)*h,b,C,E,S;if(w<1e-14&&!g&&!v)return[{value:m},{value:y}];S=Math.ceil(y/w)-Math.floor(m/w),S>p&&(w=pv(S*w/p/h)*h),_e(l)||(b=Math.pow(10,l),w=Math.ceil(w*b)/b),a==="ticks"?(C=Math.floor(m/w)*w,E=Math.ceil(y/w)*w):(C=m,E=y),g&&v&&A&&UL((o-s)/A,w/1e3)?(S=Math.round(Math.min((o-s)/w,u)),w=(o-s)/S,C=s,E=o):_?(C=g?s:C,E=v?o:E,S=c-1,w=(E-C)/S):(S=(E-C)/w,Xi(S,Math.round(S),w/1e3)?S=Math.round(S):S=Math.ceil(S));const T=Math.max(gv(w),gv(C));b=Math.pow(10,_e(l)?T:l),C=Math.round(C*b)/b,E=Math.round(E*b)/b;let U=0;for(g&&(f&&C!==s?(n.push({value:s}),C<s&&U++,Xi(Math.round((C+U*w)*b)/b,s,bB(s,B,e))&&U++):C<s&&U++);U<S;++U){const F=Math.round((C+U*w)*b)/b;if(v&&F>o)break;n.push({value:F})}return v&&f&&E!==o?n.length&&Xi(n[n.length-1].value,o,bB(o,B,e))?n[n.length-1].value=o:n.push({value:o}):(!v||E===o)&&n.push({value:E}),n}function bB(e,t,{horizontal:n,minRotation:r}){const a=St(r),A=(n?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/A,s)}class gu extends GA{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return _e(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:a,max:A}=this;const s=l=>a=n?a:l,o=l=>A=r?A:l;if(t){const l=Br(a),c=Br(A);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(a===A){let l=A===0?1:Math.abs(A*.05);o(A+l),t||s(a-l)}this.min=a,this.max=A}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},A=this._range||this,s=O9(a,A);return t.bounds==="ticks"&&Ib(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const a=(r-n)/Math.max(t.length-1,1)/2;n-=a,r+=a}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return nl(t,this.chart.options.locale,this.options.ticks.format)}}class $h extends gu{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=St(this.options.ticks.minRotation),a=(t?Math.sin(r):Math.cos(r))||.001,A=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,A.lineHeight/a))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R($h,"id","linear"),R($h,"defaults",{ticks:{callback:nd.formatters.numeric}});const Uo=e=>Math.floor(Sa(e)),cA=(e,t)=>Math.pow(10,Uo(e)+t);function _B(e){return e/Math.pow(10,Uo(e))===1}function CB(e,t,n){const r=Math.pow(10,n),a=Math.floor(e/r);return Math.ceil(t/r)-a}function M9(e,t){const n=t-e;let r=Uo(n);for(;CB(e,t,r)>10;)r++;for(;CB(e,t,r)<10;)r--;return Math.min(r,Uo(e))}function N9(e,{min:t,max:n}){t=bn(e.min,t);const r=[],a=Uo(t);let A=M9(t,n),s=A<0?Math.pow(10,Math.abs(A)):1;const o=Math.pow(10,A),l=a>A?Math.pow(10,a):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,A)),f=bn(e.min,Math.round((l+u+d*Math.pow(10,A))*s)/s);for(;f<n;)r.push({value:f,major:_B(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(A++,d=2,s=A>=0?1:s),f=Math.round((l+u+d*Math.pow(10,A))*s)/s;const h=bn(e.max,f);return r.push({value:h,major:_B(h),significand:d}),r}class Wh extends GA{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=gu.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return dt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===cA(this.min,0)?cA(this.min,-1):cA(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,a=this.max;const A=o=>r=t?r:o,s=o=>a=n?a:o;r===a&&(r<=0?(A(1),s(10)):(A(cA(r,-1)),s(cA(a,1)))),r<=0&&A(cA(a,-1)),a<=0&&s(cA(r,1)),this.min=r,this.max=a}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=N9(n,this);return t.bounds==="ticks"&&Ib(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":nl(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Sa(t),this._valueRange=Sa(this.max)-Sa(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Sa(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Wh,"id","logarithmic"),R(Wh,"defaults",{ticks:{callback:nd.formatters.logarithmic,major:{enabled:!0}}});function Gh(e){const t=e.ticks;if(t.display&&e.display){const n=kt(t.backdropPadding);return de(t.font&&t.font.size,ft.font.size)+n.height}return 0}function P9(e,t,n){return n=Me(n)?n:[n],{w:jL(e,t.string,n),h:n.length*t.lineHeight}}function kB(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:e<r||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function H9(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],a=[],A=e._pointLabels.length,s=e.options.pointLabels,o=s.centerPointLabels?Te/A:0;for(let l=0;l<A;l++){const c=s.setContext(e.getPointLabelContext(l));a[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+a[l],o),d=ht(c.font),f=P9(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Cn(e.getIndexAngle(l)+o),p=Math.round(td(h)),m=kB(p,u.x,f.w,0,180),y=kB(p,u.y,f.h,90,270);R9(n,t,h,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=$9(e,r,a)}function R9(e,t,n,r,a){const A=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/A,e.l=Math.min(e.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/A,e.r=Math.max(e.r,t.r+o)),a.start<t.t?(l=(t.t-a.start)/s,e.t=Math.min(e.t,t.t-l)):a.end>t.b&&(l=(a.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function V9(e,t,n){const r=e.drawingArea,{extra:a,additionalAngle:A,padding:s,size:o}=n,l=e.getPointPosition(t,r+a+s,A),c=Math.round(td(Cn(l.angle+Ze))),u=z9(l.y,o.h,c),d=W9(c),f=G9(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function K9(e,t){if(!t)return!0;const{left:n,top:r,right:a,bottom:A}=e;return!(zr({x:n,y:r},t)||zr({x:n,y:A},t)||zr({x:a,y:r},t)||zr({x:a,y:A},t))}function $9(e,t,n){const r=[],a=e._pointLabels.length,A=e.options,{centerPointLabels:s,display:o}=A.pointLabels,l={extra:Gh(A)/2,additionalAngle:s?Te/a:0};let c;for(let u=0;u<a;u++){l.padding=n[u],l.size=t[u];const d=V9(e,u,l);r.push(d),o==="auto"&&(d.visible=K9(d,c),d.visible&&(c=d))}return r}function W9(e){return e===0||e===180?"center":e<180?"left":"right"}function G9(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function z9(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function j9(e,t,n){const{left:r,top:a,right:A,bottom:s}=n,{backdropColor:o}=t;if(!_e(o)){const l=Oa(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=o;const u=r-c.left,d=a-c.top,f=A-r+c.width,h=s-a+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Vs(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function Y9(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let a=t-1;a>=0;a--){const A=e._pointLabelItems[a];if(!A.visible)continue;const s=r.setContext(e.getPointLabelContext(a));j9(n,s,A);const o=ht(s.font),{x:l,y:c,textAlign:u}=A;PA(n,e._pointLabels[a],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function w_(e,t,n,r){const{ctx:a}=e;if(n)a.arc(e.xCenter,e.yCenter,t,0,Je);else{let A=e.getPointPosition(0,t);a.moveTo(A.x,A.y);for(let s=1;s<r;s++)A=e.getPointPosition(s,t),a.lineTo(A.x,A.y)}}function q9(e,t,n,r,a){const A=e.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||n<0||(A.save(),A.strokeStyle=o,A.lineWidth=l,A.setLineDash(a.dash),A.lineDashOffset=a.dashOffset,A.beginPath(),w_(e,n,s,r),A.closePath(),A.stroke(),A.restore())}function X9(e,t,n){return AA(e,{label:n,index:t,type:"pointLabel"})}class Ti extends gu{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=kt(Gh(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=dt(t)&&!isNaN(t)?t:0,this.max=dt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gh(this.options))}generateTickLabels(t){gu.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const a=Re(this.options.pointLabels.callback,[n,r],this);return a||a===0?a:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?H9(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,a){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,a))}getIndexAngle(t){const n=Je/(this._pointLabels.length||1),r=this.options.startAngle||0;return Cn(t*n+St(r))}getDistanceFromCenterForValue(t){if(_e(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(_e(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return X9(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const a=this.getIndexAngle(t)-Ze+r;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:a,bottom:A}=this._pointLabelItems[t];return{left:n,top:r,right:a,bottom:A}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),w_(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:a,border:A}=n,s=this._pointLabels.length;let o,l,c;if(n.pointLabels.display&&Y9(this,s),a.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=a.setContext(f),p=A.setContext(f);q9(this,h,l,s,p)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const a=this.getIndexAngle(0);let A,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(a),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ht(c.font);if(A=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=kt(c.backdropPadding);t.fillRect(-s/2-d.left,-A-u.size/2-d.top,s+d.width,u.size+d.height)}PA(t,o.label,0,-A,u,{color:c.color})}),t.restore()}drawTitle(){}}R(Ti,"id","radialLinear"),R(Ti,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(Ti,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(Ti,"descriptors",{angleLines:{_fallback:"grid"}});const ad={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}},pn=Object.keys(ad);function J9(e,t){return e-t}function EB(e,t){if(_e(t))return null;const n=e._adapter,{parser:r,round:a,isoWeekday:A}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),dt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(a&&(s=a==="week"&&(Ya(A)||A===!0)?n.startOf(s,"isoWeek",A):n.startOf(s,a)),+s)}function SB(e,t,n,r){const a=pn.length;for(let A=pn.indexOf(e);A<a-1;++A){const s=ad[pn[A]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(o*s.size))<=r)return pn[A]}return pn[a-1]}function Z9(e,t,n,r,a){for(let A=pn.length-1;A>=pn.indexOf(n);A--){const s=pn[A];if(ad[s].common&&e._adapter.diff(a,r,s)>=t-1)return s}return pn[n?pn.indexOf(n):0]}function eN(e){for(let t=pn.indexOf(e)+1,n=pn.length;t<n;++t)if(ad[pn[t]].common)return pn[t]}function xB(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:a}=Rg(n,t),A=n[r]>=t?n[r]:n[a];e[A]=!0}}function tN(e,t,n,r){const a=e._adapter,A=+a.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=A;o<=s;o=+a.add(o,1,r))l=n[o],l>=0&&(t[l].major=!0);return t}function FB(e,t,n){const r=[],a={},A=t.length;let s,o;for(s=0;s<A;++s)o=t[s],a[o]=s,r.push({value:o,major:!1});return A===0||!n?r:tN(e,r,a,n)}class Qo extends GA{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),a=this._adapter=new t_._date(t.adapters.date);a.init(n),qi(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:EB(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:a,max:A,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(a=Math.min(a,c.min)),!o&&!isNaN(c.max)&&(A=Math.max(A,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),a=dt(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),A=dt(A)&&!isNaN(A)?A:+n.endOf(Date.now(),r)+1,this.min=Math.min(a,A-1),this.max=Math.max(a+1,A)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const A=this.min,s=this.max,o=LL(a,A,s);return this._unit=n.unit||(r.autoSkip?SB(n.minUnit,this.min,this.max,this._getLabelCapacity(A)):Z9(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:eN(this._unit),this.initOffsets(a),t.reverse&&o.reverse(),FB(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,a,A;this.options.offset&&t.length&&(a=this.getDecimalForValue(t[0]),t.length===1?n=1-a:n=(this.getDecimalForValue(t[1])-a)/2,A=this.getDecimalForValue(t[t.length-1]),t.length===1?r=A:r=(A-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Pt(n,0,s),r=Pt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,a=this.options,A=a.time,s=A.unit||SB(A.minUnit,n,r,this._getLabelCapacity(n)),o=de(a.ticks.stepSize,1),l=s==="week"?A.isoWeekday:!1,c=Ya(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*o)throw new Error(n+" and "+r+" are too far apart with stepSize of "+o+" "+s);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,o,s),h++)xB(u,f,p);return(f===r||a.bounds==="ticks"||h===1)&&xB(u,f,p),Object.keys(u).sort((m,y)=>m-y).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const a=this.options.time.displayFormats,A=this._unit,s=n||a[A];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,a){const A=this.options,s=A.ticks.callback;if(s)return Re(s,[t,n,r],this);const o=A.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,a||(h?d:u))}generateTickLabels(t){let n,r,a;for(n=0,r=t.length;n<r;++n)a=t[n],a.label=this._tickFormatFunction(a.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,a=St(this.isHorizontal()?n.maxRotation:n.minRotation),A=Math.cos(a),s=Math.sin(a),o=this._resolveTickFontOptions(0).size;return{w:r*A+o*s,h:r*s+o*A}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,a=r[n.unit]||r.millisecond,A=this._tickFormatFunction(t,0,FB(this,[t],this._majorUnit),a),s=this._getLabelSize(A),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,r=a.length;n<r;++n)t=t.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const a=this.getLabels();for(n=0,r=a.length;n<r;++n)t.push(EB(this,a[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Tb(t.sort(J9))}}R(Qo,"id","time"),R(Qo,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Xl(e,t,n){let r=0,a=e.length-1,A,s,o,l;n?(t>=e[r].pos&&t<=e[a].pos&&({lo:r,hi:a}=Gr(e,"pos",t)),{pos:A,time:o}=e[r],{pos:s,time:l}=e[a]):(t>=e[r].time&&t<=e[a].time&&({lo:r,hi:a}=Gr(e,"time",t)),{time:A,pos:o}=e[r],{time:s,pos:l}=e[a]);const c=s-A;return c?o+(l-o)*(t-A)/c:o}class zh extends Qo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Xl(n,this.min),this._tableRange=Xl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,a=[],A=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=n&&c<=r&&a.push(c);if(a.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,o=a.length;s<o;++s)u=a[s+1],l=a[s-1],c=a[s],Math.round((u+l)/2)!==c&&A.push({time:c,pos:s/(o-1)});return A}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Xl(this._table,r*this._tableRange+this._minPos,!0)}}R(zh,"id","timeseries"),R(zh,"defaults",Qo.defaults);var nN=Object.freeze({__proto__:null,CategoryScale:Kh,LinearScale:$h,LogarithmicScale:Wh,RadialLinearScale:Ti,TimeScale:Qo,TimeSeriesScale:zh});const kr=[lM,N7,Q9,nN];var rN=typeof global=="object"&&global&&global.Object===Object&&global;const b_=rN;var aN=typeof self=="object"&&self&&self.Object===Object&&self,AN=b_||aN||Function("return this")();const Er=AN;var sN=Er.Symbol;const qa=sN;var __=Object.prototype,iN=__.hasOwnProperty,oN=__.toString,yi=qa?qa.toStringTag:void 0;function lN(e){var t=iN.call(e,yi),n=e[yi];try{e[yi]=void 0;var r=!0}catch{}var a=oN.call(e);return r&&(t?e[yi]=n:delete e[yi]),a}var cN=Object.prototype,uN=cN.toString;function dN(e){return uN.call(e)}var fN="[object Null]",hN="[object Undefined]",IB=qa?qa.toStringTag:void 0;function sl(e){return e==null?e===void 0?hN:fN:IB&&IB in Object(e)?lN(e):dN(e)}function HA(e){return e!=null&&typeof e=="object"}var pN=Array.isArray;const Ws=pN;function il(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gN="[object AsyncFunction]",mN="[object Function]",vN="[object GeneratorFunction]",BN="[object Proxy]";function C_(e){if(!il(e))return!1;var t=sl(e);return t==mN||t==vN||t==gN||t==BN}var yN=Er["__core-js_shared__"];const Cf=yN;var UB=function(){var e=/[^.]+$/.exec(Cf&&Cf.keys&&Cf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wN(e){return!!UB&&UB in e}var bN=Function.prototype,_N=bN.toString;function zA(e){if(e!=null){try{return _N.call(e)}catch{}try{return e+""}catch{}}return""}var CN=/[\\^$.*+?()[\]{}|]/g,kN=/^\[object .+?Constructor\]$/,EN=Function.prototype,SN=Object.prototype,xN=EN.toString,FN=SN.hasOwnProperty,IN=RegExp("^"+xN.call(FN).replace(CN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UN(e){if(!il(e)||wN(e))return!1;var t=C_(e)?IN:kN;return t.test(zA(e))}function QN(e,t){return e==null?void 0:e[t]}function jA(e,t){var n=QN(e,t);return UN(n)?n:void 0}var TN=jA(Er,"WeakMap");const jh=TN;var QB=Object.create,DN=function(){function e(){}return function(t){if(!il(t))return{};if(QB)return QB(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const LN=DN;function ON(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var MN=function(){try{var e=jA(Object,"defineProperty");return e({},"",{}),e}catch{}}();const TB=MN;function NN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var PN=9007199254740991,HN=/^(?:0|[1-9]\d*)$/;function RN(e,t){var n=typeof e;return t=t??PN,!!t&&(n=="number"||n!="symbol"&&HN.test(e))&&e>-1&&e%1==0&&e<t}function k_(e,t,n){t=="__proto__"&&TB?TB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zg(e,t){return e===t||e!==e&&t!==t}var VN=Object.prototype,KN=VN.hasOwnProperty;function E_(e,t,n){var r=e[t];(!(KN.call(e,t)&&Zg(r,n))||n===void 0&&!(t in e))&&k_(e,t,n)}function Ad(e,t,n,r){var a=!n;n||(n={});for(var A=-1,s=t.length;++A<s;){var o=t[A],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),a?k_(n,o,l):E_(n,o,l)}return n}var $N=9007199254740991;function S_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$N}function em(e){return e!=null&&S_(e.length)&&!C_(e)}var WN=Object.prototype;function sd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WN;return e===n}function GN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var zN="[object Arguments]";function DB(e){return HA(e)&&sl(e)==zN}var x_=Object.prototype,jN=x_.hasOwnProperty,YN=x_.propertyIsEnumerable,qN=DB(function(){return arguments}())?DB:function(e){return HA(e)&&jN.call(e,"callee")&&!YN.call(e,"callee")};const F_=qN;function XN(){return!1}var I_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,LB=I_&&typeof module=="object"&&module&&!module.nodeType&&module,JN=LB&&LB.exports===I_,OB=JN?Er.Buffer:void 0,ZN=OB?OB.isBuffer:void 0,eP=ZN||XN;const To=eP;var tP="[object Arguments]",nP="[object Array]",rP="[object Boolean]",aP="[object Date]",AP="[object Error]",sP="[object Function]",iP="[object Map]",oP="[object Number]",lP="[object Object]",cP="[object RegExp]",uP="[object Set]",dP="[object String]",fP="[object WeakMap]",hP="[object ArrayBuffer]",pP="[object DataView]",gP="[object Float32Array]",mP="[object Float64Array]",vP="[object Int8Array]",BP="[object Int16Array]",yP="[object Int32Array]",wP="[object Uint8Array]",bP="[object Uint8ClampedArray]",_P="[object Uint16Array]",CP="[object Uint32Array]",at={};at[gP]=at[mP]=at[vP]=at[BP]=at[yP]=at[wP]=at[bP]=at[_P]=at[CP]=!0;at[tP]=at[nP]=at[hP]=at[rP]=at[pP]=at[aP]=at[AP]=at[sP]=at[iP]=at[oP]=at[lP]=at[cP]=at[uP]=at[dP]=at[fP]=!1;function kP(e){return HA(e)&&S_(e.length)&&!!at[sl(e)]}function tm(e){return function(t){return e(t)}}var U_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ro=U_&&typeof module=="object"&&module&&!module.nodeType&&module,EP=ro&&ro.exports===U_,kf=EP&&b_.process,SP=function(){try{var e=ro&&ro.require&&ro.require("util").types;return e||kf&&kf.binding&&kf.binding("util")}catch{}}();const Gs=SP;var MB=Gs&&Gs.isTypedArray,xP=MB?tm(MB):kP;const nm=xP;var FP=Object.prototype,IP=FP.hasOwnProperty;function Q_(e,t){var n=Ws(e),r=!n&&F_(e),a=!n&&!r&&To(e),A=!n&&!r&&!a&&nm(e),s=n||r||a||A,o=s?GN(e.length,String):[],l=o.length;for(var c in e)(t||IP.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||A&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||RN(c,l)))&&o.push(c);return o}function T_(e,t){return function(n){return e(t(n))}}var UP=T_(Object.keys,Object);const QP=UP;var TP=Object.prototype,DP=TP.hasOwnProperty;function D_(e){if(!sd(e))return QP(e);var t=[];for(var n in Object(e))DP.call(e,n)&&n!="constructor"&&t.push(n);return t}function rm(e){return em(e)?Q_(e):D_(e)}function LP(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OP=Object.prototype,MP=OP.hasOwnProperty;function NP(e){if(!il(e))return LP(e);var t=sd(e),n=[];for(var r in e)r=="constructor"&&(t||!MP.call(e,r))||n.push(r);return n}function am(e){return em(e)?Q_(e,!0):NP(e)}var PP=jA(Object,"create");const Do=PP;function HP(){this.__data__=Do?Do(null):{},this.size=0}function RP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VP="__lodash_hash_undefined__",KP=Object.prototype,$P=KP.hasOwnProperty;function WP(e){var t=this.__data__;if(Do){var n=t[e];return n===VP?void 0:n}return $P.call(t,e)?t[e]:void 0}var GP=Object.prototype,zP=GP.hasOwnProperty;function jP(e){var t=this.__data__;return Do?t[e]!==void 0:zP.call(t,e)}var YP="__lodash_hash_undefined__";function qP(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Do&&t===void 0?YP:t,this}function RA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}RA.prototype.clear=HP;RA.prototype.delete=RP;RA.prototype.get=WP;RA.prototype.has=jP;RA.prototype.set=qP;function XP(){this.__data__=[],this.size=0}function id(e,t){for(var n=e.length;n--;)if(Zg(e[n][0],t))return n;return-1}var JP=Array.prototype,ZP=JP.splice;function eH(e){var t=this.__data__,n=id(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ZP.call(t,n,1),--this.size,!0}function tH(e){var t=this.__data__,n=id(t,e);return n<0?void 0:t[n][1]}function nH(e){return id(this.__data__,e)>-1}function rH(e,t){var n=this.__data__,r=id(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function oa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}oa.prototype.clear=XP;oa.prototype.delete=eH;oa.prototype.get=tH;oa.prototype.has=nH;oa.prototype.set=rH;var aH=jA(Er,"Map");const Lo=aH;function AH(){this.size=0,this.__data__={hash:new RA,map:new(Lo||oa),string:new RA}}function sH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function od(e,t){var n=e.__data__;return sH(t)?n[typeof t=="string"?"string":"hash"]:n.map}function iH(e){var t=od(this,e).delete(e);return this.size-=t?1:0,t}function oH(e){return od(this,e).get(e)}function lH(e){return od(this,e).has(e)}function cH(e,t){var n=od(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function YA(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}YA.prototype.clear=AH;YA.prototype.delete=iH;YA.prototype.get=oH;YA.prototype.has=lH;YA.prototype.set=cH;function L_(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var uH=T_(Object.getPrototypeOf,Object);const O_=uH;function dH(){this.__data__=new oa,this.size=0}function fH(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hH(e){return this.__data__.get(e)}function pH(e){return this.__data__.has(e)}var gH=200;function mH(e,t){var n=this.__data__;if(n instanceof oa){var r=n.__data__;if(!Lo||r.length<gH-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new YA(r)}return n.set(e,t),this.size=n.size,this}function Xr(e){var t=this.__data__=new oa(e);this.size=t.size}Xr.prototype.clear=dH;Xr.prototype.delete=fH;Xr.prototype.get=hH;Xr.prototype.has=pH;Xr.prototype.set=mH;function vH(e,t){return e&&Ad(t,rm(t),e)}function BH(e,t){return e&&Ad(t,am(t),e)}var M_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,NB=M_&&typeof module=="object"&&module&&!module.nodeType&&module,yH=NB&&NB.exports===M_,PB=yH?Er.Buffer:void 0,HB=PB?PB.allocUnsafe:void 0;function wH(e,t){if(t)return e.slice();var n=e.length,r=HB?HB(n):new e.constructor(n);return e.copy(r),r}function bH(e,t){for(var n=-1,r=e==null?0:e.length,a=0,A=[];++n<r;){var s=e[n];t(s,n,e)&&(A[a++]=s)}return A}function N_(){return[]}var _H=Object.prototype,CH=_H.propertyIsEnumerable,RB=Object.getOwnPropertySymbols,kH=RB?function(e){return e==null?[]:(e=Object(e),bH(RB(e),function(t){return CH.call(e,t)}))}:N_;const Am=kH;function EH(e,t){return Ad(e,Am(e),t)}var SH=Object.getOwnPropertySymbols,xH=SH?function(e){for(var t=[];e;)L_(t,Am(e)),e=O_(e);return t}:N_;const P_=xH;function FH(e,t){return Ad(e,P_(e),t)}function H_(e,t,n){var r=t(e);return Ws(e)?r:L_(r,n(e))}function Yh(e){return H_(e,rm,Am)}function IH(e){return H_(e,am,P_)}var UH=jA(Er,"DataView");const qh=UH;var QH=jA(Er,"Promise");const Xh=QH;var TH=jA(Er,"Set");const Jh=TH;var VB="[object Map]",DH="[object Object]",KB="[object Promise]",$B="[object Set]",WB="[object WeakMap]",GB="[object DataView]",LH=zA(qh),OH=zA(Lo),MH=zA(Xh),NH=zA(Jh),PH=zA(jh),gA=sl;(qh&&gA(new qh(new ArrayBuffer(1)))!=GB||Lo&&gA(new Lo)!=VB||Xh&&gA(Xh.resolve())!=KB||Jh&&gA(new Jh)!=$B||jh&&gA(new jh)!=WB)&&(gA=function(e){var t=sl(e),n=t==DH?e.constructor:void 0,r=n?zA(n):"";if(r)switch(r){case LH:return GB;case OH:return VB;case MH:return KB;case NH:return $B;case PH:return WB}return t});const zs=gA;var HH=Object.prototype,RH=HH.hasOwnProperty;function VH(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&RH.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var KH=Er.Uint8Array;const mu=KH;function sm(e){var t=new e.constructor(e.byteLength);return new mu(t).set(new mu(e)),t}function $H(e,t){var n=t?sm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var WH=/\w*$/;function GH(e){var t=new e.constructor(e.source,WH.exec(e));return t.lastIndex=e.lastIndex,t}var zB=qa?qa.prototype:void 0,jB=zB?zB.valueOf:void 0;function zH(e){return jB?Object(jB.call(e)):{}}function jH(e,t){var n=t?sm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var YH="[object Boolean]",qH="[object Date]",XH="[object Map]",JH="[object Number]",ZH="[object RegExp]",eR="[object Set]",tR="[object String]",nR="[object Symbol]",rR="[object ArrayBuffer]",aR="[object DataView]",AR="[object Float32Array]",sR="[object Float64Array]",iR="[object Int8Array]",oR="[object Int16Array]",lR="[object Int32Array]",cR="[object Uint8Array]",uR="[object Uint8ClampedArray]",dR="[object Uint16Array]",fR="[object Uint32Array]";function hR(e,t,n){var r=e.constructor;switch(t){case rR:return sm(e);case YH:case qH:return new r(+e);case aR:return $H(e,n);case AR:case sR:case iR:case oR:case lR:case cR:case uR:case dR:case fR:return jH(e,n);case XH:return new r;case JH:case tR:return new r(e);case ZH:return GH(e);case eR:return new r;case nR:return zH(e)}}function pR(e){return typeof e.constructor=="function"&&!sd(e)?LN(O_(e)):{}}var gR="[object Map]";function mR(e){return HA(e)&&zs(e)==gR}var YB=Gs&&Gs.isMap,vR=YB?tm(YB):mR;const BR=vR;var yR="[object Set]";function wR(e){return HA(e)&&zs(e)==yR}var qB=Gs&&Gs.isSet,bR=qB?tm(qB):wR;const _R=bR;var CR=1,kR=2,ER=4,R_="[object Arguments]",SR="[object Array]",xR="[object Boolean]",FR="[object Date]",IR="[object Error]",V_="[object Function]",UR="[object GeneratorFunction]",QR="[object Map]",TR="[object Number]",K_="[object Object]",DR="[object RegExp]",LR="[object Set]",OR="[object String]",MR="[object Symbol]",NR="[object WeakMap]",PR="[object ArrayBuffer]",HR="[object DataView]",RR="[object Float32Array]",VR="[object Float64Array]",KR="[object Int8Array]",$R="[object Int16Array]",WR="[object Int32Array]",GR="[object Uint8Array]",zR="[object Uint8ClampedArray]",jR="[object Uint16Array]",YR="[object Uint32Array]",qe={};qe[R_]=qe[SR]=qe[PR]=qe[HR]=qe[xR]=qe[FR]=qe[RR]=qe[VR]=qe[KR]=qe[$R]=qe[WR]=qe[QR]=qe[TR]=qe[K_]=qe[DR]=qe[LR]=qe[OR]=qe[MR]=qe[GR]=qe[zR]=qe[jR]=qe[YR]=!0;qe[IR]=qe[V_]=qe[NR]=!1;function Rc(e,t,n,r,a,A){var s,o=t&CR,l=t&kR,c=t&ER;if(n&&(s=a?n(e,r,a,A):n(e)),s!==void 0)return s;if(!il(e))return e;var u=Ws(e);if(u){if(s=VH(e),!o)return ON(e,s)}else{var d=zs(e),f=d==V_||d==UR;if(To(e))return wH(e,o);if(d==K_||d==R_||f&&!a){if(s=l||f?{}:pR(e),!o)return l?FH(e,BH(s,e)):EH(e,vH(s,e))}else{if(!qe[d])return a?e:{};s=hR(e,d,o)}}A||(A=new Xr);var h=A.get(e);if(h)return h;A.set(e,s),_R(e)?e.forEach(function(y){s.add(Rc(y,t,n,y,e,A))}):BR(e)&&e.forEach(function(y,g){s.set(g,Rc(y,t,n,g,e,A))});var p=c?l?IH:Yh:l?am:rm,m=u?void 0:p(e);return NN(m||e,function(y,g){m&&(g=y,y=e[g]),E_(s,g,Rc(y,t,n,g,e,A))}),s}var qR=1,XR=4;function wi(e){return Rc(e,qR|XR)}var JR="__lodash_hash_undefined__";function ZR(e){return this.__data__.set(e,JR),this}function eV(e){return this.__data__.has(e)}function vu(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new YA;++t<n;)this.add(e[t])}vu.prototype.add=vu.prototype.push=ZR;vu.prototype.has=eV;function tV(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function nV(e,t){return e.has(t)}var rV=1,aV=2;function $_(e,t,n,r,a,A){var s=n&rV,o=e.length,l=t.length;if(o!=l&&!(s&&l>o))return!1;var c=A.get(e),u=A.get(t);if(c&&u)return c==t&&u==e;var d=-1,f=!0,h=n&aV?new vu:void 0;for(A.set(e,t),A.set(t,e);++d<o;){var p=e[d],m=t[d];if(r)var y=s?r(m,p,d,t,e,A):r(p,m,d,e,t,A);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!tV(t,function(g,v){if(!nV(h,v)&&(p===g||a(p,g,n,r,A)))return h.push(v)})){f=!1;break}}else if(!(p===m||a(p,m,n,r,A))){f=!1;break}}return A.delete(e),A.delete(t),f}function AV(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function sV(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var iV=1,oV=2,lV="[object Boolean]",cV="[object Date]",uV="[object Error]",dV="[object Map]",fV="[object Number]",hV="[object RegExp]",pV="[object Set]",gV="[object String]",mV="[object Symbol]",vV="[object ArrayBuffer]",BV="[object DataView]",XB=qa?qa.prototype:void 0,Ef=XB?XB.valueOf:void 0;function yV(e,t,n,r,a,A,s){switch(n){case BV:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case vV:return!(e.byteLength!=t.byteLength||!A(new mu(e),new mu(t)));case lV:case cV:case fV:return Zg(+e,+t);case uV:return e.name==t.name&&e.message==t.message;case hV:case gV:return e==t+"";case dV:var o=AV;case pV:var l=r&iV;if(o||(o=sV),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=oV,s.set(e,t);var u=$_(o(e),o(t),r,a,A,s);return s.delete(e),u;case mV:if(Ef)return Ef.call(e)==Ef.call(t)}return!1}var wV=1,bV=Object.prototype,_V=bV.hasOwnProperty;function CV(e,t,n,r,a,A){var s=n&wV,o=Yh(e),l=o.length,c=Yh(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in t:_V.call(t,f)))return!1}var h=A.get(e),p=A.get(t);if(h&&p)return h==t&&p==e;var m=!0;A.set(e,t),A.set(t,e);for(var y=s;++d<l;){f=o[d];var g=e[f],v=t[f];if(r)var _=s?r(v,g,f,t,e,A):r(g,v,f,e,t,A);if(!(_===void 0?g===v||a(g,v,n,r,A):_)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var B=e.constructor,w=t.constructor;B!=w&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof w=="function"&&w instanceof w)&&(m=!1)}return A.delete(e),A.delete(t),m}var kV=1,JB="[object Arguments]",ZB="[object Array]",Jl="[object Object]",EV=Object.prototype,ey=EV.hasOwnProperty;function SV(e,t,n,r,a,A){var s=Ws(e),o=Ws(t),l=s?ZB:zs(e),c=o?ZB:zs(t);l=l==JB?Jl:l,c=c==JB?Jl:c;var u=l==Jl,d=c==Jl,f=l==c;if(f&&To(e)){if(!To(t))return!1;s=!0,u=!1}if(f&&!u)return A||(A=new Xr),s||nm(e)?$_(e,t,n,r,a,A):yV(e,t,l,n,r,a,A);if(!(n&kV)){var h=u&&ey.call(e,"__wrapped__"),p=d&&ey.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,y=p?t.value():t;return A||(A=new Xr),a(m,y,n,r,A)}}return f?(A||(A=new Xr),CV(e,t,n,r,a,A)):!1}function W_(e,t,n,r,a){return e===t?!0:e==null||t==null||!HA(e)&&!HA(t)?e!==e&&t!==t:SV(e,t,n,r,W_,a)}var xV="[object Map]",FV="[object Set]",IV=Object.prototype,UV=IV.hasOwnProperty;function QV(e){if(e==null)return!0;if(em(e)&&(Ws(e)||typeof e=="string"||typeof e.splice=="function"||To(e)||nm(e)||F_(e)))return!e.length;var t=zs(e);if(t==xV||t==FV)return!e.size;if(sd(e))return!D_(e).length;for(var n in e)if(UV.call(e,n))return!1;return!0}function ty(e,t){return W_(e,t)}var TV=Object.defineProperty,DV=Object.defineProperties,LV=Object.getOwnPropertyDescriptors,ny=Object.getOwnPropertySymbols,OV=Object.prototype.hasOwnProperty,MV=Object.prototype.propertyIsEnumerable,ry=(e,t,n)=>t in e?TV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NV=(e,t)=>{for(var n in t||(t={}))OV.call(t,n)&&ry(e,n,t[n]);if(ny)for(var n of ny(t))MV.call(t,n)&&ry(e,n,t[n]);return e},PV=(e,t)=>DV(e,LV(t));function HV(e){return(e.match(/[a-zA-Z0-9]+/g)||[]).map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join("")}var sA=(e,t)=>{const n={chartData:{type:Object,required:!0},options:{type:Object,required:!1},chartId:{default:e,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:()=>[]},onLabelsUpdate:{type:Function},onChartUpdate:{type:Function},onChartDestroy:{type:Function},onChartRender:{type:Function}},r=HV(e);return i.defineComponent({name:r,props:n,emits:{"labels:update":()=>!0,"chart:update":a=>!0,"chart:destroy":()=>!0,"chart:render":a=>!0},setup(a,{emit:A,expose:s}){const o=i.ref(null),l=`${a.chartId}`;let c=i.shallowRef(null);i.watch(()=>a.chartData,u,{deep:!0}),i.watch(()=>a.options,y=>{c.value&&y&&(c.value.options=wi(y),p())},{deep:!0});function u(y){if(c.value){let g=c.value;ty(y.labels,c.value.data.labels)||(g.data.labels=y.labels,f()),ty(y.datasets,c.value.data.datasets)||y.datasets.forEach((v,_)=>{var B,w;if(QV(v))g.data.datasets=[];else{const b=wi(g.data),C=Object.keys((w=(B=b.datasets)==null?void 0:B[_])!=null?w:{}),E=Object.keys(v);C.filter(T=>T!=="_meta"&&E.indexOf(T)===-1).forEach(T=>{g.data.datasets[_]&&delete g.data.datasets[_][T]});for(const T in v){const U=wi(v[T]);g.data.datasets[_]||(g.data.datasets[_]={}),v.hasOwnProperty(T)&&U!=null&&g&&(g.data.datasets[_][T]=U)}}}),p()}else c.value&&m(),d()}function d(){o.value?(c.value=new Oe(o.value,{data:wi(a.chartData),type:t,options:wi(a.options),plugins:a.plugins}),h()):console.error(`Error on component ${r}, canvas cannot be rendered. Check if the render appends server-side`)}function f(){A("labels:update"),a.onLabelsUpdate&&a.onLabelsUpdate()}function h(){c.value&&(A("chart:render",c.value),a.onChartRender&&a.onChartRender(c.value))}function p(){c.value&&(c.value.update(),A("chart:update",c.value),a.onChartUpdate&&a.onChartUpdate(c.value))}function m(){c.value&&c.value.destroy(),A("chart:destroy"),a.onChartDestroy&&a.onChartDestroy()}return i.onMounted(d),i.onBeforeUnmount(()=>{c.value&&c.value.destroy()}),s({canvasRef:o,renderChart:d,chartInstance:c,canvasId:l,update:p}),()=>i.h("div",{style:PV(NV({maxWidth:"100%"},a.styles),{position:"relative"}),class:a.cssClasses},[i.h("canvas",{style:{maxWidth:"100%",maxHeight:"100%"},id:l,width:a.width,height:a.height,ref:o})])}})},ld=sA("bar-chart","bar"),cd=sA("doughnut-chart","doughnut"),G_=sA("line-chart","line");sA("pie-chart","pie");sA("polar-chart","polarArea");sA("radar-chart","radar");sA("bubble-chart","bubble");sA("scatter-chart","scatter");const Bu=i.defineComponent({__name:"InfoDoughnutChart",props:ZD,setup(e){const t=e,n=i.ref(null);Oe.register(...kr);const r=i.computed(()=>{const A=t.info==="typeRef"?"types":"rarities",s={},o=Ft(t.deckCode);for(const c in o){const u=qt().cardJsonObject[c];if(u===void 0)continue;let d=u[t.info];d==="Unit"&&(d=u.supertype==="Champion"?"Champion":"Follower"),s[d]===void 0&&(s[d]=0),s[d]+=o[c]}const l=[];for(const c in s){const u=we().dataJson[A].find(f=>f.nameRef===c),d={key:c,value:s[c],color:u==null?void 0:u.color,name:u==null?void 0:u.name,order:u==null?void 0:u.order};l.push(d)}return console.log(l),l.sort((c,u)=>c.order-u.order),{labels:l.map(c=>c.name),datasets:[{data:l.map(c=>c.value),backgroundColor:l.map(c=>c.color)}]}}),a={cutout:55,layout:{padding:{top:10,bottom:10}},elements:{arc:{borderWidth:0}},plugins:{legend:{display:!0,position:"right",labels:{usePointStyle:!0,generateLabels(A){const s=[],o=A.data.labels;for(let l=0;l<A.data.labels.length;l++)s.push({text:`${o[l]} (${A.data.datasets[0].data[l]})`,borderRadius:999,datasetIndex:0,index:l,fontColor:Va("--color-0"),fillStyle:A.data.datasets[0].backgroundColor[l]});return s}}},datalabels:{display:!1}}};return(A,s)=>(i.openBlock(),i.createBlock(i.unref(cd),{ref_key:"chart",ref:n,"chart-data":r.value,options:a},null,8,["chart-data"]))}}),RV={deck:{type:Object,required:!1,default:void 0},deckCode:{type:String,required:!1,default:void 0},paddingTop:{type:Number,required:!1,default:10},showDataLabels:{type:Boolean,required:!1,default:!0},dataLabelsOffset:{type:Number,required:!1,default:-10},tooltipsEnabled:{type:Boolean,required:!1,default:!0},displayXScale:{type:Boolean,required:!1,default:!0},animation:{type:Boolean,required:!1}};//! moment.js
828
828
  //! version : 2.29.4
829
829
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
830
830
  //! license : MIT