@feedmepos/ui-library 0.0.20 → 0.0.21

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.
Files changed (97) hide show
  1. package/README.md +3 -0
  2. package/dist/components.d.ts +76 -0
  3. package/dist/federation/{FmBreadcrumb.vue_vue_type_style_index_0_lang-37cc3d5e.js → FmBreadcrumb.vue_vue_type_style_index_0_lang-85c673ef.js} +1 -1
  4. package/dist/federation/{FmButtonGroup.vue_vue_type_script_setup_true_lang-3aaf0a46.js → FmButtonGroup.vue_vue_type_script_setup_true_lang-820be81c.js} +1 -1
  5. package/dist/federation/{FmCard.vue_vue_type_style_index_0_lang-be9db5f9.js → FmCard.vue_vue_type_style_index_0_lang-818622f4.js} +1 -1
  6. package/dist/federation/{FmCardActions.vue_vue_type_script_setup_true_lang-8b044717.js → FmCardActions.vue_vue_type_script_setup_true_lang-c393a059.js} +1 -1
  7. package/dist/federation/{FmCardSection.vue_vue_type_script_setup_true_lang-5fb7ebc7.js → FmCardSection.vue_vue_type_script_setup_true_lang-e8c6f8af.js} +1 -1
  8. package/dist/federation/{FmCardTitle.vue_vue_type_script_setup_true_lang-8d66c0af.js → FmCardTitle.vue_vue_type_script_setup_true_lang-314c5f62.js} +1 -1
  9. package/dist/federation/{FmCheckbox.vue_vue_type_style_index_0_lang-7e647e25.js → FmCheckbox.vue_vue_type_style_index_0_lang-a9c52841.js} +1 -1
  10. package/dist/federation/{FmChip.vue_vue_type_script_setup_true_lang-d119119a.js → FmChip.vue_vue_type_script_setup_true_lang-1274c9e4.js} +1 -1
  11. package/dist/federation/{FmChipGroup.vue_vue_type_script_setup_true_lang-2db49392.js → FmChipGroup.vue_vue_type_script_setup_true_lang-64b8cb30.js} +1 -1
  12. package/dist/federation/FmDatePicker-356aed6d.css +1 -0
  13. package/dist/federation/{FmDateRangePicker-c502b716.css → FmDateRangePicker-832668d5.css} +1 -1
  14. package/dist/federation/{FmDialog.vue_vue_type_style_index_0_lang-4c20a61a.js → FmDialog.vue_vue_type_style_index_0_lang-2e93b75c.js} +1 -1
  15. package/dist/federation/{FmForm.vue_vue_type_script_setup_true_lang-541ca8bd.js → FmForm.vue_vue_type_script_setup_true_lang-b43b355b.js} +1 -1
  16. package/dist/federation/{FmFormGroup.vue_vue_type_script_setup_true_lang-46ff9977.js → FmFormGroup.vue_vue_type_script_setup_true_lang-25df107c.js} +1 -1
  17. package/dist/federation/{FmHelperText.vue_vue_type_script_setup_true_lang-1ef1402d.js → FmHelperText.vue_vue_type_script_setup_true_lang-75f8df3c.js} +1 -1
  18. package/dist/federation/{FmLabel.vue_vue_type_script_setup_true_lang-62bb068f.js → FmLabel.vue_vue_type_script_setup_true_lang-cd6890de.js} +1 -1
  19. package/dist/federation/{FmLine.vue_vue_type_script_setup_true_lang-23794d0d.js → FmLine.vue_vue_type_script_setup_true_lang-7b90f445.js} +1 -1
  20. package/dist/federation/{FmProgressIndicator.vue_vue_type_style_index_0_lang-14cd0b6c.js → FmProgressIndicator.vue_vue_type_style_index_0_lang-fb7fb248.js} +1 -1
  21. package/dist/federation/{FmRadioGroup.vue_vue_type_script_setup_true_lang-78cf1b5c.js → FmRadioGroup.vue_vue_type_script_setup_true_lang-5ffabc63.js} +1 -1
  22. package/dist/federation/{FmSelect.vue_vue_type_script_setup_true_lang-e7877204.js → FmSelect.vue_vue_type_script_setup_true_lang-a7c19e77.js} +1 -1
  23. package/dist/federation/{FmStepHeader.vue_vue_type_script_setup_true_lang-890e76e8.js → FmStepHeader.vue_vue_type_script_setup_true_lang-8609c6d6.js} +1 -1
  24. package/dist/federation/{FmStepper.vue_vue_type_script_setup_true_lang-aa0b5313.js → FmStepper.vue_vue_type_script_setup_true_lang-f6575f12.js} +1 -1
  25. package/dist/federation/{FmStepperField-50329b1a.css → FmStepperField-3fe87932.css} +1 -1
  26. package/dist/federation/{FmSwitch-2b54dde6.css → FmSwitch-ea705ff8.css} +1 -1
  27. package/dist/federation/FmTab-658e6666.css +1 -0
  28. package/dist/federation/FmTable-b3766c39.css +1 -0
  29. package/dist/federation/FmTable.vue_vue_type_script_setup_true_lang-772dca8f.js +4 -0
  30. package/dist/federation/{FmTabs.vue_vue_type_script_setup_true_lang-620724ad.js → FmTabs.vue_vue_type_script_setup_true_lang-b6ab4957.js} +1 -1
  31. package/dist/federation/{FmTextField.vue_vue_type_style_index_0_lang-c818fb3d.js → FmTextField.vue_vue_type_style_index_0_lang-8e7f6d92.js} +1 -1
  32. package/dist/federation/{FmTextarea-15ab3811.css → FmTextarea-30a10160.css} +1 -1
  33. package/dist/federation/{FmTimeInput.vue_vue_type_style_index_0_lang-0dbc7e01.js → FmTimeInput.vue_vue_type_style_index_0_lang-ab6633eb.js} +1 -1
  34. package/dist/federation/FmTimePicker.vue_vue_type_script_setup_true_lang-1f29dfef.js +1 -0
  35. package/dist/federation/{FmTooltip.vue_vue_type_script_setup_true_lang-ef289616.js → FmTooltip.vue_vue_type_script_setup_true_lang-80e2e523.js} +1 -1
  36. package/dist/federation/{__federation_expose_FmBadge-125acb48.js → __federation_expose_FmBadge-8b64dfb5.js} +1 -1
  37. package/dist/federation/{__federation_expose_FmBreadcrumb-55117f83.js → __federation_expose_FmBreadcrumb-3179c182.js} +1 -1
  38. package/dist/federation/{__federation_expose_FmButton-dfd7abfa.js → __federation_expose_FmButton-8e185653.js} +1 -1
  39. package/dist/federation/{__federation_expose_FmButtonGroup-50c8a030.js → __federation_expose_FmButtonGroup-9e11dfa3.js} +1 -1
  40. package/dist/federation/{__federation_expose_FmCard-1433b043.js → __federation_expose_FmCard-8f64cce7.js} +1 -1
  41. package/dist/federation/{__federation_expose_FmCardActions-d5c26186.js → __federation_expose_FmCardActions-500ebc98.js} +1 -1
  42. package/dist/federation/{__federation_expose_FmCardSection-1f4f51f1.js → __federation_expose_FmCardSection-9976cb45.js} +1 -1
  43. package/dist/federation/{__federation_expose_FmCardTitle-6b7dbdc8.js → __federation_expose_FmCardTitle-0356ef29.js} +1 -1
  44. package/dist/federation/{__federation_expose_FmCheckbox-4932ef03.js → __federation_expose_FmCheckbox-7f4b3a27.js} +1 -1
  45. package/dist/federation/{__federation_expose_FmChip-cafebdf8.js → __federation_expose_FmChip-dd2f9a84.js} +1 -1
  46. package/dist/federation/{__federation_expose_FmChipGroup-5dd4128f.js → __federation_expose_FmChipGroup-58ec588d.js} +1 -1
  47. package/dist/federation/{__federation_expose_FmDatePicker-2792e65c.js → __federation_expose_FmDatePicker-59679f66.js} +1 -1
  48. package/dist/federation/{__federation_expose_FmDateRangePicker-bffd17e2.js → __federation_expose_FmDateRangePicker-3456df1a.js} +1 -1
  49. package/dist/federation/{__federation_expose_FmDialog-6163e501.js → __federation_expose_FmDialog-78da6f44.js} +1 -1
  50. package/dist/federation/{__federation_expose_FmDropField-9637d4cd.js → __federation_expose_FmDropField-3ec4932c.js} +1 -1
  51. package/dist/federation/{__federation_expose_FmDynamicDialog-f0af1f03.js → __federation_expose_FmDynamicDialog-911737c5.js} +1 -1
  52. package/dist/federation/{__federation_expose_FmField-fe494929.js → __federation_expose_FmField-7625848b.js} +1 -1
  53. package/dist/federation/{__federation_expose_FmForm-3dc5e622.js → __federation_expose_FmForm-9639d953.js} +1 -1
  54. package/dist/federation/{__federation_expose_FmFormGroup-e2e2aea3.js → __federation_expose_FmFormGroup-f374ecbf.js} +1 -1
  55. package/dist/federation/{__federation_expose_FmHelperText-9329ade8.js → __federation_expose_FmHelperText-ccdf6064.js} +1 -1
  56. package/dist/federation/{__federation_expose_FmIcon-9b1dbef1.js → __federation_expose_FmIcon-c40819c3.js} +1 -1
  57. package/dist/federation/{__federation_expose_FmLabel-1d48106d.js → __federation_expose_FmLabel-2a7ca193.js} +1 -1
  58. package/dist/federation/{__federation_expose_FmLineChart-c52b49c5.js → __federation_expose_FmLineChart-c0f75ba5.js} +1 -1
  59. package/dist/federation/{__federation_expose_FmList-434a127b.js → __federation_expose_FmList-e0c6acae.js} +1 -1
  60. package/dist/federation/{__federation_expose_FmListItem-6c03cfcb.js → __federation_expose_FmListItem-daa2fb66.js} +1 -1
  61. package/dist/federation/{__federation_expose_FmMenu-5934ab22.js → __federation_expose_FmMenu-e9ca74d8.js} +1 -1
  62. package/dist/federation/{__federation_expose_FmMenuItem-8f4f3bfc.js → __federation_expose_FmMenuItem-9fe4ca23.js} +1 -1
  63. package/dist/federation/{__federation_expose_FmProgressIndicator-67cce169.js → __federation_expose_FmProgressIndicator-9e716bb6.js} +1 -1
  64. package/dist/federation/{__federation_expose_FmRadio-201b94da.js → __federation_expose_FmRadio-2a084855.js} +1 -1
  65. package/dist/federation/{__federation_expose_FmRadioGroup-4dcf8abb.js → __federation_expose_FmRadioGroup-28c015af.js} +1 -1
  66. package/dist/federation/{__federation_expose_FmSelect-dcd3c152.js → __federation_expose_FmSelect-6178ae2a.js} +1 -1
  67. package/dist/federation/{__federation_expose_FmSnackbar-30f6ad8f.js → __federation_expose_FmSnackbar-651300b3.js} +1 -1
  68. package/dist/federation/{__federation_expose_FmSpacer-6b3c2f1d.js → __federation_expose_FmSpacer-332b5749.js} +1 -1
  69. package/dist/federation/{__federation_expose_FmStep-326760b7.js → __federation_expose_FmStep-01d1974b.js} +1 -1
  70. package/dist/federation/{__federation_expose_FmStepper-ddb25644.js → __federation_expose_FmStepper-ecf057a5.js} +1 -1
  71. package/dist/federation/{__federation_expose_FmStepperField-a2b5f480.js → __federation_expose_FmStepperField-9d5e6cac.js} +1 -1
  72. package/dist/federation/{__federation_expose_FmSwitch-1b25f8d8.js → __federation_expose_FmSwitch-a00cf629.js} +1 -1
  73. package/dist/federation/{__federation_expose_FmTab-77e53906.js → __federation_expose_FmTab-423113dc.js} +1 -1
  74. package/dist/federation/__federation_expose_FmTable-d439f661.js +1 -0
  75. package/dist/federation/{__federation_expose_FmTabs-a82b8425.js → __federation_expose_FmTabs-bb9fbca9.js} +1 -1
  76. package/dist/federation/{__federation_expose_FmTextField-eac82a8c.js → __federation_expose_FmTextField-4bf4dbd4.js} +1 -1
  77. package/dist/federation/{__federation_expose_FmTextarea-e9b8c5c9.js → __federation_expose_FmTextarea-428cac9c.js} +1 -1
  78. package/dist/federation/{__federation_expose_FmTimeInput-ab991923.js → __federation_expose_FmTimeInput-ad91986c.js} +1 -1
  79. package/dist/federation/{__federation_expose_FmTimePicker-45b12a65.js → __federation_expose_FmTimePicker-1b054147.js} +1 -1
  80. package/dist/federation/{__federation_expose_FmTooltip-76c9b9a9.js → __federation_expose_FmTooltip-bea5f8e5.js} +1 -1
  81. package/dist/federation/{dialog-plugin-c3957110.js → dialog-plugin-fb3675e4.js} +1 -1
  82. package/dist/federation/feedmepos-ui-components.js +1 -1
  83. package/dist/federation/{floating-ui.vue.esm-5b1f56a2.js → floating-ui.vue.esm-d0ecc63f.js} +1 -1
  84. package/dist/federation/index-6cb898d0.css +1 -0
  85. package/dist/federation/index-d94664c6.js +11 -0
  86. package/dist/federation/{useProxiedModel-5d10be95.js → useProxiedModel-928bd48f.js} +1 -1
  87. package/dist/feedmepos-ui-library.js +10208 -7506
  88. package/dist/feedmepos-ui-library.umd.cjs +33 -12
  89. package/dist/global-components.d.ts +2 -1
  90. package/dist/style.css +1 -1
  91. package/package.json +4 -2
  92. package/dist/federation/FmDatePicker-91a125af.css +0 -1
  93. package/dist/federation/FmTab-219d73c7.css +0 -1
  94. package/dist/federation/FmTimePicker.vue_vue_type_script_setup_true_lang-442e0b9c.js +0 -1
  95. package/dist/federation/index-28af6805.css +0 -1
  96. package/dist/federation/index-e8737782.js +0 -14
  97. /package/dist/federation/{__federation_fn_import-f9059dda.js → __federation_fn_import-c07c5963.js} +0 -0
@@ -1,25 +1,46 @@
1
- var Cg=Object.defineProperty;var Mg=(st,mt,r)=>mt in st?Cg(st,mt,{enumerable:!0,configurable:!0,writable:!0,value:r}):st[mt]=r;var P=(st,mt,r)=>(Mg(st,typeof mt!="symbol"?mt+"":mt,r),r);(function(st,mt){typeof exports=="object"&&typeof module<"u"?mt(exports,require("v-wave"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","v-wave","vue","vue-router"],mt):(st=typeof globalThis<"u"?globalThis:st||self,mt(st["feedmepos-ui-library"]={},st.VWave,st.Vue,st.VueRouter))})(this,function(st,mt,r,ni){var ts;"use strict";const Sg="",cr={class:"gap-8 inline-flex items-center relative select-none"},dr={key:0,class:"fm-typo-body-sm-400 justify-center"},hr=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(n){const t=n,e=r.computed(()=>t.value&&t.value>99?"99+":t.value);return(s,i)=>(r.openBlock(),r.createElementBlock("div",cr,[r.renderSlot(s.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",`fm-badge--${s.variant}`,{absolute:!s.inline,"top-0 right-0 w-[6px] h-[6px]":t.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":t.value&&t.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>10&&t.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>99}])},[t.value!==null?(r.openBlock(),r.createElementBlock("span",dr,r.toDisplayString(e.value),1)):r.createCommentVNode("",!0)],2)]))}}),Dg="",et=(n,t)=>{const e=n.__vccOpts||n;for(const[s,i]of t)e[s]=i;return e},cn=et(hr,[["__scopeId","data-v-02018628"]]),fr={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},ur=["onMouseenter"],pr={key:0},mr=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=ni.useRoute(),e=ni.useRouter();r.onMounted(async()=>{await e.isReady();const m=s.items.findIndex(g=>g.route==t.path);m!=-1&&!s.items[m].disabled&&(i.value=m)});const s=n,i=r.ref(-1),o=r.ref(-1),a=r.ref(" / "),l=r.ref("... /"),c=r.ref(!1),d=m=>i.value===m?"selected":o.value===m?"hovered":s.items[m].disabled?"disabled":"default",h=m=>{s.items[m].disabled||(i.value=m)},f=m=>m!=s.items.length-1,u=m=>!c.value&&s.items.length>5&&m>=2&&m<s.items.length-2,p=()=>{c.value=!c.value};return(m,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.items,(x,y)=>(r.openBlock(),r.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>o.value=y,onMouseleave:g[0]||(g[0]=k=>o.value=-1)},[u(y)?y===3&&!c.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:p},r.toDisplayString(l.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass(d(y)),to:x.disabled?"":x.route,onClick:k=>h(y)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(x.label),1),f(y)?(r.openBlock(),r.createElementBlock("span",pr,r.toDisplayString(a.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,ur))),128))])])}}}),Bg="",gr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,br=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/,yr=/^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/,_r=/^hsl[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*[)]$/,xr=/^hsla[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*,\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/;function ns(n){return[gr,br,yr,_r,xr].some(t=>t.test(n))}const kr=r.defineComponent({__name:"FmIcon",props:{name:{type:String,required:!0},color:{type:String,default:"black"},outline:{type:Boolean,default:!1},size:{type:String,default:"md"}},setup(n){const t=n,e=r.computed(()=>{const o=[],a={};return o.push(s()),o.push(i()),ns(t.color)?a.color=t.color:o.push(`text-fm-color-${t.color}`),{class:o.join(" "),style:a}});function s(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${t.size}`}return(o,a)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps(e.value,{class:"fm-icon"}),r.toDisplayString(t.name),17))}}),vg="",R=et(kr,[["__scopeId","data-v-fd802d37"]]),wr=["disabled","type"],Cr={key:1,class:"fm-typo-body-lg-700"},Mr=r.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"}},setup(n){const t=n,e=r.ref(!1),s=r.computed(()=>`${i[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),i={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function o(a){e.value=a}return(a,l)=>{const c=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
1
+ var By=Object.defineProperty;var $y=(re,l,Ue)=>l in re?By(re,l,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):re[l]=Ue;var F=(re,l,Ue)=>($y(re,typeof l!="symbol"?l+"":l,Ue),Ue);(function(re,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],l):(re=typeof globalThis<"u"?globalThis:re||self,l(re["feedmepos-ui-library"]={},re.Vue,re.VueRouter))})(this,function(re,l,Ue){var mo;"use strict";const Py="",Ti={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},fa=t=>"config"in t&&"globalProperties"in t.config,ha=t=>{let e;return t==="vue2"?e=!1:t==="vue3"?e=!0:e=fa(t),e?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},zi=t=>typeof t=="string"&&t!=="auto",Hi=(t,e)=>{t.dataset.vWaveBoundary=zi(e)?e:"true"},pa=({borderTopLeftRadius:t,borderTopRightRadius:e,borderBottomLeftRadius:n,borderBottomRightRadius:o},i)=>{const s=document.createElement(i);return s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.display="block",s.style.position="absolute",s.style.borderRadius=`${t} ${e} ${o} ${n}`,s.style.overflow="hidden",s.style.pointerEvents="none",s.style.webkitMaskImage="-webkit-radial-gradient(white, black)",s},ga=(t,e,n,o)=>{const i=document.createElement("div");return i.style.position="absolute",i.style.width=`${n}px`,i.style.height=`${n}px`,i.style.top=`${e}px`,i.style.left=`${t}px`,i.style.background=o.color,i.style.borderRadius="50%",i.style.opacity=`${o.initialOpacity}`,i.style.transform="translate(-50%,-50%) scale(0)",i.style.transition=`transform ${o.duration}s ${o.easing}, opacity ${o.duration}s ${o.easing}`,i};function bn(t,e,n,o){const i=t-n,s=e-o;return Math.sqrt(i*i+s*s)}function ma(t,e,{width:n,height:o}){const i=bn(t,e,0,0),s=bn(t,e,n,0),r=bn(t,e,0,o),a=bn(t,e,n,o);return Math.max(i,s,r,a)}const ba=({x:t,y:e},{top:n,left:o})=>({x:t-o,y:e-n}),yo="vWaveCountInternal";function ya(t){const e=_o(t);Wi(t,e+1)}function _a(t){const e=_o(t);Wi(t,e-1)}function Wi(t,e){t.dataset[yo]=e.toString()}function _o(t){var e;return parseInt((e=t.dataset[yo])!==null&&e!==void 0?e:"0",10)}function xa(t){delete t.dataset[yo]}const xo=(t,e,n)=>{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e),{x:s,y:r}=ba(t,o),a=2.05*ma(s,r,o),c=pa(i,n.tagName),d=ga(s,r,a,n);ya(e);let u="";i.position==="static"&&(e.style.position&&(u=e.style.position),e.style.position="relative"),c.appendChild(d),e.appendChild(c);let f=!1;const p=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p)),f?h():f=!0},h=()=>{d.style.transition=`opacity ${n.dissolveDuration}s linear`,d.style.opacity="0",setTimeout(()=>{c.remove(),_a(e),_o(e)===0&&(xa(e),e.style.position=u)},n.dissolveDuration*1e3)};document.addEventListener("pointerup",p),document.addEventListener("pointercancel",p);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{d.style.transform="translate(-50%,-50%) scale(1)",d.style.opacity=`${n.finalOpacity}`,setTimeout(()=>p(),n.duration*1e3)})},n.cancellationPeriod),m=()=>{clearTimeout(g),c.remove(),document.removeEventListener("pointerup",p),document.removeEventListener("pointercancel",p),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},At=new WeakMap,ji=(t={},e="vue3")=>{const n=Object.assign(Object.assign({},Ti),t),o=ha(e),i=a=>{const c=a.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${c}"]`).forEach(u=>xo(a,u,Object.assign(Object.assign({},n),At.get(u))))},s={[o.mounted](a,{value:c={}}){var d;At.set(a,c),Hi(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger),a.addEventListener("pointerdown",u=>{if(At.get(a)===!1)return;const f=Object.assign(Object.assign({},n),At.get(a));if(f.trigger===!1)return xo(u,a,f);if(zi(f.trigger))return;const p=a.querySelector('[data-v-wave-trigger="true"]');!p&&f.trigger===!0||p&&!u.composedPath().includes(p)||xo(u,a,f)})},[o.updated](a,{value:c={}}){var d;At.set(a,c),Hi(a,(d=c&&c.trigger)!==null&&d!==void 0?d:n.trigger)}},r={[o.mounted](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c!=="true"&&a.addEventListener("pointerdown",i)},[o.updated](a,{arg:c="true"}){a.dataset.vWaveTrigger=c,c==="true"?a.removeEventListener("pointerdown",i):a.addEventListener("pointerdown",i)}};return{wave:s,vWave:s,waveTrigger:r,vWaveTrigger:r}},wa={install(t,e={}){if(this.installed)return;this.installed=!0;const n=Object.assign(Object.assign({},Ti),e),{vWave:o,vWaveTrigger:i}=ji(n,t);t.directive(n.directive,o),t.directive(`${n.directive}-trigger`,i)},installed:!1,createLocalWaveDirective:ji},Ca={class:"gap-8 inline-flex items-center relative select-none"},ka={key:0,class:"fm-typo-body-sm-400 justify-center"},Sa=l.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(t){const e=t,n=l.computed(()=>e.value&&e.value>99?"99+":e.value);return(o,i)=>(l.openBlock(),l.createElementBlock("div",Ca,[l.renderSlot(o.$slots,"default",{},void 0,!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-badge",`fm-badge--${o.variant}`,{absolute:!o.inline,"top-0 right-0 w-[6px] h-[6px]":e.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":e.value&&e.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>10&&e.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":e.value&&e.value>99}])},[e.value!==null?(l.openBlock(),l.createElementBlock("span",ka,l.toDisplayString(n.value),1)):l.createCommentVNode("",!0)],2)]))}}),Ay="",Q=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},yn=Q(Sa,[["__scopeId","data-v-02018628"]]),va={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Ma=["onMouseenter"],Ea={key:0},Da=l.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(t){const e=Ue.useRoute(),n=Ue.useRouter();l.onMounted(async()=>{await n.isReady();const g=o.items.findIndex(m=>m.route==e.path);g!=-1&&!o.items[g].disabled&&(i.value=g)});const o=t,i=l.ref(-1),s=l.ref(-1),r=l.ref(" / "),a=l.ref("... /"),c=l.ref(!1),d=g=>i.value===g?"selected":s.value===g?"hovered":o.items[g].disabled?"disabled":"default",u=g=>{o.items[g].disabled||(i.value=g)},f=g=>g!=o.items.length-1,p=g=>!c.value&&o.items.length>5&&g>=2&&g<o.items.length-2,h=()=>{c.value=!c.value};return(g,m)=>{const b=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("nav",null,[l.createElementVNode("ul",va,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.items,(x,y)=>(l.openBlock(),l.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:w=>s.value=y,onMouseleave:m[0]||(m[0]=w=>s.value=-1)},[p(y)?y===3&&!c.value?(l.openBlock(),l.createElementBlock("a",{key:1,onClick:h},l.toDisplayString(a.value),1)):l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(b,{key:0,class:l.normalizeClass(d(y)),to:x.disabled?"":x.route,onClick:w=>u(y)},{default:l.withCtx(()=>[l.createElementVNode("span",null,l.toDisplayString(x.label),1),f(y)?(l.openBlock(),l.createElementBlock("span",Ea,l.toDisplayString(r.value),1)):l.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Ma))),128))])])}}}),Oy="",Va=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Ra=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/,Fa=/^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/,Ba=/^hsl[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*[)]$/,$a=/^hsla[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*,\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/;function wo(t){return[Va,Ra,Fa,Ba,$a].some(e=>e.test(t))}const Pa=l.defineComponent({__name:"FmIcon",props:{name:{type:String,required:!0},color:{type:String,default:"black"},outline:{type:Boolean,default:!1},size:{type:String,default:"md"}},setup(t){const e=t,n=l.computed(()=>{const s=[],r={};return s.push(o()),s.push(i()),wo(e.color)?r.color=e.color:s.push(`text-fm-color-${e.color}`),{class:s.join(" "),style:r}});function o(){return`fm-icon--${e.outline?"outlined":"rounded"}`}function i(){return`fm-icon--${e.size}`}return(s,r)=>(l.openBlock(),l.createElementBlock("span",l.mergeProps(n.value,{class:"fm-icon"}),l.toDisplayString(e.name),17))}}),Ny="",L=Q(Pa,[["__scopeId","data-v-fd802d37"]]),Aa=["disabled","type"],Oa={key:1,class:"fm-typo-body-lg-700"},Na=l.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"},iconPosition:{default:"prepend"}},setup(t){const e=t,n=l.ref(!1),o=l.computed(()=>`${i[e.variant]} ${e.disabled?"cursor-not-allowed":"cursor-pointer"}`),i={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function s(r){n.value=r}return(r,a)=>{const c=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("button",{ref:"buttonEl",class:l.normalizeClass(`
2
2
  fm-btn
3
- ${s.value}
4
- fm-btn--${a.size}
5
- ${a.label?"":`fm-btn--${a.size}--just-icon`}
6
- fm-btn--${a.variant}
7
- ${a.disabled?"fm-btn--disabled":""}
8
- `),disabled:a.disabled,type:a.type,onMousedown:l[0]||(l[0]=()=>o(!0)),onMouseup:l[1]||(l[1]=()=>o(!1)),onMouseleave:l[2]||(l[2]=()=>o(!1))},[a.icon&&a.iconPosition==="prepend"?(r.openBlock(),r.createBlock(R,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),a.label?(r.openBlock(),r.createElementBlock("span",Cr,r.toDisplayString(a.label),1)):r.createCommentVNode("",!0),a.icon&&a.iconPosition==="append"?(r.openBlock(),r.createBlock(R,{key:2,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0)],42,wr)),[[c,!a.disabled]])}}}),Eg="",kt=et(Mr,[["__scopeId","data-v-8c5319b7"]]),Sr={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Dr=["v-wave","disabled","onClick","onMousedown"],Br=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=t,i=d=>{s("update:modelValue",d)},o=r.ref(null),a=d=>{o.value=d},l=d=>d.disabled||e.disabled,c=d=>JSON.stringify(d)===JSON.stringify(e.modelValue);return(d,h)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.items,(f,u)=>(r.openBlock(),r.createElementBlock("button",{key:u,"v-wave":l(f),class:r.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":c(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":l(f)}]),disabled:l(f),onClick:p=>i(f),onMousedown:p=>a(f),onMouseup:h[0]||(h[0]=p=>a(null)),onMouseleave:h[1]||(h[1]=p=>a(null))},[f.icon?(r.openBlock(),r.createBlock(R,{key:0,name:f.icon,size:"md",color:l(f)?"neutral-gray-200":c(f)?"primary":"",outline:JSON.stringify(o.value)!==JSON.stringify(f)&&!c(f)},null,8,["name","color","outline"])):r.createCommentVNode("",!0),f.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700",[l(f)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0)],42,Dr))),128))]))}}),vr={class:"grow"},si=r.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-title",n.padding])},[r.createElementVNode("div",vr,[r.renderSlot(t.$slots,"default")]),r.renderSlot(t.$slots,"actions")],2))}}),Er={class:"fm-typo-title-md-700 grow"},Vr=r.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(n){const t=n,e=r.useSlots();return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex-nowrap fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[r.renderSlot(s.$slots,"header",{title:t.title},()=>[n.title||r.unref(e)["header-title"]||r.unref(e)["header-actions"]?(r.openBlock(),r.createBlock(si,{key:0},{actions:r.withCtx(()=>[r.renderSlot(s.$slots,"header-actions")]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.renderSlot(s.$slots,"header-title",{title:t.title},()=>[r.createElementVNode("div",Er,r.toDisplayString(t.title),1)])])]),_:3})):r.createCommentVNode("",!0)]),r.renderSlot(s.$slots,"default"),r.renderSlot(s.$slots,"actions")],2))}}),Vg="",Pr=r.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=r.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[r.renderSlot(s.$slots,"default")],2))}}),Ar=r.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-section",n.padding])},[r.renderSlot(t.$slots,"default")],2))}}),ii=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=t,i=r.ref(!1),o=r.ref(!1);function a(d){e.selectable&&(o.value=d)}const l=()=>{!e.selectable||e.disabled||(i.value=!i.value)},c=()=>{e.disabled||s("chip-closed")};return r.onMounted(()=>{i.value=e.selected}),r.watch(()=>e.selected,()=>{i.value=e.selected}),(d,h)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",i.value&&!d.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",d.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled,"hover:bg-fm-color-opacity-sm":!i.value&&!d.disabled&&d.selectable}]),onClick:l,onMousedown:h[0]||(h[0]=()=>a(!0)),onMouseup:h[1]||(h[1]=()=>a(!1)),onMouseleave:h[2]||(h[2]=()=>a(!1))},[r.renderSlot(d.$slots,"default",{},()=>[d.icon?(r.openBlock(),r.createBlock(R,{key:0,name:d.icon,size:"sm",outline:!o.value&&!i.value,color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),d.label?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",d.disabled?"text-fm-color-typo-disabled":i.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},r.toDisplayString(d.label),3)):r.createCommentVNode("",!0)]),d.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!i.value&&!d.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled}]),onClick:c},[r.createVNode(R,{name:"close",size:"sm",color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34))}}),oi=r.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=t,i=r.ref(null),o=r.ref(0),a=r.ref(null),l=r.ref(),c=()=>{var u,p;if(!i.value)return;const h=i.value.getBoundingClientRect();o.value>0&&a.value&&((u=l.value)==null||u.splice(a.value,1)),o.value=0;let f=0;Array.from(i.value.children).forEach((m,g)=>{const b=m.getBoundingClientRect(),x=b.y-h.y;f=Math.max(b.height*2+4,f),x>f&&(o.value+=1,a.value=a.value===null?g:g-o.value)}),o.value>0&&a.value&&((p=l.value)==null||p.splice(a.value,0,{label:`+${o.value}`,removable:!1,selectable:!1,compact:e.compact}))},d=h=>{s("chip-closed",h)};return r.onMounted(()=>{l.value=e.items,c(),new ResizeObserver(()=>{c()}).observe(i.value)}),r.watch(()=>e.items,()=>{l.value=e.items,c()}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:i,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",h.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(u,p)=>(r.openBlock(),r.createBlock(ii,{key:p,label:u.label,icon:u.icon,selected:u.selected,removable:u.removable!==void 0?u.removable:h.removable,selectable:u.selectable!==void 0?u.selectable:h.selectable,disabled:u.disabled!==void 0?u.disabled:h.disabled,compact:h.compact,onChipClosed:m=>d(p)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),Or={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Fr={class:"overflow-y-auto"},Tr={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Nr=r.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=t,i=r.ref(null),o=a=>{e.overlay&&i.value&&a.target===i.value&&s("update:modelValue",!1)};return(a,l)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[a.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":a.overlay}),onClick:l[1]||(l[1]=c=>o(c))},[r.createElementVNode("div",{class:r.normalizeClass(`fm-dialog min-w-[${a.minWidth}px]`)},[r.createElementVNode("div",Or,[r.renderSlot(a.$slots,"dialog-header"),a.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:l[0]||(l[0]=c=>s("update:modelValue",!1))})):r.createCommentVNode("",!0)]),r.createElementVNode("div",Fr,[r.renderSlot(a.$slots,"dialog-content")]),r.createElementVNode("div",Tr,[r.renderSlot(a.$slots,"dialog-footer")])],2)],2)):r.createCommentVNode("",!0)]),_:3})]))}}),Pg="",$r={class:"fm-drop-field"},Lr=["accept","disabled"],Rr=r.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(n,{emit:t}){const e=n,s=t,i=r.ref(!1),o=r.ref(),a=r.ref(),l=r.ref(),c=_=>{e.disabled||(_.stopPropagation(),_.preventDefault())},d=_=>{e.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!0)},h=_=>{e.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1)},f=_=>{e.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1,u(_))},u=_=>{var S;l.value=((S=_.dataTransfer)==null?void 0:S.files)??_.target.files;const w=l.value;if(o.value=m(w[0]),a.value=g(w[0]),o.value&&a.value)s("file-upload",w[0]);else{const C=p();s("file-rejected",[{file:w[0],reason:C}])}},p=()=>{const _=[];return o.value||_.push("invalid-type"),a.value||_.push("invalid-size"),_},m=_=>{if(!e.accept)return!0;const w=e.accept.split(",").map(S=>S.trim());for(const S of w)if(b(S)){if(y(S)===y(_.type))return!0}else if(x(_)===S||_.type===S)return!0;return!1},g=_=>_.size<=e.maxFileSize,b=_=>_.indexOf("*")!==-1,x=_=>"."+_.name.split(".").pop(),y=_=>_.substring(0,_.indexOf("/")),k=r.computed(()=>{if(i.value)return"Drop file to upload";if(o.value){if(!a.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),M=r.computed(()=>l.value?!o.value||!a.value:!1);return(_,w)=>(r.openBlock(),r.createElementBlock("label",$r,[r.renderSlot(_.$slots,"label",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(_.label),3)],!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":i.value,"fm-drop-field__container--invalid":M.value&&!_.disabled,"fm-drop-field__container--disabled":_.disabled}]),onDragenter:c,onDragover:d,onDragleave:h,onDrop:f},[(i.value||M.value)&&!_.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":i.value,"text-fm-color-typo-error":M.value})},r.toDisplayString(k.value),3)):(r.openBlock(),r.createBlock(kt,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:_.disabled},null,8,["disabled"])),r.renderSlot(_.$slots,"accept-text",{},()=>[e.accept?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-md-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Accepts ${e.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:_.accept,disabled:_.disabled,onChange:u},null,40,Lr)],34),r.renderSlot(_.$slots,"helper-text",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-sm-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),Ag="",zr=et(Rr,[["__scopeId","data-v-c914dc32"]]),Ir={},Wr={class:"flex-grow"};function Yr(n,t){return r.openBlock(),r.createElementBlock("div",Wr)}const ai=et(Ir,[["render",Yr]]),ri=Symbol.for("fm:form"),li=Symbol.for("fm:radio-group"),ci=Symbol.for("fm:stepper"),di=Symbol.for("fm:dialog"),jr={install:n=>{const t={open:e=>{const s={primary:[],secondary:[],tertiary:[]},i={onPrimary:d=>(s.primary.push(d),i),onSecondary:d=>(s.secondary.push(d),i),onTertiary:d=>(s.tertiary.push(d),i)};function o(){a&&r.render(null,a),a=null,c=null}let a=document.createElement("div");document.body.appendChild(a);const l=r.markRaw(hi);let c=r.createVNode(l,{...e,unmount:o,storedFunctions:s});return c.appContext=n._context,r.render(c,a),i}};n.config.globalProperties.$dialog=t,n.provide(di,t)}},Hr={key:0,class:"block relative"},Ur={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Xr={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},qr={key:0,class:"overflow-y-auto"},Kr={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},Gr={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},hi=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=r.ref(!0),s=n,i=t,o=r.ref(null),a=()=>{s.overlay&&(s.unmount(),i("dialog-closed"))},l=d=>{o.value&&d.target===o.value&&a()},c=(d,h)=>{s.storedFunctions[h].forEach(f=>f()),d.close&&a()};return r.onMounted(()=>{i("dialog-opened")}),(d,h)=>(r.openBlock(),r.createBlock(r.Transition,null,{default:r.withCtx(()=>[e.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:o,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":d.overlay}),onClick:l},[d.dialogComponent?(r.openBlock(),r.createElementBlock("div",Hr,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.dialogComponent),r.normalizeProps(r.guardReactiveProps(d.dialogComponentProps)),null,16)),d.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:a})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:"fm-dialog",style:r.normalizeStyle({"min-width":`${s.minWidth}px`})},[r.createElementVNode("div",Ur,[r.createElementVNode("div",Xr,r.toDisplayString(d.title),1),d.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a})):r.createCommentVNode("",!0)]),d.contentComponent?(r.openBlock(),r.createElementBlock("div",qr,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.contentComponent),r.normalizeProps(r.guardReactiveProps(d.contentComponentProps)),null,16))])):(r.openBlock(),r.createElementBlock("div",Kr,r.toDisplayString(d.message),1)),r.createElementVNode("div",Gr,[d.tertiaryActions?(r.openBlock(),r.createBlock(kt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:d.tertiaryActions.text,size:"md",onClick:h[0]||(h[0]=f=>c(d.tertiaryActions,"tertiary"))},null,8,["label"])):r.createCommentVNode("",!0),r.createVNode(ai,{class:"sm:hidden xs:hidden"}),d.secondaryActions?(r.openBlock(),r.createBlock(kt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:d.secondaryActions.text,size:"md",onClick:h[1]||(h[1]=f=>c(d.secondaryActions,"secondary"))},null,8,["label"])):r.createCommentVNode("",!0),d.primaryActions?(r.openBlock(),r.createBlock(kt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:d.primaryActions.text,size:"md",onClick:h[2]||(h[2]=f=>c(d.primaryActions,"primary"))},null,8,["label"])):r.createCommentVNode("",!0)])],4))],2)):r.createCommentVNode("",!0)]),_:1}))}}),Og="";/*!
3
+ ${o.value}
4
+ fm-btn--${r.size}
5
+ ${r.label?"":`fm-btn--${r.size}--just-icon`}
6
+ fm-btn--${r.variant}
7
+ ${r.disabled?"fm-btn--disabled":""}
8
+ `),disabled:r.disabled,type:r.type,onMousedown:a[0]||(a[0]=()=>s(!0)),onMouseup:a[1]||(a[1]=()=>s(!1)),onMouseleave:a[2]||(a[2]=()=>s(!1))},[r.icon&&r.iconPosition==="prepend"?(l.openBlock(),l.createBlock(L,{key:0,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),r.label?(l.openBlock(),l.createElementBlock("span",Oa,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),r.icon&&r.iconPosition==="append"?(l.openBlock(),l.createBlock(L,{key:2,name:r.icon,outline:!n.value,color:r.disabled?"neutral-gray-200":r.iconColor??"",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0)],42,Aa)),[[c,!r.disabled]])}}}),Iy="",fe=Q(Na,[["__scopeId","data-v-8c5319b7"]]),Ia={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},La=["v-wave","disabled","onClick","onMousedown"],Ta=l.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=d=>{o("update:modelValue",d)},s=l.ref(null),r=d=>{s.value=d},a=d=>d.disabled||n.disabled,c=d=>JSON.stringify(d)===JSON.stringify(n.modelValue);return(d,u)=>(l.openBlock(),l.createElementBlock("div",Ia,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,(f,p)=>(l.openBlock(),l.createElementBlock("button",{key:p,"v-wave":a(f),class:l.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":c(f),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(f)}]),disabled:a(f),onClick:h=>i(f),onMousedown:h=>r(f),onMouseup:u[0]||(u[0]=h=>r(null)),onMouseleave:u[1]||(u[1]=h=>r(null))},[f.icon?(l.openBlock(),l.createBlock(L,{key:0,name:f.icon,size:"md",color:a(f)?"neutral-gray-200":c(f)?"primary":"",outline:JSON.stringify(s.value)!==JSON.stringify(f)&&!c(f)},null,8,["name","color","outline"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700",[a(f)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0)],42,La))),128))]))}}),za={class:"grow"},Yi=l.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-title",t.padding])},[l.createElementVNode("div",za,[l.renderSlot(e.$slots,"default")]),l.renderSlot(e.$slots,"actions")],2))}}),Ha={class:"fm-typo-title-md-700 grow"},Wa=l.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(t){const e=t,n=l.useSlots();return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex-nowrap fm-card",`${t.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${t.horizontal?"fm-card--horizontal":""}`])},[l.renderSlot(o.$slots,"header",{title:e.title},()=>[t.title||l.unref(n)["header-title"]||l.unref(n)["header-actions"]?(l.openBlock(),l.createBlock(Yi,{key:0},{actions:l.withCtx(()=>[l.renderSlot(o.$slots,"header-actions")]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.renderSlot(o.$slots,"header-title",{title:e.title},()=>[l.createElementVNode("div",Ha,l.toDisplayString(e.title),1)])])]),_:3})):l.createCommentVNode("",!0)]),l.renderSlot(o.$slots,"default"),l.renderSlot(o.$slots,"actions")],2))}}),Ly="",ja=l.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(t){const e=t,n=l.computed(()=>{switch(e.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-actions",`${n.value} ${t.padding}`])},[l.renderSlot(o.$slots,"default")],2))}}),Ya=l.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-card-section",t.padding])},[l.renderSlot(e.$slots,"default")],2))}}),Gi=l.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:["chip-closed"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.ref(!1);function r(d){n.selectable&&(s.value=d)}const a=()=>{!n.selectable||n.disabled||(i.value=!i.value)},c=()=>{n.disabled||o("chip-closed")};return l.onMounted(()=>{i.value=n.selected}),l.watch(()=>n.selected,()=>{i.value=n.selected}),(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",i.value&&!d.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",d.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled,"hover:bg-fm-color-opacity-sm":!i.value&&!d.disabled&&d.selectable}]),onClick:a,onMousedown:u[0]||(u[0]=()=>r(!0)),onMouseup:u[1]||(u[1]=()=>r(!1)),onMouseleave:u[2]||(u[2]=()=>r(!1))},[l.renderSlot(d.$slots,"default",{},()=>[d.icon?(l.openBlock(),l.createBlock(L,{key:0,name:d.icon,size:"sm",outline:!s.value&&!i.value,color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),d.label?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",d.disabled?"text-fm-color-typo-disabled":i.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},l.toDisplayString(d.label),3)):l.createCommentVNode("",!0)]),d.removable?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex items-center justify-center rounded-xxxl",!i.value&&!d.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":d.disabled,"cursor-pointer":d.selectable&&!d.disabled}]),onClick:c},[l.createVNode(L,{name:"close",size:"sm",color:d.disabled?"neutral-gray-200":i.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):l.createCommentVNode("",!0)],34))}}),Ui=l.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(null),s=l.ref(0),r=l.ref(null),a=l.ref(),c=()=>{var p,h;if(!i.value)return;const u=i.value.getBoundingClientRect();s.value>0&&r.value&&((p=a.value)==null||p.splice(r.value,1)),s.value=0;let f=0;Array.from(i.value.children).forEach((g,m)=>{const b=g.getBoundingClientRect(),x=b.y-u.y;f=Math.max(b.height*2+4,f),x>f&&(s.value+=1,r.value=r.value===null?m:m-s.value)}),s.value>0&&r.value&&((h=a.value)==null||h.splice(r.value,0,{label:`+${s.value}`,removable:!1,selectable:!1,compact:n.compact}))},d=u=>{o("chip-closed",u)};return l.onMounted(()=>{a.value=n.items,c(),new ResizeObserver(()=>{c()}).observe(i.value)}),l.watch(()=>n.items,()=>{a.value=n.items,c()}),(u,f)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"chipsContainer",ref:i,class:l.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",u.compact?"max-h-48":"max-h-64"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,(p,h)=>(l.openBlock(),l.createBlock(Gi,{key:h,label:p.label,icon:p.icon,selected:p.selected,removable:p.removable!==void 0?p.removable:u.removable,selectable:p.selectable!==void 0?p.selectable:u.selectable,disabled:p.disabled!==void 0?p.disabled:u.disabled,compact:u.compact,onChipClosed:g=>d(h)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),Ga={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Ua={class:"overflow-y-auto"},qa={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Xa=l.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(null),s=r=>{n.overlay&&i.value&&r.target===i.value&&o("update:modelValue",!1)};return(r,a)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.Transition,null,{default:l.withCtx(()=>[r.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":r.overlay}),onClick:a[1]||(a[1]=c=>s(c))},[l.createElementVNode("div",{class:l.normalizeClass(`fm-dialog min-w-[${r.minWidth}px]`)},[l.createElementVNode("div",Ga,[l.renderSlot(r.$slots,"dialog-header"),r.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=c=>o("update:modelValue",!1))})):l.createCommentVNode("",!0)]),l.createElementVNode("div",Ua,[l.renderSlot(r.$slots,"dialog-content")]),l.createElementVNode("div",qa,[l.renderSlot(r.$slots,"dialog-footer")])],2)],2)):l.createCommentVNode("",!0)]),_:3})]))}}),Ty="",Ka={class:"fm-drop-field"},Za=["accept","disabled"],Ja=l.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.ref(),r=l.ref(),a=l.ref(),c=_=>{n.disabled||(_.stopPropagation(),_.preventDefault())},d=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!0)},u=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1)},f=_=>{n.disabled||(_.stopPropagation(),_.preventDefault(),i.value=!1,p(_))},p=_=>{var v;a.value=((v=_.dataTransfer)==null?void 0:v.files)??_.target.files;const k=a.value;if(s.value=g(k[0]),r.value=m(k[0]),s.value&&r.value)o("file-upload",k[0]);else{const C=h();o("file-rejected",[{file:k[0],reason:C}])}},h=()=>{const _=[];return s.value||_.push("invalid-type"),r.value||_.push("invalid-size"),_},g=_=>{if(!n.accept)return!0;const k=n.accept.split(",").map(v=>v.trim());for(const v of k)if(b(v)){if(y(v)===y(_.type))return!0}else if(x(_)===v||_.type===v)return!0;return!1},m=_=>_.size<=n.maxFileSize,b=_=>_.indexOf("*")!==-1,x=_=>"."+_.name.split(".").pop(),y=_=>_.substring(0,_.indexOf("/")),w=l.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!r.value)return`File size exceeds ${n.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),S=l.computed(()=>a.value?!s.value||!r.value:!1);return(_,k)=>(l.openBlock(),l.createElementBlock("label",Ka,[l.renderSlot(_.$slots,"label",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},l.toDisplayString(_.label),3)],!0),l.createElementVNode("div",{class:l.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":i.value,"fm-drop-field__container--invalid":S.value&&!_.disabled,"fm-drop-field__container--disabled":_.disabled}]),onDragenter:c,onDragover:d,onDragleave:u,onDrop:f},[(i.value||S.value)&&!_.disabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":i.value,"text-fm-color-typo-error":S.value})},l.toDisplayString(w.value),3)):(l.openBlock(),l.createBlock(fe,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:_.disabled},null,8,["disabled"])),l.renderSlot(_.$slots,"accept-text",{},()=>[n.accept?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-md-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Accepts ${n.accept}`),3)):l.createCommentVNode("",!0)],!0),l.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:_.accept,disabled:_.disabled,onChange:p},null,40,Za)],34),l.renderSlot(_.$slots,"helper-text",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-sm-400",[_.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},l.toDisplayString(`Max size ${n.maxFileSize*1e-6}mb`),3)],!0)]))}}),zy="",Qa=Q(Ja,[["__scopeId","data-v-c914dc32"]]),ec={},tc={class:"flex-grow"};function nc(t,e){return l.openBlock(),l.createElementBlock("div",tc)}const qi=Q(ec,[["render",nc]]),Xi=Symbol.for("fm:form"),Ki=Symbol.for("fm:radio-group"),Zi=Symbol.for("fm:stepper"),Ji=Symbol.for("fm:dialog"),Qi=Symbol.for("fm:menu"),oc={install:t=>{const e={open:n=>{const o={primary:[],secondary:[],tertiary:[]},i={onPrimary:d=>(o.primary.push(d),i),onSecondary:d=>(o.secondary.push(d),i),onTertiary:d=>(o.tertiary.push(d),i)};function s(){r&&l.render(null,r),r=null,c=null}let r=document.createElement("div");document.body.appendChild(r);const a=l.markRaw(es);let c=l.createVNode(a,{...n,unmount:s,storedFunctions:o});return c.appContext=t._context,l.render(c,r),i}};t.config.globalProperties.$dialog=e,t.provide(Ji,e)}},ic={key:0,class:"block relative"},sc={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},rc={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},lc={key:0,class:"overflow-y-auto"},ac={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},cc={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},es=l.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null}},emits:["dialog-opened","dialog-closed"],setup(t,{emit:e}){const n=l.ref(!0),o=t,i=e,s=l.ref(null),r=()=>{o.overlay&&(o.unmount(),i("dialog-closed"))},a=d=>{s.value&&d.target===s.value&&r()},c=(d,u)=>{o.storedFunctions[u].forEach(f=>f()),d.close&&r()};return l.onMounted(()=>{i("dialog-opened")}),(d,u)=>(l.openBlock(),l.createBlock(l.Transition,null,{default:l.withCtx(()=>[n.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:l.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":d.overlay}),onClick:a},[d.dialogComponent?(l.openBlock(),l.createElementBlock("div",ic,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.dialogComponent),l.normalizeProps(l.guardReactiveProps(d.dialogComponentProps)),null,16)),d.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",{key:1,class:"fm-dialog",style:l.normalizeStyle({"min-width":`${o.minWidth}px`})},[l.createElementVNode("div",sc,[l.createElementVNode("div",rc,l.toDisplayString(d.title),1),d.closeButton?(l.openBlock(),l.createBlock(L,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:r})):l.createCommentVNode("",!0)]),d.contentComponent?(l.openBlock(),l.createElementBlock("div",lc,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(d.contentComponent),l.normalizeProps(l.guardReactiveProps(d.contentComponentProps)),null,16))])):(l.openBlock(),l.createElementBlock("div",ac,l.toDisplayString(d.message),1)),l.createElementVNode("div",cc,[d.tertiaryActions?(l.openBlock(),l.createBlock(fe,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:d.tertiaryActions.text,size:"md",onClick:u[0]||(u[0]=f=>c(d.tertiaryActions,"tertiary"))},null,8,["label"])):l.createCommentVNode("",!0),l.createVNode(qi,{class:"sm:hidden xs:hidden"}),d.secondaryActions?(l.openBlock(),l.createBlock(fe,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:d.secondaryActions.text,size:"md",onClick:u[1]||(u[1]=f=>c(d.secondaryActions,"secondary"))},null,8,["label"])):l.createCommentVNode("",!0),d.primaryActions?(l.openBlock(),l.createBlock(fe,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:d.primaryActions.text,size:"md",onClick:u[2]||(u[2]=f=>c(d.primaryActions,"primary"))},null,8,["label"])):l.createCommentVNode("",!0)])],4))],2)):l.createCommentVNode("",!0)]),_:1}))}}),Hy="";/*!
9
9
  * @kurkle/color v0.3.2
10
10
  * https://github.com/kurkle/color#readme
11
11
  * (c) 2023 Jukka Kurkela
12
12
  * Released under the MIT License
13
- */function Ee(n){return n+.5|0}const jt=(n,t,e)=>Math.max(Math.min(n,e),t);function Ve(n){return jt(Ee(n*2.55),0,255)}function Ht(n){return jt(Ee(n*255),0,255)}function Pt(n){return jt(Ee(n/2.55)/100,0,1)}function fi(n){return jt(Ee(n*100),0,100)}const wt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ss=[..."0123456789ABCDEF"],Zr=n=>ss[n&15],Jr=n=>ss[(n&240)>>4]+ss[n&15],dn=n=>(n&240)>>4===(n&15),Qr=n=>dn(n.r)&&dn(n.g)&&dn(n.b)&&dn(n.a);function tl(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&wt[n[1]]*17,g:255&wt[n[2]]*17,b:255&wt[n[3]]*17,a:t===5?wt[n[4]]*17:255}:(t===7||t===9)&&(e={r:wt[n[1]]<<4|wt[n[2]],g:wt[n[3]]<<4|wt[n[4]],b:wt[n[5]]<<4|wt[n[6]],a:t===9?wt[n[7]]<<4|wt[n[8]]:255})),e}const el=(n,t)=>n<255?t(n):"";function nl(n){var t=Qr(n)?Zr:Jr;return n?"#"+t(n.r)+t(n.g)+t(n.b)+el(n.a,t):void 0}const sl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ui(n,t,e){const s=t*Math.min(e,1-e),i=(o,a=(o+n/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[i(0),i(8),i(4)]}function il(n,t,e){const s=(i,o=(i+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ol(n,t,e){const s=ui(n,1,.5);let i;for(t+e>1&&(i=1/(t+e),t*=i,e*=i),i=0;i<3;i++)s[i]*=1-t-e,s[i]+=t;return s}function al(n,t,e,s,i){return n===i?(t-e)/s+(t<e?6:0):t===i?(e-n)/s+2:(n-t)/s+4}function is(n){const e=n.r/255,s=n.g/255,i=n.b/255,o=Math.max(e,s,i),a=Math.min(e,s,i),l=(o+a)/2;let c,d,h;return o!==a&&(h=o-a,d=l>.5?h/(2-o-a):h/(o+a),c=al(e,s,i,h,o),c=c*60+.5),[c|0,d||0,l]}function os(n,t,e,s){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,s)).map(Ht)}function as(n,t,e){return os(ui,n,t,e)}function rl(n,t,e){return os(ol,n,t,e)}function ll(n,t,e){return os(il,n,t,e)}function pi(n){return(n%360+360)%360}function cl(n){const t=sl.exec(n);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ve(+t[5]):Ht(+t[5]));const i=pi(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=rl(i,o,a):t[1]==="hsv"?s=ll(i,o,a):s=as(i,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function dl(n,t){var e=is(n);e[0]=pi(e[0]+t),e=as(e),n.r=e[0],n.g=e[1],n.b=e[2]}function hl(n){if(!n)return;const t=is(n),e=t[0],s=fi(t[1]),i=fi(t[2]);return n.a<255?`hsla(${e}, ${s}%, ${i}%, ${Pt(n.a)})`:`hsl(${e}, ${s}%, ${i}%)`}const mi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},gi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function fl(){const n={},t=Object.keys(gi),e=Object.keys(mi);let s,i,o,a,l;for(s=0;s<t.length;s++){for(a=l=t[s],i=0;i<e.length;i++)o=e[i],l=l.replace(o,mi[o]);o=parseInt(gi[a],16),n[l]=[o>>16&255,o>>8&255,o&255]}return n}let hn;function ul(n){hn||(hn=fl(),hn.transparent=[0,0,0,0]);const t=hn[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const pl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ml(n){const t=pl.exec(n);let e=255,s,i,o;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?Ve(a):jt(a*255,0,255)}return s=+t[1],i=+t[3],o=+t[5],s=255&(t[2]?Ve(s):jt(s,0,255)),i=255&(t[4]?Ve(i):jt(i,0,255)),o=255&(t[6]?Ve(o):jt(o,0,255)),{r:s,g:i,b:o,a:e}}}function gl(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Pt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const rs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,xe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function bl(n,t,e){const s=xe(Pt(n.r)),i=xe(Pt(n.g)),o=xe(Pt(n.b));return{r:Ht(rs(s+e*(xe(Pt(t.r))-s))),g:Ht(rs(i+e*(xe(Pt(t.g))-i))),b:Ht(rs(o+e*(xe(Pt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function fn(n,t,e){if(n){let s=is(n);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=as(s),n.r=s[0],n.g=s[1],n.b=s[2]}}function bi(n,t){return n&&Object.assign(t||{},n)}function yi(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ht(n[3]))):(t=bi(n,{r:0,g:0,b:0,a:1}),t.a=Ht(t.a)),t}function yl(n){return n.charAt(0)==="r"?ml(n):cl(n)}class Pe{constructor(t){if(t instanceof Pe)return t;const e=typeof t;let s;e==="object"?s=yi(t):e==="string"&&(s=tl(t)||ul(t)||yl(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=bi(this._rgb);return t&&(t.a=Pt(t.a)),t}set rgb(t){this._rgb=yi(t)}rgbString(){return this._valid?gl(this._rgb):void 0}hexString(){return this._valid?nl(this._rgb):void 0}hslString(){return this._valid?hl(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,i=t.rgb;let o;const a=e===o?.5:e,l=2*a-1,c=s.a-i.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;o=1-d,s.r=255&d*s.r+o*i.r+.5,s.g=255&d*s.g+o*i.g+.5,s.b=255&d*s.b+o*i.b+.5,s.a=a*s.a+(1-a)*i.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=bl(this._rgb,t._rgb,e)),this}clone(){return new Pe(this.rgb)}alpha(t){return this._rgb.a=Ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ee(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fn(this._rgb,2,t),this}darken(t){return fn(this._rgb,2,-t),this}saturate(t){return fn(this._rgb,1,t),this}desaturate(t){return fn(this._rgb,1,-t),this}rotate(t){return dl(this._rgb,t),this}}/*!
13
+ */function Ot(t){return t+.5|0}const qe=(t,e,n)=>Math.max(Math.min(t,n),e);function Nt(t){return qe(Ot(t*2.55),0,255)}function Xe(t){return qe(Ot(t*255),0,255)}function $e(t){return qe(Ot(t/2.55)/100,0,1)}function ts(t){return qe(Ot(t*100),0,100)}const ke={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Co=[..."0123456789ABCDEF"],dc=t=>Co[t&15],uc=t=>Co[(t&240)>>4]+Co[t&15],_n=t=>(t&240)>>4===(t&15),fc=t=>_n(t.r)&&_n(t.g)&&_n(t.b)&&_n(t.a);function hc(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&ke[t[1]]*17,g:255&ke[t[2]]*17,b:255&ke[t[3]]*17,a:e===5?ke[t[4]]*17:255}:(e===7||e===9)&&(n={r:ke[t[1]]<<4|ke[t[2]],g:ke[t[3]]<<4|ke[t[4]],b:ke[t[5]]<<4|ke[t[6]],a:e===9?ke[t[7]]<<4|ke[t[8]]:255})),n}const pc=(t,e)=>t<255?e(t):"";function gc(t){var e=fc(t)?dc:uc;return t?"#"+e(t.r)+e(t.g)+e(t.b)+pc(t.a,e):void 0}const mc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ns(t,e,n){const o=e*Math.min(n,1-n),i=(s,r=(s+t/30)%12)=>n-o*Math.max(Math.min(r-3,9-r,1),-1);return[i(0),i(8),i(4)]}function bc(t,e,n){const o=(i,s=(i+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[o(5),o(3),o(1)]}function yc(t,e,n){const o=ns(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)o[i]*=1-e-n,o[i]+=e;return o}function _c(t,e,n,o,i){return t===i?(e-n)/o+(e<n?6:0):e===i?(n-t)/o+2:(t-e)/o+4}function ko(t){const n=t.r/255,o=t.g/255,i=t.b/255,s=Math.max(n,o,i),r=Math.min(n,o,i),a=(s+r)/2;let c,d,u;return s!==r&&(u=s-r,d=a>.5?u/(2-s-r):u/(s+r),c=_c(n,o,i,u,s),c=c*60+.5),[c|0,d||0,a]}function So(t,e,n,o){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,o)).map(Xe)}function vo(t,e,n){return So(ns,t,e,n)}function xc(t,e,n){return So(yc,t,e,n)}function wc(t,e,n){return So(bc,t,e,n)}function os(t){return(t%360+360)%360}function Cc(t){const e=mc.exec(t);let n=255,o;if(!e)return;e[5]!==o&&(n=e[6]?Nt(+e[5]):Xe(+e[5]));const i=os(+e[2]),s=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?o=xc(i,s,r):e[1]==="hsv"?o=wc(i,s,r):o=vo(i,s,r),{r:o[0],g:o[1],b:o[2],a:n}}function kc(t,e){var n=ko(t);n[0]=os(n[0]+e),n=vo(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Sc(t){if(!t)return;const e=ko(t),n=e[0],o=ts(e[1]),i=ts(e[2]);return t.a<255?`hsla(${n}, ${o}%, ${i}%, ${$e(t.a)})`:`hsl(${n}, ${o}%, ${i}%)`}const is={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ss={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function vc(){const t={},e=Object.keys(ss),n=Object.keys(is);let o,i,s,r,a;for(o=0;o<e.length;o++){for(r=a=e[o],i=0;i<n.length;i++)s=n[i],a=a.replace(s,is[s]);s=parseInt(ss[r],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let xn;function Mc(t){xn||(xn=vc(),xn.transparent=[0,0,0,0]);const e=xn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Ec=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Dc(t){const e=Ec.exec(t);let n=255,o,i,s;if(e){if(e[7]!==o){const r=+e[7];n=e[8]?Nt(r):qe(r*255,0,255)}return o=+e[1],i=+e[3],s=+e[5],o=255&(e[2]?Nt(o):qe(o,0,255)),i=255&(e[4]?Nt(i):qe(i,0,255)),s=255&(e[6]?Nt(s):qe(s,0,255)),{r:o,g:i,b:s,a:n}}}function Vc(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${$e(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Mo=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Mt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Rc(t,e,n){const o=Mt($e(t.r)),i=Mt($e(t.g)),s=Mt($e(t.b));return{r:Xe(Mo(o+n*(Mt($e(e.r))-o))),g:Xe(Mo(i+n*(Mt($e(e.g))-i))),b:Xe(Mo(s+n*(Mt($e(e.b))-s))),a:t.a+n*(e.a-t.a)}}function wn(t,e,n){if(t){let o=ko(t);o[e]=Math.max(0,Math.min(o[e]+o[e]*n,e===0?360:1)),o=vo(o),t.r=o[0],t.g=o[1],t.b=o[2]}}function rs(t,e){return t&&Object.assign(e||{},t)}function ls(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Xe(t[3]))):(e=rs(t,{r:0,g:0,b:0,a:1}),e.a=Xe(e.a)),e}function Fc(t){return t.charAt(0)==="r"?Dc(t):Cc(t)}class It{constructor(e){if(e instanceof It)return e;const n=typeof e;let o;n==="object"?o=ls(e):n==="string"&&(o=hc(e)||Mc(e)||Fc(e)),this._rgb=o,this._valid=!!o}get valid(){return this._valid}get rgb(){var e=rs(this._rgb);return e&&(e.a=$e(e.a)),e}set rgb(e){this._rgb=ls(e)}rgbString(){return this._valid?Vc(this._rgb):void 0}hexString(){return this._valid?gc(this._rgb):void 0}hslString(){return this._valid?Sc(this._rgb):void 0}mix(e,n){if(e){const o=this.rgb,i=e.rgb;let s;const r=n===s?.5:n,a=2*r-1,c=o.a-i.a,d=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;s=1-d,o.r=255&d*o.r+s*i.r+.5,o.g=255&d*o.g+s*i.g+.5,o.b=255&d*o.b+s*i.b+.5,o.a=r*o.a+(1-r)*i.a,this.rgb=o}return this}interpolate(e,n){return e&&(this._rgb=Rc(this._rgb,e._rgb,n)),this}clone(){return new It(this.rgb)}alpha(e){return this._rgb.a=Xe(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Ot(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return wn(this._rgb,2,e),this}darken(e){return wn(this._rgb,2,-e),this}saturate(e){return wn(this._rgb,1,e),this}desaturate(e){return wn(this._rgb,1,-e),this}rotate(e){return kc(this._rgb,e),this}}/*!
14
14
  * Chart.js v4.4.1
15
15
  * https://www.chartjs.org
16
16
  * (c) 2023 Chart.js Contributors
17
17
  * Released under the MIT License
18
- */function At(){}const _l=(()=>{let n=0;return()=>n++})();function I(n){return n===null||typeof n>"u"}function X(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gt(n,t){return J(n)?n:t}function L(n,t){return typeof n>"u"?t:n}const xl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,_i=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function H(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(n,t,e,s){let i,o,a;if(X(n))if(o=n.length,s)for(i=o-1;i>=0;i--)t.call(e,n[i],i);else for(i=0;i<o;i++)t.call(e,n[i],i);else if(z(n))for(a=Object.keys(n),o=a.length,i=0;i<o;i++)t.call(e,n[a[i]],a[i])}function un(n,t){let e,s,i,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,s=n.length;e<s;++e)if(i=n[e],o=t[e],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function pn(n){if(X(n))return n.map(pn);if(z(n)){const t=Object.create(null),e=Object.keys(n),s=e.length;let i=0;for(;i<s;++i)t[e[i]]=pn(n[e[i]]);return t}return n}function xi(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function kl(n,t,e,s){if(!xi(n))return;const i=t[n],o=e[n];z(i)&&z(o)?Ae(i,o,s):t[n]=pn(o)}function Ae(n,t,e){const s=X(t)?t:[t],i=s.length;if(!z(n))return n;e=e||{};const o=e.merger||kl;let a;for(let l=0;l<i;++l){if(a=s[l],!z(a))continue;const c=Object.keys(a);for(let d=0,h=c.length;d<h;++d)o(c[d],n,a,e)}return n}function Oe(n,t){return Ae(n,t,{merger:wl})}function wl(n,t,e){if(!xi(n))return;const s=t[n],i=e[n];z(s)&&z(i)?Oe(s,i):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=pn(i))}const ki={"":n=>n,x:n=>n.x,y:n=>n.y};function Cl(n){const t=n.split("."),e=[];let s="";for(const i of t)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Ml(n){const t=Cl(n);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Ut(n,t){return(ki[t]||(ki[t]=Ml(t)))(n)}function ls(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Fe=n=>typeof n<"u",Xt=n=>typeof n=="function",wi=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Sl(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Dl=K+q,mn=Number.POSITIVE_INFINITY,Bl=q/180,tt=q/2,se=q/4,Ci=q*2/3,qt=Math.log10,Dt=Math.sign;function Te(n,t,e){return Math.abs(n-t)<e}function Mi(n){const t=Math.round(n);n=Te(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(qt(n))),s=n/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function vl(n){const t=[],e=Math.sqrt(n);let s;for(s=1;s<e;s++)n%s===0&&(t.push(s),t.push(n/s));return e===(e|0)&&t.push(e),t.sort((i,o)=>i-o).pop(),t}function ke(n){return!isNaN(parseFloat(n))&&isFinite(n)}function El(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Si(n,t,e){let s,i,o;for(s=0,i=n.length;s<i;s++)o=n[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Mt(n){return n*(q/180)}function cs(n){return n*(180/q)}function Di(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Bi(n,t){const e=t.x-n.x,s=t.y-n.y,i=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*q&&(o+=K),{angle:o,distance:i}}function ds(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Vl(n,t){return(n-t+Dl)%K-q}function bt(n){return(n%K+K)%K}function Ne(n,t,e,s){const i=bt(n),o=bt(t),a=bt(e),l=bt(o-i),c=bt(a-i),d=bt(i-o),h=bt(i-a);return i===o||i===a||s&&o===a||l>c&&d<h}function it(n,t,e){return Math.max(t,Math.min(e,n))}function Pl(n){return it(n,-32768,32767)}function Ot(n,t,e,s=1e-6){return n>=Math.min(t,e)-s&&n<=Math.max(t,e)+s}function hs(n,t,e){e=e||(a=>n[a]<t);let s=n.length-1,i=0,o;for(;s-i>1;)o=i+s>>1,e(o)?i=o:s=o;return{lo:i,hi:s}}const Ft=(n,t,e,s)=>hs(n,e,s?i=>{const o=n[i][t];return o<e||o===e&&n[i+1][t]===e}:i=>n[i][t]<e),Al=(n,t,e)=>hs(n,e,s=>n[s][t]>=e);function Ol(n,t,e){let s=0,i=n.length;for(;s<i&&n[s]<t;)s++;for(;i>s&&n[i-1]>e;)i--;return s>0||i<n.length?n.slice(s,i):n}const vi=["push","pop","shift","splice","unshift"];function Fl(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vi.forEach(e=>{const s="_onData"+ls(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const a=i.apply(this,o);return n._chartjs.listeners.forEach(l=>{typeof l[s]=="function"&&l[s](...o)}),a}})})}function Ei(n,t){const e=n._chartjs;if(!e)return;const s=e.listeners,i=s.indexOf(t);i!==-1&&s.splice(i,1),!(s.length>0)&&(vi.forEach(o=>{delete n[o]}),delete n._chartjs)}function Vi(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Pi=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ai(n,t){let e=[],s=!1;return function(...i){e=i,s||(s=!0,Pi.call(window,()=>{s=!1,n.apply(t,e)}))}}function Tl(n,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(n,t,s)):n.apply(this,s),t}}const fs=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Nl=(n,t,e,s)=>n===(s?"left":"right")?e:n==="center"?(t+e)/2:t;function Oi(n,t,e){const s=t.length;let i=0,o=s;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(i=it(Math.min(Ft(l,c,d).lo,e?s:Ft(t,c,a.getPixelForValue(d)).lo),0,s-1)),u?o=it(Math.max(Ft(l,a.axis,h,!0).hi+1,e?0:Ft(t,c,a.getPixelForValue(h),!0).hi+1),i,s)-i:o=s-i}return{start:i,count:o}}function Fi(n){const{xScale:t,yScale:e,_scaleRanges:s}=n,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return n._scaleRanges=i,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,i),o}const gn=n=>n===0||n===1,Ti=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),Ni=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,$e={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*tt)+1,easeOutSine:n=>Math.sin(n*tt),easeInOutSine:n=>-.5*(Math.cos(q*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>gn(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>gn(n)?n:Ti(n,.075,.3),easeOutElastic:n=>gn(n)?n:Ni(n,.075,.3),easeInOutElastic(n){return gn(n)?n:n<.5?.5*Ti(n*2,.1125,.45):.5+.5*Ni(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-$e.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?$e.easeInBounce(n*2)*.5:$e.easeOutBounce(n*2-1)*.5+.5};function us(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $i(n){return us(n)?n:new Pe(n)}function ps(n){return us(n)?n:new Pe(n).saturate(.5).darken(.1).hexString()}const $l=["x","y","borderWidth","radius","tension"],Ll=["color","borderColor","backgroundColor"];function Rl(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Ll},numbers:{type:"number",properties:$l}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function zl(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Li=new Map;function Il(n,t){t=t||{};const e=n+JSON.stringify(t);let s=Li.get(e);return s||(s=new Intl.NumberFormat(n,t),Li.set(e,s)),s}function Le(n,t,e){return Il(t,e).format(n)}const Ri={values(n){return X(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const s=this.chart.options.locale;let i,o=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(i="scientific"),o=Wl(n,e)}const a=qt(Math.abs(o)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:i,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Le(n,s,c)},logarithmic(n,t,e){if(n===0)return"0";const s=e[t].significand||n/Math.pow(10,Math.floor(qt(n)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Ri.numeric.call(this,n,t,e):""}};function Wl(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var bn={formatters:Ri};function Yl(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:bn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ie=Object.create(null),ms=Object.create(null);function Re(n,t){if(!t)return n;const e=t.split(".");for(let s=0,i=e.length;s<i;++s){const o=e[s];n=n[o]||(n[o]=Object.create(null))}return n}function gs(n,t,e){return typeof t=="string"?Ae(Re(n,t),e):Ae(Re(n,""),t)}class jl{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,i)=>ps(i.backgroundColor),this.hoverBorderColor=(s,i)=>ps(i.borderColor),this.hoverColor=(s,i)=>ps(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return gs(this,t,e)}get(t){return Re(this,t)}describe(t,e){return gs(ms,t,e)}override(t,e){return gs(ie,t,e)}route(t,e,s,i){const o=Re(this,t),a=Re(this,s),l="_"+e;Object.defineProperties(o,{[l]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[l],d=a[i];return z(c)?Object.assign({},d,c):L(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(e=>e(this))}}var Q=new jl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rl,zl,Yl]);function Hl(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function yn(n,t,e,s,i){let o=t[i];return o||(o=t[i]=n.measureText(i).width,e.push(i)),o>s&&(s=o),s}function Ul(n,t,e,s){s=s||{};let i=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(i=s.data={},o=s.garbageCollect=[],s.font=t),n.save(),n.font=t;let a=0;const l=e.length;let c,d,h,f,u;for(c=0;c<l;c++)if(f=e[c],f!=null&&!X(f))a=yn(n,i,o,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=yn(n,i,o,a,u));n.restore();const p=o.length/2;if(p>e.length){for(c=0;c<p;c++)delete i[o[c]];o.splice(0,p)}return a}function oe(n,t,e){const s=n.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*s)/s+i}function zi(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function bs(n,t,e,s){Ii(n,t,e,s,null)}function Ii(n,t,e,s,i){let o,a,l,c,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Bl;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,s),n.rotate(b),n.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),p){default:i?n.ellipse(e,s,i/2,g,0,0,K):n.arc(e,s,g,0,K),n.closePath();break;case"triangle":h=i?i/2:g,n.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Ci,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Ci,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(b+se)*c,f=Math.cos(b+se)*(i?i/2-d:c),l=Math.sin(b+se)*c,u=Math.sin(b+se)*(i?i/2-d:c),n.arc(e-f,s-l,d,b-q,b-tt),n.arc(e+u,s-a,d,b-tt,b),n.arc(e+f,s+l,d,b,b+tt),n.arc(e-u,s+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=i?i/2:c,n.rect(e-h,s-c,2*h,2*c);break}b+=se;case"rectRot":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+u,s-a),n.lineTo(e+f,s+l),n.lineTo(e-u,s+a),n.closePath();break;case"crossRot":b+=se;case"cross":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"star":f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a),b+=se,f=Math.cos(b)*(i?i/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(i?i/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"line":a=i?i/2:Math.cos(b)*g,l=Math.sin(b)*g,n.moveTo(e-a,s-l),n.lineTo(e+a,s+l);break;case"dash":n.moveTo(e,s),n.lineTo(e+Math.cos(b)*(i?i/2:g),s+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Tt(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function _n(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function xn(n){n.restore()}function Xl(n,t,e,s,i){if(!t)return n.lineTo(e.x,e.y);if(i==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else i==="after"!=!!s?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function ql(n,t,e,s){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Kl(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),I(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Gl(n,t,e,s,i){if(i.strikethrough||i.underline){const o=n.measureText(s),a=t-o.actualBoundingBoxLeft,l=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,d=e+o.actualBoundingBoxDescent,h=i.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=i.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function Zl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ae(n,t,e,s,i,o={}){const a=X(t)?t:[t],l=o.strokeWidth>0&&o.strokeColor!=="";let c,d;for(n.save(),n.font=i.string,Kl(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&Zl(n,o.backdrop),l&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),I(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,s,o.maxWidth)),n.fillText(d,e,s,o.maxWidth),Gl(n,e,s,d,o),s+=Number(i.lineHeight);n.restore()}function ze(n,t){const{x:e,y:s,w:i,h:o,radius:a}=t;n.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*q,q,!0),n.lineTo(e,s+o-a.bottomLeft),n.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+i-a.bottomRight,s+o),n.arc(e+i-a.bottomRight,s+o-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+i,s+a.topRight),n.arc(e+i-a.topRight,s+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,s)}const Jl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ql=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tc(n,t){const e=(""+n).match(Jl);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const ec=n=>+n||0;function ys(n,t){const e={},s=z(t),i=s?Object.keys(t):t,o=z(n)?s?a=>L(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of i)e[a]=ec(o(a));return e}function Wi(n){return ys(n,{top:"y",right:"x",bottom:"y",left:"x"})}function re(n){return ys(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Wi(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(n,t){n=n||{},t=t||Q.font;let e=L(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=L(n.style,t.style);s&&!(""+s).match(Ql)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:L(n.family,t.family),lineHeight:tc(L(n.lineHeight,t.lineHeight),e),size:e,style:s,weight:L(n.weight,t.weight),string:""};return i.string=Hl(i),i}function Ie(n,t,e,s){let i=!0,o,a,l;for(o=0,a=n.length;o<a;++o)if(l=n[o],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),i=!1),e!==void 0&&X(l)&&(l=l[e%l.length],i=!1),l!==void 0))return s&&!i&&(s.cacheable=!1),l}function nc(n,t,e){const{min:s,max:i}=n,o=_i(t,(i-s)/2),a=(l,c)=>e&&l===0?0:l+c;return{min:a(s,-Math.abs(o)),max:a(i,o)}}function Kt(n,t){return Object.assign(Object.create(n),t)}function _s(n,t=[""],e,s,i=()=>n[0]){const o=e||n;typeof s>"u"&&(s=Xi("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:s,_getTarget:i,override:l=>_s([l,...n],t,o,s)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return ji(l,c,()=>dc(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return qi(l).includes(c)},ownKeys(l){return qi(l)},set(l,c,d){const h=l._storage||(l._storage=i());return l[c]=h[c]=d,delete l._keys,!0}})}function we(n,t,e,s){const i={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Yi(n,s),setContext:o=>we(n,o,e,s),override:o=>we(n.override(o),t,e,s)};return new Proxy(i,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,l){return ji(o,a,()=>ic(o,a,l))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(o,a,l){return n[a]=l,delete o[a],!0}})}function Yi(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:i=t.allKeys}=n;return{allKeys:i,scriptable:e,indexable:s,isScriptable:Xt(e)?e:()=>e,isIndexable:Xt(s)?s:()=>s}}const sc=(n,t)=>n?n+ls(t):t,xs=(n,t)=>z(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ji(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const s=e();return n[t]=s,s}function ic(n,t,e){const{_proxy:s,_context:i,_subProxy:o,_descriptors:a}=n;let l=s[t];return Xt(l)&&a.isScriptable(t)&&(l=oc(t,l,n,e)),X(l)&&l.length&&(l=ac(t,l,n,a.isIndexable)),xs(t,l)&&(l=we(l,i,o&&o[t],a)),l}function oc(n,t,e,s){const{_proxy:i,_context:o,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=t(o,a||s);return l.delete(n),xs(n,c)&&(c=ks(i._scopes,i,n,c)),c}function ac(n,t,e,s){const{_proxy:i,_context:o,_subProxy:a,_descriptors:l}=e;if(typeof o.index<"u"&&s(n))return t[o.index%t.length];if(z(t[0])){const c=t,d=i._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=ks(d,i,n,h);t.push(we(f,o,a&&a[n],l))}}return t}function Hi(n,t,e){return Xt(n)?n(t,e):n}const rc=(n,t)=>n===!0?t:typeof n=="string"?Ut(t,n):void 0;function lc(n,t,e,s,i){for(const o of t){const a=rc(e,o);if(a){n.add(a);const l=Hi(a._fallback,e,i);if(typeof l<"u"&&l!==e&&l!==s)return l}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function ks(n,t,e,s){const i=t._rootScopes,o=Hi(t._fallback,e,s),a=[...n,...i],l=new Set;l.add(s);let c=Ui(l,a,e,o||e,s);return c===null||typeof o<"u"&&o!==e&&(c=Ui(l,a,o,c,s),c===null)?!1:_s(Array.from(l),[""],i,o,()=>cc(t,e,s))}function Ui(n,t,e,s,i){for(;e;)e=lc(n,t,e,s,i);return e}function cc(n,t,e){const s=n._getTarget();t in s||(s[t]={});const i=s[t];return X(i)&&z(e)?e:i||{}}function dc(n,t,e,s){let i;for(const o of t)if(i=Xi(sc(o,n),e),typeof i<"u")return xs(n,i)?ks(e,s,n,i):i}function Xi(n,t){for(const e of t){if(!e)continue;const s=e[n];if(typeof s<"u")return s}}function qi(n){let t=n._keys;return t||(t=n._keys=hc(n._scopes)),t}function hc(n){const t=new Set;for(const e of n)for(const s of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(s);return Array.from(t)}function Ki(n,t,e,s){const{iScale:i}=n,{key:o="r"}=this._parsing,a=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+e,h=t[d],a[l]={r:i.parse(Ut(h,o),d)};return a}const fc=Number.EPSILON||1e-14,Ce=(n,t)=>t<n.length&&!n[t].skip&&n[t],Gi=n=>n==="x"?"y":"x";function uc(n,t,e,s){const i=n.skip?t:n,o=t,a=e.skip?t:e,l=ds(o,i),c=ds(a,o);let d=l/(l+c),h=c/(l+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=s*d,u=s*h;return{previous:{x:o.x-f*(a.x-i.x),y:o.y-f*(a.y-i.y)},next:{x:o.x+u*(a.x-i.x),y:o.y+u*(a.y-i.y)}}}function pc(n,t,e){const s=n.length;let i,o,a,l,c,d=Ce(n,0);for(let h=0;h<s-1;++h)if(c=d,d=Ce(n,h+1),!(!c||!d)){if(Te(t[h],0,fc)){e[h]=e[h+1]=0;continue}i=e[h]/t[h],o=e[h+1]/t[h],l=Math.pow(i,2)+Math.pow(o,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=i*a*t[h],e[h+1]=o*a*t[h])}}function mc(n,t,e="x"){const s=Gi(e),i=n.length;let o,a,l,c=Ce(n,0);for(let d=0;d<i;++d){if(a=l,l=c,c=Ce(n,d+1),!l)continue;const h=l[e],f=l[s];a&&(o=(h-a[e])/3,l[`cp1${e}`]=h-o,l[`cp1${s}`]=f-o*t[d]),c&&(o=(c[e]-h)/3,l[`cp2${e}`]=h+o,l[`cp2${s}`]=f+o*t[d])}}function gc(n,t="x"){const e=Gi(t),s=n.length,i=Array(s).fill(0),o=Array(s);let a,l,c,d=Ce(n,0);for(a=0;a<s;++a)if(l=c,c=d,d=Ce(n,a+1),!!c){if(d){const h=d[t]-c[t];i[a]=h!==0?(d[e]-c[e])/h:0}o[a]=l?d?Dt(i[a-1])!==Dt(i[a])?0:(i[a-1]+i[a])/2:i[a-1]:i[a]}pc(n,i,o),mc(n,o,t)}function kn(n,t,e){return Math.max(Math.min(n,e),t)}function bc(n,t){let e,s,i,o,a,l=Tt(n[0],t);for(e=0,s=n.length;e<s;++e)a=o,o=l,l=e<s-1&&Tt(n[e+1],t),o&&(i=n[e],a&&(i.cp1x=kn(i.cp1x,t.left,t.right),i.cp1y=kn(i.cp1y,t.top,t.bottom)),l&&(i.cp2x=kn(i.cp2x,t.left,t.right),i.cp2y=kn(i.cp2y,t.top,t.bottom)))}function yc(n,t,e,s,i){let o,a,l,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")gc(n,i);else{let d=s?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)l=n[o],c=uc(d,l,n[Math.min(o+1,a-(s?0:1))%a],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&bc(n,e)}function ws(){return typeof window<"u"&&typeof document<"u"}function Cs(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wn(n,t,e){let s;return typeof n=="string"?(s=parseInt(n,10),n.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=n,s}const Cn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function _c(n,t){return Cn(n).getPropertyValue(t)}const xc=["top","right","bottom","left"];function le(n,t,e){const s={};e=e?"-"+e:"";for(let i=0;i<4;i++){const o=xc[i];s[o]=parseFloat(n[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const kc=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function wc(n,t){const e=n.touches,s=e&&e.length?e[0]:n,{offsetX:i,offsetY:o}=s;let a=!1,l,c;if(kc(i,o,n.target))l=i,c=o;else{const d=t.getBoundingClientRect();l=s.clientX-d.left,c=s.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function ce(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:s}=t,i=Cn(e),o=i.boxSizing==="border-box",a=le(i,"padding"),l=le(i,"border","width"),{x:c,y:d,box:h}=wc(n,e),f=a.left+(h&&l.left),u=a.top+(h&&l.top);let{width:p,height:m}=t;return o&&(p-=a.width+l.width,m-=a.height+l.height),{x:Math.round((c-f)/p*e.width/s),y:Math.round((d-u)/m*e.height/s)}}function Cc(n,t,e){let s,i;if(t===void 0||e===void 0){const o=Cs(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),l=Cn(o),c=le(l,"border","width"),d=le(l,"padding");t=a.width-d.width-c.width,e=a.height-d.height-c.height,s=wn(l.maxWidth,o,"clientWidth"),i=wn(l.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||mn,maxHeight:i||mn}}const Mn=n=>Math.round(n*10)/10;function Mc(n,t,e,s){const i=Cn(n),o=le(i,"margin"),a=wn(i.maxWidth,n,"clientWidth")||mn,l=wn(i.maxHeight,n,"clientHeight")||mn,c=Cc(n,t,e);let{width:d,height:h}=c;if(i.boxSizing==="content-box"){const u=le(i,"border","width"),p=le(i,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-o.width),h=Math.max(0,s?d/s:h-o.height),d=Mn(Math.min(d,a,c.maxWidth)),h=Mn(Math.min(h,l,c.maxHeight)),d&&!h&&(h=Mn(d/2)),(t!==void 0||e!==void 0)&&s&&c.height&&h>c.height&&(h=c.height,d=Mn(Math.floor(h*s))),{width:d,height:h}}function Zi(n,t,e){const s=t||1,i=Math.floor(n.height*s),o=Math.floor(n.width*s);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==s||a.height!==i||a.width!==o?(n.currentDevicePixelRatio=s,a.height=i,a.width=o,n.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Sc=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};ws()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Ji(n,t){const e=_c(n,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function de(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Dc(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:s==="middle"?e<.5?n.y:t.y:s==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Bc(n,t,e,s){const i={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=de(n,i,e),l=de(i,o,e),c=de(o,t,e),d=de(a,l,e),h=de(l,c,e);return de(d,h,e)}const vc=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ec=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Me(n,t,e){return n?vc(t,e):Ec()}function Qi(n,t){let e,s;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=s)}function to(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function eo(n){return n==="angle"?{between:Ne,compare:Vl,normalize:bt}:{between:Ot,compare:(t,e)=>t-e,normalize:t=>t}}function no({start:n,end:t,count:e,loop:s,style:i}){return{start:n%e,end:t%e,loop:s&&(t-n+1)%e===0,style:i}}function Vc(n,t,e){const{property:s,start:i,end:o}=e,{between:a,normalize:l}=eo(s),c=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=c,h+=c,u=0,p=c;u<p&&a(l(t[d%c][s]),i,o);++u)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function so(n,t,e){if(!e)return[n];const{property:s,start:i,end:o}=e,a=t.length,{compare:l,between:c,normalize:d}=eo(s),{start:h,end:f,loop:u,style:p}=Vc(n,t,e),m=[];let g=!1,b=null,x,y,k;const M=()=>c(i,k,x)&&l(i,k)!==0,_=()=>l(o,x)===0||c(o,k,x),w=()=>g||M(),S=()=>!g||_();for(let C=h,v=h;C<=f;++C)y=t[C%a],!y.skip&&(x=d(y[s]),x!==k&&(g=c(x,i,o),b===null&&w()&&(b=l(x,i)===0?C:v),b!==null&&S()&&(m.push(no({start:b,end:C,loop:u,count:a,style:p})),b=null),v=C,k=x));return b!==null&&m.push(no({start:b,end:f,loop:u,count:a,style:p})),m}function io(n,t){const e=[],s=n.segments;for(let i=0;i<s.length;i++){const o=so(s[i],n.points,t);o.length&&e.push(...o)}return e}function Pc(n,t,e,s){let i=0,o=t-1;if(e&&!s)for(;i<t&&!n[i].skip;)i++;for(;i<t&&n[i].skip;)i++;for(i%=t,e&&(o+=i);o>i&&n[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Ac(n,t,e,s){const i=n.length,o=[];let a=t,l=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%i];d.skip||d.stop?l.skip||(s=!1,o.push({start:t%i,end:(c-1)%i,loop:s}),t=a=d.stop?c:null):(a=c,l.skip&&(t=c)),l=d}return a!==null&&o.push({start:t%i,end:a%i,loop:s}),o}function Oc(n,t){const e=n.points,s=n.options.spanGaps,i=e.length;if(!i)return[];const o=!!n._loop,{start:a,end:l}=Pc(e,i,o,s);if(s===!0)return oo(n,[{start:a,end:l,loop:o}],e,t);const c=l<a?l+i:l,d=!!n._fullLoop&&a===0&&l===i-1;return oo(n,Ac(e,a,c,d),e,t)}function oo(n,t,e,s){return!s||!s.setContext||!e?t:Fc(n,t,e,s)}function Fc(n,t,e,s){const i=n._chart.getContext(),o=ao(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=e.length,d=[];let h=o,f=t[0].start,u=f;function p(m,g,b,x){const y=l?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=y;for(;e[g%c].skip;)g+=y;m%c!==g%c&&(d.push({start:m%c,end:g%c,loop:b,style:x}),h=x,f=g%c)}}for(const m of t){f=l?f:m.start;let g=e[f%c],b;for(u=f+1;u<=m.end;u++){const x=e[u%c];b=ao(s.setContext(Kt(i,{type:"segment",p0:g,p1:x,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:a}))),Tc(b,h)&&p(f,u-1,m.loop,h),g=x,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function ao(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Tc(n,t){if(!t)return!1;const e=[],s=function(i,o){return us(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,s)!==JSON.stringify(t,s)}/*!
18
+ */function Pe(){}const Bc=(()=>{let t=0;return()=>t++})();function H(t){return t===null||typeof t>"u"}function q(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function z(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ee(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function ye(t,e){return ee(t)?t:e}function T(t,e){return typeof t>"u"?e:t}const $c=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,as=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function G(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function j(t,e,n,o){let i,s,r;if(q(t))if(s=t.length,o)for(i=s-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i<s;i++)e.call(n,t[i],i);else if(z(t))for(r=Object.keys(t),s=r.length,i=0;i<s;i++)e.call(n,t[r[i]],r[i])}function Cn(t,e){let n,o,i,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,o=t.length;n<o;++n)if(i=t[n],s=e[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function kn(t){if(q(t))return t.map(kn);if(z(t)){const e=Object.create(null),n=Object.keys(t),o=n.length;let i=0;for(;i<o;++i)e[n[i]]=kn(t[n[i]]);return e}return t}function cs(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Pc(t,e,n,o){if(!cs(t))return;const i=e[t],s=n[t];z(i)&&z(s)?Lt(i,s,o):e[t]=kn(s)}function Lt(t,e,n){const o=q(e)?e:[e],i=o.length;if(!z(t))return t;n=n||{};const s=n.merger||Pc;let r;for(let a=0;a<i;++a){if(r=o[a],!z(r))continue;const c=Object.keys(r);for(let d=0,u=c.length;d<u;++d)s(c[d],t,r,n)}return t}function Tt(t,e){return Lt(t,e,{merger:Ac})}function Ac(t,e,n){if(!cs(t))return;const o=e[t],i=n[t];z(o)&&z(i)?Tt(o,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=kn(i))}const ds={"":t=>t,x:t=>t.x,y:t=>t.y};function Oc(t){const e=t.split("."),n=[];let o="";for(const i of e)o+=i,o.endsWith("\\")?o=o.slice(0,-1)+".":(n.push(o),o="");return n}function Nc(t){const e=Oc(t);return n=>{for(const o of e){if(o==="")break;n=n&&n[o]}return n}}function Ke(t,e){return(ds[e]||(ds[e]=Nc(e)))(t)}function Eo(t){return t.charAt(0).toUpperCase()+t.slice(1)}const zt=t=>typeof t<"u",Ze=t=>typeof t=="function",us=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Ic(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const X=Math.PI,K=2*X,Lc=K+X,Sn=Number.POSITIVE_INFINITY,Tc=X/180,ne=X/2,ct=X/4,fs=X*2/3,Je=Math.log10,Ve=Math.sign;function Ht(t,e,n){return Math.abs(t-e)<n}function hs(t){const e=Math.round(t);t=Ht(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Je(t))),o=t/n;return(o<=1?1:o<=2?2:o<=5?5:10)*n}function zc(t){const e=[],n=Math.sqrt(t);let o;for(o=1;o<n;o++)t%o===0&&(e.push(o),e.push(t/o));return n===(n|0)&&e.push(n),e.sort((i,s)=>i-s).pop(),e}function Et(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Hc(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function ps(t,e,n){let o,i,s;for(o=0,i=t.length;o<i;o++)s=t[o][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function ve(t){return t*(X/180)}function Do(t){return t*(180/X)}function gs(t){if(!ee(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function ms(t,e){const n=e.x-t.x,o=e.y-t.y,i=Math.sqrt(n*n+o*o);let s=Math.atan2(o,n);return s<-.5*X&&(s+=K),{angle:s,distance:i}}function Vo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Wc(t,e){return(t-e+Lc)%K-X}function _e(t){return(t%K+K)%K}function Wt(t,e,n,o){const i=_e(t),s=_e(e),r=_e(n),a=_e(s-i),c=_e(r-i),d=_e(i-s),u=_e(i-r);return i===s||i===r||o&&s===r||a>c&&d<u}function ie(t,e,n){return Math.max(e,Math.min(n,t))}function jc(t){return ie(t,-32768,32767)}function Ae(t,e,n,o=1e-6){return t>=Math.min(e,n)-o&&t<=Math.max(e,n)+o}function Ro(t,e,n){n=n||(r=>t[r]<e);let o=t.length-1,i=0,s;for(;o-i>1;)s=i+o>>1,n(s)?i=s:o=s;return{lo:i,hi:o}}const Oe=(t,e,n,o)=>Ro(t,n,o?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),Yc=(t,e,n)=>Ro(t,n,o=>t[o][e]>=n);function Gc(t,e,n){let o=0,i=t.length;for(;o<i&&t[o]<e;)o++;for(;i>o&&t[i-1]>n;)i--;return o>0||i<t.length?t.slice(o,i):t}const bs=["push","pop","shift","splice","unshift"];function Uc(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),bs.forEach(n=>{const o="_onData"+Eo(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const r=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[o]=="function"&&a[o](...s)}),r}})})}function ys(t,e){const n=t._chartjs;if(!n)return;const o=n.listeners,i=o.indexOf(e);i!==-1&&o.splice(i,1),!(o.length>0)&&(bs.forEach(s=>{delete t[s]}),delete t._chartjs)}function _s(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const xs=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ws(t,e){let n=[],o=!1;return function(...i){n=i,o||(o=!0,xs.call(window,()=>{o=!1,t.apply(e,n)}))}}function qc(t,e){let n;return function(...o){return e?(clearTimeout(n),n=setTimeout(t,e,o)):t.apply(this,o),e}}const Fo=t=>t==="start"?"left":t==="end"?"right":"center",le=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Xc=(t,e,n,o)=>t===(o?"left":"right")?n:t==="center"?(e+n)/2:e;function Cs(t,e,n){const o=e.length;let i=0,s=o;if(t._sorted){const{iScale:r,_parsed:a}=t,c=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();f&&(i=ie(Math.min(Oe(a,c,d).lo,n?o:Oe(e,c,r.getPixelForValue(d)).lo),0,o-1)),p?s=ie(Math.max(Oe(a,r.axis,u,!0).hi+1,n?0:Oe(e,c,r.getPixelForValue(u),!0).hi+1),i,o)-i:s=o-i}return{start:i,count:s}}function ks(t){const{xScale:e,yScale:n,_scaleRanges:o}=t,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!o)return t._scaleRanges=i,!0;const s=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==n.min||o.ymax!==n.max;return Object.assign(o,i),s}const vn=t=>t===0||t===1,Ss=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*K/n)),vs=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*K/n)+1,jt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*ne)+1,easeOutSine:t=>Math.sin(t*ne),easeInOutSine:t=>-.5*(Math.cos(X*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>vn(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>vn(t)?t:Ss(t,.075,.3),easeOutElastic:t=>vn(t)?t:vs(t,.075,.3),easeInOutElastic(t){return vn(t)?t:t<.5?.5*Ss(t*2,.1125,.45):.5+.5*vs(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-jt.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?jt.easeInBounce(t*2)*.5:jt.easeOutBounce(t*2-1)*.5+.5};function Bo(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ms(t){return Bo(t)?t:new It(t)}function $o(t){return Bo(t)?t:new It(t).saturate(.5).darken(.1).hexString()}const Kc=["x","y","borderWidth","radius","tension"],Zc=["color","borderColor","backgroundColor"];function Jc(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Zc},numbers:{type:"number",properties:Kc}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Qc(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Es=new Map;function ed(t,e){e=e||{};const n=t+JSON.stringify(e);let o=Es.get(n);return o||(o=new Intl.NumberFormat(t,e),Es.set(n,o)),o}function Yt(t,e,n){return ed(e,n).format(t)}const Ds={values(t){return q(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const o=this.chart.options.locale;let i,s=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(i="scientific"),s=td(t,n)}const r=Je(Math.abs(s)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Yt(t,o,c)},logarithmic(t,e,n){if(t===0)return"0";const o=n[e].significand||t/Math.pow(10,Math.floor(Je(t)));return[1,2,3,5,10,15].includes(o)||e>.8*n.length?Ds.numeric.call(this,t,e,n):""}};function td(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Mn={formatters:Ds};function nd(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Mn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const dt=Object.create(null),Po=Object.create(null);function Gt(t,e){if(!e)return t;const n=e.split(".");for(let o=0,i=n.length;o<i;++o){const s=n[o];t=t[s]||(t[s]=Object.create(null))}return t}function Ao(t,e,n){return typeof e=="string"?Lt(Gt(t,e),n):Lt(Gt(t,""),e)}class od{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=o=>o.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(o,i)=>$o(i.backgroundColor),this.hoverBorderColor=(o,i)=>$o(i.borderColor),this.hoverColor=(o,i)=>$o(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Ao(this,e,n)}get(e){return Gt(this,e)}describe(e,n){return Ao(Po,e,n)}override(e,n){return Ao(dt,e,n)}route(e,n,o,i){const s=Gt(this,e),r=Gt(this,o),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],d=r[i];return z(c)?Object.assign({},d,c):T(c,d)},set(c){this[a]=c}}})}apply(e){e.forEach(n=>n(this))}}var te=new od({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Jc,Qc,nd]);function id(t){return!t||H(t.size)||H(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function En(t,e,n,o,i){let s=e[i];return s||(s=e[i]=t.measureText(i).width,n.push(i)),s>o&&(o=s),o}function sd(t,e,n,o){o=o||{};let i=o.data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(i=o.data={},s=o.garbageCollect=[],o.font=e),t.save(),t.font=e;let r=0;const a=n.length;let c,d,u,f,p;for(c=0;c<a;c++)if(f=n[c],f!=null&&!q(f))r=En(t,i,s,r,f);else if(q(f))for(d=0,u=f.length;d<u;d++)p=f[d],p!=null&&!q(p)&&(r=En(t,i,s,r,p));t.restore();const h=s.length/2;if(h>n.length){for(c=0;c<h;c++)delete i[s[c]];s.splice(0,h)}return r}function ut(t,e,n){const o=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*o)/o+i}function Vs(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Oo(t,e,n,o){Rs(t,e,n,o,null)}function Rs(t,e,n,o,i){let s,r,a,c,d,u,f,p;const h=e.pointStyle,g=e.rotation,m=e.radius;let b=(g||0)*Tc;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,o),t.rotate(b),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),h){default:i?t.ellipse(n,o,i/2,m,0,0,K):t.arc(n,o,m,0,K),t.closePath();break;case"triangle":u=i?i/2:m,t.moveTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=fs,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),b+=fs,t.lineTo(n+Math.sin(b)*u,o-Math.cos(b)*m),t.closePath();break;case"rectRounded":d=m*.516,c=m-d,r=Math.cos(b+ct)*c,f=Math.cos(b+ct)*(i?i/2-d:c),a=Math.sin(b+ct)*c,p=Math.sin(b+ct)*(i?i/2-d:c),t.arc(n-f,o-a,d,b-X,b-ne),t.arc(n+p,o-r,d,b-ne,b),t.arc(n+f,o+a,d,b,b+ne),t.arc(n-p,o+r,d,b+ne,b+X),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*m,u=i?i/2:c,t.rect(n-u,o-c,2*u,2*c);break}b+=ct;case"rectRot":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+p,o-r),t.lineTo(n+f,o+a),t.lineTo(n-p,o+r),t.closePath();break;case"crossRot":b+=ct;case"cross":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"star":f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r),b+=ct,f=Math.cos(b)*(i?i/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,p=Math.sin(b)*(i?i/2:m),t.moveTo(n-f,o-a),t.lineTo(n+f,o+a),t.moveTo(n+p,o-r),t.lineTo(n-p,o+r);break;case"line":r=i?i/2:Math.cos(b)*m,a=Math.sin(b)*m,t.moveTo(n-r,o-a),t.lineTo(n+r,o+a);break;case"dash":t.moveTo(n,o),t.lineTo(n+Math.cos(b)*(i?i/2:m),o+Math.sin(b)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function Ne(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Dn(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Vn(t){t.restore()}function rd(t,e,n,o,i){if(!e)return t.lineTo(n.x,n.y);if(i==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else i==="after"!=!!o?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function ld(t,e,n,o){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(o?e.cp1x:e.cp2x,o?e.cp1y:e.cp2y,o?n.cp2x:n.cp1x,o?n.cp2y:n.cp1y,n.x,n.y)}function ad(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),H(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function cd(t,e,n,o,i){if(i.strikethrough||i.underline){const s=t.measureText(o),r=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,u=i.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(r,u),t.lineTo(a,u),t.stroke()}}function dd(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function ft(t,e,n,o,i,s={}){const r=q(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=i.string,ad(t,s),c=0;c<r.length;++c)d=r[c],s.backdrop&&dd(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),H(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,n,o,s.maxWidth)),t.fillText(d,n,o,s.maxWidth),cd(t,n,o,d,s),o+=Number(i.lineHeight);t.restore()}function Ut(t,e){const{x:n,y:o,w:i,h:s,radius:r}=e;t.arc(n+r.topLeft,o+r.topLeft,r.topLeft,1.5*X,X,!0),t.lineTo(n,o+s-r.bottomLeft),t.arc(n+r.bottomLeft,o+s-r.bottomLeft,r.bottomLeft,X,ne,!0),t.lineTo(n+i-r.bottomRight,o+s),t.arc(n+i-r.bottomRight,o+s-r.bottomRight,r.bottomRight,ne,0,!0),t.lineTo(n+i,o+r.topRight),t.arc(n+i-r.topRight,o+r.topRight,r.topRight,0,-ne,!0),t.lineTo(n+r.topLeft,o)}const ud=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fd=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function hd(t,e){const n=(""+t).match(ud);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const pd=t=>+t||0;function No(t,e){const n={},o=z(e),i=o?Object.keys(e):e,s=z(t)?o?r=>T(t[r],t[e[r]]):r=>t[r]:()=>t;for(const r of i)n[r]=pd(s(r));return n}function Fs(t){return No(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ht(t){return No(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=Fs(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function oe(t,e){t=t||{},e=e||te.font;let n=T(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let o=T(t.style,e.style);o&&!(""+o).match(fd)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const i={family:T(t.family,e.family),lineHeight:hd(T(t.lineHeight,e.lineHeight),n),size:n,style:o,weight:T(t.weight,e.weight),string:""};return i.string=id(i),i}function qt(t,e,n,o){let i=!0,s,r,a;for(s=0,r=t.length;s<r;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),i=!1),n!==void 0&&q(a)&&(a=a[n%a.length],i=!1),a!==void 0))return o&&!i&&(o.cacheable=!1),a}function gd(t,e,n){const{min:o,max:i}=t,s=as(e,(i-o)/2),r=(a,c)=>n&&a===0?0:a+c;return{min:r(o,-Math.abs(s)),max:r(i,s)}}function Qe(t,e){return Object.assign(Object.create(t),e)}function Io(t,e=[""],n,o,i=()=>t[0]){const s=n||t;typeof o>"u"&&(o=Os("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:i,override:a=>Io([a,...t],e,s,o)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete t[0][c],!0},get(a,c){return $s(a,c,()=>kd(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return Ns(a).includes(c)},ownKeys(a){return Ns(a)},set(a,c,d){const u=a._storage||(a._storage=i());return a[c]=u[c]=d,delete a._keys,!0}})}function Dt(t,e,n,o){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Bs(t,o),setContext:s=>Dt(t,s,n,o),override:s=>Dt(t.override(s),e,n,o)};return new Proxy(i,{deleteProperty(s,r){return delete s[r],delete t[r],!0},get(s,r,a){return $s(s,r,()=>bd(s,r,a))},getOwnPropertyDescriptor(s,r){return s._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(s,r,a){return t[r]=a,delete s[r],!0}})}function Bs(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:o=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:o,isScriptable:Ze(n)?n:()=>n,isIndexable:Ze(o)?o:()=>o}}const md=(t,e)=>t?t+Eo(e):e,Lo=(t,e)=>z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function $s(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const o=n();return t[e]=o,o}function bd(t,e,n){const{_proxy:o,_context:i,_subProxy:s,_descriptors:r}=t;let a=o[e];return Ze(a)&&r.isScriptable(e)&&(a=yd(e,a,t,n)),q(a)&&a.length&&(a=_d(e,a,t,r.isIndexable)),Lo(e,a)&&(a=Dt(a,i,s&&s[e],r)),a}function yd(t,e,n,o){const{_proxy:i,_context:s,_subProxy:r,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(s,r||o);return a.delete(t),Lo(t,c)&&(c=To(i._scopes,i,t,c)),c}function _d(t,e,n,o){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;if(typeof s.index<"u"&&o(t))return e[s.index%e.length];if(z(e[0])){const c=e,d=i._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=To(d,i,t,u);e.push(Dt(f,s,r&&r[t],a))}}return e}function Ps(t,e,n){return Ze(t)?t(e,n):t}const xd=(t,e)=>t===!0?e:typeof t=="string"?Ke(e,t):void 0;function wd(t,e,n,o,i){for(const s of e){const r=xd(n,s);if(r){t.add(r);const a=Ps(r._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==o)return a}else if(r===!1&&typeof o<"u"&&n!==o)return null}return!1}function To(t,e,n,o){const i=e._rootScopes,s=Ps(e._fallback,n,o),r=[...t,...i],a=new Set;a.add(o);let c=As(a,r,n,s||n,o);return c===null||typeof s<"u"&&s!==n&&(c=As(a,r,s,c,o),c===null)?!1:Io(Array.from(a),[""],i,s,()=>Cd(e,n,o))}function As(t,e,n,o,i){for(;n;)n=wd(t,e,n,o,i);return n}function Cd(t,e,n){const o=t._getTarget();e in o||(o[e]={});const i=o[e];return q(i)&&z(n)?n:i||{}}function kd(t,e,n,o){let i;for(const s of e)if(i=Os(md(s,t),n),typeof i<"u")return Lo(t,i)?To(n,o,t,i):i}function Os(t,e){for(const n of e){if(!n)continue;const o=n[t];if(typeof o<"u")return o}}function Ns(t){let e=t._keys;return e||(e=t._keys=Sd(t._scopes)),e}function Sd(t){const e=new Set;for(const n of t)for(const o of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(o);return Array.from(e)}function Is(t,e,n,o){const{iScale:i}=t,{key:s="r"}=this._parsing,r=new Array(o);let a,c,d,u;for(a=0,c=o;a<c;++a)d=a+n,u=e[d],r[a]={r:i.parse(Ke(u,s),d)};return r}const vd=Number.EPSILON||1e-14,Vt=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ls=t=>t==="x"?"y":"x";function Md(t,e,n,o){const i=t.skip?e:t,s=e,r=n.skip?e:n,a=Vo(s,i),c=Vo(r,s);let d=a/(a+c),u=c/(a+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=o*d,p=o*u;return{previous:{x:s.x-f*(r.x-i.x),y:s.y-f*(r.y-i.y)},next:{x:s.x+p*(r.x-i.x),y:s.y+p*(r.y-i.y)}}}function Ed(t,e,n){const o=t.length;let i,s,r,a,c,d=Vt(t,0);for(let u=0;u<o-1;++u)if(c=d,d=Vt(t,u+1),!(!c||!d)){if(Ht(e[u],0,vd)){n[u]=n[u+1]=0;continue}i=n[u]/e[u],s=n[u+1]/e[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=i*r*e[u],n[u+1]=s*r*e[u])}}function Dd(t,e,n="x"){const o=Ls(n),i=t.length;let s,r,a,c=Vt(t,0);for(let d=0;d<i;++d){if(r=a,a=c,c=Vt(t,d+1),!a)continue;const u=a[n],f=a[o];r&&(s=(u-r[n])/3,a[`cp1${n}`]=u-s,a[`cp1${o}`]=f-s*e[d]),c&&(s=(c[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${o}`]=f+s*e[d])}}function Vd(t,e="x"){const n=Ls(e),o=t.length,i=Array(o).fill(0),s=Array(o);let r,a,c,d=Vt(t,0);for(r=0;r<o;++r)if(a=c,c=d,d=Vt(t,r+1),!!c){if(d){const u=d[e]-c[e];i[r]=u!==0?(d[n]-c[n])/u:0}s[r]=a?d?Ve(i[r-1])!==Ve(i[r])?0:(i[r-1]+i[r])/2:i[r-1]:i[r]}Ed(t,i,s),Dd(t,s,e)}function Rn(t,e,n){return Math.max(Math.min(t,n),e)}function Rd(t,e){let n,o,i,s,r,a=Ne(t[0],e);for(n=0,o=t.length;n<o;++n)r=s,s=a,a=n<o-1&&Ne(t[n+1],e),s&&(i=t[n],r&&(i.cp1x=Rn(i.cp1x,e.left,e.right),i.cp1y=Rn(i.cp1y,e.top,e.bottom)),a&&(i.cp2x=Rn(i.cp2x,e.left,e.right),i.cp2y=Rn(i.cp2y,e.top,e.bottom)))}function Fd(t,e,n,o,i){let s,r,a,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")Vd(t,i);else{let d=o?t[t.length-1]:t[0];for(s=0,r=t.length;s<r;++s)a=t[s],c=Md(d,a,t[Math.min(s+1,r-(o?0:1))%r],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,d=a}e.capBezierPoints&&Rd(t,n)}function zo(){return typeof window<"u"&&typeof document<"u"}function Ho(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Fn(t,e,n){let o;return typeof t=="string"?(o=parseInt(t,10),t.indexOf("%")!==-1&&(o=o/100*e.parentNode[n])):o=t,o}const Bn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Bd(t,e){return Bn(t).getPropertyValue(e)}const $d=["top","right","bottom","left"];function pt(t,e,n){const o={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=$d[i];o[s]=parseFloat(t[e+"-"+s+n])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Pd=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Ad(t,e){const n=t.touches,o=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=o;let r=!1,a,c;if(Pd(i,s,t.target))a=i,c=s;else{const d=e.getBoundingClientRect();a=o.clientX-d.left,c=o.clientY-d.top,r=!0}return{x:a,y:c,box:r}}function gt(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:o}=e,i=Bn(n),s=i.boxSizing==="border-box",r=pt(i,"padding"),a=pt(i,"border","width"),{x:c,y:d,box:u}=Ad(t,n),f=r.left+(u&&a.left),p=r.top+(u&&a.top);let{width:h,height:g}=e;return s&&(h-=r.width+a.width,g-=r.height+a.height),{x:Math.round((c-f)/h*n.width/o),y:Math.round((d-p)/g*n.height/o)}}function Od(t,e,n){let o,i;if(e===void 0||n===void 0){const s=Ho(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const r=s.getBoundingClientRect(),a=Bn(s),c=pt(a,"border","width"),d=pt(a,"padding");e=r.width-d.width-c.width,n=r.height-d.height-c.height,o=Fn(a.maxWidth,s,"clientWidth"),i=Fn(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:o||Sn,maxHeight:i||Sn}}const $n=t=>Math.round(t*10)/10;function Nd(t,e,n,o){const i=Bn(t),s=pt(i,"margin"),r=Fn(i.maxWidth,t,"clientWidth")||Sn,a=Fn(i.maxHeight,t,"clientHeight")||Sn,c=Od(t,e,n);let{width:d,height:u}=c;if(i.boxSizing==="content-box"){const p=pt(i,"border","width"),h=pt(i,"padding");d-=h.width+p.width,u-=h.height+p.height}return d=Math.max(0,d-s.width),u=Math.max(0,o?d/o:u-s.height),d=$n(Math.min(d,r,c.maxWidth)),u=$n(Math.min(u,a,c.maxHeight)),d&&!u&&(u=$n(d/2)),(e!==void 0||n!==void 0)&&o&&c.height&&u>c.height&&(u=c.height,d=$n(Math.floor(u*o))),{width:d,height:u}}function Ts(t,e,n){const o=e||1,i=Math.floor(t.height*o),s=Math.floor(t.width*o);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const r=t.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==o||r.height!==i||r.width!==s?(t.currentDevicePixelRatio=o,r.height=i,r.width=s,t.ctx.setTransform(o,0,0,o,0,0),!0):!1}const Id=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};zo()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function zs(t,e){const n=Bd(t,e),o=n&&n.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function mt(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Ld(t,e,n,o){return{x:t.x+n*(e.x-t.x),y:o==="middle"?n<.5?t.y:e.y:o==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function Td(t,e,n,o){const i={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=mt(t,i,n),a=mt(i,s,n),c=mt(s,e,n),d=mt(r,a,n),u=mt(a,c,n);return mt(d,u,n)}const zd=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,o){return n-o},leftForLtr(n,o){return n-o}}},Hd=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Rt(t,e,n){return t?zd(e,n):Hd()}function Hs(t,e){let n,o;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,o=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=o)}function Ws(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function js(t){return t==="angle"?{between:Wt,compare:Wc,normalize:_e}:{between:Ae,compare:(e,n)=>e-n,normalize:e=>e}}function Ys({start:t,end:e,count:n,loop:o,style:i}){return{start:t%n,end:e%n,loop:o&&(e-t+1)%n===0,style:i}}function Wd(t,e,n){const{property:o,start:i,end:s}=n,{between:r,normalize:a}=js(o),c=e.length;let{start:d,end:u,loop:f}=t,p,h;if(f){for(d+=c,u+=c,p=0,h=c;p<h&&r(a(e[d%c][o]),i,s);++p)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Gs(t,e,n){if(!n)return[t];const{property:o,start:i,end:s}=n,r=e.length,{compare:a,between:c,normalize:d}=js(o),{start:u,end:f,loop:p,style:h}=Wd(t,e,n),g=[];let m=!1,b=null,x,y,w;const S=()=>c(i,w,x)&&a(i,w)!==0,_=()=>a(s,x)===0||c(s,w,x),k=()=>m||S(),v=()=>!m||_();for(let C=u,D=u;C<=f;++C)y=e[C%r],!y.skip&&(x=d(y[o]),x!==w&&(m=c(x,i,s),b===null&&k()&&(b=a(x,i)===0?C:D),b!==null&&v()&&(g.push(Ys({start:b,end:C,loop:p,count:r,style:h})),b=null),D=C,w=x));return b!==null&&g.push(Ys({start:b,end:f,loop:p,count:r,style:h})),g}function Us(t,e){const n=[],o=t.segments;for(let i=0;i<o.length;i++){const s=Gs(o[i],t.points,e);s.length&&n.push(...s)}return n}function jd(t,e,n,o){let i=0,s=e-1;if(n&&!o)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(s+=i);s>i&&t[s%e].skip;)s--;return s%=e,{start:i,end:s}}function Yd(t,e,n,o){const i=t.length,s=[];let r=e,a=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%i];d.skip||d.stop?a.skip||(o=!1,s.push({start:e%i,end:(c-1)%i,loop:o}),e=r=d.stop?c:null):(r=c,a.skip&&(e=c)),a=d}return r!==null&&s.push({start:e%i,end:r%i,loop:o}),s}function Gd(t,e){const n=t.points,o=t.options.spanGaps,i=n.length;if(!i)return[];const s=!!t._loop,{start:r,end:a}=jd(n,i,s,o);if(o===!0)return qs(t,[{start:r,end:a,loop:s}],n,e);const c=a<r?a+i:a,d=!!t._fullLoop&&r===0&&a===i-1;return qs(t,Yd(n,r,c,d),n,e)}function qs(t,e,n,o){return!o||!o.setContext||!n?e:Ud(t,e,n,o)}function Ud(t,e,n,o){const i=t._chart.getContext(),s=Xs(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,c=n.length,d=[];let u=s,f=e[0].start,p=f;function h(g,m,b,x){const y=a?-1:1;if(g!==m){for(g+=c;n[g%c].skip;)g-=y;for(;n[m%c].skip;)m+=y;g%c!==m%c&&(d.push({start:g%c,end:m%c,loop:b,style:x}),u=x,f=m%c)}}for(const g of e){f=a?f:g.start;let m=n[f%c],b;for(p=f+1;p<=g.end;p++){const x=n[p%c];b=Xs(o.setContext(Qe(i,{type:"segment",p0:m,p1:x,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:r}))),qd(b,u)&&h(f,p-1,g.loop,u),m=x,u=b}f<p-1&&h(f,p-1,g.loop,u)}return d}function Xs(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function qd(t,e){if(!e)return!1;const n=[],o=function(i,s){return Bo(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,o)!==JSON.stringify(e,o)}/*!
19
19
  * Chart.js v4.4.1
20
20
  * https://www.chartjs.org
21
21
  * (c) 2023 Chart.js Contributors
22
22
  * Released under the MIT License
23
- */class Nc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,i){const o=e.listeners[i],a=e.duration;o.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Pi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,l=!1,c;for(;a>=0;--a)c=o[a],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),l=!0):(o[a]=o[o.length-1],o.pop());l&&(i.draw(),this._notify(i,s,t,"progress")),o.length||(s.running=!1,this._notify(i,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Nt=new Nc;const ro="transparent",$c={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const s=$i(n||ro),i=s.valid&&$i(t||ro);return i&&i.valid?i.mix(s,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Lc{constructor(t,e,s,i){const o=e[s];i=Ie([t.to,i,o,t.from]);const a=Ie([t.from,o,i]);this._active=!0,this._fn=t.fn||$c[t.type||typeof a],this._easing=$e[t.easing]||$e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const i=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ie([t.to,e,i,t.from]),this._from=Ie([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,i=this._prop,o=this._from,a=this._loop,l=this._to;let c;if(this._active=o!==l&&(a||e<s),!this._active){this._target[i]=l,this._notify(!0);return}if(e<0){this._target[i]=o;return}c=e/s%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(o,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let i=0;i<s.length;i++)s[i][e]()}}class lo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;const e=Object.keys(Q.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!z(o))return;const a={};for(const l of e)a[l]=o[l];(X(o.properties)&&o.properties||[i]).forEach(l=>{(l===i||!s.has(l))&&s.set(l,a)})})}_animateOptions(t,e){const s=e.options,i=zc(t,s);if(!i)return[];const o=this._createAnimations(i,s);return s.$shared&&Rc(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(t,e));continue}const h=e[d];let f=o[d];const u=s.get(d);if(f)if(u&&f.active()){f.update(u,h,l);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}o[d]=f=new Lc(u,t,d,h),i.push(f)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Nt.add(this._chart,s),!0}}function Rc(n,t){const e=[],s=Object.keys(t);for(let i=0;i<s.length;i++){const o=n[s[i]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function zc(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function co(n,t){const e=n&&n.options||{},s=e.reverse,i=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:i,end:s?i:o}}function Ic(n,t,e){if(e===!1)return!1;const s=co(n,e),i=co(t,e);return{top:i.end,right:s.end,bottom:i.start,left:s.start}}function Wc(n){let t,e,s,i;return z(n)?(t=n.top,e=n.right,s=n.bottom,i=n.left):t=e=s=i=n,{top:t,right:e,bottom:s,left:i,disabled:n===!1}}function ho(n,t){const e=[],s=n._getSortedDatasetMetas(t);let i,o;for(i=0,o=s.length;i<o;++i)e.push(s[i].index);return e}function fo(n,t,e,s={}){const i=n.keys,o=s.mode==="single";let a,l,c,d;if(t!==null){for(a=0,l=i.length;a<l;++a){if(c=+i[a],c===e){if(s.all)continue;break}d=n.values[c],J(d)&&(o||t===0||Dt(t)===Dt(d))&&(t+=d)}return t}}function Yc(n){const t=Object.keys(n),e=new Array(t.length);let s,i,o;for(s=0,i=t.length;s<i;++s)o=t[s],e[s]={x:o,y:n[o]};return e}function uo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function jc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Hc(n){const{min:t,max:e,minDefined:s,maxDefined:i}=n.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function Uc(n,t,e){const s=n[t]||(n[t]={});return s[e]||(s[e]={})}function po(n,t,e,s){for(const i of t.getMatchingVisibleMetas(s).reverse()){const o=n[i.index];if(e&&o>0||!e&&o<0)return i.index}return null}function mo(n,t){const{chart:e,_cachedMeta:s}=n,i=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:l}=s,c=o.axis,d=a.axis,h=jc(o,a,s),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[c]:g,[d]:b}=m,x=m._stacks||(m._stacks={});u=x[d]=Uc(i,h,g),u[l]=b,u._top=po(u,a,!0,s.type),u._bottom=po(u,a,!1,s.type);const y=u._visualValues||(u._visualValues={});y[l]=b}}function Ms(n,t){const e=n.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Xc(n,t){return Kt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qc(n,t,e){return Kt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function We(n,t){const e=n.controller.index,s=n.vScale&&n.vScale.axis;if(s){t=t||n._parsed;for(const i of t){const o=i._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Ss=n=>n==="reset"||n==="none",go=(n,t)=>t?n:Object.assign({},n),Kc=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:ho(e,!0),values:null};class St{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=uo(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&&We(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),i=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,o=e.xAxisID=L(s.xAxisID,Ms(t,"x")),a=e.yAxisID=L(s.yAxisID,Ms(t,"y")),l=e.rAxisID=L(s.rAxisID,Ms(t,"r")),c=e.indexAxis,d=e.iAxisID=i(c,o,a,l),h=e.vAxisID=i(c,a,o,l);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ei(this._data,this),t._stacked&&We(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(z(e))this._data=Yc(e);else if(s!==e){if(s){Ei(s,this);const i=this._cachedMeta;We(i),i._parsed=[]}e&&Object.isExtensible(e)&&Fl(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const o=e._stacked;e._stacked=uo(e.vScale,e),e.stack!==s.stack&&(i=!0,We(e),e.stack=s.stack),this._resyncElements(t),(i||o!==e._stacked)&&mo(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:i}=this,{iScale:o,_stacked:a}=s,l=o.axis;let c=t===0&&e===i.length?!0:s._sorted,d=t>0&&s._parsed[t-1],h,f,u;if(this._parsing===!1)s._parsed=i,s._sorted=!0,u=i;else{X(i[t])?u=this.parseArrayData(s,i,t,e):z(i[t])?u=this.parseObjectData(s,i,t,e):u=this.parsePrimitiveData(s,i,t,e);const p=()=>f[l]===null||d&&f[l]<d[l];for(h=0;h<e;++h)s._parsed[h+t]=f=u[h],c&&(p()&&(c=!1),d=f);s._sorted=c}a&&mo(this,u)}parsePrimitiveData(t,e,s,i){const{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,d=o.getLabels(),h=o===a,f=new Array(i);let u,p,m;for(u=0,p=i;u<p;++u)m=u+s,f[u]={[l]:h||o.parse(d[m],m),[c]:a.parse(e[m],m)};return f}parseArrayData(t,e,s,i){const{xScale:o,yScale:a}=t,l=new Array(i);let c,d,h,f;for(c=0,d=i;c<d;++c)h=c+s,f=e[h],l[c]={x:o.parse(f[0],h),y:a.parse(f[1],h)};return l}parseObjectData(t,e,s,i){const{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(i);let h,f,u,p;for(h=0,f=i;h<f;++h)u=h+s,p=e[u],d[h]={x:o.parse(Ut(p,l),u),y:a.parse(Ut(p,c),u)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const i=this.chart,o=this._cachedMeta,a=e[t.axis],l={keys:ho(i,!0),values:e._stacks[t.axis]._visualValues};return fo(l,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,i){const o=s[e.axis];let a=o===null?NaN:o;const l=i&&s._stacks[e.axis];i&&l&&(i.values=l,a=fo(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,i=s._parsed,o=s._sorted&&t===s.iScale,a=i.length,l=this._getOtherScale(t),c=Kc(e,s,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=Hc(l);let u,p;function m(){p=i[u];const g=p[l.axis];return!J(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,c),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,c);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let i,o,a;for(i=0,o=e.length;i<o;++i)a=e[i][t.axis],J(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,i=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Wc(L(this.options.clip,Ic(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,i=s.data||[],o=e.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||i.length-l,d=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,l,c),h=l;h<l+c;++h){const f=i[h];f.hidden||(f.active&&d?a.push(f):f.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=qc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Xc(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const i=e==="active",o=this._cachedDataOpts,a=t+"-"+e,l=o[a],c=this.enableOptionSharing&&Fe(s);if(l)return go(l,c);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(Q.elements[t]),m=()=>this.getContext(s,i,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(go(g,c))),g}_resolveAnimations(t,e,s){const i=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,l=o[a];if(l)return l;let c;if(i.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,s,e))}const d=new lo(i,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ss(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),i=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==i;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,i){Ss(i)?Object.assign(t,s):this._resolveAnimations(e,i).update(t,s)}updateSharedOptions(t,e,s){t&&!Ss(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,i){t.active=i;const o=this.getStyle(e,i);this._resolveAnimations(e,s,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const i=s.length,o=e.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,e,s=!0){const i=this._cachedMeta,o=i.data,a=t+e;let l;const c=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,i){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const i=s._parsed.splice(t,e);s._stacked&&We(s,i)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,i]=t;this[e](s,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(St,"defaults",{}),P(St,"datasetElementType",null),P(St,"dataElementType",null);function Gc(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let s=[];for(let i=0,o=e.length;i<o;i++)s=s.concat(e[i].controller.getAllParsedValues(n));n._cache.$bar=Vi(s.sort((i,o)=>i-o))}return n._cache.$bar}function Zc(n){const t=n.iScale,e=Gc(t,n.type);let s=t._length,i,o,a,l;const c=()=>{a===32767||a===-32768||(Fe(l)&&(s=Math.min(s,Math.abs(a-l)||s)),l=a)};for(i=0,o=e.length;i<o;++i)a=t.getPixelForValue(e[i]),c();for(l=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),c();return s}function Jc(n,t,e,s){const i=e.barThickness;let o,a;return I(i)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=i*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[n]-o/2}}function Qc(n,t,e,s){const i=t.pixels,o=i[n];let a=n>0?i[n-1]:null,l=n<i.length-1?i[n+1]:null;const c=e.categoryPercentage;a===null&&(a=o-(l===null?t.end-t.start:l-o)),l===null&&(l=o+o-a);const d=o-(o-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/s,ratio:e.barPercentage,start:d}}function td(n,t,e,s){const i=e.parse(n[0],s),o=e.parse(n[1],s),a=Math.min(i,o),l=Math.max(i,o);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:i,end:o,min:a,max:l}}function bo(n,t,e,s){return X(n)?td(n,t,e,s):t[e.axis]=e.parse(n,s),t}function yo(n,t,e,s){const i=n.iScale,o=n.vScale,a=i.getLabels(),l=i===o,c=[];let d,h,f,u;for(d=e,h=e+s;d<h;++d)u=t[d],f={},f[i.axis]=l||i.parse(a[d],d),c.push(bo(u,f,o,d));return c}function Ds(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function ed(n,t,e){return n!==0?Dt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function nd(n){let t,e,s,i,o;return n.horizontal?(t=n.base>n.x,e="left",s="right"):(t=n.base<n.y,e="bottom",s="top"),t?(i="end",o="start"):(i="start",o="end"),{start:e,end:s,reverse:t,top:i,bottom:o}}function sd(n,t,e,s){let i=t.borderSkipped;const o={};if(!i){n.borderSkipped=o;return}if(i===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:h}=nd(n);i==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===s?i=d:(e._bottom||0)===s?i=h:(o[_o(h,a,l,c)]=!0,i=d)),o[_o(i,a,l,c)]=!0,n.borderSkipped=o}function _o(n,t,e,s){return s?(n=id(n,t,e),n=xo(n,e,t)):n=xo(n,t,e),n}function id(n,t,e){return n===t?e:n===e?t:n}function xo(n,t,e){return n==="start"?t:n==="end"?e:n}function od(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Sn extends St{parsePrimitiveData(t,e,s,i){return yo(t,e,s,i)}parseArrayData(t,e,s,i){return yo(t,e,s,i)}parseObjectData(t,e,s,i){const{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=o.axis==="x"?l:c,h=a.axis==="x"?l:c,f=[];let u,p,m,g;for(u=s,p=s+i;u<p;++u)g=e[u],m={},m[o.axis]=o.parse(Ut(g,d),u),f.push(bo(Ut(g,h),m,a,u));return f}updateRangeFromParsed(t,e,s,i){super.updateRangeFromParsed(t,e,s,i);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:i}=e,o=this.getParsed(t),a=o._custom,l=Ds(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,i);for(let p=e;p<e+s;p++){const m=this.getParsed(p),g=o||I(m[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),x=(m._stacks||{})[l.axis],y={horizontal:d,base:g.base,enableBorderRadius:!x||Ds(m._custom)||a===x._top||a===x._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};u&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const k=y.options||t[p].options;sd(y,k,x,a),od(y,k,h.ratio),this.updateElement(t[p],p,y,i)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,i=s.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=s.options.stacked,a=[],l=c=>{const d=c.controller.getParsed(e),h=d&&d[c.vScale.axis];if(I(h)||isNaN(h))return!0};for(const c of i)if(!(e!==void 0&&l(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const i=this._getStacks(t,s),o=e!==void 0?i.indexOf(e):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,i=[];let o,a;for(o=0,a=e.data.length;o<a;++o)i.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const l=t.barThickness;return{min:l||Zc(e),pixels:i,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:i},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),d=c._custom,h=Ds(d);let f=c[e.axis],u=0,p=s?this.applyStack(e,c,s):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&Dt(f)!==Dt(d.barEnd)&&(u=0),u+=f);const b=!I(o)&&!h?o:u;let x=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=x,g=m-x,Math.abs(g)<a){g=ed(g,e,l)*a,f===l&&(x-=g/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),M=Math.min(y,k),_=Math.max(y,k);x=Math.max(Math.min(x,_),M),m=x+g,s&&!h&&(c._stacks[e.axis]._visualValues[i]=e.getValueForPixel(m)-e.getValueForPixel(x))}if(x===e.getPixelForValue(l)){const y=Dt(g)*e.getLineWidthForValue(l)/2;x+=y,g-=y}return{size:g,base:x,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,i=this.options,o=i.skipNull,a=L(i.maxBarThickness,1/0);let l,c;if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,h=i.barThickness==="flex"?Qc(t,e,i,d):Jc(t,e,i,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=h.start+h.chunk*f+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(a,e.min*e.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,i=s.length;let o=0;for(;o<i;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}P(Sn,"id","bar"),P(Sn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Sn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Dn extends St{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,i){const o=super.parsePrimitiveData(t,e,s,i);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,e,s,i){const o=super.parseArrayData(t,e,s,i);for(let a=0;a<o.length;a++){const l=e[s+a];o[a]._custom=L(l[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,e,s,i){const o=super.parseObjectData(t,e,s,i);for(let a=0;a<o.length;a++){const l=e[s+a];o[a]._custom=L(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=e,a=this.getParsed(t),l=i.getLabelForValue(a.x),c=o.getLabelForValue(a.y),d=a._custom;return{label:s[t]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,i),h=a.axis,f=l.axis;for(let u=e;u<e+s;u++){const p=t[u],m=!o&&this.getParsed(u),g={},b=g[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),x=g[f]=o?l.getBasePixel():l.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(x),d&&(g.options=c||this.resolveDataElementOptions(u,p.active?"active":i),o&&(g.options.radius=0)),this.updateElement(p,u,g,i)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return e!=="active"&&(i.radius=0),i.radius+=L(s&&s._custom,o),i}}P(Dn,"id","bubble"),P(Dn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(Dn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ad(n,t,e){let s=1,i=1,o=0,a=0;if(t<K){const l=n,c=l+t,d=Math.cos(l),h=Math.sin(l),f=Math.cos(c),u=Math.sin(c),p=(k,M,_)=>Ne(k,l,c,!0)?1:Math.max(M,M*e,_,_*e),m=(k,M,_)=>Ne(k,l,c,!0)?-1:Math.min(M,M*e,_,_*e),g=p(0,d,f),b=p(tt,h,u),x=m(q,d,f),y=m(q+tt,h,u);s=(g-x)/2,i=(b-y)/2,o=-(g+x)/2,a=-(b+y)/2}return{ratioX:s,ratioY:i,offsetX:o,offsetY:a}}class he extends St{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=s;else{let o=c=>+s[c];if(z(s[t])){const{key:c="value"}=this._parsing;o=d=>+Ut(s[d],c)}let a,l;for(a=t,l=t+e;a<l;++a)i._parsed[a]=o(a)}}_getRotation(){return Mt(this.options.rotation-90)}_getCircumference(){return Mt(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const i=this.chart.getDatasetMeta(s).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min(xl(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=ad(f,h,c),b=(s.width-a)/u,x=(s.height-a)/p,y=Math.max(Math.min(b,x)/2,0),k=_i(this.options.radius,y),M=Math.max(k*c,0),_=(k-M)/this._getVisibleDatasetWeightTotal();this.offsetX=m*k,this.offsetY=g*k,i.total=this.calculateTotal(),this.outerRadius=k-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,i=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/K)}updateElements(t,e,s,i){const o=i==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,f=(l.top+l.bottom)/2,u=o&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,i);let x=this._getRotation(),y;for(y=0;y<e;++y)x+=this._circumference(y,o);for(y=e;y<e+s;++y){const k=this._circumference(y,o),M=t[y],_={x:h+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+k,circumference:k,outerRadius:m,innerRadius:p};b&&(_.options=g||this.resolveDataElementOptions(y,M.active?"active":i)),x+=k,this.updateElement(M,y,_,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,i;for(i=0;i<e.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=Le(e._parsed[t],s.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let i,o,a,l,c;if(!t){for(i=0,o=s.data.datasets.length;i<o;++i)if(s.isDatasetVisible(i)){a=s.getDatasetMeta(i),t=a.data,l=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)c=l.resolveDataElementOptions(i),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,i=t.length;s<i;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(L(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(he,"id","doughnut"),P(he,"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"}),P(he,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(he,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map((o,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class Bn extends St{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:i=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:l,count:c}=Oi(e,i,a);this._drawStart=l,this._drawCount=c,Fi(e)&&(l=0,c=i.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:d},t),this.updateElements(i,l,c,t)}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,i),u=a.axis,p=l.axis,{spanGaps:m,segment:g}=this.options,b=ke(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||i==="none",y=e+s,k=t.length;let M=e>0&&this.getParsed(e-1);for(let _=0;_<k;++_){const w=t[_],S=x?w:{};if(_<e||_>=y){S.skip=!0;continue}const C=this.getParsed(_),v=I(C[p]),E=S[u]=a.getPixelForValue(C[u],_),O=S[p]=o||v?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[p],_);S.skip=isNaN(E)||isNaN(O)||v,S.stop=_>0&&Math.abs(C[u]-M[u])>b,g&&(S.parsed=C,S.raw=d.data[_]),f&&(S.options=h||this.resolveDataElementOptions(_,w.active?"active":i)),x||this.updateElement(w,_,S,i),M=C}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return s;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(Bn,"id","line"),P(Bn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(Bn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ye extends St{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=Le(e._parsed[t].r,s.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,e,s,i){return Ki.bind(this)(t,e,s,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(i/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,s,i){const o=i==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*q;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,i,g);for(m=e;m<e+s;m++){const b=t[m];let x=p,y=p+this._computeAngle(m,i,g),k=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,o&&(c.animateScale&&(k=0),c.animateRotate&&(x=y=u));const M={x:h,y:f,innerRadius:0,outerRadius:k,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(m,b.active?"active":i)};this.updateElement(b,m,M,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Mt(this.resolveDataElementOptions(t,e).angle||s):0}}P(Ye,"id","polarArea"),P(Ye,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(Ye,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return e.labels.map((o,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Bs extends he{}P(Bs,"id","pie"),P(Bs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class vn extends St{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,i){return Ki.bind(this)(t,e,s,i)}update(t){const e=this._cachedMeta,s=e.dataset,i=e.data||[],o=e.iScale.getLabels();if(s.points=i,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===i.length,options:a};this.updateElement(s,void 0,l,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,s,i){const o=this._cachedMeta.rScale,a=i==="reset";for(let l=e;l<e+s;l++){const c=t[l],d=this.resolveDataElementOptions(l,c.active?"active":i),h=o.getPointPositionForValue(l,this.getParsed(l).r),f=a?o.xCenter:h.x,u=a?o.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(c,l,p,i)}}}P(vn,"id","radar"),P(vn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(vn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class En extends St{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=e,a=this.getParsed(t),l=i.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+l+", "+c+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,i=this.chart._animationsDisabled;let{start:o,count:a}=Oi(e,s,i);if(this._drawStart=o,this._drawCount=a,Fi(e)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!i,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,i){const o=i==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,i),f=this.getSharedOptions(h),u=this.includeOptions(i,f),p=a.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,x=ke(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||i==="none";let k=e>0&&this.getParsed(e-1);for(let M=e;M<e+s;++M){const _=t[M],w=this.getParsed(M),S=y?_:{},C=I(w[m]),v=S[p]=a.getPixelForValue(w[p],M),E=S[m]=o||C?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,w,c):w[m],M);S.skip=isNaN(v)||isNaN(E)||C,S.stop=M>0&&Math.abs(w[p]-k[p])>x,b&&(S.parsed=w,S.raw=d.data[M]),u&&(S.options=f||this.resolveDataElementOptions(M,_.active?"active":i)),y||this.updateElement(_,M,S,i),k=w}this.updateSharedOptions(f,i,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let c=e.length-1;c>=0;--c)l=Math.max(l,e[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const s=t.dataset,i=s.options&&s.options.borderWidth||0;if(!e.length)return i;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,o,a)/2}}P(En,"id","scatter"),P(En,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(En,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var rd=Object.freeze({__proto__:null,BarController:Sn,BubbleController:Dn,DoughnutController:he,LineController:Bn,PieController:Bs,PolarAreaController:Ye,RadarController:vn,ScatterController:En});function fe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vs{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(vs.prototype,t)}init(){}formats(){return fe()}parse(){return fe()}format(){return fe()}add(){return fe()}diff(){return fe()}startOf(){return fe()}endOf(){return fe()}}var ld={_date:vs};function cd(n,t,e,s){const{controller:i,data:o,_sorted:a}=n,l=i._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&o.length){const c=l._reversePixels?Al:Ft;if(s){if(i._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,e-h),u=c(o,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return c(o,t,e)}return{lo:0,hi:o.length-1}}function je(n,t,e,s,i){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,c=o.length;l<c;++l){const{index:d,data:h}=o[l],{lo:f,hi:u}=cd(o[l],t,a,i);for(let p=f;p<=u;++p){const m=h[p];m.skip||s(m,d,p)}}}function dd(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(s,i){const o=t?Math.abs(s.x-i.x):0,a=e?Math.abs(s.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Es(n,t,e,s,i){const o=[];return!i&&!n.isPointInArea(t)||je(n,e,t,function(l,c,d){!i&&!Tt(l,n.chartArea,0)||l.inRange(t.x,t.y,s)&&o.push({element:l,datasetIndex:c,index:d})},!0),o}function hd(n,t,e,s){let i=[];function o(a,l,c){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:f}=Bi(a,{x:t.x,y:t.y});Ne(f,d,h)&&i.push({element:a,datasetIndex:l,index:c})}return je(n,e,t,o),i}function fd(n,t,e,s,i,o){let a=[];const l=dd(e);let c=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,i);if(s&&!p)return;const m=h.getCenterPoint(i);if(!(!!o||n.isPointInArea(m))&&!p)return;const b=l(t,m);b<c?(a=[{element:h,datasetIndex:f,index:u}],c=b):b===c&&a.push({element:h,datasetIndex:f,index:u})}return je(n,e,t,d),a}function Vs(n,t,e,s,i,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!s?hd(n,t,e,i):fd(n,t,e,s,i,o)}function ko(n,t,e,s,i){const o=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return je(n,e,t,(c,d,h)=>{c[a](t[e],i)&&(o.push({element:c,datasetIndex:d,index:h}),l=l||c.inRange(t.x,t.y,i))}),s&&!l?[]:o}var ud={evaluateInteractionItems:je,modes:{index(n,t,e,s){const i=ce(t,n),o=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?Es(n,i,o,s,a):Vs(n,i,o,!1,s,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,t,e,s){const i=ce(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?Es(n,i,o,s,a):Vs(n,i,o,!1,s,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:c,index:h})}return l},point(n,t,e,s){const i=ce(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Es(n,i,o,s,a)},nearest(n,t,e,s){const i=ce(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Vs(n,i,o,e.intersect,s,a)},x(n,t,e,s){const i=ce(t,n);return ko(n,i,"x",e.intersect,s)},y(n,t,e,s){const i=ce(t,n);return ko(n,i,"y",e.intersect,s)}}};const wo=["left","top","right","bottom"];function He(n,t){return n.filter(e=>e.pos===t)}function Co(n,t){return n.filter(e=>wo.indexOf(e.pos)===-1&&e.box.axis===t)}function Ue(n,t){return n.sort((e,s)=>{const i=t?s:e,o=t?e:s;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function pd(n){const t=[];let e,s,i,o,a,l;for(e=0,s=(n||[]).length;e<s;++e)i=n[e],{position:o,options:{stack:a,stackWeight:l=1}}=i,t.push({index:e,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:l});return t}function md(n){const t={};for(const e of n){const{stack:s,pos:i,stackWeight:o}=e;if(!s||!wo.includes(i))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function gd(n,t){const e=md(n),{vBoxMaxWidth:s,hBoxMaxHeight:i}=t;let o,a,l;for(o=0,a=n.length;o<a;++o){l=n[o];const{fullSize:c}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*s:c&&t.availableWidth,l.height=i):(l.width=s,l.height=h?h*i:c&&t.availableHeight)}return e}function bd(n){const t=pd(n),e=Ue(t.filter(d=>d.box.fullSize),!0),s=Ue(He(t,"left"),!0),i=Ue(He(t,"right")),o=Ue(He(t,"top"),!0),a=Ue(He(t,"bottom")),l=Co(t,"x"),c=Co(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:i.concat(c).concat(a).concat(l),chartArea:He(t,"chartArea"),vertical:s.concat(i).concat(c),horizontal:o.concat(a).concat(l)}}function Mo(n,t,e,s){return Math.max(n[e],t[e])+Math.max(n[s],t[s])}function So(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function yd(n,t,e,s){const{pos:i,box:o}=e,a=n.maxPadding;if(!z(i)){e.size&&(n[i]-=e.size);const f=s[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,n[i]+=e.size}o.getPadding&&So(a,o.getPadding());const l=Math.max(0,t.outerWidth-Mo(a,n,"left","right")),c=Math.max(0,t.outerHeight-Mo(a,n,"top","bottom")),d=l!==n.w,h=c!==n.h;return n.w=l,n.h=c,e.horizontal?{same:d,other:h}:{same:h,other:d}}function _d(n){const t=n.maxPadding;function e(s){const i=Math.max(t[s]-n[s],0);return n[s]+=i,i}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function xd(n,t){const e=t.maxPadding;function s(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(n?["left","right"]:["top","bottom"])}function Xe(n,t,e,s){const i=[];let o,a,l,c,d,h;for(o=0,a=n.length,d=0;o<a;++o){l=n[o],c=l.box,c.update(l.width||t.w,l.height||t.h,xd(l.horizontal,t));const{same:f,other:u}=yd(t,e,l,s);d|=f&&i.length,h=h||u,c.fullSize||i.push(l)}return d&&Xe(i,t,e,s)||h}function Vn(n,t,e,s,i){n.top=e,n.left=t,n.right=t+s,n.bottom=e+i,n.width=s,n.height=i}function Do(n,t,e,s){const i=e.padding;let{x:o,y:a}=t;for(const l of n){const c=l.box,d=s[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*h,u=d.size||c.height;Fe(d.start)&&(a=d.start),c.fullSize?Vn(c,i.left,a,e.outerWidth-i.right-i.left,u):Vn(c,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=c.bottom}else{const f=t.h*h,u=d.size||c.width;Fe(d.start)&&(o=d.start),c.fullSize?Vn(c,o,i.top,u,e.outerHeight-i.bottom-i.top):Vn(c,o,t.top+d.placed,u,f),d.start=o,d.placed+=f,o=c.right}}t.x=o,t.y=a}var lt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,s){if(!n)return;const i=rt(n.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(e-i.height,0),l=bd(n.boxes),c=l.vertical,d=l.horizontal;Y(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},i);So(u,rt(s));const p=Object.assign({maxPadding:u,w:o,h:a,x:i.left,y:i.top},i),m=gd(c.concat(d),f);Xe(l.fullSize,p,f,m),Xe(c,p,f,m),Xe(d,p,f,m)&&Xe(c,p,f,m),_d(p),Do(l.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,Do(l.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Y(l.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Bo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,i){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):s)}}isAttached(t){return!0}updateConfig(t){}}class kd extends Bo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pn="$chartjs",wd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vo=n=>n===null||n==="";function Cd(n,t){const e=n.style,s=n.getAttribute("height"),i=n.getAttribute("width");if(n[Pn]={initial:{height:s,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vo(i)){const o=Ji(n,"width");o!==void 0&&(n.width=o)}if(vo(s))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Ji(n,"height");o!==void 0&&(n.height=o)}return n}const Eo=Sc?{passive:!0}:!1;function Md(n,t,e){n.addEventListener(t,e,Eo)}function Sd(n,t,e){n.canvas.removeEventListener(t,e,Eo)}function Dd(n,t){const e=wd[n.type]||n.type,{x:s,y:i}=ce(n,t);return{type:e,chart:t,native:n,x:s!==void 0?s:null,y:i!==void 0?i:null}}function An(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Bd(n,t,e){const s=n.canvas,i=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||An(l.addedNodes,s),a=a&&!An(l.removedNodes,s);a&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function vd(n,t,e){const s=n.canvas,i=new MutationObserver(o=>{let a=!1;for(const l of o)a=a||An(l.removedNodes,s),a=a&&!An(l.addedNodes,s);a&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const qe=new Map;let Vo=0;function Po(){const n=window.devicePixelRatio;n!==Vo&&(Vo=n,qe.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Ed(n,t){qe.size||window.addEventListener("resize",Po),qe.set(n,t)}function Vd(n){qe.delete(n),qe.size||window.removeEventListener("resize",Po)}function Pd(n,t,e){const s=n.canvas,i=s&&Cs(s);if(!i)return;const o=Ai((l,c)=>{const d=i.clientWidth;e(l,c),d<i.clientWidth&&e()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||o(d,h)});return a.observe(i),Ed(n,o),a}function Ps(n,t,e){e&&e.disconnect(),t==="resize"&&Vd(n)}function Ad(n,t,e){const s=n.canvas,i=Ai(o=>{n.ctx!==null&&e(Dd(o,n))},n);return Md(s,t,i),i}class Od extends Bo{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Cd(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Pn])return!1;const s=e[Pn].initial;["height","width"].forEach(o=>{const a=s[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});const i=s.style||{};return Object.keys(i).forEach(o=>{e.style[o]=i[o]}),e.width=e.width,delete e[Pn],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),a={attach:Bd,detach:vd,resize:Pd}[e]||Ad;i[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),i=s[e];if(!i)return;({attach:Ps,detach:Ps,resize:Ps}[e]||Sd)(t,e,i),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,i){return Mc(t,e,s,i)}isAttached(t){const e=Cs(t);return!!(e&&e.isConnected)}}function Fd(n){return!ws()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?kd:Od}let $t=(ts=class{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return ke(this.x)&&ke(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const i={};return t.forEach(o=>{i[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),i}},P(ts,"defaults",{}),P(ts,"defaultRoutes"),ts);function Td(n,t){const e=n.options.ticks,s=Nd(n),i=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Ld(t):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>i)return Rd(t,d,o,a/i),d;const h=$d(o,t,i);if(a>0){let f,u;const p=a>1?Math.round((c-l)/(a-1)):null;for(On(t,d,h,I(p)?0:l-p,l),f=0,u=a-1;f<u;f++)On(t,d,h,o[f],o[f+1]);return On(t,d,h,c,I(p)?t.length:c+p),d}return On(t,d,h),d}function Nd(n){const t=n.options.offset,e=n._tickSize(),s=n._length/e+(t?0:1),i=n._maxLength/e;return Math.floor(Math.min(s,i))}function $d(n,t,e){const s=zd(n),i=t.length/e;if(!s)return Math.max(i,1);const o=vl(s);for(let a=0,l=o.length-1;a<l;a++){const c=o[a];if(c>i)return c}return Math.max(i,1)}function Ld(n){const t=[];let e,s;for(e=0,s=n.length;e<s;e++)n[e].major&&t.push(e);return t}function Rd(n,t,e,s){let i=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<n.length;a++)a===o&&(t.push(n[a]),i++,o=e[i*s])}function On(n,t,e,s,i){const o=L(s,0),a=Math.min(L(i,n.length),n.length);let l=0,c,d,h;for(e=Math.ceil(e),i&&(c=i-s,e=c/Math.floor(c/e)),h=o;h<0;)l++,h=Math.round(o+l*e);for(d=Math.max(o,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(o+l*e))}function zd(n){const t=n.length;let e,s;if(t<2)return!1;for(s=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==s)return!1;return s}const Id=n=>n==="left"?"right":n==="right"?"left":n,Ao=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Oo=(n,t)=>Math.min(t||n,n);function Fo(n,t){const e=[],s=n.length/t,i=n.length;let o=0;for(;o<i;o+=s)e.push(n[Math.floor(o)]);return e}function Wd(n,t,e){const s=n.ticks.length,i=Math.min(t,s-1),o=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(i),d;if(!(e&&(s===1?d=Math.max(c-o,a-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(i-1))/2,c+=i<t?d:-d,c<o-l||c>a+l)))return c}function Yd(n,t){Y(n,e=>{const s=e.gc,i=s.length/2;let o;if(i>t){for(o=0;o<i;++o)delete e.data[s[o]];s.splice(0,i)}})}function Ke(n){return n.drawTicks?n.tickLength:0}function To(n,t){if(!n.display)return 0;const e=nt(n.font,t),s=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+s.height}function jd(n,t){return Kt(n,{scale:t,type:"scale"})}function Hd(n,t,e){return Kt(n,{tick:e,index:t,type:"tick"})}function Ud(n,t,e){let s=fs(n);return(e&&t!=="right"||!e&&t==="right")&&(s=Id(s)),s}function Xd(n,t,e,s){const{top:i,left:o,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:h}=c;let f=0,u,p,m;const g=a-i,b=l-o;if(n.isHorizontal()){if(p=at(s,o,l),z(e)){const x=Object.keys(e)[0],y=e[x];m=h[x].getPixelForValue(y)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=Ao(n,e,t);u=l-o}else{if(z(e)){const x=Object.keys(e)[0],y=e[x];p=h[x].getPixelForValue(y)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=Ao(n,e,t);m=at(s,a,i),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class ue extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:i}=this;return t=gt(t,Number.POSITIVE_INFINITY),e=gt(e,Number.NEGATIVE_INFINITY),s=gt(s,Number.POSITIVE_INFINITY),i=gt(i,Number.NEGATIVE_INFINITY),{min:gt(t,s),max:gt(e,i),minDefined:J(t),maxDefined:J(e)}}getMinMax(t){let{min:e,max:s,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:e,max:s};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,t),i||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=i&&e>s?e:s,{min:gt(e,gt(s,e)),max:gt(s,gt(e,s))}}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(){H(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:i,grace:o,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=nc(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Fo(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Td(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(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(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,i,o;for(s=0,i=t.length;s<i;s++)o=t[s],o.label=H(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Oo(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,o=e.maxRotation;let a=i,l,c,d;if(!this._isVisible()||!e.display||i>=o||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=it(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/s:p/(s-1),f+6>l&&(l=p/(s-(t.offset?.5:1)),c=this.maxHeight-Ke(t.grid)-e.padding-To(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=cs(Math.min(Math.asin(it((h.highest.height+6)/l,-1,1)),Math.asin(it(c/d,-1,1))-Math.asin(it(u/d,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:i,grid:o}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=To(i,e.options.font);if(l?(t.width=this.maxWidth,t.height=Ke(o)+c):(t.height=this.maxHeight,t.width=Ke(o)+c),s.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=s.padding*2,m=Mt(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(l){const x=s.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=s.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(d,h,b,g)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,i){const{ticks:{align:o,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;c?d?(u=i*t.width,p=s*e.height):(u=s*t.height,p=i*e.width):o==="start"?p=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,p=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+a,this.paddingBottom=f+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)I(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Fo(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:i,_longestTextCache:o}=this,a=[],l=[],c=Math.floor(e/Oo(e,s));let d=0,h=0,f,u,p,m,g,b,x,y,k,M,_;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),i.font=b=g.string,x=o[b]=o[b]||{data:{},gc:[]},y=g.lineHeight,k=M=0,!I(m)&&!X(m))k=yn(i,x.data,x.gc,k,m),M=y;else if(X(m))for(u=0,p=m.length;u<p;++u)_=m[u],!I(_)&&!X(_)&&(k=yn(i,x.data,x.gc,k,_),M+=y);a.push(k),l.push(M),d=Math.max(k,d),h=Math.max(M,h)}Yd(o,e);const w=a.indexOf(d),S=l.indexOf(h),C=v=>({width:a[v]||0,height:l[v]||0});return{first:C(0),last:C(e-1),widest:C(w),highest:C(S),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Pl(this._alignToPixels?oe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Hd(this.getContext(),t,s))}return this.$context||(this.$context=jd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Mt(this.labelRotation),s=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,l=o?o.widest.width+a:0,c=o?o.highest.height+a:0;return this.isHorizontal()?c*s>l*i?l/s:c/i:c*i<l*s?c/s:l/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,i=this.options,{grid:o,position:a,border:l}=i,c=o.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=Ke(o),p=[],m=l.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,x=function(D){return oe(s,D,g)};let y,k,M,_,w,S,C,v,E,O,N,U;if(a==="top")y=x(this.bottom),S=this.bottom-u,v=y-b,O=x(t.top)+b,U=t.bottom;else if(a==="bottom")y=x(this.top),O=t.top,U=x(t.bottom)-b,S=y+b,v=this.top+u;else if(a==="left")y=x(this.right),w=this.right-u,C=y-b,E=x(t.left)+b,N=t.right;else if(a==="right")y=x(this.left),E=t.left,N=x(t.right)-b,w=y+b,C=this.left+u;else if(e==="x"){if(a==="center")y=x((t.top+t.bottom)/2+.5);else if(z(a)){const D=Object.keys(a)[0],V=a[D];y=x(this.chart.scales[D].getPixelForValue(V))}O=t.top,U=t.bottom,S=y+b,v=S+u}else if(e==="y"){if(a==="center")y=x((t.left+t.right)/2);else if(z(a)){const D=Object.keys(a)[0],V=a[D];y=x(this.chart.scales[D].getPixelForValue(V))}w=y-b,C=w-u,E=t.left,N=t.right}const F=L(i.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/F));for(k=0;k<f;k+=B){const D=this.getContext(k),V=o.setContext(D),A=l.setContext(D),T=V.lineWidth,$=V.color,W=A.dash||[],j=A.dashOffset,G=V.tickWidth,Z=V.tickColor,ot=V.tickBorderDash||[],ut=V.tickBorderDashOffset;M=Wd(this,k,c),M!==void 0&&(_=oe(s,M,T),d?w=C=E=N=_:S=v=O=U=_,p.push({tx1:w,ty1:S,tx2:C,ty2:v,x1:E,y1:O,x2:N,y2:U,width:T,color:$,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Z,tickBorderDash:ot,tickBorderDashOffset:ut}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const e=this.axis,s=this.options,{position:i,ticks:o}=s,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=o,u=Ke(s.grid),p=u+h,m=f?-h:p,g=-Mt(this.labelRotation),b=[];let x,y,k,M,_,w,S,C,v,E,O,N,U="middle";if(i==="top")w=this.bottom-m,S=this._getXAxisLabelAlignment();else if(i==="bottom")w=this.top+m,S=this._getXAxisLabelAlignment();else if(i==="left"){const B=this._getYAxisLabelAlignment(u);S=B.textAlign,_=B.x}else if(i==="right"){const B=this._getYAxisLabelAlignment(u);S=B.textAlign,_=B.x}else if(e==="x"){if(i==="center")w=(t.top+t.bottom)/2+p;else if(z(i)){const B=Object.keys(i)[0],D=i[B];w=this.chart.scales[B].getPixelForValue(D)+p}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(z(i)){const B=Object.keys(i)[0],D=i[B];_=this.chart.scales[B].getPixelForValue(D)}S=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const F=this._getLabelSizes();for(x=0,y=l.length;x<y;++x){k=l[x],M=k.label;const B=o.setContext(this.getContext(x));C=this.getPixelForTick(x)+o.labelOffset,v=this._resolveTickFontOptions(x),E=v.lineHeight,O=X(M)?M.length:1;const D=O/2,V=B.color,A=B.textStrokeColor,T=B.textStrokeWidth;let $=S;a?(_=C,S==="inner"&&(x===y-1?$=this.options.reverse?"left":"right":x===0?$=this.options.reverse?"right":"left":$="center"),i==="top"?d==="near"||g!==0?N=-O*E+E/2:d==="center"?N=-F.highest.height/2-D*E+E:N=-F.highest.height+E/2:d==="near"||g!==0?N=E/2:d==="center"?N=F.highest.height/2-D*E:N=F.highest.height-O*E,f&&(N*=-1),g!==0&&!B.showLabelBackdrop&&(_+=E/2*Math.sin(g))):(w=C,N=(1-O)*E/2);let W;if(B.showLabelBackdrop){const j=rt(B.backdropPadding),G=F.heights[x],Z=F.widths[x];let ot=N-j.top,ut=0-j.left;switch(U){case"middle":ot-=G/2;break;case"bottom":ot-=G;break}switch(S){case"center":ut-=Z/2;break;case"right":ut-=Z;break;case"inner":x===y-1?ut-=Z:x>0&&(ut-=Z/2);break}W={left:ut,top:ot,width:Z+j.width,height:G+j.height,color:B.backdropColor}}b.push({label:M,font:v,textOffset:N,options:{rotation:g,color:V,strokeColor:A,strokeWidth:T,textAlign:$,textBaseline:U,translation:[_,w],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Mt(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),l=t+o,c=a.widest.width;let d,h;return e==="left"?i?(h=this.right+o,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-l,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h=this.left)):e==="right"?i?(h=this.left+o,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+l,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:i,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,i,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const l=(c,d,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(d.x,d.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=i.length;o<a;++o){const c=i[o];e.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:i}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const l=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,h,f,u;this.isHorizontal()?(d=oe(t,this.left,a)-a/2,h=oe(t,this.right,l)+l/2,f=u=c):(f=oe(t,this.top,a)-a/2,u=oe(t,this.bottom,l)+l/2,d=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,i=this._computeLabelArea();i&&_n(s,i);const o=this.getLabelItems(t);for(const a of o){const l=a.options,c=a.font,d=a.label,h=a.textOffset;ae(s,d,0,h,c,l)}i&&xn(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:i}}=this;if(!s.display)return;const o=nt(s.font),a=rt(s.padding),l=s.align;let c=o.lineHeight/2;e==="bottom"||e==="center"||z(e)?(c+=a.bottom,X(s.text)&&(c+=o.lineHeight*(s.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=Xd(this,c,e,l);ae(t,s.text,0,0,o,{color:s.color,maxWidth:f,rotation:u,textAlign:Ud(l,e,i),textBaseline:"middle",translation:[d,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=L(t.grid&&t.grid.z,-1),i=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ue.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let o,a;for(o=0,a=e.length;o<a;++o){const l=e[o];l[s]===this.id&&(!t||l.type===t)&&i.push(l)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fn{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Gd(e)&&(s=this.register(e));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,qd(t,a,s),this.override&&Q.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,i=this.scope;s in e&&delete e[s],i&&s in Q[i]&&(delete Q[i][s],this.override&&delete ie[s])}}function qd(n,t,e){const s=Ae(Object.create(null),[e?Q.get(e):{},Q.get(t),n.defaults]);Q.set(t,s),n.defaultRoutes&&Kd(t,n.defaultRoutes),n.descriptors&&Q.describe(t,n.descriptors)}function Kd(n,t){Object.keys(t).forEach(e=>{const s=e.split("."),i=s.pop(),o=[n].concat(s).join("."),a=t[e].split("."),l=a.pop(),c=a.join(".");Q.route(o,i,c,l)})}function Gd(n){return"id"in n&&"defaults"in n}class Zd{constructor(){this.controllers=new Fn(St,"datasets",!0),this.elements=new Fn($t,"elements"),this.plugins=new Fn(Object,"plugins"),this.scales=new Fn(ue,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(i=>{const o=s||this._getRegistryForType(i);s||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Y(i,a=>{const l=s||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,s){const i=ls(t);H(s["before"+i],[],s),e[t](s),H(s["after"+i],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return i}}var Bt=new Zd;class Jd{constructor(){this._init=[]}notify(t,e,s,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,i){i=i||{};for(const o of t){const a=o.plugin,l=a[s],c=[e,i,o.options];if(H(l,c,a)===!1&&i.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,i=L(s.options&&s.options.plugins,{}),o=Qd(s);return i===!1&&!e?[]:eh(t,o,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,i=(o,a)=>o.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(i(e,s),t,"stop"),this._notify(i(s,e),t,"start")}}function Qd(n){const t={},e=[],s=Object.keys(Bt.plugins.items);for(let o=0;o<s.length;o++)e.push(Bt.getPlugin(s[o]));const i=n.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function th(n,t){return!t&&n===!1?null:n===!0?{}:n}function eh(n,{plugins:t,localIds:e},s,i){const o=[],a=n.getContext();for(const l of t){const c=l.id,d=th(s[c],i);d!==null&&o.push({plugin:l,options:nh(n.config,{plugin:l,local:e[c]},d,a)})}return o}function nh(n,{plugin:t,local:e},s,i){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function As(n,t){const e=Q.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function sh(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function ih(n,t){return n===t?"_index_":"_value_"}function No(n){if(n==="x"||n==="y"||n==="r")return n}function oh(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Os(n,...t){if(No(n))return n;for(const e of t){const s=e.axis||oh(e.position)||n.length>1&&No(n[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $o(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function ah(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===n||s.yAxisID===n);if(e.length)return $o(n,"x",e[0])||$o(n,"y",e[0])}return{}}function rh(n,t){const e=ie[n.type]||{scales:{}},s=t.scales||{},i=As(n.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const l=s[a];if(!z(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=Os(a,l,ah(a,n),Q.scales[l.type]),d=ih(c,i),h=e.scales||{};o[a]=Oe(Object.create(null),[{axis:c},l,h[c],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||As(l,t),h=(ie[l]||{}).scales||{};Object.keys(h).forEach(f=>{const u=sh(f,c),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),Oe(o[p],[{axis:u},s[p],h[f]])})}),Object.keys(o).forEach(a=>{const l=o[a];Oe(l,[Q.scales[l.type],Q.scale])}),o}function Lo(n){const t=n.options||(n.options={});t.plugins=L(t.plugins,{}),t.scales=rh(n,t)}function Ro(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function lh(n){return n=n||{},n.data=Ro(n.data),Lo(n),n}const zo=new Map,Io=new Set;function Tn(n,t){let e=zo.get(n);return e||(e=t(),zo.set(n,e),Io.add(e)),e}const Ge=(n,t,e)=>{const s=Ut(t,e);s!==void 0&&n.add(s)};class ch{constructor(t){this._config=lh(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=Ro(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(),Lo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Tn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Tn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Tn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Tn(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let i=s.get(t);return(!i||e)&&(i=new Map,s.set(t,i)),i}getOptionScopes(t,e,s){const{options:i,type:o}=this,a=this._cachedScopes(t,s),l=a.get(e);if(l)return l;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>Ge(c,t,f))),h.forEach(f=>Ge(c,i,f)),h.forEach(f=>Ge(c,ie[o]||{},f)),h.forEach(f=>Ge(c,Q,f)),h.forEach(f=>Ge(c,ms,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Io.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,ie[e]||{},Q.datasets[e]||{},{type:e},Q,ms]}resolveNamedOptions(t,e,s,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:l}=Wo(this._resolverCache,t,i);let c=a;if(hh(a,e)){o.$shared=!1,s=Xt(s)?s():s;const d=this.createResolver(t,s,l);c=we(a,s,d)}for(const d of e)o[d]=c[d];return o}createResolver(t,e,s=[""],i){const{resolver:o}=Wo(this._resolverCache,t,s);return z(e)?we(o,e,void 0,i):o}}function Wo(n,t,e){let s=n.get(t);s||(s=new Map,n.set(t,s));const i=e.join();let o=s.get(i);return o||(o={resolver:_s(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},s.set(i,o)),o}const dh=n=>z(n)&&Object.getOwnPropertyNames(n).some(t=>Xt(n[t]));function hh(n,t){const{isScriptable:e,isIndexable:s}=Yi(n);for(const i of t){const o=e(i),a=s(i),l=(a||o)&&n[i];if(o&&(Xt(l)||dh(l))||a&&X(l))return!0}return!1}var fh="4.4.1";const uh=["top","bottom","left","right","chartArea"];function Yo(n,t){return n==="top"||n==="bottom"||uh.indexOf(n)===-1&&t==="x"}function jo(n,t){return function(e,s){return e[n]===s[n]?e[t]-s[t]:e[n]-s[n]}}function Ho(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[n],t)}function ph(n){const t=n.chart,e=t.options.animation;H(e&&e.onProgress,[n],t)}function Uo(n){return ws()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Nn={},Xo=n=>{const t=Uo(n);return Object.values(Nn).filter(e=>e.canvas===t).pop()};function mh(n,t,e){const s=Object.keys(n);for(const i of s){const o=+i;if(o>=t){const a=n[i];delete n[i],(e>0||o>t)&&(n[o+e]=a)}}}function gh(n,t,e,s){return!e||n.type==="mouseout"?null:s?t:n}function $n(n,t,e){return n.options.clip?n[e]:t[e]}function bh(n,t){const{xScale:e,yScale:s}=n;return e&&s?{left:$n(e,t,"left"),right:$n(e,t,"right"),top:$n(s,t,"top"),bottom:$n(s,t,"bottom")}:t}class Lt{static register(...t){Bt.add(...t),qo()}static unregister(...t){Bt.remove(...t),qo()}constructor(t,e){const s=this.config=new ch(e),i=Uo(t),o=Xo(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Fd(i)),this.platform.updateConfig(s);const l=this.platform.acquireContext(i,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,h=c&&c.width;if(this.id=_l(),this.ctx=l,this.canvas=c,this.width=h,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Jd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Tl(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Nn[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Nt.listen(this,"complete",Ho),Nt.listen(this,"progress",ph),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:i,_aspectRatio:o}=this;return I(t)?e&&o?o:i?s/i: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 Bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Zi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return Nt.stop(this),this}resize(t,e){Nt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,i=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,e,o),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Zi(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),H(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(e,(s,i)=>{s.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,i=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const l=e[a],c=Os(a,l),d=c==="r",h=c==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Y(o,a=>{const l=a.options,c=l.id,d=Os(c,l),h=L(l.type,a.dtype);(l.position===void 0||Yo(l.position,d)!==Yo(a.dposition))&&(l.position=a.dposition),i[c]=!0;let f=null;if(c in s&&s[c].type===h)f=s[c];else{const u=Bt.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),s[f.id]=f}f.init(l,t)}),Y(i,(a,l)=>{a||delete s[l]}),Y(s,a=>{lt.configure(this,a,a.options),lt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((i,o)=>i.index-o.index),s>e){for(let i=e;i<s;++i)this._destroyDatasetMeta(i);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(jo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,i)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=e.length;s<i;s++){const o=e[s];let a=this.getDatasetMeta(s);const l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=o.indexAxis||As(l,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const c=Bt.getController(l),{datasetElementType:d,dataElementType:h}=Q.datasets[l];Object.assign(c,{dataElementType:Bt.getElement(h),datasetElementType:d&&Bt.getElement(d)}),a.controller=new c(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Y(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:f}=this.getDatasetMeta(d),u=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),i||Y(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(jo("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Y(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!wi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:o}of e){const a=s==="_removeElements"?-o:o;mh(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),i=s(0);for(let o=1;o<e;o++)if(!wi(i,s(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Xt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),i={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(s.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Nt.has(this)?this.attached&&!Nt.running(this)&&Nt.start(this):(this.draw(),Ho({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:i}=this._resizeBeforeDraw;this._resize(s,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let i,o;for(i=0,o=e.length;i<o;++i){const a=e[i];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,i=!s.disabled,o=bh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(i&&_n(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),i&&xn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Tt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,i){const o=ud.modes[e];return typeof o=="function"?o(this,t,s,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let i=s.filter(o=>o&&o._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=Kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const i=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);Fe(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(l=>l.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Nt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),zi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Nn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},i=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Y(this.options.events,o=>s(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},i=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},o=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{i("attach",l),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),s("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const i=s?"set":"remove";let o,a,l,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!un(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const i=this.options.hover,o=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),a=o(e,t),l=s?t:o(t,e);a.length&&this.updateHoverStyle(a,i.mode,!1),l.length&&i.mode&&this.updateHoverStyle(l,i.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:i=[],options:o}=this,a=e,l=this._getActiveElements(t,i,s,a),c=Sl(t),d=gh(t,this._lastEvent,s,c);s&&(this._lastEvent=null,H(o.onHover,[t,l,this],this),c&&H(o.onClick,[t,l,this],this));const h=!un(l,i);return(h||e)&&(this._active=l,this._updateHoverStyles(l,i,e)),this._lastEvent=d,h}_getActiveElements(t,e,s,i){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}P(Lt,"defaults",Q),P(Lt,"instances",Nn),P(Lt,"overrides",ie),P(Lt,"registry",Bt),P(Lt,"version",fh),P(Lt,"getChart",Xo);function qo(){return Y(Lt.instances,n=>n._plugins.invalidate())}function yh(n,t,e){const{startAngle:s,pixelMargin:i,x:o,y:a,outerRadius:l,innerRadius:c}=t;let d=i/l;n.beginPath(),n.arc(o,a,l,s-d,e+d),c>i?(d=i/c,n.arc(o,a,c,e+d,s-d,!0)):n.arc(o,a,i,e+tt,s-tt),n.closePath(),n.clip()}function _h(n){return ys(n,["outerStart","outerEnd","innerStart","innerEnd"])}function xh(n,t,e,s){const i=_h(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),l=c=>{const d=(e-Math.min(o,c))*s/2;return it(c,0,Math.min(o,d))};return{outerStart:l(i.outerStart),outerEnd:l(i.outerEnd),innerStart:it(i.innerStart,0,a),innerEnd:it(i.innerEnd,0,a)}}function Se(n,t,e,s){return{x:e+n*Math.cos(t),y:s+n*Math.sin(t)}}function Ln(n,t,e,s,i,o){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+s+e-d,0),u=h>0?h+s+e+d:0;let p=0;const m=i-c;if(s){const B=h>0?h-s:0,D=f>0?f-s:0,V=(B+D)/2,A=V!==0?m*V/(V+s):m;p=(m-A)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,x=c+b+p,y=i-b-p,{outerStart:k,outerEnd:M,innerStart:_,innerEnd:w}=xh(t,u,f,y-x),S=f-k,C=f-M,v=x+k/S,E=y-M/C,O=u+_,N=u+w,U=x+_/O,F=y-w/N;if(n.beginPath(),o){const B=(v+E)/2;if(n.arc(a,l,f,v,B),n.arc(a,l,f,B,E),M>0){const T=Se(C,E,a,l);n.arc(T.x,T.y,M,E,y+tt)}const D=Se(N,y,a,l);if(n.lineTo(D.x,D.y),w>0){const T=Se(N,F,a,l);n.arc(T.x,T.y,w,y+tt,F+Math.PI)}const V=(y-w/u+(x+_/u))/2;if(n.arc(a,l,u,y-w/u,V,!0),n.arc(a,l,u,V,x+_/u,!0),_>0){const T=Se(O,U,a,l);n.arc(T.x,T.y,_,U+Math.PI,x-tt)}const A=Se(S,x,a,l);if(n.lineTo(A.x,A.y),k>0){const T=Se(S,v,a,l);n.arc(T.x,T.y,k,x-tt,v)}}else{n.moveTo(a,l);const B=Math.cos(v)*f+a,D=Math.sin(v)*f+l;n.lineTo(B,D);const V=Math.cos(E)*f+a,A=Math.sin(E)*f+l;n.lineTo(V,A)}n.closePath()}function kh(n,t,e,s,i){const{fullCircles:o,startAngle:a,circumference:l}=t;let c=t.endAngle;if(o){Ln(n,t,e,s,c,i);for(let d=0;d<o;++d)n.fill();isNaN(l)||(c=a+(l%K||K))}return Ln(n,t,e,s,c,i),n.fill(),c}function wh(n,t,e,s,i){const{fullCircles:o,startAngle:a,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=c,p=c.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let m=t.endAngle;if(o){Ln(n,t,e,s,m,i);for(let g=0;g<o;++g)n.stroke();isNaN(l)||(m=a+(l%K||K))}p&&yh(n,t,m),o||(Ln(n,t,e,s,m,i),n.stroke())}class Ze extends $t{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(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,e&&Object.assign(this,e)}inRange(e,s,i){const o=this.getProps(["x","y"],i),{angle:a,distance:l}=Bi(o,{x:e,y:s}),{startAngle:c,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,g=L(u,d-c)>=K||Ne(a,c,d),b=Ot(l,h+p,f+p);return g&&b}getCenterPoint(e){const{x:s,y:i,startAngle:o,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:h}=this.options,f=(o+a)/2,u=(l+c+h+d)/2;return{x:s+Math.cos(f)*u,y:i+Math.sin(f)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:i}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,l=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=i>K?Math.floor(i/K):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*o,Math.sin(c)*o);const d=1-Math.sin(Math.min(q,i||0)),h=o*d;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,kh(e,this,h,a,l),wh(e,this,h,a,l),e.restore()}}P(Ze,"id","arc"),P(Ze,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(Ze,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(Ze,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ko(n,t,e=t){n.lineCap=L(e.borderCapStyle,t.borderCapStyle),n.setLineDash(L(e.borderDash,t.borderDash)),n.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),n.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=L(e.borderWidth,t.borderWidth),n.strokeStyle=L(e.borderColor,t.borderColor)}function Ch(n,t,e){n.lineTo(e.x,e.y)}function Mh(n){return n.stepped?Xl:n.tension||n.cubicInterpolationMode==="monotone"?ql:Ch}function Go(n,t,e={}){const s=n.length,{start:i=0,end:o=s-1}=e,{start:a,end:l}=t,c=Math.max(i,a),d=Math.min(o,l),h=i<a&&o<a||i>l&&o>l;return{count:s,start:c,loop:t.loop,ilen:d<c&&!h?s+d-c:d-c}}function Sh(n,t,e,s){const{points:i,options:o}=t,{count:a,start:l,loop:c,ilen:d}=Go(i,e,s),h=Mh(o);let{move:f=!0,reverse:u}=s||{},p,m,g;for(p=0;p<=d;++p)m=i[(l+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,o.stepped),g=m);return c&&(m=i[(l+(u?d:0))%a],h(n,g,m,u,o.stepped)),!!c}function Dh(n,t,e,s){const i=t.points,{count:o,start:a,ilen:l}=Go(i,e,s),{move:c=!0,reverse:d}=s||{};let h=0,f=0,u,p,m,g,b,x;const y=M=>(a+(d?l-M:M))%o,k=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,x))};for(c&&(p=i[y(0)],n.moveTo(p.x,p.y)),u=0;u<=l;++u){if(p=i[y(u)],p.skip)continue;const M=p.x,_=p.y,w=M|0;w===m?(_<g?g=_:_>b&&(b=_),h=(f*h+M)/++f):(k(),n.lineTo(M,_),m=w,f=0,g=b=_),x=_}k()}function Fs(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Dh:Sh}function Bh(n){return n.stepped?Dc:n.tension||n.cubicInterpolationMode==="monotone"?Bc:de}function vh(n,t,e,s){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,s)&&i.closePath()),Ko(n,t.options),n.stroke(i)}function Eh(n,t,e,s){const{segments:i,options:o}=t,a=Fs(t);for(const l of i)Ko(n,o,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+s-1})&&n.closePath(),n.stroke()}const Vh=typeof Path2D=="function";function Ph(n,t,e,s){Vh&&!t.options.segment?vh(n,t,e,s):Eh(n,t,e,s)}class Gt extends $t{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;yc(this._points,s,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Oc(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,i=t[e],o=this.points,a=io(this,{property:e,start:i,end:i});if(!a.length)return;const l=[],c=Bh(s);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=o[f],m=o[u];if(p===m){l.push(p);continue}const g=Math.abs((i-p[e])/(m[e]-p[e])),b=c(p,m,g,s.stepped);b[e]=t[e],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,e,s){return Fs(this)(t,this,e,s)}path(t,e,s){const i=this.segments,o=Fs(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const l of i)a&=o(t,this,l,{start:e,end:e+s-1});return!!a}draw(t,e,s,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ph(t,this,s,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(Gt,"id","line"),P(Gt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(Gt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(Gt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Zo(n,t,e,s){const i=n.options,{[e]:o}=n.getProps([e],s);return Math.abs(t-o)<i.radius+i.hitRadius}class Rn extends $t{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,i){const o=this.options,{x:a,y:l}=this.getProps(["x","y"],i);return Math.pow(e-a,2)+Math.pow(s-l,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Zo(this,e,"x",s)}inYRange(e,s){return Zo(this,e,"y",s)}getCenterPoint(e){const{x:s,y:i}=this.getProps(["x","y"],e);return{x:s,y:i}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const i=s&&e.borderWidth||0;return(s+i)*2}draw(e,s){const i=this.options;this.skip||i.radius<.1||!Tt(this,s,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,bs(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Rn,"id","point"),P(Rn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Jo(n,t){const{x:e,y:s,base:i,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let l,c,d,h,f;return n.horizontal?(f=a/2,l=Math.min(e,i),c=Math.max(e,i),d=s-f,h=s+f):(f=o/2,l=e-f,c=e+f,d=Math.min(s,i),h=Math.max(s,i)),{left:l,top:d,right:c,bottom:h}}function Zt(n,t,e,s){return n?0:it(t,e,s)}function Ah(n,t,e){const s=n.options.borderWidth,i=n.borderSkipped,o=Wi(s);return{t:Zt(i.top,o.top,0,e),r:Zt(i.right,o.right,0,t),b:Zt(i.bottom,o.bottom,0,e),l:Zt(i.left,o.left,0,t)}}function Oh(n,t,e){const{enableBorderRadius:s}=n.getProps(["enableBorderRadius"]),i=n.options.borderRadius,o=re(i),a=Math.min(t,e),l=n.borderSkipped,c=s||z(i);return{topLeft:Zt(!c||l.top||l.left,o.topLeft,0,a),topRight:Zt(!c||l.top||l.right,o.topRight,0,a),bottomLeft:Zt(!c||l.bottom||l.left,o.bottomLeft,0,a),bottomRight:Zt(!c||l.bottom||l.right,o.bottomRight,0,a)}}function Fh(n){const t=Jo(n),e=t.right-t.left,s=t.bottom-t.top,i=Ah(n,e/2,s/2),o=Oh(n,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:s-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Ts(n,t,e,s){const i=t===null,o=e===null,l=n&&!(i&&o)&&Jo(n,s);return l&&(i||Ot(t,l.left,l.right))&&(o||Ot(e,l.top,l.bottom))}function Th(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Nh(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ns(n,t,e={}){const s=n.x!==e.x?-t:0,i=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-s,a=(n.y+n.h!==e.y+e.h?t:0)-i;return{x:n.x+s,y:n.y+i,w:n.w+o,h:n.h+a,radius:n.radius}}class zn extends $t{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:i}}=this,{inner:o,outer:a}=Fh(this),l=Th(a.radius)?ze:Nh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),l(t,Ns(a,e,o)),t.clip(),l(t,Ns(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),l(t,Ns(o,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,s){return Ts(this,t,e,s)}inXRange(t,e){return Ts(this,t,null,e)}inYRange(t,e){return Ts(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+i)/2:e,y:o?s:(s+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(zn,"id","bar"),P(zn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(zn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var $h=Object.freeze({__proto__:null,ArcElement:Ze,BarElement:zn,LineElement:Gt,PointElement:Rn});const $s=["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)"],Qo=$s.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ta(n){return $s[n%$s.length]}function ea(n){return Qo[n%Qo.length]}function Lh(n,t){return n.borderColor=ta(t),n.backgroundColor=ea(t),++t}function Rh(n,t){return n.backgroundColor=n.data.map(()=>ta(t++)),t}function zh(n,t){return n.backgroundColor=n.data.map(()=>ea(t++)),t}function Ih(n){let t=0;return(e,s)=>{const i=n.getDatasetMeta(s).controller;i instanceof he?t=Rh(e,t):i instanceof Ye?t=zh(e,t):i&&(t=Lh(e,t))}}function na(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Wh(n){return n&&(n.borderColor||n.backgroundColor)}var Yh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:s},options:i}=n.config,{elements:o}=i;if(!e.forceOverride&&(na(s)||Wh(i)||o&&na(o)))return;const a=Ih(n);s.forEach(a)}};function jh(n,t,e,s,i){const o=i.samples||s;if(o>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(o-2);let c=0;const d=t+e-1;let h=t,f,u,p,m,g;for(a[c++]=n[h],f=0;f<o-2;f++){let b=0,x=0,y;const k=Math.floor((f+1)*l)+1+t,M=Math.min(Math.floor((f+2)*l)+1,e)+t,_=M-k;for(y=k;y<M;y++)b+=n[y].x,x+=n[y].y;b/=_,x/=_;const w=Math.floor(f*l)+1+t,S=Math.min(Math.floor((f+1)*l)+1,e)+t,{x:C,y:v}=n[h];for(p=m=-1,y=w;y<S;y++)m=.5*Math.abs((C-b)*(n[y].y-v)-(C-n[y].x)*(x-v)),m>p&&(p=m,u=n[y],g=y);a[c++]=u,h=g}return a[c++]=n[d],a}function Hh(n,t,e,s){let i=0,o=0,a,l,c,d,h,f,u,p,m,g;const b=[],x=t+e-1,y=n[t].x,M=n[x].x-y;for(a=t;a<t+e;++a){l=n[a],c=(l.x-y)/M*s,d=l.y;const _=c|0;if(_===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),i=(o*i+l.x)/++o;else{const w=a-1;if(!I(f)&&!I(u)){const S=Math.min(f,u),C=Math.max(f,u);S!==p&&S!==w&&b.push({...n[S],x:i}),C!==p&&C!==w&&b.push({...n[C],x:i})}a>0&&w!==p&&b.push(n[w]),b.push(l),h=_,o=0,m=g=d,f=u=p=a}}return b}function sa(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ia(n){n.data.datasets.forEach(t=>{sa(t)})}function Uh(n,t){const e=t.length;let s=0,i;const{iScale:o}=n,{min:a,max:l,minDefined:c,maxDefined:d}=o.getUserBounds();return c&&(s=it(Ft(t,o.axis,a).lo,0,e-1)),d?i=it(Ft(t,o.axis,l).hi+1,s,e)-s:i=e-s,{start:s,count:i}}var Xh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){ia(n);return}const s=n.width;n.data.datasets.forEach((i,o)=>{const{_data:a,indexAxis:l}=i,c=n.getDatasetMeta(o),d=a||i.data;if(Ie([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const h=n.scales[c.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:u}=Uh(c,d);const p=e.threshold||4*s;if(u<=p){sa(i);return}I(a)&&(i._data=d,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=jh(d,f,u,s,e);break;case"min-max":m=Hh(d,f,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=m})},destroy(n){ia(n)}};function qh(n,t,e){const s=n.segments,i=n.points,o=t.points,a=[];for(const l of s){let{start:c,end:d}=l;d=Rs(c,d,i);const h=Ls(e,i[c],i[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:i[c],end:i[d]});continue}const f=io(t,h);for(const u of f){const p=Ls(e,o[u.start],o[u.end],u.loop),m=so(l,i,p);for(const g of m)a.push({source:g,target:u,start:{[e]:oa(h,p,"start",Math.max)},end:{[e]:oa(h,p,"end",Math.min)}})}}return a}function Ls(n,t,e,s){if(s)return;let i=t[n],o=e[n];return n==="angle"&&(i=bt(i),o=bt(o)),{property:n,start:i,end:o}}function Kh(n,t){const{x:e=null,y:s=null}=n||{},i=t.points,o=[];return t.segments.forEach(({start:a,end:l})=>{l=Rs(a,l,i);const c=i[a],d=i[l];s!==null?(o.push({x:c.x,y:s}),o.push({x:d.x,y:s})):e!==null&&(o.push({x:e,y:c.y}),o.push({x:e,y:d.y}))}),o}function Rs(n,t,e){for(;t>n;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function oa(n,t,e,s){return n&&t?s(n[e],t[e]):n?n[e]:t?t[e]:0}function aa(n,t){let e=[],s=!1;return X(n)?(s=!0,e=n):e=Kh(n,t),e.length?new Gt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function ra(n){return n&&n.fill!==!1}function Gh(n,t,e){let i=n[t].fill;const o=[t];let a;if(!e)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!J(i))return i;if(a=n[i],!a)return!1;if(a.visible)return i;o.push(i),i=a.fill}return!1}function Zh(n,t,e){const s=ef(n);if(z(s))return isNaN(s.value)?!1:s;let i=parseFloat(s);return J(i)&&Math.floor(i)===i?Jh(s[0],t,i,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Jh(n,t,e,s){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Qh(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:z(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function tf(n,t,e){let s;return n==="start"?s=e:n==="end"?s=t.options.reverse?t.min:t.max:z(n)?s=n.value:s=t.getBaseValue(),s}function ef(n){const t=n.options,e=t.fill;let s=L(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function nf(n){const{scale:t,index:e,line:s}=n,i=[],o=s.segments,a=s.points,l=sf(t,e);l.push(aa({x:null,y:t.bottom},s));for(let c=0;c<o.length;c++){const d=o[c];for(let h=d.start;h<=d.end;h++)of(i,a[h],l)}return new Gt({points:i,options:{}})}function sf(n,t){const e=[],s=n.getMatchingVisibleMetas("line");for(let i=0;i<s.length;i++){const o=s[i];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function of(n,t,e){const s=[];for(let i=0;i<e.length;i++){const o=e[i],{first:a,last:l,point:c}=af(o,t,"x");if(!(!c||a&&l)){if(a)s.unshift(c);else if(n.push(c),!l)break}}n.push(...s)}function af(n,t,e){const s=n.interpolate(t,e);if(!s)return{};const i=s[e],o=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<o.length;d++){const h=o[d],f=a[h.start][e],u=a[h.end][e];if(Ot(i,f,u)){l=i===f,c=i===u;break}}return{first:l,last:c,point:s}}class la{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:i,y:o,radius:a}=this;return e=e||{start:0,end:K},t.arc(i,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:i}=this,o=t.angle;return{x:e+Math.cos(o)*i,y:s+Math.sin(o)*i,angle:o}}}function rf(n){const{chart:t,fill:e,line:s}=n;if(J(e))return lf(t,e);if(e==="stack")return nf(n);if(e==="shape")return!0;const i=cf(n);return i instanceof la?i:aa(i,s)}function lf(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function cf(n){return(n.scale||{}).getPointPositionForValue?hf(n):df(n)}function df(n){const{scale:t={},fill:e}=n,s=Qh(e,t);if(J(s)){const i=t.isHorizontal();return{x:i?s:null,y:i?null:s}}return null}function hf(n){const{scale:t,fill:e}=n,s=t.options,i=t.getLabels().length,o=s.reverse?t.max:t.min,a=tf(e,t,o),l=[];if(s.grid.circular){const c=t.getPointPositionForValue(0,o);return new la({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<i;++c)l.push(t.getPointPositionForValue(c,a));return l}function zs(n,t,e){const s=rf(t),{line:i,scale:o,axis:a}=t,l=i.options,c=l.fill,d=l.backgroundColor,{above:h=d,below:f=d}=c||{};s&&i.points.length&&(_n(n,e),ff(n,{line:i,target:s,above:h,below:f,area:e,scale:o,axis:a}),xn(n))}function ff(n,t){const{line:e,target:s,above:i,below:o,area:a,scale:l}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&o!==i&&(ca(n,s,a.top),da(n,{line:e,target:s,color:i,scale:l,property:c}),n.restore(),n.save(),ca(n,s,a.bottom)),da(n,{line:e,target:s,color:o,scale:l,property:c}),n.restore()}function ca(n,t,e){const{segments:s,points:i}=t;let o=!0,a=!1;n.beginPath();for(const l of s){const{start:c,end:d}=l,h=i[c],f=i[Rs(c,d,i)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function da(n,t){const{line:e,target:s,property:i,color:o,scale:a}=t,l=qh(e,s,i);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:u=o}={}}=c,p=s!==!0;n.save(),n.fillStyle=u,uf(n,a,p&&Ls(i,h,f)),n.beginPath();const m=!!e.pathSegment(n,c);let g;if(p){m?n.closePath():ha(n,s,f,i);const b=!!s.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||ha(n,s,h,i)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function uf(n,t,e){const{top:s,bottom:i}=t.chart.chartArea,{property:o,start:a,end:l}=e||{};o==="x"&&(n.beginPath(),n.rect(a,s,l-a,i-s),n.clip())}function ha(n,t,e,s){const i=t.interpolate(e,s);i&&n.lineTo(i.x,i.y)}var pf={id:"filler",afterDatasetsUpdate(n,t,e){const s=(n.data.datasets||[]).length,i=[];let o,a,l,c;for(a=0;a<s;++a)o=n.getDatasetMeta(a),l=o.dataset,c=null,l&&l.options&&l instanceof Gt&&(c={visible:n.isDatasetVisible(a),index:a,fill:Zh(l,a,s),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=c,i.push(c);for(a=0;a<s;++a)c=i[a],!(!c||c.fill===!1)&&(c.fill=Gh(i,a,e.propagate))},beforeDraw(n,t,e){const s=e.drawTime==="beforeDraw",i=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=i.length-1;a>=0;--a){const l=i[a].$filler;l&&(l.line.updateControlPoints(o,l.axis),s&&l.fill&&zs(n.ctx,l,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=n.getSortedVisibleDatasetMetas();for(let i=s.length-1;i>=0;--i){const o=s[i].$filler;ra(o)&&zs(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const s=t.meta.$filler;!ra(s)||e.drawTime!=="beforeDatasetDraw"||zs(n.ctx,s,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fa=(n,t)=>{let{boxHeight:e=t,boxWidth:s=t}=n;return n.usePointStyle&&(e=Math.min(e,t),s=n.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},mf=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ua extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,i)=>t.sort(s,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,i=nt(s.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=fa(s,o);let d,h;e.font=i.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,o,l,c)+10):(h=this.maxHeight,d=this._fitCols(a,i,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,i){const{ctx:o,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=i+l;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=s+e/2+o.measureText(m.text).width;(g===0||d[d.length-1]+b+2*l>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),c[g]={left:0,top:p,row:u,width:b,height:i},d[d.length-1]+=b+l}),f}_fitCols(t,e,s,i){const{ctx:o,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=l,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:y,itemHeight:k}=gf(s,e,o,b,i);x>0&&p+k+2*l>h&&(f+=u+l,d.push({width:u,height:p}),m+=u+l,g++,u=p=0),c[x]={left:m,top:p,col:g,width:y,height:k},u=Math.max(u,y),p+=k+l}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:i},rtl:o}}=this,a=Me(o,this.left,this.width);if(this.isHorizontal()){let l=0,c=at(s,this.left+i,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,c=at(s,this.left+i,this.right-this.lineWidths[l])),d.top+=this.top+t+i,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+i}else{let l=0,c=at(s,this.top+t+i,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,c=at(s,this.top+t+i,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+i,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;_n(t,this),this._draw(),xn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:i}=this,{align:o,labels:a}=t,l=Q.color,c=Me(t.rtl,this.left,this.width),d=nt(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=fa(a,f),x=function(w,S,C){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const v=L(C.lineWidth,1);if(i.fillStyle=L(C.fillStyle,l),i.lineCap=L(C.lineCap,"butt"),i.lineDashOffset=L(C.lineDashOffset,0),i.lineJoin=L(C.lineJoin,"miter"),i.lineWidth=v,i.strokeStyle=L(C.strokeStyle,l),i.setLineDash(L(C.lineDash,[])),a.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:v},O=c.xPlus(w,m/2),N=S+u;Ii(i,E,O,N,a.pointStyleWidth&&m)}else{const E=S+Math.max((f-g)/2,0),O=c.leftForLtr(w,m),N=re(C.borderRadius);i.beginPath(),Object.values(N).some(U=>U!==0)?ze(i,{x:O,y:E,w:m,h:g,radius:N}):i.rect(O,E,m,g),i.fill(),v!==0&&i.stroke()}i.restore()},y=function(w,S,C){ae(i,C.text,w,S+b/2,d,{strikethrough:C.hidden,textAlign:c.textAlign(C.textAlign)})},k=this.isHorizontal(),M=this._computeTitleHeight();k?p={x:at(o,this.left+h,this.right-s[0]),y:this.top+h+M,line:0}:p={x:this.left+h,y:at(o,this.top+M+h,this.bottom-e[0].height),line:0},Qi(this.ctx,t.textDirection);const _=b+h;this.legendItems.forEach((w,S)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const C=i.measureText(w.text).width,v=c.textAlign(w.textAlign||(w.textAlign=a.textAlign)),E=m+u+C;let O=p.x,N=p.y;c.setWidth(this.width),k?S>0&&O+E+h>this.right&&(N=p.y+=_,p.line++,O=p.x=at(o,this.left+h,this.right-s[p.line])):S>0&&N+_>this.bottom&&(O=p.x=O+e[p.line].width+h,p.line++,N=p.y=at(o,this.top+M+h,this.bottom-e[p.line].height));const U=c.x(O);if(x(U,N,w),O=Nl(v,O+m+u,k?O+E:this.right,t.rtl),y(c.x(O),N,w),k)p.x+=E+h;else if(typeof w.text!="string"){const F=d.lineHeight;p.y+=pa(w,F)+h}else p.y+=_}),to(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=nt(e.font),i=rt(e.padding);if(!e.display)return;const o=Me(t.rtl,this.left,this.width),a=this.ctx,l=e.position,c=s.size/2,d=i.top+c;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+d,f=at(t.align,f,this.right-u);else{const m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=d+at(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=at(l,f,f+u);a.textAlign=o.textAlign(fs(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,ae(a,e.text,p,h,s)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,i,o;if(Ot(t,this.left,this.right)&&Ot(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(i=o[s],Ot(t,i.left,i.left+i.width)&&Ot(e,i.top,i.top+i.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!_f(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=mf(i,s);i&&!o&&H(e.onLeave,[t,i,this],this),this._hoveredItem=s,s&&!o&&H(e.onHover,[t,s,this],this)}else s&&H(e.onClick,[t,s,this],this)}}function gf(n,t,e,s,i){const o=bf(s,n,t,e),a=yf(i,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function bf(n,t,e,s){let i=n.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(i).width}function yf(n,t,e){let s=n;return typeof t.text!="string"&&(s=pa(t,e)),s}function pa(n,t){const e=n.text?n.text.length:0;return t*e}function _f(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var xf={id:"legend",_element:ua,start(n,t,e){const s=n.legend=new ua({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const s=n.legend;lt.configure(n,s,e),s.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const s=t.datasetIndex,i=e.chart;i.isDatasetVisible(s)?(i.hide(s),t.hidden=!0):(i.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:i,color:o,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:s||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Is extends $t{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const i=X(s.text)?s.text.length:1;this._padding=rt(s.padding);const o=i*nt(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:i,right:o,options:a}=this,l=a.align;let c=0,d,h,f;return this.isHorizontal()?(h=at(l,s,o),f=e+t,d=o-s):(a.position==="left"?(h=s+t,f=at(l,i,e),c=q*-.5):(h=o-t,f=at(l,e,i),c=q*.5),d=i-e),{titleX:h,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=nt(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(o);ae(t,e.text,0,0,s,{color:e.color,maxWidth:c,rotation:d,textAlign:fs(e.align),textBaseline:"middle",translation:[a,l]})}}function kf(n,t){const e=new Is({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var wf={id:"title",_element:Is,start(n,t,e){kf(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const s=n.titleBlock;lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const In=new WeakMap;var Cf={id:"subtitle",start(n,t,e){const s=new Is({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s),In.set(n,s)},stop(n){lt.removeBox(n,In.get(n)),In.delete(n)},beforeUpdate(n,t,e){const s=In.get(n);lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Je={average(n){if(!n.length)return!1;let t,e,s=0,i=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s+=l.x,i+=l.y,++o}}return{x:s/o,y:i/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,s=t.y,i=Number.POSITIVE_INFINITY,o,a,l;for(o=0,a=n.length;o<a;++o){const c=n[o].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),h=ds(t,d);h<i&&(i=h,l=c)}}if(l){const c=l.tooltipPosition();e=c.x,s=c.y}return{x:e,y:s}}};function vt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Rt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
24
- `)>-1?n.split(`
25
- `):n}function Mf(n,t){const{element:e,datasetIndex:s,index:i}=t,o=n.getDatasetMeta(s).controller,{label:a,value:l}=o.getLabelAndValue(i);return{chart:n,label:a,parsed:o.getParsed(i),raw:n.data.datasets[s].data[i],formattedValue:l,dataset:o.getDataset(),dataIndex:i,datasetIndex:s,element:e}}function ma(n,t){const e=n.chart.ctx,{body:s,footer:i,title:o}=n,{boxWidth:a,boxHeight:l}=t,c=nt(t.bodyFont),d=nt(t.titleFont),h=nt(t.footerFont),f=o.length,u=i.length,p=s.length,m=rt(t.padding);let g=m.height,b=0,x=s.reduce((M,_)=>M+_.before.length+_.lines.length+_.after.length,0);if(x+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const M=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=p*M+(x-p)*c.lineHeight+(x-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(M){b=Math.max(b,e.measureText(M).width+y)};return e.save(),e.font=d.string,Y(n.title,k),e.font=c.string,Y(n.beforeBody.concat(n.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,Y(s,M=>{Y(M.before,k),Y(M.lines,k),Y(M.after,k)}),y=0,e.font=h.string,Y(n.footer,k),e.restore(),b+=m.width,{width:b,height:g}}function Sf(n,t){const{y:e,height:s}=t;return e<s/2?"top":e>n.height-s/2?"bottom":"center"}function Df(n,t,e,s){const{x:i,width:o}=s,a=e.caretSize+e.caretPadding;if(n==="left"&&i+o+a>t.width||n==="right"&&i-o-a<0)return!0}function Bf(n,t,e,s){const{x:i,width:o}=e,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return s==="center"?d=i<=(l+c)/2?"left":"right":i<=o/2?d="left":i>=a-o/2&&(d="right"),Df(d,n,t,e)&&(d="center"),d}function ga(n,t,e){const s=e.yAlign||t.yAlign||Sf(n,e);return{xAlign:e.xAlign||t.xAlign||Bf(n,t,e,s),yAlign:s}}function vf(n,t){let{x:e,width:s}=n;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Ef(n,t,e){let{y:s,height:i}=n;return t==="top"?s+=e:t==="bottom"?s-=i+e:s-=i/2,s}function ba(n,t,e,s){const{caretSize:i,caretPadding:o,cornerRadius:a}=n,{xAlign:l,yAlign:c}=e,d=i+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=re(a);let m=vf(t,l);const g=Ef(t,c,d);return c==="center"?l==="left"?m+=d:l==="right"&&(m-=d):l==="left"?m-=Math.max(h,u)+i:l==="right"&&(m+=Math.max(f,p)+i),{x:it(m,0,s.width-t.width),y:it(g,0,s.height-t.height)}}function Wn(n,t,e){const s=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-s.right:n.x+s.left}function ya(n){return vt([],Rt(n))}function Vf(n,t,e){return Kt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function _a(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const xa={beforeTitle:At,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:At,beforeBody:At,beforeLabel:At,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return I(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:At,afterBody:At,beforeFooter:At,footer:At,afterFooter:At};function dt(n,t,e,s){const i=n[t].call(e,s);return typeof i>"u"?xa[t].call(e,s):i}class Ws extends $t{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&e.options.animation&&s.animations,o=new lo(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Vf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,i=dt(s,"beforeTitle",this,t),o=dt(s,"title",this,t),a=dt(s,"afterTitle",this,t);let l=[];return l=vt(l,Rt(i)),l=vt(l,Rt(o)),l=vt(l,Rt(a)),l}getBeforeBody(t,e){return ya(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,i=[];return Y(t,o=>{const a={before:[],lines:[],after:[]},l=_a(s,o);vt(a.before,Rt(dt(l,"beforeLabel",this,o))),vt(a.lines,dt(l,"label",this,o)),vt(a.after,Rt(dt(l,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,e){return ya(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,i=dt(s,"beforeFooter",this,t),o=dt(s,"footer",this,t),a=dt(s,"afterFooter",this,t);let l=[];return l=vt(l,Rt(i)),l=vt(l,Rt(o)),l=vt(l,Rt(a)),l}_createItems(t){const e=this._active,s=this.chart.data,i=[],o=[],a=[];let l=[],c,d;for(c=0,d=e.length;c<d;++c)l.push(Mf(this.chart,e[c]));return t.filter&&(l=l.filter((h,f,u)=>t.filter(h,f,u,s))),t.itemSort&&(l=l.sort((h,f)=>t.itemSort(h,f,s))),Y(l,h=>{const f=_a(t.callbacks,h);i.push(dt(f,"labelColor",this,h)),o.push(dt(f,"labelPointStyle",this,h)),a.push(dt(f,"labelTextColor",this,h))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const s=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const l=Je[s.position].call(this,i,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const c=this._size=ma(this,s),d=Object.assign({},l,c),h=ga(this.chart,s,d),f=ba(s,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,i){const o=this.getCaretPosition(t,s,i);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=re(l),{x:u,y:p}=t,{width:m,height:g}=e;let b,x,y,k,M,_;return o==="center"?(M=p+g/2,i==="left"?(b=u,x=b-a,k=M+a,_=M-a):(b=u+m,x=b+a,k=M-a,_=M+a),y=b):(i==="left"?x=u+Math.max(c,h)+a:i==="right"?x=u+m-Math.max(d,f)-a:x=this.caretX,o==="top"?(k=p,M=k-a,b=x-a,y=x+a):(k=p+g,M=k+a,b=x+a,y=x-a),_=k),{x1:b,x2:x,x3:y,y1:k,y2:M,y3:_}}drawTitle(t,e,s){const i=this.title,o=i.length;let a,l,c;if(o){const d=Me(s.rtl,this.x,this.width);for(t.x=Wn(this,s.titleAlign,s),e.textAlign=d.textAlign(s.titleAlign),e.textBaseline="middle",a=nt(s.titleFont),l=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,c=0;c<o;++c)e.fillText(i[c],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=s.titleMarginBottom-l)}}_drawColorBox(t,e,s,i,o){const a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:d}=o,h=nt(o.bodyFont),f=Wn(this,"left",o),u=i.x(f),p=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+p;if(o.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=i.leftForLtr(u,d)+d/2,x=m+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,bs(t,g,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,bs(t,g,b,x)}else{t.lineWidth=z(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const g=i.leftForLtr(u,d),b=i.leftForLtr(i.xPlus(u,1),d-2),x=re(a.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ze(t,{x:g,y:m,w:d,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ze(t,{x:b,y:m+1,w:d-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,d,c),t.strokeRect(g,m,d,c),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:h}=s,f=nt(s.bodyFont);let u=f.lineHeight,p=0;const m=Me(s.rtl,this.x,this.width),g=function(C){e.fillText(C,m.x(t.x+p),t.y+u/2),t.y+=u+o},b=m.textAlign(a);let x,y,k,M,_,w,S;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Wn(this,b,s),e.fillStyle=s.bodyColor,Y(this.beforeBody,g),p=l&&b!=="right"?a==="center"?d/2+h:d+2+h:0,M=0,w=i.length;M<w;++M){for(x=i[M],y=this.labelTextColors[M],e.fillStyle=y,Y(x.before,g),k=x.lines,l&&k.length&&(this._drawColorBox(e,t,M,m,s),u=Math.max(f.lineHeight,c)),_=0,S=k.length;_<S;++_)g(k[_]),u=f.lineHeight;Y(x.after,g)}p=0,u=f.lineHeight,Y(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const i=this.footer,o=i.length;let a,l;if(o){const c=Me(s.rtl,this.x,this.width);for(t.x=Wn(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=c.textAlign(s.footerAlign),e.textBaseline="middle",a=nt(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,l=0;l<o;++l)e.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,i){const{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:d,height:h}=s,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=re(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(l+f,c),a==="top"&&this.drawCaret(t,e,s,i),e.lineTo(l+d-u,c),e.quadraticCurveTo(l+d,c,l+d,c+u),a==="center"&&o==="right"&&this.drawCaret(t,e,s,i),e.lineTo(l+d,c+h-m),e.quadraticCurveTo(l+d,c+h,l+d-m,c+h),a==="bottom"&&this.drawCaret(t,e,s,i),e.lineTo(l+p,c+h),e.quadraticCurveTo(l,c+h,l,c+h-p),a==="center"&&o==="left"&&this.drawCaret(t,e,s,i),e.lineTo(l,c+f),e.quadraticCurveTo(l,c,l+f,c),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,i=s&&s.x,o=s&&s.y;if(i||o){const a=Je[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=ma(this,t),c=Object.assign({},a,this._size),d=ga(e,t,c),h=ba(t,c,d,e);(i._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=rt(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,i,e),Qi(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),to(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,i=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),o=!un(s,i),a=this._positionChanged(i,e);(o||a)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),l=this._positionChanged(a,t),c=e||!un(a,o)||l;return c&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,s,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:i,options:o}=this,a=Je[o.position].call(this,t,e);return a!==!1&&(s!==a.x||i!==a.y)}}P(Ws,"positioners",Je);var Pf={id:"tooltip",_element:Ws,positioners:Je,afterInit(n,t,e){e&&(n.tooltip=new Ws({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:xa},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Af=Object.freeze({__proto__:null,Colors:Yh,Decimation:Xh,Filler:pf,Legend:xf,SubTitle:Cf,Title:wf,Tooltip:Pf});const Of=(n,t,e,s)=>(typeof t=="string"?(e=n.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ff(n,t,e,s){const i=n.indexOf(t);if(i===-1)return Of(n,t,e,s);const o=n.lastIndexOf(t);return i!==o?e:i}const Tf=(n,t)=>n===null?null:it(Math.round(n),0,t);function ka(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ys extends ue{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:i,label:o}of e)s[i]===o&&s.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Ff(s,t,L(e,t),this._addedLabels),Tf(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(i=this.getLabels().length-1)),this.min=s,this.max=i}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,i=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)i.push({value:a});return i}getLabelForValue(t){return ka.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(Ys,"id","category"),P(Ys,"defaults",{ticks:{callback:ka}});function Nf(n,t){const e=[],{bounds:i,step:o,min:a,max:l,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=o||1,m=h-1,{min:g,max:b}=t,x=!I(a),y=!I(l),k=!I(d),M=(b-g)/(f+1);let _=Mi((b-g)/m/p)*p,w,S,C,v;if(_<1e-14&&!x&&!y)return[{value:g},{value:b}];v=Math.ceil(b/_)-Math.floor(g/_),v>m&&(_=Mi(v*_/m/p)*p),I(c)||(w=Math.pow(10,c),_=Math.ceil(_*w)/w),i==="ticks"?(S=Math.floor(g/_)*_,C=Math.ceil(b/_)*_):(S=g,C=b),x&&y&&o&&El((l-a)/o,_/1e3)?(v=Math.round(Math.min((l-a)/_,h)),_=(l-a)/v,S=a,C=l):k?(S=x?a:S,C=y?l:C,v=d-1,_=(C-S)/v):(v=(C-S)/_,Te(v,Math.round(v),_/1e3)?v=Math.round(v):v=Math.ceil(v));const E=Math.max(Di(_),Di(S));w=Math.pow(10,I(c)?E:c),S=Math.round(S*w)/w,C=Math.round(C*w)/w;let O=0;for(x&&(u&&S!==a?(e.push({value:a}),S<a&&O++,Te(Math.round((S+O*_)*w)/w,a,wa(a,M,n))&&O++):S<a&&O++);O<v;++O){const N=Math.round((S+O*_)*w)/w;if(y&&N>l)break;e.push({value:N})}return y&&u&&C!==l?e.length&&Te(e[e.length-1].value,l,wa(l,M,n))?e[e.length-1].value=l:e.push({value:l}):(!y||C===l)&&e.push({value:C}),e}function wa(n,t,{horizontal:e,minRotation:s}){const i=Mt(s),o=(e?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Yn extends ue{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:i,max:o}=this;const a=c=>i=e?i:c,l=c=>o=s?o:c;if(t){const c=Dt(i),d=Dt(o);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(i===o){let c=o===0?1:Math.abs(o*.05);l(o+c),t||a(i-c)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Nf(i,o);return t.bounds==="ticks"&&Si(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const i=(s-e)/Math.max(t.length-1,1)/2;e-=i,s+=i}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Le(t,this.chart.options.locale,this.options.ticks.format)}}class js extends Yn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Mt(this.options.ticks.minRotation),i=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(js,"id","linear"),P(js,"defaults",{ticks:{callback:bn.formatters.numeric}});const Qe=n=>Math.floor(qt(n)),pe=(n,t)=>Math.pow(10,Qe(n)+t);function Ca(n){return n/Math.pow(10,Qe(n))===1}function Ma(n,t,e){const s=Math.pow(10,e),i=Math.floor(n/s);return Math.ceil(t/s)-i}function $f(n,t){const e=t-n;let s=Qe(e);for(;Ma(n,t,s)>10;)s++;for(;Ma(n,t,s)<10;)s--;return Math.min(s,Qe(n))}function Lf(n,{min:t,max:e}){t=gt(n.min,t);const s=[],i=Qe(t);let o=$f(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),c=i>o?Math.pow(10,i):0,d=Math.round((t-c)*a)/a,h=Math.floor((t-c)/l/10)*l*10;let f=Math.floor((d-h)/Math.pow(10,o)),u=gt(n.min,Math.round((c+h+f*Math.pow(10,o))*a)/a);for(;u<e;)s.push({value:u,major:Ca(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((c+h+f*Math.pow(10,o))*a)/a;const p=gt(n.max,u);return s.push({value:p,major:Ca(p),significand:f}),s}class Hs extends ue{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Yn.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return J(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,i=this.max;const o=l=>s=t?s:l,a=l=>i=e?i:l;s===i&&(s<=0?(o(1),a(10)):(o(pe(s,-1)),a(pe(i,1)))),s<=0&&o(pe(i,-1)),i<=0&&a(pe(s,1)),this.min=s,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Lf(e,this);return t.bounds==="ticks"&&Si(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Le(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=qt(t),this._valueRange=qt(this.max)-qt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(qt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(Hs,"id","logarithmic"),P(Hs,"defaults",{ticks:{callback:bn.formatters.logarithmic,major:{enabled:!0}}});function Us(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return L(t.font&&t.font.size,Q.font.size)+e.height}return 0}function Rf(n,t,e){return e=X(e)?e:[e],{w:Ul(n,t.string,e),h:e.length*t.lineHeight}}function Sa(n,t,e,s,i){return n===s||n===i?{start:t-e/2,end:t+e/2}:n<s||n>i?{start:t-e,end:t}:{start:t,end:t+e}}function zf(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),s=[],i=[],o=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?q/o:0;for(let c=0;c<o;c++){const d=a.setContext(n.getPointLabelContext(c));i[c]=d.padding;const h=n.getPointPosition(c,n.drawingArea+i[c],l),f=nt(d.font),u=Rf(n.ctx,f,n._pointLabels[c]);s[c]=u;const p=bt(n.getIndexAngle(c)+l),m=Math.round(cs(p)),g=Sa(m,h.x,u.w,0,180),b=Sa(m,h.y,u.h,90,270);If(e,t,p,g,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=jf(n,s,i)}function If(n,t,e,s,i){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,c=0;s.start<t.l?(l=(t.l-s.start)/o,n.l=Math.min(n.l,t.l-l)):s.end>t.r&&(l=(s.end-t.r)/o,n.r=Math.max(n.r,t.r+l)),i.start<t.t?(c=(t.t-i.start)/a,n.t=Math.min(n.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/a,n.b=Math.max(n.b,t.b+c))}function Wf(n,t,e){const s=n.drawingArea,{extra:i,additionalAngle:o,padding:a,size:l}=e,c=n.getPointPosition(t,s+i+a,o),d=Math.round(cs(bt(c.angle+tt))),h=Xf(c.y,l.h,d),f=Hf(d),u=Uf(c.x,l.w,f);return{visible:!0,x:c.x,y:h,textAlign:f,left:u,top:h,right:u+l.w,bottom:h+l.h}}function Yf(n,t){if(!t)return!0;const{left:e,top:s,right:i,bottom:o}=n;return!(Tt({x:e,y:s},t)||Tt({x:e,y:o},t)||Tt({x:i,y:s},t)||Tt({x:i,y:o},t))}function jf(n,t,e){const s=[],i=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:l}=o.pointLabels,c={extra:Us(o)/2,additionalAngle:a?q/i:0};let d;for(let h=0;h<i;h++){c.padding=e[h],c.size=t[h];const f=Wf(n,h,c);s.push(f),l==="auto"&&(f.visible=Yf(f,d),f.visible&&(d=f))}return s}function Hf(n){return n===0||n===180?"center":n<180?"left":"right"}function Uf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Xf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function qf(n,t,e){const{left:s,top:i,right:o,bottom:a}=e,{backdropColor:l}=t;if(!I(l)){const c=re(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=l;const h=s-d.left,f=i-d.top,u=o-s+d.width,p=a-i+d.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),ze(n,{x:h,y:f,w:u,h:p,radius:c}),n.fill()):n.fillRect(h,f,u,p)}}function Kf(n,t){const{ctx:e,options:{pointLabels:s}}=n;for(let i=t-1;i>=0;i--){const o=n._pointLabelItems[i];if(!o.visible)continue;const a=s.setContext(n.getPointLabelContext(i));qf(e,a,o);const l=nt(a.font),{x:c,y:d,textAlign:h}=o;ae(e,n._pointLabels[i],c,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Da(n,t,e,s){const{ctx:i}=n;if(e)i.arc(n.xCenter,n.yCenter,t,0,K);else{let o=n.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=n.getPointPosition(a,t),i.lineTo(o.x,o.y)}}function Gf(n,t,e,s,i){const o=n.ctx,a=t.circular,{color:l,lineWidth:c}=t;!a&&!s||!l||!c||e<0||(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),Da(n,e,a,s),o.closePath(),o.stroke(),o.restore())}function Zf(n,t,e){return Kt(n,{label:e,index:t,type:"pointLabel"})}class tn extends Yn{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=rt(Us(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Us(this.options))}generateTickLabels(t){Yn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const i=H(this.options.pointLabels.callback,[e,s],this);return i||i===0?i:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?zf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,i))}getIndexAngle(t){const e=K/(this._pointLabels.length||1),s=this.options.startAngle||0;return bt(t*e+Mt(s))}getDistanceFromCenterForValue(t){if(I(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return Zf(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const i=this.getIndexAngle(t)-tt+s;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:i,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),Da(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:i,border:o}=e,a=this._pointLabels.length;let l,c,d;if(e.pointLabels.display&&Kf(this,a),i.display&&this.ticks.forEach((h,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=i.setContext(u),m=o.setContext(u);Gf(this,p,c,a,m)}}),s.display){for(t.save(),l=a-1;l>=0;l--){const h=s.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const i=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&!e.reverse)return;const d=s.setContext(this.getContext(c)),h=nt(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-o-h.size/2-f.top,a+f.width,h.size+f.height)}ae(t,l.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}P(tn,"id","radialLinear"),P(tn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(tn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(tn,"descriptors",{angleLines:{_fallback:"grid"}});const jn={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}},ht=Object.keys(jn);function Ba(n,t){return n-t}function va(n,t){if(I(t))return null;const e=n._adapter,{parser:s,round:i,isoWeekday:o}=n._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),J(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(i&&(a=i==="week"&&(ke(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,i)),+a)}function Ea(n,t,e,s){const i=ht.length;for(let o=ht.indexOf(n);o<i-1;++o){const a=jn[ht[o]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=s)return ht[o]}return ht[i-1]}function Jf(n,t,e,s,i){for(let o=ht.length-1;o>=ht.indexOf(e);o--){const a=ht[o];if(jn[a].common&&n._adapter.diff(i,s,a)>=t-1)return a}return ht[e?ht.indexOf(e):0]}function Qf(n){for(let t=ht.indexOf(n)+1,e=ht.length;t<e;++t)if(jn[ht[t]].common)return ht[t]}function Va(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:s,hi:i}=hs(e,t),o=e[s]>=t?e[s]:e[i];n[o]=!0}}function tu(n,t,e,s){const i=n._adapter,o=+i.startOf(t[0].value,s),a=t[t.length-1].value;let l,c;for(l=o;l<=a;l=+i.add(l,1,s))c=e[l],c>=0&&(t[c].major=!0);return t}function Pa(n,t,e){const s=[],i={},o=t.length;let a,l;for(a=0;a<o;++a)l=t[a],i[l]=a,s.push({value:l,major:!1});return o===0||!e?s:tu(n,s,i,e)}class en extends ue{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),i=this._adapter=new ld._date(t.adapters.date);i.init(e),Oe(s.displayFormats,i.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:va(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(i=Math.min(i,d.min)),!l&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=J(i)&&!isNaN(i)?i:+e.startOf(Date.now(),s),o=J(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,i=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,l=Ol(i,o,a);return this._unit=e.unit||(s.autoSkip?Ea(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Jf(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Qf(this._unit),this.initOffsets(i),t.reverse&&l.reverse(),Pa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=it(e,0,a),s=it(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,i=this.options,o=i.time,a=o.unit||Ea(o.minUnit,e,s,this._getLabelCapacity(e)),l=L(i.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,d=ke(c)||c===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":a),t.diff(s,e,a)>1e5*l)throw new Error(e+" and "+s+" are too far apart with stepSize of "+l+" "+a);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<s;u=+t.add(u,l,a),p++)Va(h,u,m);return(u===s||i.bounds==="ticks"||p===1)&&Va(h,u,m),Object.keys(h).sort(Ba).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,o=this._unit,a=e||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,i){const o=this.options,a=o.ticks.callback;if(a)return H(a,[t,e,s],this);const l=o.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&l[c],f=d&&l[d],u=s[e],p=d&&f&&u&&u.major;return this._adapter.format(t,i||(p?f:h))}generateTickLabels(t){let e,s,i;for(e=0,s=t.length;e<s;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,i=Mt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(i),a=Math.sin(i),l=this._resolveTickFontOptions(0).size;return{w:s*o+l*a,h:s*a+l*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,i=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Pa(this,[t],this._majorUnit),i),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,s=i.length;e<s;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const i=this.getLabels();for(e=0,s=i.length;e<s;++e)t.push(va(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vi(t.sort(Ba))}}P(en,"id","time"),P(en,"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 Hn(n,t,e){let s=0,i=n.length-1,o,a,l,c;e?(t>=n[s].pos&&t<=n[i].pos&&({lo:s,hi:i}=Ft(n,"pos",t)),{pos:o,time:l}=n[s],{pos:a,time:c}=n[i]):(t>=n[s].time&&t<=n[i].time&&({lo:s,hi:i}=Ft(n,"time",t)),{time:o,pos:l}=n[s],{time:a,pos:c}=n[i]);const d=a-o;return d?l+(c-l)*(t-o)/d:l}class Xs extends en{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Hn(e,this.min),this._tableRange=Hn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,i=[],o=[];let a,l,c,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=s&&i.push(d);if(i.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,l=i.length;a<l;++a)h=i[a+1],c=i[a-1],d=i[a],Math.round((h+c)/2)!==d&&o.push({time:d,pos:a/(l-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Hn(this._table,s*this._tableRange+this._minPos,!0)}}P(Xs,"id","timeseries"),P(Xs,"defaults",en.defaults);var eu=Object.freeze({__proto__:null,CategoryScale:Ys,LinearScale:js,LogarithmicScale:Hs,RadialLinearScale:tn,TimeScale:en,TimeSeriesScale:Xs});const nu=[rd,$h,Af,eu];Lt.register(...nu);const su={class:"px-24 py-16"},iu={class:"flex flex-col gap-8"},ou={class:"fm-color-typo-primary fm-typo-body-lg-400"},au={class:"fm-color-typo-secondary fm-typo-body-md-400"},ru=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=r.ref(null);let s=null;r.watch([()=>t.xAxis,()=>t.datasets],()=>{s&&(s.data.datasets=t.datasets,s.data.labels=t.xAxis.categories,s.update())});function i(d,h){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${h})`;if(d.startsWith("rgb")){const u=d.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${h})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${h})`].join(",")}return""}function o(d){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:d,color:h}){const{ctx:f,chartArea:u}=d.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,i(h,.5)),p.addColorStop(1,i(h,0)),p}const l=r.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=o(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){e.value&&(s=new Lt(e.value,{type:"line",data:l.value,options:{plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},beginAtZero:!0},y:{grid:{display:!0},beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return r.onMounted(()=>{c()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",su,[r.createElementVNode("div",iu,[r.createElementVNode("div",ou,r.toDisplayString(d.name),1),r.createElementVNode("div",au,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});function lu(){var n;return(n=r.getCurrentInstance())==null?void 0:n.emit}function yt(n,t){const e=lu(),s=r.ref(n[t]);return r.watch(()=>n[t],()=>{s.value=n[t]}),r.computed({get(){return s.value},set(o){s.value=o,e==null||e(`update:${t}`,o)}})}function ft(n,t){return typeof n!="object"&&typeof t!="object"?n===t:Object.keys(n).length!==Object.keys(t).length?!1:Object.keys(n).every(e=>ft(n[e],t[e]))}const cu={class:"fm-checkbox"},du={class:"fm-checkbox--wrapper"},hu={class:"fm-checkbox__input--container"},fu=["checked","disabled","indeterminate"],uu={key:0,class:"fm-checkbox__label-container"},pu={class:"fm-typo-body-lg-400"},mu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Aa=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(n){const t=n,e=yt(t,"modelValue"),s=yt(t,"indeterminate"),i=Array.isArray(e.value),o=r.ref(i?e.value.some(c=>ft(c,t.value)):e.value),a=r.computed(()=>{const c=i?e.value.some(d=>ft(d,t.value)):e.value;return s.value&&!c?"remove":e.value?"check_small":""});function l(){if(t.disabled)return;s.value=!1,o.value=!o.value;let c=e.value;i?c=o.value?c.concat(t.value):c.filter(d=>!ft(d,t.value)):c=o.value,e.value=c}return r.watch(()=>e.value,()=>{o.value=i?e.value.some(c=>ft(c,t.value)):e.value}),(c,d)=>(r.openBlock(),r.createElementBlock("div",cu,[r.createElementVNode("label",du,[r.createElementVNode("div",hu,[r.createElementVNode("input",{class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.value}),type:"checkbox",checked:o.value,disabled:t.disabled,indeterminate:r.unref(s),onClick:l},null,10,fu),r.unref(s)||o.value?(r.openBlock(),r.createBlock(R,{key:0,class:"fm-checkbox__input--checkmark",name:a.value,size:"md",color:"#FFFFFF"},null,8,["name"])):r.createCommentVNode("",!0)]),t.label?(r.openBlock(),r.createElementBlock("div",uu,[r.renderSlot(c.$slots,"label"),r.createElementVNode("div",pu,r.toDisplayString(t.label),1),t.sublabel?(r.openBlock(),r.createElementBlock("div",mu,r.toDisplayString(t.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),Fg="";var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oa={exports:{}};(function(n,t){(function(e,s){n.exports=s()})(gu,function(){var e=1e3,s=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",d="day",h="week",f="month",u="quarter",p="year",m="date",g="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var B=["th","st","nd","rd"],D=F%100;return"["+F+(B[(D-20)%10]||B[D]||B[0])+"]"}},k=function(F,B,D){var V=String(F);return!V||V.length>=B?F:""+Array(B+1-V.length).join(D)+F},M={s:k,z:function(F){var B=-F.utcOffset(),D=Math.abs(B),V=Math.floor(D/60),A=D%60;return(B<=0?"+":"-")+k(V,2,"0")+":"+k(A,2,"0")},m:function F(B,D){if(B.date()<D.date())return-F(D,B);var V=12*(D.year()-B.year())+(D.month()-B.month()),A=B.clone().add(V,f),T=D-A<0,$=B.clone().add(V+(T?-1:1),f);return+(-(V+(D-A)/(T?A-$:$-A))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:h,d,D:m,h:c,m:l,s:a,ms:o,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},_="en",w={};w[_]=y;var S="$isDayjsObject",C=function(F){return F instanceof N||!(!F||!F[S])},v=function F(B,D,V){var A;if(!B)return _;if(typeof B=="string"){var T=B.toLowerCase();w[T]&&(A=T),D&&(w[T]=D,A=T);var $=B.split("-");if(!A&&$.length>1)return F($[0])}else{var W=B.name;w[W]=B,A=W}return!V&&A&&(_=A),A||!V&&_},E=function(F,B){if(C(F))return F.clone();var D=typeof B=="object"?B:{};return D.date=F,D.args=arguments,new N(D)},O=M;O.l=v,O.i=C,O.w=function(F,B){return E(F,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var N=function(){function F(D){this.$L=v(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[S]=!0}var B=F.prototype;return B.parse=function(D){this.$d=function(V){var A=V.date,T=V.utc;if(A===null)return new Date(NaN);if(O.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var $=A.match(b);if($){var W=$[2]-1||0,j=($[7]||"0").substring(0,3);return T?new Date(Date.UTC($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)):new Date($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)}}return new Date(A)}(D),this.init()},B.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},B.$utils=function(){return O},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(D,V){var A=E(D);return this.startOf(V)<=A&&A<=this.endOf(V)},B.isAfter=function(D,V){return E(D)<this.startOf(V)},B.isBefore=function(D,V){return this.endOf(V)<E(D)},B.$g=function(D,V,A){return O.u(D)?this[V]:this.set(A,D)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(D,V){var A=this,T=!!O.u(V)||V,$=O.p(D),W=function(_e,pt){var ne=O.w(A.$u?Date.UTC(A.$y,pt,_e):new Date(A.$y,pt,_e),A);return T?ne:ne.endOf(d)},j=function(_e,pt){return O.w(A.toDate()[_e].apply(A.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(pt)),A)},G=this.$W,Z=this.$M,ot=this.$D,ut="set"+(this.$u?"UTC":"");switch($){case p:return T?W(1,0):W(31,11);case f:return T?W(1,Z):W(0,Z+1);case h:var ye=this.$locale().weekStart||0,rn=(G<ye?G+7:G)-ye;return W(T?ot-rn:ot+(6-rn),Z);case d:case m:return j(ut+"Hours",0);case c:return j(ut+"Minutes",1);case l:return j(ut+"Seconds",2);case a:return j(ut+"Milliseconds",3);default:return this.clone()}},B.endOf=function(D){return this.startOf(D,!1)},B.$set=function(D,V){var A,T=O.p(D),$="set"+(this.$u?"UTC":""),W=(A={},A[d]=$+"Date",A[m]=$+"Date",A[f]=$+"Month",A[p]=$+"FullYear",A[c]=$+"Hours",A[l]=$+"Minutes",A[a]=$+"Seconds",A[o]=$+"Milliseconds",A)[T],j=T===d?this.$D+(V-this.$W):V;if(T===f||T===p){var G=this.clone().set(m,1);G.$d[W](j),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](j);return this.init(),this},B.set=function(D,V){return this.clone().$set(D,V)},B.get=function(D){return this[O.p(D)]()},B.add=function(D,V){var A,T=this;D=Number(D);var $=O.p(V),W=function(Z){var ot=E(T);return O.w(ot.date(ot.date()+Math.round(Z*D)),T)};if($===f)return this.set(f,this.$M+D);if($===p)return this.set(p,this.$y+D);if($===d)return W(1);if($===h)return W(7);var j=(A={},A[l]=s,A[c]=i,A[a]=e,A)[$]||1,G=this.$d.getTime()+D*j;return O.w(G,this)},B.subtract=function(D,V){return this.add(-1*D,V)},B.format=function(D){var V=this,A=this.$locale();if(!this.isValid())return A.invalidDate||g;var T=D||"YYYY-MM-DDTHH:mm:ssZ",$=O.z(this),W=this.$H,j=this.$m,G=this.$M,Z=A.weekdays,ot=A.months,ut=A.meridiem,ye=function(pt,ne,ln,es){return pt&&(pt[ne]||pt(V,T))||ln[ne].slice(0,es)},rn=function(pt){return O.s(W%12||12,pt,"0")},_e=ut||function(pt,ne,ln){var es=pt<12?"AM":"PM";return ln?es.toLowerCase():es};return T.replace(x,function(pt,ne){return ne||function(ln){switch(ln){case"YY":return String(V.$y).slice(-2);case"YYYY":return O.s(V.$y,4,"0");case"M":return G+1;case"MM":return O.s(G+1,2,"0");case"MMM":return ye(A.monthsShort,G,ot,3);case"MMMM":return ye(ot,G);case"D":return V.$D;case"DD":return O.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ye(A.weekdaysMin,V.$W,Z,2);case"ddd":return ye(A.weekdaysShort,V.$W,Z,3);case"dddd":return Z[V.$W];case"H":return String(W);case"HH":return O.s(W,2,"0");case"h":return rn(1);case"hh":return rn(2);case"a":return _e(W,j,!0);case"A":return _e(W,j,!1);case"m":return String(j);case"mm":return O.s(j,2,"0");case"s":return String(V.$s);case"ss":return O.s(V.$s,2,"0");case"SSS":return O.s(V.$ms,3,"0");case"Z":return $}return null}(pt)||$.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(D,V,A){var T,$=this,W=O.p(V),j=E(D),G=(j.utcOffset()-this.utcOffset())*s,Z=this-j,ot=function(){return O.m($,j)};switch(W){case p:T=ot()/12;break;case f:T=ot();break;case u:T=ot()/3;break;case h:T=(Z-G)/6048e5;break;case d:T=(Z-G)/864e5;break;case c:T=Z/i;break;case l:T=Z/s;break;case a:T=Z/e;break;default:T=Z}return A?T:O.a(T)},B.daysInMonth=function(){return this.endOf(f).$D},B.$locale=function(){return w[this.$L]},B.locale=function(D,V){if(!D)return this.$L;var A=this.clone(),T=v(D,V,!0);return T&&(A.$L=T),A},B.clone=function(){return O.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},F}(),U=N.prototype;return E.prototype=U,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){U[F[1]]=function(B){return this.$g(B,F[0],F[1])}}),E.extend=function(F,B){return F.$i||(F(B,N,E),F.$i=!0),E},E.locale=v,E.isDayjs=C,E.unix=function(F){return E(1e3*F)},E.en=w[_],E.Ls=w,E.p={},E})})(Oa);var yu=Oa.exports;const ct=bu(yu),De=Math.min,me=Math.max,Un=Math.round,Xn=Math.floor,Jt=n=>({x:n,y:n}),_u={left:"right",right:"left",bottom:"top",top:"bottom"},xu={start:"end",end:"start"};function qs(n,t,e){return me(n,De(t,e))}function nn(n,t){return typeof n=="function"?n(t):n}function ge(n){return n.split("-")[0]}function sn(n){return n.split("-")[1]}function Fa(n){return n==="x"?"y":"x"}function Ks(n){return n==="y"?"height":"width"}function qn(n){return["top","bottom"].includes(ge(n))?"y":"x"}function Gs(n){return Fa(qn(n))}function ku(n,t,e){e===void 0&&(e=!1);const s=sn(n),i=Gs(n),o=Ks(i);let a=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Kn(a)),[a,Kn(a)]}function wu(n){const t=Kn(n);return[Zs(n),t,Zs(t)]}function Zs(n){return n.replace(/start|end/g,t=>xu[t])}function Cu(n,t,e){const s=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?o:a;default:return[]}}function Mu(n,t,e,s){const i=sn(n);let o=Cu(ge(n),e==="start",s);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Zs)))),o}function Kn(n){return n.replace(/left|right|bottom|top/g,t=>_u[t])}function Su(n){return{top:0,right:0,bottom:0,left:0,...n}}function Ta(n){return typeof n!="number"?Su(n):{top:n,right:n,bottom:n,left:n}}function Gn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Na(n,t,e){let{reference:s,floating:i}=n;const o=qn(t),a=Gs(t),l=Ks(a),c=ge(t),d=o==="y",h=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,u=s[l]/2-i[l]/2;let p;switch(c){case"top":p={x:h,y:s.y-i.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-i.width,y:f};break;default:p={x:s.x,y:s.y}}switch(sn(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Du=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:a}=e,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:i}),{x:h,y:f}=Na(d,s,c),u=s,p={},m=0;for(let g=0;g<l.length;g++){const{name:b,fn:x}=l[g],{x:y,y:k,data:M,reset:_}=await x({x:h,y:f,initialPlacement:s,placement:u,strategy:i,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=y??h,f=k??f,p={...p,[b]:{...p[b],...M}},_&&m<=50){m++,typeof _=="object"&&(_.placement&&(u=_.placement),_.rects&&(d=_.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:i}):_.rects),{x:h,y:f}=Na(d,u,c)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:i,middlewareData:p}};async function $a(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:a,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=nn(t,n),m=Ta(p),b=l[u?f==="floating"?"reference":"floating":f],x=Gn(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(b)))==null||e?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),y=f==="floating"?{...a.floating,x:s,y:i}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),M=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},_=Gn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:k,strategy:c}):y);return{top:(x.top-_.top+m.top)/M.y,bottom:(_.bottom-x.bottom+m.bottom)/M.y,left:(x.left-_.left+m.left)/M.x,right:(_.right-x.right+m.right)/M.x}}const Bu=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=nn(n,t)||{};if(d==null)return{};const f=Ta(h),u={x:e,y:s},p=Gs(i),m=Ks(p),g=await a.getDimensions(d),b=p==="y",x=b?"top":"left",y=b?"bottom":"right",k=b?"clientHeight":"clientWidth",M=o.reference[m]+o.reference[p]-u[p]-o.floating[m],_=u[p]-o.reference[p],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let S=w?w[k]:0;(!S||!await(a.isElement==null?void 0:a.isElement(w)))&&(S=l.floating[k]||o.floating[m]);const C=M/2-_/2,v=S/2-g[m]/2-1,E=De(f[x],v),O=De(f[y],v),N=E,U=S-g[m]-O,F=S/2-g[m]/2+C,B=qs(N,F,U),D=!c.arrow&&sn(i)!=null&&F!=B&&o.reference[m]/2-(F<N?E:O)-g[m]/2<0,V=D?F<N?F-N:F-U:0;return{[p]:u[p]+V,data:{[p]:B,centerOffset:F-B-V,...D&&{alignmentOffset:V}},reset:D}}}),La=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=nn(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const x=ge(i),y=ge(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),M=u||(y||!g?[Kn(l)]:wu(l));!u&&m!=="none"&&M.push(...Mu(l,g,m,k));const _=[l,...M],w=await $a(t,b),S=[];let C=((s=o.flip)==null?void 0:s.overflows)||[];if(h&&S.push(w[x]),f){const N=ku(i,a,k);S.push(w[N[0]],w[N[1]])}if(C=[...C,{placement:i,overflows:S}],!S.every(N=>N<=0)){var v,E;const N=(((v=o.flip)==null?void 0:v.index)||0)+1,U=_[N];if(U)return{data:{index:N,overflows:C},reset:{placement:U}};let F=(E=C.filter(B=>B.overflows[0]<=0).sort((B,D)=>B.overflows[1]-D.overflows[1])[0])==null?void 0:E.placement;if(!F)switch(p){case"bestFit":{var O;const B=(O=C.map(D=>[D.placement,D.overflows.filter(V=>V>0).reduce((V,A)=>V+A,0)]).sort((D,V)=>D[1]-V[1])[0])==null?void 0:O[0];B&&(F=B);break}case"initialPlacement":F=l;break}if(i!==F)return{reset:{placement:F}}}return{}}}};async function vu(n,t){const{placement:e,platform:s,elements:i}=n,o=await(s.isRTL==null?void 0:s.isRTL(i.floating)),a=ge(e),l=sn(e),c=qn(e)==="y",d=["left","top"].includes(a)?-1:1,h=o&&c?-1:1,f=nn(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Ra=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,s;const{x:i,y:o,placement:a,middlewareData:l}=t,c=await vu(t,n);return a===((e=l.offset)==null?void 0:e.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:a}}}}},Eu=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x,y}=b;return{x,y}}},...c}=nn(n,t),d={x:e,y:s},h=await $a(t,c),f=qn(ge(i)),u=Fa(f);let p=d[u],m=d[f];if(o){const b=u==="y"?"top":"left",x=u==="y"?"bottom":"right",y=p+h[b],k=p-h[x];p=qs(y,p,k)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=m+h[b],k=m-h[x];m=qs(y,m,k)}const g=l.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-s}}}}};function Qt(n){return za(n)?(n.nodeName||"").toLowerCase():"#document"}function _t(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function zt(n){var t;return(t=(za(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function za(n){return n instanceof Node||n instanceof _t(n).Node}function It(n){return n instanceof Element||n instanceof _t(n).Element}function Et(n){return n instanceof HTMLElement||n instanceof _t(n).HTMLElement}function Ia(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof _t(n).ShadowRoot}function on(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=Ct(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function Vu(n){return["table","td","th"].includes(Qt(n))}function Js(n){const t=Qs(),e=Ct(n);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Pu(n){let t=Be(n);for(;Et(t)&&!Zn(t);){if(Js(t))return t;t=Be(t)}return null}function Qs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(n){return["html","body","#document"].includes(Qt(n))}function Ct(n){return _t(n).getComputedStyle(n)}function Jn(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Be(n){if(Qt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ia(n)&&n.host||zt(n);return Ia(t)?t.host:t}function Wa(n){const t=Be(n);return Zn(t)?n.ownerDocument?n.ownerDocument.body:n.body:Et(t)&&on(t)?t:Wa(t)}function an(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=Wa(n),o=i===((s=n.ownerDocument)==null?void 0:s.body),a=_t(i);return o?t.concat(a,a.visualViewport||[],on(i)?i:[],a.frameElement&&e?an(a.frameElement):[]):t.concat(i,an(i,[],e))}function Ya(n){const t=Ct(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Et(n),o=i?n.offsetWidth:e,a=i?n.offsetHeight:s,l=Un(e)!==o||Un(s)!==a;return l&&(e=o,s=a),{width:e,height:s,$:l}}function ti(n){return It(n)?n:n.contextElement}function ve(n){const t=ti(n);if(!Et(t))return Jt(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:o}=Ya(t);let a=(o?Un(e.width):e.width)/s,l=(o?Un(e.height):e.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Au=Jt(0);function ja(n){const t=_t(n);return!Qs()||!t.visualViewport?Au:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==_t(n)?!1:t}function be(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),o=ti(n);let a=Jt(1);t&&(s?It(s)&&(a=ve(s)):a=ve(n));const l=Ou(o,e,s)?ja(o):Jt(0);let c=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,h=i.width/a.x,f=i.height/a.y;if(o){const u=_t(o),p=s&&It(s)?_t(s):s;let m=u.frameElement;for(;m&&s&&p!==u;){const g=ve(m),b=m.getBoundingClientRect(),x=Ct(m),y=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,k=b.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,d*=g.y,h*=g.x,f*=g.y,c+=y,d+=k,m=_t(m).frameElement}}return Gn({width:h,height:f,x:c,y:d})}function Fu(n){let{rect:t,offsetParent:e,strategy:s}=n;const i=Et(e),o=zt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},l=Jt(1);const c=Jt(0);if((i||!i&&s!=="fixed")&&((Qt(e)!=="body"||on(o))&&(a=Jn(e)),Et(e))){const d=be(e);l=ve(e),c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function Tu(n){return Array.from(n.getClientRects())}function Ha(n){return be(zt(n)).left+Jn(n).scrollLeft}function Nu(n){const t=zt(n),e=Jn(n),s=n.ownerDocument.body,i=me(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=me(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-e.scrollLeft+Ha(n);const l=-e.scrollTop;return Ct(s).direction==="rtl"&&(a+=me(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:a,y:l}}function $u(n,t){const e=_t(n),s=zt(n),i=e.visualViewport;let o=s.clientWidth,a=s.clientHeight,l=0,c=0;if(i){o=i.width,a=i.height;const d=Qs();(!d||d&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:l,y:c}}function Lu(n,t){const e=be(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,o=Et(n)?ve(n):Jt(1),a=n.clientWidth*o.x,l=n.clientHeight*o.y,c=i*o.x,d=s*o.y;return{width:a,height:l,x:c,y:d}}function Ua(n,t,e){let s;if(t==="viewport")s=$u(n,e);else if(t==="document")s=Nu(zt(n));else if(It(t))s=Lu(t,e);else{const i=ja(n);s={...t,x:t.x-i.x,y:t.y-i.y}}return Gn(s)}function Xa(n,t){const e=Be(n);return e===t||!It(e)||Zn(e)?!1:Ct(e).position==="fixed"||Xa(e,t)}function Ru(n,t){const e=t.get(n);if(e)return e;let s=an(n,[],!1).filter(l=>It(l)&&Qt(l)!=="body"),i=null;const o=Ct(n).position==="fixed";let a=o?Be(n):n;for(;It(a)&&!Zn(a);){const l=Ct(a),c=Js(a);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||on(a)&&!c&&Xa(n,a))?s=s.filter(h=>h!==a):i=l,a=Be(a)}return t.set(n,s),s}function zu(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const a=[...e==="clippingAncestors"?Ru(t,this._c):[].concat(e),s],l=a[0],c=a.reduce((d,h)=>{const f=Ua(t,h,i);return d.top=me(f.top,d.top),d.right=De(f.right,d.right),d.bottom=De(f.bottom,d.bottom),d.left=me(f.left,d.left),d},Ua(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Iu(n){return Ya(n)}function Wu(n,t,e){const s=Et(t),i=zt(t),o=e==="fixed",a=be(n,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Jt(0);if(s||!s&&!o)if((Qt(t)!=="body"||on(i))&&(l=Jn(t)),s){const d=be(t,!0,o,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else i&&(c.x=Ha(i));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function qa(n,t){return!Et(n)||Ct(n).position==="fixed"?null:t?t(n):n.offsetParent}function Ka(n,t){const e=_t(n);if(!Et(n))return e;let s=qa(n,t);for(;s&&Vu(s)&&Ct(s).position==="static";)s=qa(s,t);return s&&(Qt(s)==="html"||Qt(s)==="body"&&Ct(s).position==="static"&&!Js(s))?e:s||Pu(n)||e}const Yu=async function(n){let{reference:t,floating:e,strategy:s}=n;const i=this.getOffsetParent||Ka,o=this.getDimensions;return{reference:Wu(t,await i(e),s),floating:{x:0,y:0,...await o(e)}}};function ju(n){return Ct(n).direction==="rtl"}const Hu={convertOffsetParentRelativeRectToViewportRelativeRect:Fu,getDocumentElement:zt,getClippingRect:zu,getOffsetParent:Ka,getElementRects:Yu,getClientRects:Tu,getDimensions:Iu,getScale:ve,isElement:It,isRTL:ju};function Uu(n,t){let e=null,s;const i=zt(n);function o(){clearTimeout(s),e&&e.disconnect(),e=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(l||t(),!f||!u)return;const p=Xn(h),m=Xn(i.clientWidth-(d+f)),g=Xn(i.clientHeight-(h+u)),b=Xn(d),y={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:me(0,De(1,c))||1};let k=!0;function M(_){const w=_[0].intersectionRatio;if(w!==c){if(!k)return a();w?a(!1,w):s=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{e=new IntersectionObserver(M,{...y,root:i.ownerDocument})}catch{e=new IntersectionObserver(M,y)}e.observe(n)}return a(!0),o}function Xu(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=ti(n),h=i||o?[...d?an(d):[],...an(t)]:[];h.forEach(x=>{i&&x.addEventListener("scroll",e,{passive:!0}),o&&x.addEventListener("resize",e)});const f=d&&l?Uu(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!c&&p.observe(d),p.observe(t));let m,g=c?be(n):null;c&&b();function b(){const x=be(n);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&e(),g=x,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(x=>{i&&x.removeEventListener("scroll",e),o&&x.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ga=(n,t,e)=>{const s=new Map,i={platform:Hu,...e},o={...i.platform,_c:s};return Du(n,t,{...i,platform:o})};function ei(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function qu(n){return{name:"arrow",options:n,fn(t){const e=ei(r.unref(n.element));return e==null?{}:Bu({element:e,padding:n.padding}).fn(t)}}}function Za(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ja(n,t){const e=Za(n);return Math.round(t*e)/e}function Ku(n,t,e){e===void 0&&(e={});const s=e.whileElementsMounted,i=r.computed(()=>{var S;return(S=r.unref(e.open))!=null?S:!0}),o=r.computed(()=>r.unref(e.middleware)),a=r.computed(()=>{var S;return(S=r.unref(e.placement))!=null?S:"bottom"}),l=r.computed(()=>{var S;return(S=r.unref(e.strategy))!=null?S:"absolute"}),c=r.computed(()=>{var S;return(S=r.unref(e.transform))!=null?S:!0}),d=r.computed(()=>ei(n.value)),h=r.computed(()=>ei(t.value)),f=r.ref(0),u=r.ref(0),p=r.ref(l.value),m=r.ref(a.value),g=r.shallowRef({}),b=r.ref(!1),x=r.computed(()=>{const S={position:p.value,left:"0",top:"0"};if(!h.value)return S;const C=Ja(h.value,f.value),v=Ja(h.value,u.value);return c.value?{...S,transform:"translate("+C+"px, "+v+"px)",...Za(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:C+"px",top:v+"px"}});let y;function k(){d.value==null||h.value==null||Ga(d.value,h.value,{middleware:o.value,placement:a.value,strategy:l.value}).then(S=>{f.value=S.x,u.value=S.y,p.value=S.strategy,m.value=S.placement,g.value=S.middlewareData,b.value=!0})}function M(){typeof y=="function"&&(y(),y=void 0)}function _(){if(M(),s===void 0){k();return}if(d.value!=null&&h.value!=null){y=s(d.value,h.value,k);return}}function w(){i.value||(b.value=!1)}return r.watch([o,a,l],k,{flush:"sync"}),r.watch([d,h],_,{flush:"sync"}),r.watch(i,w,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(M),{x:r.shallowReadonly(f),y:r.shallowReadonly(u),strategy:r.shallowReadonly(p),placement:r.shallowReadonly(m),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:x,update:k}}function Gu(n){for(;n;){if(Zu(n))return n;n=n.parentElement}return document.scrollingElement}function Zu(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(n);return t.overflowY==="scroll"||t.overflowY==="auto"&&n.scrollHeight>n.clientHeight}class Ju{constructor(t,e){P(this,"onScroll");P(this,"scrollParent");this.onScroll=e,this.scrollParent=Gu(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Qu={class:"fm-menu__wrapper"},tp=r.defineComponent({__name:"FmMenu",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const s=n,i=r.ref(!1),o=r.ref(null),a=r.ref(null),{floatingStyles:l}=Ku(o,a,{middleware:[Ra(4),La()],placement:s.placement,whileElementsMounted:Xu});let c;const d=e;t({show:()=>{i.value||(i.value=!0,d("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,d("dropdown-changed",i.value))}});const h=p=>{p.preventDefault(),p.stopPropagation(),!s.disabled&&(i.value=!i.value,d("dropdown-changed",i.value))},f=p=>{if(!i.value)return;const m=p.path||p.composedPath();for(const g of m)if(g==o.value||g==a.value)return;i.value=!1,d("dropdown-changed",i.value)},u=()=>{d("dropdown-changed",!1)};return r.watch(()=>s.showMenu,p=>i.value=p),r.onMounted(()=>{i.value=s.showMenu,window.addEventListener("click",f),c=new Ju(o.value,u),c.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",f),c.unbindScroll()}),(p,m)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:o,class:"fm-menu",onClick:h},[r.renderSlot(p.$slots,"menu-button",{},void 0,!0)],512),i.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:r.normalizeStyle(r.unref(l))},[r.renderSlot(p.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",Qu,[r.renderSlot(p.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),Tg="",xt=et(tp,[["__scopeId","data-v-6ad9d23d"]]),ep={class:"fm-menu-item--left"},np={key:0,class:"fm-menu-item--right"},sp=r.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),i=t,o=c=>{c.preventDefault(),!e.disabled&&i("update:modelValue",!e.modelValue)},a=()=>{i("update:modelValue",e.modelValue)};function l(c){s.value=c}return(c,d)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{class:r.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":c.modelValue&&!c.hasCheckbox,"fm-menu-item--disabled":c.disabled}),onClick:o,onMousedown:d[1]||(d[1]=()=>l(!0)),onMouseup:d[2]||(d[2]=()=>l(!1)),onMouseleave:d[3]||(d[3]=()=>l(!1))},[r.createElementVNode("div",ep,[!c.hasCheckbox&&c.icon?(r.openBlock(),r.createBlock(R,{key:0,name:c.icon,size:"md",outline:!s.value&&!c.modelValue,color:c.disabled?"#C7C7CC":c.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),c.hasCheckbox?(r.openBlock(),r.createBlock(Aa,{key:1,"model-value":c.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:c.disabled,"onUpdate:modelValue":a,onClick:d[0]||(d[0]=h=>h.preventDefault())},null,8,["model-value","disabled"])):r.createCommentVNode("",!0),r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 ${c.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},r.toDisplayString(c.label),3),c.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 ${c.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},r.toDisplayString(c.sublabel),3)):r.createCommentVNode("",!0)])],!0)]),r.renderSlot(c.$slots,"append",{},void 0,!0),c.expandable?(r.openBlock(),r.createElementBlock("div",np,[r.createVNode(R,{name:"chevron_right",size:"md",color:c.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),Ng="",Vt=et(sp,[["__scopeId","data-v-a50682bb"]]),ip={class:"w-full"},op=r.defineComponent({__name:"FmField",props:{tag:{default:"div"},prependIcon:{default:""},appendIcon:{default:""},invalid:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},setup(n){const t=n;return(e,s)=>(r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":e.focused,"fm-field--invalid":e.invalid,"fm-field--valid":e.showValidBorder&&!e.invalid,"fm-field--disabled":e.disabled}),tabindex:"0"},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"prepend",{},()=>[e.prependIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.prependIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",ip,[r.renderSlot(e.$slots,"default",{},void 0,!0)]),r.renderSlot(e.$slots,"append",{},()=>[e.appendIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.appendIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),$g="",te=et(op,[["__scopeId","data-v-177cd78a"]]),ap={class:"flex gap-4"},Qa=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(n){const t=n,e=r.computed(()=>t.state==="success"?"check_circle":t.state==="warning"?"warning":t.state==="error"?"error":""),s=r.computed(()=>t.state==="success"?"text-fm-color-system-success-300":t.state==="warning"?"text-fm-color-system-warning-300":t.state==="error"?"text-fm-color-system-error-300":"");return(i,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":i.disabled,"text-fm-color-typo-secondary":i.state==="none"&&!i.disabled,"text-fm-color-typo-success":i.state==="success"&&!i.disabled,"text-fm-color-typo-warning":i.state==="warning"&&!i.disabled,"text-fm-color-typo-error":i.state==="error"&&!i.disabled}])},[i.errorMessages.length===0?r.renderSlot(i.$slots,"default",{key:0},()=>[r.createElementVNode("div",ap,[e.value?(r.openBlock(),r.createBlock(R,{key:0,size:"sm",name:e.value,class:r.normalizeClass(["mt-[2px]",s.value])},null,8,["name","class"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(i.text),1)])]):r.renderSlot(i.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.errorMessages,a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(R,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),r.createElementVNode("span",null,r.toDisplayString(a),1)]))),128))])],2))}}),rp={class:"px-2 py-0"},lp={key:0,class:"fm-typo-body-xl-700"},cp={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},tr=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{default:null},disabled:{type:Boolean,default:!1}},setup(n){const t=n,e=r.ref(null),s=r.ref(null),i=r.ref(null),o=async()=>{var x,y,k,M;const{x:p,y:m,placement:g,middlewareData:b}=await Ga(e.value,s.value,{placement:t.beak,middleware:[Ra(10),La(),Eu({padding:5}),t.hasArrow?qu({element:i.value,padding:10}):null]});if(Object.assign(s.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const _={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(i.value.style,{left:((x=b.arrow)==null?void 0:x.x)!=null?`${(y=b.arrow)==null?void 0:y.x}px`:"",top:((k=b.arrow)==null?void 0:k.y)!=null?`${(M=b.arrow)==null?void 0:M.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[_]:"-4px"})}},a=r.ref(!1),l=r.ref(0),c=r.ref(0),d=r.computed(()=>({...{plain:{color:"#FFF",background:"#1C1C1E",boxShadow:"0 2px 4px rgba(0, 0, 0, 0)"},rich:{background:"#FFF",boxShadow:"0px 8px 16px 0px rgba(199, 199, 204, 0.24)"}}[t.variant],display:a.value?"block":"none"})),h=()=>{clearTimeout(c.value),l.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(l.value),c.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(c.value),a.value=!0};return r.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,m)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:r.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":p.disabled}]),onMouseenter:h,onMouseleave:f},[r.renderSlot(p.$slots,"default")],34),r.createElementVNode("div",{ref_key:"tooltip",ref:s,class:"absolute box-border break-words left-0 max-w-xs px-4 py-3 rounded-2xl top-0 w-max whitespace-normal z-50",style:r.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[r.createElementVNode("div",null,[r.createElementVNode("div",rp,[p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",lp,r.toDisplayString(p.titleText),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},r.toDisplayString(p.contentText),3)]),p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",cp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actionButtons,(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b},[r.createVNode(kt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):r.createCommentVNode("",!0)]),r.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),er=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(n){return(t,e)=>t.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":t.info}])},[r.renderSlot(t.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.label),1),t.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),t.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),t.info?(r.openBlock(),r.createBlock(tr,{key:2,beak:"top","content-text":t.info,disabled:t.disabled},{default:r.withCtx(()=>[r.createVNode(R,{name:"info",size:"sm",class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}});function nr(n,t){const e=r.ref([]);function s(){const o=[];if(t.value&&t.value.length>0)for(const a of t.value){const c=(typeof a=="function"?a:()=>a)(n.value);c!==!0&&o.push(c)}return e.value=o,e.value}function i(){e.value=[]}return{validate:s,resetValidation:i,errorMessages:e}}function sr(n,t=null,e=null){let s=null;const i=yt(n,"modelValue"),o=r.ref(!0),a=r.inject(ri,null),{validate:l,resetValidation:c,errorMessages:d}=nr(i,r.toRef(()=>n.rules)),h=(f=e)=>{o.value=!0,c(),f&&typeof f=="function"&&f(),i.value=t};return r.onMounted(()=>{a&&(s=a.register({validate:l,resetValidation:c,resetValue:h})),t=t??i.value}),r.onUnmounted(()=>{a&&a.unregister(s)}),r.watch(()=>i.value,()=>{o.value=!1,i.value!==t&&l()}),r.watch(()=>n.focused,f=>{o.value=!1,f||l()}),{validate:l,resetValidation:c,errorMessages:d,resetValue:h,isPristine:o}}function Qn(){const n=r.ref(!1);function t(){n.value=!0}function e(){n.value=!1}return{focus:t,blur:e,isFocused:n}}const dp={key:1,class:"flex items-center justify-between"},Wt=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""},helperText:{default:""},helperState:{default:"none"},tag:{default:"label"}},setup(n){const t=n,{errorMessages:e,isPristine:s}=sr(t),{focus:i,blur:o}=Qn(),a=r.computed(()=>({label:t.label,disabled:t.disabled,required:t.required,optional:t.optional,info:t.info})),l=r.computed(()=>({text:t.helperText,disabled:t.disabled,state:t.helperState,errorMessages:e.value})),c=r.computed(()=>({isPristine:s,invalid:e.value.length>0}));return(d,h)=>(r.openBlock(),r.createBlock(t.tag,{class:"flex flex-col gap-4",onClick:r.unref(i),onBlur:r.unref(o)},{default:r.withCtx(()=>[d.label?(r.openBlock(),r.createBlock(er,r.normalizeProps(r.mergeProps({key:0},a.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),_:3},16)):r.createCommentVNode("",!0),r.renderSlot(d.$slots,"default",r.normalizeProps(r.guardReactiveProps(c.value))),l.value.text||l.value.errorMessages.length>0||d.$slots["helper-append"]?(r.openBlock(),r.createElementBlock("div",dp,[r.createVNode(Qa,r.normalizeProps(r.guardReactiveProps(l.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},16),r.renderSlot(d.$slots,"helper-append")])):r.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),hp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},fp={class:"w-max"},up={class:"flex h-40 justify-between px-4 py-8"},pp={class:"flex gap-4 items-center"},mp={class:"fm-typo-body-lg-700"},gp={class:"h-[264px] w-[160px]"},bp={class:"fm-typo-body-lg-700"},yp={class:"h-[264px] w-[160px]"},_p={class:"flex gap-4 items-center justify-center"},xp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},kp=["onClick"],wp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Cp=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),s=r.ref(ct(e.value,"YYYY-MM-DD")),i=r.ref(!1),o=r.ref(ct().startOf("month")),a=r.ref(!1),l=r.ref(!1),c=g=>{s.value=g},d=()=>{e.value=s.value.format("YYYY-MM-DD"),setTimeout(()=>{i.value=!1},0)},h=()=>{s.value=e.value?ct(e.value):null,i.value=!1},f=g=>{const b=[],x=g.endOf("month"),y=g.month();let k=g.startOf("week"),M=[];for(;k.isBefore(x.endOf("week"));)k.day()===0&&M.length>0&&(b.push(M),M=[]),M.push({date:k,isCurrentMonth:k.month()===y}),k=k.add(1,"day");return M.length>0&&b.push(M),b},u=g=>{a.value=!1,l.value=!1,o.value=g},p=r.computed(()=>Array.from(Array(7),(g,b)=>ct().day(b).format("ddd"))),m=r.computed(()=>{let g=-5;const b=[];for(;g!=5;)b.push(o.value.add(g,"year")),g++;return b});return(g,b)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":b[5]||(b[5]=x=>r.isRef(e)?e.value=x:null),label:g.label,disabled:g.disabled,required:g.labelMark==="required",optional:g.labelMark==="optional",info:g.labelInfo,rules:g.rules,focused:i.value,"helper-text":g.helperText,"helper-state":g.helperState,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(g.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:x})=>[r.createVNode(xt,{"show-menu":i.value,disabled:g.disabled,onDropdownChanged:b[4]||(b[4]=y=>i.value=y)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:"cursor-text",focused:i.value,invalid:x,"show-valid-border":g.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(g.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(g.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(r.unref(e)?r.unref(ct)(r.unref(e)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",hp,[r.createElementVNode("div",fp,[r.createElementVNode("div",up,[r.createElementVNode("div",pp,[r.createVNode(xt,{"show-menu":a.value,onDropdownChanged:b[0]||(b[0]=y=>a.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",mp,r.toDisplayString(o.value.format("MMMM")),1),r.createVNode(R,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",gp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(y,k)=>o.value.month(k)),y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("MMMM")},[r.createVNode(Vt,{"model-value":o.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(xt,{"show-menu":l.value,onDropdownChanged:b[1]||(b[1]=y=>l.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",l.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",bp,r.toDisplayString(o.value.format("YYYY")),1),r.createVNode(R,{name:l.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",yp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("YYYY")},[r.createVNode(Vt,{"model-value":o.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createElementVNode("div",_p,[r.createVNode(R,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>u(o.value.subtract(1,"month")))}),r.createVNode(R,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>u(o.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",xp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(o.value),(y,k)=>(r.openBlock(),r.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,M=>(r.openBlock(),r.createElementBlock("div",{key:M.date.date(),class:"fm-calendar__cell"},[M.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":M.date.isSame(s.value)}]),type:"button",onClick:()=>c(M.date)},r.toDisplayString(M.date.date()),11,kp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",wp,[r.createVNode(kt,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(kt,{label:"Apply",size:"md",variant:"primary",disabled:!s.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(g.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Lg="",Mp=et(Cp,[["__scopeId","data-v-0c5e239e"]]),Sp=n=>(r.pushScopeId("data-v-a148e113"),n=n(),r.popScopeId(),n),Dp={class:"flex gap-1 items-center relative w-full"},Bp={class:"flex flex-col gap-4 w-full"},vp=Sp(()=>r.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," to ",-1)),Ep={class:"flex flex-col gap-4 w-full"},Vp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Pp={class:"flex gap-24"},Ap={class:"w-max"},Op={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Fp={class:"flex gap-4 items-center"},Tp={class:"fm-typo-body-lg-700"},Np={class:"h-[264px] w-[160px]"},$p={class:"fm-typo-body-lg-700"},Lp={class:"h-[264px] w-[160px]"},Rp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},zp=["onClick","onMouseover"],Ip={class:"w-max"},Wp={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},Yp={class:"flex gap-4 items-center"},jp={class:"fm-typo-body-lg-700"},Hp={class:"h-[264px] w-[160px]"},Up={class:"fm-typo-body-lg-700"},Xp={class:"h-[264px] w-[160px]"},qp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Kp=["onClick","onMouseover"],Gp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Zp=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),s=r.ref({startDate:ct(e.value.startDate,"YYYY-MM-DD"),endDate:ct(e.value.endDate,"YYYY-MM-DD")}),i=r.ref(!1),o=r.ref(ct().startOf("month")),a=r.ref(ct().startOf("month").add(1,"month")),l=r.ref(null),c=r.ref(!1),d=r.ref(!1),h=r.ref(!1),f=r.ref(!1),u=_=>{if(s.value.startDate&&s.value.endDate){s.value={startDate:_,endDate:null};return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=_;else if(_.isBefore(s.value.startDate)){const w=s.value.startDate;s.value={startDate:_,endDate:w}}else s.value.endDate=_},p=()=>{e.value={startDate:s.value.startDate.format("YYYY-MM-DD"),endDate:s.value.endDate.format("YYYY-MM-DD")},setTimeout(()=>{i.value=!1})},m=()=>{var _,w;s.value={startDate:(_=e.value)!=null&&_.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(w=e.value)!=null&&w.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null},i.value=!1},g=_=>{const w=[],S=_.endOf("month"),C=_.month();let v=_.startOf("week"),E=[];for(;v.isBefore(S.endOf("week"));)v.day()===0&&E.length>0&&(w.push(E),E=[]),E.push({date:v,isCurrentMonth:v.month()===C}),v=v.add(1,"day");return E.length>0&&w.push(E),w},b=(_,w)=>{c.value=!1,h.value=!1,d.value=!1,f.value=!1,_==="left"?(o.value=w,a.value=w.add(1,"month")):_==="right"&&(a.value=w,o.value=w.subtract(1,"month"))},x=r.computed(()=>Array.from(Array(7),(_,w)=>ct().day(w).format("ddd"))),y=_=>{const w=s.value.startDate,S=s.value.endDate;l.value=w&&S?null:l.value;const C=l.value,v=w==null?void 0:w.isSame(_),E=S==null?void 0:S.isSame(_),O=C==null?void 0:C.isSame(_);return{"fm-calendar__cell__button--selected":v&&E||v&&!S,"fm-calendar__cell__button--selected-start":v&&S&&!(v&&E)||w&&!S&&v&&(C==null?void 0:C.isAfter(w))||w&&!S&&O&&(C==null?void 0:C.isBefore(w)),"fm-calendar__cell__button--selected-end":E&&w&&!(v&&E)||w&&!S&&v&&(C==null?void 0:C.isBefore(w))||w&&!S&&O&&(C==null?void 0:C.isAfter(w)),"fm-calendar__cell__button--selected-between":w&&(S||C)&&S?_.isAfter(w)&&_.isBefore(S):_.isAfter(C)&&_.isBefore(w)||_.isBefore(C)&&_.isAfter(w)}},k=_=>{l.value=_},M=r.computed(()=>{let _=-5;const w=[];for(;_!=5;)w.push(o.value.add(_,"year")),_++;return w});return r.watch(()=>e.value,()=>{var _,w;return s.value={startDate:(_=e.value)!=null&&_.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(w=e.value)!=null&&w.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null}}),(_,w)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":w[7]||(w[7]=S=>r.isRef(e)?e.value=S:null),disabled:_.disabled,rules:_.rules,focused:i.value,"helper-text":_.helperText,"helper-state":_.helperState,tag:"div"},{default:r.withCtx(({invalid:S})=>[r.createVNode(xt,{"show-menu":i.value,disabled:_.disabled,onDropdownChanged:w[6]||(w[6]=C=>i.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",Dp,[r.createElementVNode("label",Bp,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.startLabel),3),r.createVNode(te,{class:r.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:S,"show-valid-border":_.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(_.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var C,v;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(C=r.unref(e))!=null&&C.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((v=r.unref(e))!=null&&v.startDate?r.unref(ct)(r.unref(e).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),vp,r.createElementVNode("label",Ep,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.endLabel),3),r.createVNode(te,{class:r.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:S,"show-valid-border":_.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(_.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var C,v;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(C=r.unref(e))!=null&&C.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((v=r.unref(e))!=null&&v.endDate?r.unref(ct)(r.unref(e).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Vp,[r.createElementVNode("div",Pp,[r.createElementVNode("div",Ap,[r.createElementVNode("div",Op,[r.createElementVNode("div",Fp,[r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:w[0]||(w[0]=()=>b("left",o.value.subtract(1,"month")))}),r.createVNode(xt,{"show-menu":c.value,onDropdownChanged:w[1]||(w[1]=C=>c.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Tp,r.toDisplayString(o.value.format("MMMM")),1),r.createVNode(R,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Np,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(C,v)=>o.value.month(v)),C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("MMMM")},[r.createVNode(Vt,{"model-value":o.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":v=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(xt,{"show-menu":h.value,onDropdownChanged:w[2]||(w[2]=C=>h.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",h.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",$p,r.toDisplayString(o.value.format("YYYY")),1),r.createVNode(R,{name:h.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Lp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M.value,C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("YYYY")},[r.createVNode(Vt,{"model-value":o.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":v=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",Rp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,C=>(r.openBlock(),r.createElementBlock("div",{key:C,class:"fm-calendar__cell"},r.toDisplayString(C),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(o.value),(C,v)=>(r.openBlock(),r.createElementBlock("div",{key:v,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:O=>k(E.date)},r.toDisplayString(E.date.date()),43,zp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",Ip,[r.createElementVNode("div",Wp,[r.createElementVNode("div",Yp,[r.createVNode(xt,{"show-menu":d.value,onDropdownChanged:w[3]||(w[3]=C=>d.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",jp,r.toDisplayString(a.value.format("MMMM")),1),r.createVNode(R,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Hp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(C,v)=>a.value.month(v)),C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("MMMM")},[r.createVNode(Vt,{"model-value":a.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":v=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(xt,{"show-menu":f.value,onDropdownChanged:w[4]||(w[4]=C=>f.value=C)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Up,r.toDisplayString(a.value.format("YYYY")),1),r.createVNode(R,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Xp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M.value,C=>(r.openBlock(),r.createElementBlock("li",{key:C.format("YYYY")},[r.createVNode(Vt,{"model-value":a.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":v=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:w[5]||(w[5]=()=>b("left",o.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",qp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,C=>(r.openBlock(),r.createElementBlock("div",{key:C,class:"fm-calendar__cell"},r.toDisplayString(C),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(a.value),(C,v)=>(r.openBlock(),r.createElementBlock("div",{key:v,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:O=>k(E.date)},r.toDisplayString(E.date.date()),43,Kp)):r.createCommentVNode("",!0)]))),128))]))),128))])])])]),r.createElementVNode("div",Gp,[r.createVNode(kt,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),r.createVNode(kt,{label:"OK",size:"md",variant:"primary",disabled:!s.value.startDate||!s.value.endDate,onClick:p},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(_.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),Rg="",Jp=et(Zp,[["__scopeId","data-v-a148e113"]]),Qp=r.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const s=r.ref([]),i=r.ref(0),o=e,a=()=>{let d=[];for(let h=0;h<s.value.length;h++){const f=s.value[h];d=[...d,...f.validate()]}d.length?o("validation-failed",d):o("validation-success")},l=()=>{for(let d=0;d<s.value.length;d++)s.value[d].resetValue();o("reset")};return t({validateInputs:a,resetInputsValidation:()=>{for(let d=0;d<s.value.length;d++)s.value[d].resetValidation();o("validation-reset")},resetInputs:l}),r.provide(ri,{register({validate:d,resetValidation:h,resetValue:f}){return s.value.push({componentId:i.value,validate:d,resetValidation:h,resetValue:f}),i.value++},unregister(d){s.value.filter(h=>h.componentId!==d)}}),(d,h)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(a,["prevent"]),onReset:r.withModifiers(l,["prevent"])},[r.renderSlot(d.$slots,"default")],32))}}),tm={class:"fm-radio-btn"},em={class:"fm-radio-btn__input--container"},nm=["value","disabled","checked"],sm={class:"py-8"},im={class:"fm-typo-body-lg-400"},om={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},am=r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),s=r.ref(),i=r.inject(li,null),o=()=>{a.value||(i?i.updateValue(t.value):e.value=t.value)},a=r.computed(()=>i?i.getDisabled():t.disabled),l=r.computed(()=>i?t.value===i.groupValue.value:e.value===t.value);return(c,d)=>{const h=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",tm,[r.createElementVNode("label",{class:r.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":a.value,"cursor-pointer":!a.value}),onClick:o},[r.withDirectives((r.openBlock(),r.createElementBlock("div",em,[r.createElementVNode("input",{ref_key:"inputEl",ref:s,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:a.value,checked:l.value},null,8,nm)])),[[h,!a.value]]),r.createElementVNode("div",sm,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",im,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",om,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),zg="",rm=et(am,[["__scopeId","data-v-24fa5bf9"]]),lm=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[n=>!!n||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue");return r.provide(li,{groupValue:e,getDisabled:()=>t.disabled,updateValue(s){e.value=s}}),(s,i)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":i[0]||(i[0]=o=>r.isRef(e)?e.value=o:null),label:s.label,disabled:s.disabled,required:s.labelMark==="required",optional:s.labelMark==="optional",info:s.labelInfo,rules:s.rules,"helper-text":s.helperText,"helper-state":s.helperState},{label:r.withCtx(()=>[r.renderSlot(s.$slots,"label")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass({"flex items-center gap-16 justify-start":s.inline})},[r.renderSlot(s.$slots,"default")],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(s.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}}),cm={class:"flex flex-col gap-4"},dm={class:"w-[280px]"},hm={class:"flex flex-col gap-4 justify-center"},fm=r.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),s=r.ref(!1),i=(d,h)=>{if(t.multiselect){let f=[];d?f=e.value.length===0?[h]:t.items.filter(u=>e.value.some(p=>ft(u.value,p)||ft(u.value,h.value))):f=t.items.filter(u=>e.value.some(p=>ft(u.value,p)&&!ft(u.value,h.value))),e.value=f.map(u=>u.value)}else e.value=h.value,setTimeout(()=>{s.value=!1},0)},o=d=>{const h=[...e.value].filter((f,u)=>u!==d);e.value=h},a=r.computed(()=>t.multiselect?t.items.filter(d=>r.toRaw(e.value).some(h=>ft(h,d.value))):t.items.filter(d=>ft(e.value,d.value))),l=r.computed(()=>t.items.filter(d=>e.value.some(h=>ft(d.value,h))).map(d=>({label:d.label}))),c=r.computed(()=>{var d;return t.multiselect?t.placeholder:((d=t.items.find(h=>ft(h.value,e.value)))==null?void 0:d.label)??t.placeholder});return(d,h)=>(r.openBlock(),r.createElementBlock("div",cm,[r.createVNode(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":h[1]||(h[1]=f=>r.isRef(e)?e.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:s.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),default:r.withCtx(({invalid:f})=>[r.createVNode(xt,{"show-menu":s.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:h[0]||(h[0]=u=>s.value=u)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:s.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(d.$slots,"prepend")]),append:r.withCtx(()=>[r.createVNode(R,{name:s.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",dm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.items,u=>(r.openBlock(),r.createBlock(Vt,{key:u.value,"has-checkbox":d.multiselect,label:u.label,value:u.value,"model-value":a.value.some(p=>r.unref(ft)(p.value,u.value)),"onUpdate:modelValue":p=>i(p,u)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),r.createElementVNode("div",hm,[d.multiselect&&a.value.length>0?(r.openBlock(),r.createBlock(oi,{key:0,items:l.value,removable:"",disabled:d.disabled,onChipClosed:o},null,8,["items","disabled"])):r.createCommentVNode("",!0)])]))}}),um=["inputMode","value","placeholder","readOnly"],pm={key:0},mm=r.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),{isFocused:s,blur:i,focus:o}=Qn(),a=r.ref(null);let l;const c=y=>{if(y!==""){const k=+y.replace(/,/g,"");return isNaN(k)?null:k}return null},d=y=>l.format(y),h=y=>{if(typeof e.value!="number"){e.value=+e.value;return}if(y>0&&g.value||y<0&&b.value)return;let k=x(e.value)?e.value+y:0;k=f(k),e.value=k},f=y=>t.max!==void 0&&y>t.max?t.max:t.min!==void 0&&y<t.min?t.min:y,u=()=>{var y;e.value=c(((y=a.value)==null?void 0:y.value)??"")},p=y=>{if(![...Array(10).keys()].map(k=>k.toString()).includes(y.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(y.key)){y.preventDefault();return}},m=r.computed(()=>e.value!=null?d(e.value):""),g=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>=t.max),t.min!==void 0&&(y=e.value<t.min),y}),b=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>t.max),t.min!==void 0&&(y=e.value<=t.min),y});r.onMounted(()=>{l=new Intl.NumberFormat("en-MY",{useGrouping:t.useGrouping})});function x(y){return typeof y=="number"&&isFinite(y)}return(y,k)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":k[8]||(k[8]=M=>r.isRef(e)?e.value=M:null),label:y.label,disabled:y.disabled,required:y.labelMark==="required",optional:y.labelMark==="optional",info:y.labelInfo,rules:y.rules,focused:r.unref(s),"helper-text":y.helperText,"helper-state":y.helperState},{label:r.withCtx(()=>[r.renderSlot(y.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:M})=>[r.createVNode(te,{class:"cursor-text","append-icon":y.appendIcon,"prepend-icon":y.prependIcon,focused:r.unref(s),invalid:M,"show-valid-border":y.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(y.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(y.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex items-center justify-center",{"mr-32":y.showSteppers}])},[y.appendText?(r.openBlock(),r.createElementBlock("div",pm,r.toDisplayString(y.appendText),1)):r.createCommentVNode("",!0),y.appendIcon?(r.openBlock(),r.createBlock(R,{key:1,name:y.appendIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)],!0),y.showSteppers?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-stepper-field__stepper__container",r.unref(s)?"right-[6px]":"right-[7px]"])},[r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:k[2]||(k[2]=()=>h(y.step)),onFocus:k[3]||(k[3]=(..._)=>r.unref(o)&&r.unref(o)(..._)),onBlur:k[4]||(k[4]=(..._)=>r.unref(i)&&r.unref(i)(..._))},[r.createVNode(R,{name:"expand_less",size:"md",color:y.disabled||g.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:k[5]||(k[5]=()=>h(-y.step)),onFocus:k[6]||(k[6]=(..._)=>r.unref(o)&&r.unref(o)(..._)),onBlur:k[7]||(k[7]=(..._)=>r.unref(i)&&r.unref(i)(..._))},[r.createVNode(R,{name:"expand_more",size:"md",color:y.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:m.value,placeholder:y.placeholder,readOnly:y.readonly,onInput:u,onFocus:k[0]||(k[0]=(..._)=>r.unref(o)&&r.unref(o)(..._)),onBlur:k[1]||(k[1]=(..._)=>r.unref(i)&&r.unref(i)(..._)),onKeydown:p},null,40,um)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(y.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Ig="",gm=et(mm,[["__scopeId","data-v-3234ba43"]]),bm={class:"cursor-pointer fm-switch__container"},ym={key:0},_m={class:"fm-typo-body-lg-400"},xm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},km={class:"fm-switch__input--container"},wm=["checked","value","disabled"],Cm={key:1},Mm={class:"fm-typo-body-lg-400"},Sm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Dm=r.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{},disabled:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=yt(t,"modelValue"),s=()=>{t.disabled||(e.value=!e.value)};return(i,o)=>(r.openBlock(),r.createElementBlock("label",bm,[i.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",ym,[r.renderSlot(i.$slots,"label",{},void 0,!0),r.createElementVNode("div",_m,r.toDisplayString(i.label),1),i.sublabel?(r.openBlock(),r.createElementBlock("div",xm,r.toDisplayString(i.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",km,[r.createElementVNode("input",{checked:r.unref(e),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:s},null,8,wm),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":i.showIcon})},[i.showIcon?(r.openBlock(),r.createBlock(R,{key:0,name:r.unref(e)?"check":"close",size:"sm",color:i.disabled?"#C7C7CC":r.unref(e)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)]),i.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",Cm,[r.createElementVNode("div",Mm,r.toDisplayString(i.label),1),i.sublabel?(r.openBlock(),r.createElementBlock("div",Sm,r.toDisplayString(i.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),Wg="",Bm=et(Dm,[["__scopeId","data-v-924bfa9d"]]),vm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],Em=r.defineComponent({__name:"FmTextField",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},prependIcon:{default:""},appendIcon:{default:""},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=r.ref(null),s=yt(t,"modelValue"),{isFocused:i,focus:o,blur:a}=Qn(),l=c=>{s.value=c.target.value};return(c,d)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(s),"onUpdate:modelValue":d[2]||(d[2]=h=>r.isRef(s)?s.value=h:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:r.unref(i),"helper-text":c.helperText,"helper-state":c.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(c.$slots,"label")]),default:r.withCtx(({invalid:h})=>[r.createVNode(te,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:r.unref(i),invalid:h,"show-valid-border":c.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(c.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(c.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:e,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:r.unref(s),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:l,onFocus:d[0]||(d[0]=(...f)=>r.unref(o)&&r.unref(o)(...f)),onBlur:d[1]||(d[1]=(...f)=>r.unref(a)&&r.unref(a)(...f))},null,42,vm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(c.maxLength?`${r.unref(s).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Yg="",Vm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Pm=r.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelInfo:{default:""},helperText:{default:""},helperState:{default:"none"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n){const e=yt(n,"modelValue"),{isFocused:s,focus:i,blur:o}=Qn(),a=l=>{e.value=l.target.value};return(l,c)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":c[2]||(c[2]=d=>r.isRef(e)?e.value=d:null),label:l.label,disabled:l.disabled,required:l.labelMark==="required",optional:l.labelMark==="optional",info:l.labelInfo,rules:l.rules,focused:r.unref(s),"helper-text":l.helperText,"helper-state":l.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(l.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:d})=>[r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":r.unref(s),"fm-textarea__container--invalid":!!r.unref(e)&&d,"fm-textarea__container--valid":l.showValidBorder&&l.showSuccess&&!!r.unref(e)&&!d,"fm-textarea__container--disabled":l.disabled})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!l.disabled,"fm-color-typo-disabled":l.disabled}),value:r.unref(e),placeholder:l.placeholder,minlength:l.minLength,maxlength:l.maxLength,readOnly:l.readonly,disabled:l.disabled,onInput:a,onFocus:c[0]||(c[0]=(...h)=>r.unref(i)&&r.unref(i)(...h)),onBlur:c[1]||(c[1]=(...h)=>r.unref(o)&&r.unref(o)(...h))},null,42,Vm)],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(l.$slots,"helper-text",{},void 0,!0)]),_:2},[l.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([l.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(l.maxLength?`${r.unref(e).length} / ${l.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),jg="",Am=et(Pm,[["__scopeId","data-v-decdd479"]]),Om={class:"flex flex-col fm-time-input items-center"},Fm=["value"],Tm=r.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(n,{emit:t}){const e=n,s=t,i=r.ref();function o(h){i.value&&(i.value.value=h)}r.watch(()=>e.modelValue,o);function a(){if(!i.value)return;const h=l(i.value.value);if(h==null||h>e.max||h<e.min){o(e.modelValue);return}s("update:model-value",h)}function l(h){return h&&/^\d+$/.test(h)?Number(h):null}function c(){s("update:model-value",l(e.modelValue)+1)}function d(){s("update:model-value",l(e.modelValue)-1)}return(h,f)=>(r.openBlock(),r.createElementBlock("div",Om,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(R,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:i,value:e.modelValue,onInput:a},null,40,Fm),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[r.createVNode(R,{name:"expand_more",size:"lg"})])]))}}),Hg="",ir=et(Tm,[["__scopeId","data-v-e8ddb125"]]);var Yt=(n=>(n.AM="AM",n.PM="PM",n))(Yt||{});function ee(n){return n.toString().padStart(2,"0")}const Nm={class:"flex fm-time-input gap-16 items-center"},$m=r.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Lm={class:"fm-time-input-periods"},Rm=["onClick"],or=r.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,s=t;function i(o){const a={hours:o.hours??e.modelValue.hours,minutes:o.minutes??e.modelValue.minutes,period:o.period??e.modelValue.period},l=e.modelValue.hours;(l===12&&a.hours===11||l===11&&a.hours===12)&&(a.period=e.modelValue.period===Yt.AM?Yt.PM:Yt.AM),a.hours>12?a.hours=1:a.hours<1&&(a.hours=12),a.minutes>59?a.minutes=0:a.minutes<0&&(a.minutes=59),s("update:model-value",a)}return(o,a)=>(r.openBlock(),r.createElementBlock("div",Nm,[r.createVNode(ir,{"model-value":r.unref(ee)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":a[0]||(a[0]=l=>i({hours:l}))},null,8,["model-value"]),$m,r.createVNode(ir,{"model-value":r.unref(ee)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":a[1]||(a[1]=l=>i({minutes:l}))},null,8,["model-value"]),r.createElementVNode("div",Lm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Yt),l=>(r.openBlock(),r.createElementBlock("div",{key:l,class:r.normalizeClass([{"fm-time-input-period__selected":l===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:l})},r.toDisplayString(l),11,Rm))),128))])]))}}),Ug="",zm={class:"flex gap-8"},Im={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},Wm=r.createElementVNode("div",{class:"fm-typo-body-xl-700"},"Enter time",-1),Ym={class:"flex justify-center w-full"},jm={class:"flex justify-end"},Hm=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const e=yt(n,"modelValue"),s=r.ref(null),i=r.computed(()=>{if(!e.value)return null;const{hours:p,minutes:m,period:g}=l(e.value);return`${ee(p)}:${ee(m)} ${g}`});function o(){if(!s.value){e.value=null;return}const{hours:p,minutes:m,period:g}=s.value,b=a(p,m,g);e.value=b,h()}function a(p,m,g){let b=p;return g===Yt.PM?b=p===12?p:p+12:p===12&&(b=0),`${ee(b)}:${ee(m)}`}r.onMounted(()=>{e.value&&(s.value=l(e.value))}),r.watch(()=>e.value,p=>{p&&(s.value=l(p))});function l(p){const[m,g,b]=c(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function c(p){const[m,g]=p.split(":"),b=Number(m),x=Number(g),y=b>11?Yt.PM:Yt.AM;let k=b;return k===0?k=12:k>12&&(k-=12),`${ee(k)}:${ee(x)}:${y}`}const d=r.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=r.ref(!1);function u(p){p?s.value=l(e.value??"00:00"):s.value=e.value?l(e.value):null,f.value=p}return(p,m)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":m[1]||(m[1]=g=>r.isRef(e)?e.value=g:null),label:p.label,disabled:p.disabled,required:p.labelMark==="required",optional:p.labelMark==="optional",info:p.labelInfo,rules:p.rules,focused:f.value,"helper-text":p.helperText,"helper-state":p.helperState},{label:r.withCtx(()=>[r.renderSlot(p.$slots,"label")]),default:r.withCtx(({invalid:g})=>[r.createVNode(xt,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(p.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:g,"show-valid-border":p.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",zm,[r.createVNode(R,{name:"schedule",outline:!f.value},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass(["grow",{"text-fm-color-typo-disabled":!i.value}])},r.toDisplayString(i.value??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Im,[Wm,r.createElementVNode("div",Ym,[r.createVNode(or,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Yt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=b=>s.value=b)},null,8,["model-value"])]),r.createElementVNode("div",jm,[r.createVNode(kt,{label:"Cancel",variant:"tertiary",onClick:h}),r.createVNode(kt,{label:"Confirm",variant:"tertiary",onClick:o})])])]),_:2},1536)]),"helper-text":r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Um=r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),Xg="",Xm=et(Um,[["__scopeId","data-v-884ba127"]]),qm=r.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(n){const t=n;return(e,s)=>{const i=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":e.disabled,"cursor-pointer":e.clickable&&!e.disabled,"cursor-not-allowed":e.clickable&&e.disabled,activeClass:e.activeClass})},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[i,e.clickable&&!e.disabled]])}}}),qg="",Km=et(qm,[["__scopeId","data-v-f565b558"]]),Gm={class:"fm-progress-indicator relative"},Zm=["data-progress"],Jm={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},ar=r.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=r.ref(null),s=r.computed(()=>`${t.modelValue/100*360}deg`),i=o=>{e.value&&e.value.style.setProperty("--progress",o)};return r.onMounted(()=>{i(s.value)}),r.onUpdated(()=>{i(s.value)}),r.watch(s,async o=>{i(o)}),(o,a)=>(r.openBlock(),r.createElementBlock("div",Gm,[r.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":s.value},null,8,Zm),r.createElementVNode("div",Jm,[r.renderSlot(o.$slots,"default")])]))}}),Kg="",Qm={class:"flex"},tg={key:0,class:"mt-8"},eg=r.defineComponent({__name:"FmSnackbar",props:{title:{type:String,default:void 0},description:{type:String,default:void 0},variant:{type:String,default:"info"},dismissable:{type:Boolean,default:!1},action:{type:String,default:void 0},color:{type:String,default:void 0},bgColor:{type:String,default:void 0}},emits:["onDismiss","onAction"],setup(n,{emit:t}){const e=n,s=t,i=r.computed(()=>{switch(e.variant){case"info":return{icon:{name:"info",color:"system-info-300"},actionColor:"typo-info",bgColor:"system-info-100"};case"success":return{icon:{name:"check_circle",color:"system-success-300"},actionColor:"typo-success",bgColor:"system-success-100"};case"warning":return{icon:{name:"warning",color:"system-warning-300"},actionColor:"typo-warning",bgColor:"system-warning-100"};case"error":return{icon:{name:"error",color:"system-error-300"},actionColor:"typo-error",bgColor:"system-error-100"};case"neutral":return{actionColor:"primary",bgColor:"neutral-gray-100"};default:throw Error(`Unimplement snackbar variant ${e.variant}`)}}),o=r.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),a=r.computed(()=>e.bgColor?ns(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),l=r.computed(()=>e.color?ns(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(c,d)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(a.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[r.createElementVNode("div",Qm,[i.value.icon?(r.openBlock(),r.createBlock(R,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${o.value.classes} grow ellipsis`)},r.toDisplayString(o.value.text),3),e.dismissable?(r.openBlock(),r.createBlock(R,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:d[0]||(d[0]=()=>s("onDismiss"))})):r.createCommentVNode("",!0)]),e.title&&e.description?(r.openBlock(),r.createElementBlock("div",tg,r.toDisplayString(e.description),1)):r.createCommentVNode("",!0),r.renderSlot(c.$slots,"actions",{},()=>[e.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},l.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:d[1]||(d[1]=()=>s("onAction"))},r.toDisplayString(e.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),Gg="",ng=et(eg,[["__scopeId","data-v-b6db34bb"]]),sg={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},rr=r.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(n.title),3),n.description?(r.openBlock(),r.createElementBlock("div",sg,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0)],2))}}),ig=["data-title","data-description","data-disabled"],og={class:"flex fm-step-container gap-12 grow"},ag=r.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(n){const t=n,{currentStep:e,goToStep:s}=r.inject(ci);function i(){o.value||s(t.value)}const o=r.computed(()=>t.disabled?t.disabled():!1),a=r.computed(()=>t.error?t.error():!1),l=r.computed(()=>e()===t.value),c=r.computed(()=>t.complete()),d=r.computed(()=>l.value||c.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=r.computed(()=>l.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:o.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,u)=>{const p=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":o.value,class:r.normalizeClass(`fm-step gap-4 grow ${o.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(i,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),r.createElementVNode("div",og,[r.createElementVNode("div",{class:r.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",h.value.className])},[h.value.config?(r.openBlock(),r.createBlock(R,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(rr,{title:n.title,description:n.description,disabled:o.value,class:"grow"},null,8,["title","description","disabled"])])],10,ig)),[[p,!o.value]])}}}),Zg="",rg=et(ag,[["__scopeId","data-v-ee172cad"]]),lg={class:"hidden items-center xs:flex"},cg={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},dg=r.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,s=t,i=f=>{s("update:model-value",f)};r.provide(ci,{currentStep:()=>e.modelValue,goToStep:i});const o=r.ref(),a=r.ref([]),l=r.computed(()=>a.value[e.modelValue-1]),c=r.computed(()=>e.modelValue/a.value.length*100),d=r.computed(()=>`${e.modelValue} of ${a.value.length}`),h=()=>{var u;const f=Array.from(((u=o.value)==null?void 0:u.querySelectorAll(":scope > .fm-step"))??[]);a.value=f.map(p=>({title:p.dataset.title??"",description:p.dataset.description,disabled:p.dataset.disabled=="true"}))};return r.onMounted(()=>{h()}),(f,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:o,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(f.$slots,"default")],2),r.createElementVNode("div",lg,[r.createVNode(ar,{"model-value":c.value,class:"mr-12",style:{"min-width":"60px"}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.value),1)]),_:1},8,["model-value"]),l.value?(r.openBlock(),r.createBlock(rr,{key:0,class:"grow","title-bold":"",title:l.value.title,description:l.value.description,disabled:l.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),f.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(f.$slots,"contents"),r.createElementVNode("div",cg,[r.renderSlot(f.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let hg=0;function fg(){return hg++}const ug=n=>(r.pushScopeId("data-v-50625760"),n=n(),r.popScopeId(),n),pg=["disabled"],mg=[ug(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],gg={class:"max-w-[360px] min-w-[186px]"},bg=r.defineComponent({__name:"FmTab",props:{modelValue:{default:null},label:{default:""},vertical:{type:Boolean,default:!1},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:()=>fg()},children:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=r.ref(!1),s=n,i=t,o=r.ref(!1);function a(f){e.value=f}const l=()=>{s.disabled||s.children.length>0||i("update:modelValue",s.value)},c=f=>{s.children.length!==0&&(o.value=f)},d=r.computed(()=>s.children.length>0?s.children.some(f=>f.value===s.modelValue):s.modelValue===s.value),h=f=>{o.value=!1,i("update:modelValue",f)};return(f,u)=>(r.openBlock(),r.createBlock(xt,{"show-menu":o.value,disabled:f.children.length===0,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":f.vertical}]),placement:f.vertical?"right-start":"bottom-start",onDropdownChanged:c},{"menu-button":r.withCtx(()=>[r.createElementVNode("button",{class:r.normalizeClass(["fm-tab",`fm-tab--${f.vertical?"vertical":"horizontal"}`,f.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":d.value}]),disabled:f.disabled,onMousedown:u[0]||(u[0]=()=>a(!0)),onMouseup:u[1]||(u[1]=()=>a(!1)),onMouseleave:u[2]||(u[2]=()=>a(!1)),onClick:l},[r.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(r.openBlock(),r.createBlock(R,{key:0,name:f.icon,outline:!e.value&&!d.value,color:f.disabled?"neutral-gray-200":d.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),f.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",d.value?"visible":"invisible"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0),f.label?(r.openBlock(),r.createElementBlock("span",{key:2,class:r.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!d.value||f.disabled?"visible":"invisible"])},r.toDisplayString(f.label),3)):r.createCommentVNode("",!0),f.badge?(r.openBlock(),r.createBlock(cn,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),f.children.length>0?(r.openBlock(),r.createBlock(R,{key:4,size:"md",name:o.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(f.$slots,"append",{},void 0,!0),d.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},mg,2)):r.createCommentVNode("",!0)],42,pg)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",gg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.children,p=>r.renderSlot(f.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(p)),()=>[r.createVNode(Vt,{"model-value":s.modelValue===p.value,label:p.label,icon:p.icon,disabled:p.disabled,onClick:m=>h(p.value)},{append:r.withCtx(()=>[p.badge?(r.openBlock(),r.createBlock(cn,{key:0,value:p.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),Qg="",lr=et(bg,[["__scopeId","data-v-50625760"]]),yg=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),_g={class:"max-w-[360px] min-w-[186px]"},xg={FmBadge:cn,FmBreadcrumb:mr,FmButton:kt,FmButtonGroup:Br,FmCard:Vr,FmCardActions:Pr,FmCardSection:Ar,FmCardTitle:si,FmChip:ii,FmChipGroup:oi,FmDialog:Nr,FmDropField:zr,FmDynamicDialog:hi,FmLineChart:ru,FmCheckbox:Aa,FmDatePicker:Mp,FmDateRangePicker:Jp,FmField:te,FmForm:Qp,FmFormGroup:Wt,FmHelperText:Qa,FmLabel:er,FmRadio:rm,FmRadioGroup:lm,FmSelect:fm,FmStepperField:gm,FmSwitch:Bm,FmTextField:Em,FmTextarea:Am,FmTimeInput:or,FmTimePicker:Hm,FmIcon:R,FmList:Xm,FmListItem:Km,FmMenu:xt,FmMenuItem:Vt,FmProgressIndicator:ar,FmSnackbar:ng,FmSpacer:ai,FmStep:rg,FmStepper:dg,FmTab:lr,FmTabs:r.defineComponent({__name:"FmTabs",props:{modelValue:{default:null},items:{},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showMoreAt:{default:6}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=t,i=r.ref(!1),o=r.computed(()=>({vertical:e.vertical,disabled:e.disabled})),a=r.computed(()=>e.items.slice(0,e.showMoreAt)),l=r.computed(()=>e.items.slice(e.showMoreAt)),c=d=>{i.value=!1,s("update:modelValue",d)};return(d,h)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",d.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,f=>r.renderSlot(d.$slots,"default",r.normalizeProps(r.guardReactiveProps({...f,tabsProps:o.value})),()=>[r.createVNode(lr,r.mergeProps({"model-value":e.modelValue},{children:f.children,label:f.label,icon:f.icon,disabled:f.disabled,badge:f.badge,value:f.value,tabsProps:o.value},{disabled:f.disabled===void 0?d.disabled:f.disabled,vertical:d.vertical,"onUpdate:modelValue":h[0]||(h[0]=u=>s("update:modelValue",u))}),null,16,["model-value","disabled","vertical"])])),256)),l.value.length>0?(r.openBlock(),r.createBlock(xt,{key:0,"show-menu":i.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":d.vertical}]),placement:d.vertical?"right-start":"bottom-start",onDropdownChanged:h[1]||(h[1]=f=>i.value=f)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[d.vertical?"h-40":"h-[46px]"]])},[r.createVNode(R,{name:"more_vert"}),yg],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",_g,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,f=>r.renderSlot(d.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(f)),()=>[r.createVNode(Vt,{"model-value":e.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:u=>c(f.value)},{append:r.withCtx(()=>[f.badge?(r.openBlock(),r.createBlock(cn,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),FmTooltip:tr};function kg(){const n=r.inject(di);if(!n)throw new Error("No provider");return n}const wg=n=>{n.use(mt,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(jr),Object.entries(xg).forEach(([t,e])=>{n.component(t,e)})};st.uiPlugin=wg,st.useDialog=kg,st.useFormChild=sr,st.useValidation=nr,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
23
+ */class Xd{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,o,i){const s=n.listeners[i],r=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:r,currentStep:Math.min(o-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=xs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((o,i)=>{if(!o.running||!o.items.length)return;const s=o.items;let r=s.length-1,a=!1,c;for(;r>=0;--r)c=s[r],c._active?(c._total>o.duration&&(o.duration=c._total),c.tick(e),a=!0):(s[r]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,o,e,"progress")),s.length||(o.running=!1,this._notify(i,o,e,"complete"),o.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let o=n.get(e);return o||(o={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,o)),o}listen(e,n,o){this._getAnims(e).listeners[n].push(o)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((o,i)=>Math.max(o,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const o=n.items;let i=o.length-1;for(;i>=0;--i)o[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ie=new Xd;const Ks="transparent",Kd={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Ms(t||Ks),i=o.valid&&Ms(e||Ks);return i&&i.valid?i.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Zd{constructor(e,n,o,i){const s=n[o];i=qt([e.to,i,s,e.from]);const r=qt([e.from,s,i]);this._active=!0,this._fn=e.fn||Kd[e.type||typeof r],this._easing=jt[e.easing]||jt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=o,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,o){if(this._active){this._notify(!1);const i=this._target[this._prop],s=o-this._start,r=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=qt([e.to,n,i,e.from]),this._from=qt([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,o=this._duration,i=this._prop,s=this._from,r=this._loop,a=this._to;let c;if(this._active=s!==a&&(r||n<o),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}c=n/o%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(s,a,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,o)=>{e.push({res:n,rej:o})})}_notify(e){const n=e?"res":"rej",o=this._promises||[];for(let i=0;i<o.length;i++)o[i][n]()}}class Zs{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!z(e))return;const n=Object.keys(te.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!z(s))return;const r={};for(const a of n)r[a]=s[a];(q(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!o.has(a))&&o.set(a,r)})})}_animateOptions(e,n){const o=n.options,i=Qd(e,o);if(!i)return[];const s=this._createAnimations(i,o);return o.$shared&&Jd(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,n){const o=this._properties,i=[],s=e.$animations||(e.$animations={}),r=Object.keys(n),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const d=r[c];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[d];let f=s[d];const p=o.get(d);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){e[d]=u;continue}s[d]=f=new Zd(p,e,d,u),i.push(f)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const o=this._createAnimations(e,n);if(o.length)return Ie.add(this._chart,o),!0}}function Jd(t,e){const n=[],o=Object.keys(e);for(let i=0;i<o.length;i++){const s=t[o[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Qd(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Js(t,e){const n=t&&t.options||{},o=n.reverse,i=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:o?s:i,end:o?i:s}}function eu(t,e,n){if(n===!1)return!1;const o=Js(t,n),i=Js(e,n);return{top:i.end,right:o.end,bottom:i.start,left:o.start}}function tu(t){let e,n,o,i;return z(t)?(e=t.top,n=t.right,o=t.bottom,i=t.left):e=n=o=i=t,{top:e,right:n,bottom:o,left:i,disabled:t===!1}}function Qs(t,e){const n=[],o=t._getSortedDatasetMetas(e);let i,s;for(i=0,s=o.length;i<s;++i)n.push(o[i].index);return n}function er(t,e,n,o={}){const i=t.keys,s=o.mode==="single";let r,a,c,d;if(e!==null){for(r=0,a=i.length;r<a;++r){if(c=+i[r],c===n){if(o.all)continue;break}d=t.values[c],ee(d)&&(s||e===0||Ve(e)===Ve(d))&&(e+=d)}return e}}function nu(t){const e=Object.keys(t),n=new Array(e.length);let o,i,s;for(o=0,i=e.length;o<i;++o)s=e[o],n[o]={x:s,y:t[s]};return n}function tr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function ou(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function iu(t){const{min:e,max:n,minDefined:o,maxDefined:i}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function su(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function nr(t,e,n,o){for(const i of e.getMatchingVisibleMetas(o).reverse()){const s=t[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function or(t,e){const{chart:n,_cachedMeta:o}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:r,index:a}=o,c=s.axis,d=r.axis,u=ou(s,r,o),f=e.length;let p;for(let h=0;h<f;++h){const g=e[h],{[c]:m,[d]:b}=g,x=g._stacks||(g._stacks={});p=x[d]=su(i,u,m),p[a]=b,p._top=nr(p,r,!0,o.type),p._bottom=nr(p,r,!1,o.type);const y=p._visualValues||(p._visualValues={});y[a]=b}}function Wo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function ru(t,e){return Qe(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function lu(t,e,n){return Qe(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function Xt(t,e){const n=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const i of e){const s=i._stacks;if(!s||s[o]===void 0||s[o][n]===void 0)return;delete s[o][n],s[o]._visualValues!==void 0&&s[o]._visualValues[n]!==void 0&&delete s[o]._visualValues[n]}}}const jo=t=>t==="reset"||t==="none",ir=(t,e)=>e?t:Object.assign({},t),au=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Qs(n,!0),values:null};class Me{constructor(e,n){this.chart=e,this._ctx=e.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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=tr(e.vScale,e),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(e){this.index!==e&&Xt(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),i=(f,p,h,g)=>f==="x"?p:f==="r"?g:h,s=n.xAxisID=T(o.xAxisID,Wo(e,"x")),r=n.yAxisID=T(o.yAxisID,Wo(e,"y")),a=n.rAxisID=T(o.rAxisID,Wo(e,"r")),c=n.indexAxis,d=n.iAxisID=i(c,s,r,a),u=n.vAxisID=i(c,r,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&ys(this._data,this),e._stacked&&Xt(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(z(n))this._data=nu(n);else if(o!==n){if(o){ys(o,this);const i=this._cachedMeta;Xt(i),i._parsed=[]}n&&Object.isExtensible(n)&&Uc(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,o=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=tr(n.vScale,n),n.stack!==o.stack&&(i=!0,Xt(n),n.stack=o.stack),this._resyncElements(e),(i||s!==n._stacked)&&or(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),o=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(o,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:o,_data:i}=this,{iScale:s,_stacked:r}=o,a=s.axis;let c=e===0&&n===i.length?!0:o._sorted,d=e>0&&o._parsed[e-1],u,f,p;if(this._parsing===!1)o._parsed=i,o._sorted=!0,p=i;else{q(i[e])?p=this.parseArrayData(o,i,e,n):z(i[e])?p=this.parseObjectData(o,i,e,n):p=this.parsePrimitiveData(o,i,e,n);const h=()=>f[a]===null||d&&f[a]<d[a];for(u=0;u<n;++u)o._parsed[u+e]=f=p[u],c&&(h()&&(c=!1),d=f);o._sorted=c}r&&or(this,p)}parsePrimitiveData(e,n,o,i){const{iScale:s,vScale:r}=e,a=s.axis,c=r.axis,d=s.getLabels(),u=s===r,f=new Array(i);let p,h,g;for(p=0,h=i;p<h;++p)g=p+o,f[p]={[a]:u||s.parse(d[g],g),[c]:r.parse(n[g],g)};return f}parseArrayData(e,n,o,i){const{xScale:s,yScale:r}=e,a=new Array(i);let c,d,u,f;for(c=0,d=i;c<d;++c)u=c+o,f=n[u],a[c]={x:s.parse(f[0],u),y:r.parse(f[1],u)};return a}parseObjectData(e,n,o,i){const{xScale:s,yScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=new Array(i);let u,f,p,h;for(u=0,f=i;u<f;++u)p=u+o,h=n[p],d[u]={x:s.parse(Ke(h,a),p),y:r.parse(Ke(h,c),p)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,o){const i=this.chart,s=this._cachedMeta,r=n[e.axis],a={keys:Qs(i,!0),values:n._stacks[e.axis]._visualValues};return er(a,r,s.index,{mode:o})}updateRangeFromParsed(e,n,o,i){const s=o[n.axis];let r=s===null?NaN:s;const a=i&&o._stacks[n.axis];i&&a&&(i.values=a,r=er(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,n){const o=this._cachedMeta,i=o._parsed,s=o._sorted&&e===o.iScale,r=i.length,a=this._getOtherScale(e),c=au(n,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=iu(a);let p,h;function g(){h=i[p];const m=h[a.axis];return!ee(h[e.axis])||u>m||f<m}for(p=0;p<r&&!(!g()&&(this.updateRangeFromParsed(d,e,h,c),s));++p);if(s){for(p=r-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(d,e,h,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let i,s,r;for(i=0,s=n.length;i<s;++i)r=n[i][e.axis],ee(r)&&o.push(r);return o}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,o=n.iScale,i=n.vScale,s=this.getParsed(e);return{label:o?""+o.getLabelForValue(s[o.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=tu(T(this.options.clip,eu(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,o=this._cachedMeta,i=o.data||[],s=n.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||i.length-a,d=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,a,c),u=a;u<a+c;++u){const f=i[u];f.hidden||(f.active&&d?r.push(f):f.draw(e,s))}for(u=0;u<r.length;++u)r[u].draw(e,s)}getStyle(e,n){const o=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(o):this.resolveDataElementOptions(e||0,o)}getContext(e,n,o){const i=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const r=this._cachedMeta.data[e];s=r.$context||(r.$context=lu(this.getContext(),e,r)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=ru(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=o,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",o){const i=n==="active",s=this._cachedDataOpts,r=e+"-"+n,a=s[r],c=this.enableOptionSharing&&zt(o);if(a)return ir(a,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=i?[`${e}Hover`,"hover",e,""]:[e,""],p=d.getOptionScopes(this.getDataset(),u),h=Object.keys(te.elements[e]),g=()=>this.getContext(o,i,n),m=d.resolveNamedOptions(p,h,g,f);return m.$shared&&(m.$shared=c,s[r]=Object.freeze(ir(m,c))),m}_resolveAnimations(e,n,o){const i=this.chart,s=this._cachedDataOpts,r=`animation-${n}`,a=s[r];if(a)return a;let c;if(i.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(p,this.getContext(e,o,n))}const d=new Zs(i,c&&c.animations);return c&&c._cacheable&&(s[r]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||jo(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(o),r=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,o),{sharedOptions:s,includeOptions:r}}updateElement(e,n,o,i){jo(i)?Object.assign(e,o):this._resolveAnimations(n,i).update(e,o)}updateSharedOptions(e,n,o){e&&!jo(n)&&this._resolveAnimations(void 0,n).update(e,o)}_setStyle(e,n,o,i){e.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,o,i).update(e,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,o){this._setStyle(e,o,"active",!1)}setHoverStyle(e,n,o){this._setStyle(e,o,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,o=this._cachedMeta.data;for(const[a,c,d]of this._syncList)this[a](c,d);this._syncList=[];const i=o.length,s=n.length,r=Math.min(s,i);r&&this.parse(0,r),s>i?this._insertElements(i,s-i,e):s<i&&this._removeElements(s,i-s)}_insertElements(e,n,o=!0){const i=this._cachedMeta,s=i.data,r=e+n;let a;const c=d=>{for(d.length+=n,a=d.length-1;a>=r;a--)d[a]=d[a-n]};for(c(s),a=e;a<r;++a)s[a]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(e,n),o&&this.updateElements(s,e,n,"reset")}updateElements(e,n,o,i){}_removeElements(e,n){const o=this._cachedMeta;if(this._parsing){const i=o._parsed.splice(e,n);o._stacked&&Xt(o,i)}o.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,o,i]=e;this[n](o,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const o=arguments.length-2;o&&this._sync(["_insertElements",e,o])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}F(Me,"defaults",{}),F(Me,"datasetElementType",null),F(Me,"dataElementType",null);function cu(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let o=[];for(let i=0,s=n.length;i<s;i++)o=o.concat(n[i].controller.getAllParsedValues(t));t._cache.$bar=_s(o.sort((i,s)=>i-s))}return t._cache.$bar}function du(t){const e=t.iScale,n=cu(e,t.type);let o=e._length,i,s,r,a;const c=()=>{r===32767||r===-32768||(zt(a)&&(o=Math.min(o,Math.abs(r-a)||o)),a=r)};for(i=0,s=n.length;i<s;++i)r=e.getPixelForValue(n[i]),c();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)r=e.getPixelForTick(i),c();return o}function uu(t,e,n,o){const i=n.barThickness;let s,r;return H(i)?(s=e.min*n.categoryPercentage,r=n.barPercentage):(s=i*o,r=1),{chunk:s/o,ratio:r,start:e.pixels[t]-s/2}}function fu(t,e,n,o){const i=e.pixels,s=i[t];let r=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const c=n.categoryPercentage;r===null&&(r=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-r);const d=s-(s-Math.min(r,a))/2*c;return{chunk:Math.abs(a-r)/2*c/o,ratio:n.barPercentage,start:d}}function hu(t,e,n,o){const i=n.parse(t[0],o),s=n.parse(t[1],o),r=Math.min(i,s),a=Math.max(i,s);let c=r,d=a;Math.abs(r)>Math.abs(a)&&(c=a,d=r),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:i,end:s,min:r,max:a}}function sr(t,e,n,o){return q(t)?hu(t,e,n,o):e[n.axis]=n.parse(t,o),e}function rr(t,e,n,o){const i=t.iScale,s=t.vScale,r=i.getLabels(),a=i===s,c=[];let d,u,f,p;for(d=n,u=n+o;d<u;++d)p=e[d],f={},f[i.axis]=a||i.parse(r[d],d),c.push(sr(p,f,s,d));return c}function Yo(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function pu(t,e,n){return t!==0?Ve(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function gu(t){let e,n,o,i,s;return t.horizontal?(e=t.base>t.x,n="left",o="right"):(e=t.base<t.y,n="bottom",o="top"),e?(i="end",s="start"):(i="start",s="end"),{start:n,end:o,reverse:e,top:i,bottom:s}}function mu(t,e,n,o){let i=e.borderSkipped;const s={};if(!i){t.borderSkipped=s;return}if(i===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:c,top:d,bottom:u}=gu(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?i=d:(n._bottom||0)===o?i=u:(s[lr(u,r,a,c)]=!0,i=d)),s[lr(i,r,a,c)]=!0,t.borderSkipped=s}function lr(t,e,n,o){return o?(t=bu(t,e,n),t=ar(t,n,e)):t=ar(t,e,n),t}function bu(t,e,n){return t===e?n:t===n?e:t}function ar(t,e,n){return t==="start"?e:t==="end"?n:t}function yu(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Pn extends Me{parsePrimitiveData(e,n,o,i){return rr(e,n,o,i)}parseArrayData(e,n,o,i){return rr(e,n,o,i)}parseObjectData(e,n,o,i){const{iScale:s,vScale:r}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?a:c,u=r.axis==="x"?a:c,f=[];let p,h,g,m;for(p=o,h=o+i;p<h;++p)m=n[p],g={},g[s.axis]=s.parse(Ke(m,d),p),f.push(sr(Ke(m,u),g,r,p));return f}updateRangeFromParsed(e,n,o,i){super.updateRangeFromParsed(e,n,o,i);const s=o._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:o,vScale:i}=n,s=this.getParsed(e),r=s._custom,a=Yo(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+o.getLabelForValue(s[o.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,o,i){const s=i==="reset",{index:r,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),d=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,i);for(let h=n;h<n+o;h++){const g=this.getParsed(h),m=s||H(g[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,u),x=(g._stacks||{})[a.axis],y={horizontal:d,base:m.base,enableBorderRadius:!x||Yo(g._custom)||r===x._top||r===x._bottom,x:d?m.head:b.center,y:d?b.center:m.head,height:d?b.size:Math.abs(m.size),width:d?Math.abs(m.size):b.size};p&&(y.options=f||this.resolveDataElementOptions(h,e[h].active?"active":i));const w=y.options||e[h].options;mu(y,w,x,r),yu(y,w,u.ratio),this.updateElement(e[h],h,y,i)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,i=o.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),s=o.options.stacked,r=[],a=c=>{const d=c.controller.getParsed(n),u=d&&d[c.vScale.axis];if(H(u)||isNaN(u))return!0};for(const c of i)if(!(n!==void 0&&a(c))&&((s===!1||r.indexOf(c.stack)===-1||s===void 0&&c.stack===void 0)&&r.push(c.stack),c.index===e))break;return r.length||r.push(void 0),r}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,o){const i=this._getStacks(e,o),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,o=n.iScale,i=[];let s,r;for(s=0,r=n.data.length;s<r;++s)i.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const a=e.barThickness;return{min:a||du(n),pixels:i,start:o._startPixel,end:o._endPixel,stackCount:this._getStackCount(),scale:o,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:o,index:i},options:{base:s,minBarLength:r}}=this,a=s||0,c=this.getParsed(e),d=c._custom,u=Yo(d);let f=c[n.axis],p=0,h=o?this.applyStack(n,c,o):f,g,m;h!==f&&(p=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Ve(f)!==Ve(d.barEnd)&&(p=0),p+=f);const b=!H(s)&&!u?s:p;let x=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?g=n.getPixelForValue(p+h):g=x,m=g-x,Math.abs(m)<r){m=pu(m,n,a)*r,f===a&&(x-=m/2);const y=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),S=Math.min(y,w),_=Math.max(y,w);x=Math.max(Math.min(x,_),S),g=x+m,o&&!u&&(c._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const y=Ve(m)*n.getLineWidthForValue(a)/2;x+=y,m-=y}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(e,n){const o=n.scale,i=this.options,s=i.skipNull,r=T(i.maxBarThickness,1/0);let a,c;if(n.grouped){const d=s?this._getStackCount(e):n.stackCount,u=i.barThickness==="flex"?fu(e,n,i,d):uu(e,n,i,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0);a=u.start+u.chunk*f+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else a=o.getPixelForValue(this.getParsed(e)[o.axis],e),c=Math.min(r,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,o=e.data,i=o.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&o[s].draw(this._ctx)}}F(Pn,"id","bar"),F(Pn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),F(Pn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class An extends Me{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,i){const s=super.parsePrimitiveData(e,n,o,i);for(let r=0;r<s.length;r++)s[r]._custom=this.resolveDataElementOptions(r+o).radius;return s}parseArrayData(e,n,o,i){const s=super.parseArrayData(e,n,o,i);for(let r=0;r<s.length;r++){const a=n[o+r];s[r]._custom=T(a[2],this.resolveDataElementOptions(r+o).radius)}return s}parseObjectData(e,n,o,i){const s=super.parseObjectData(e,n,o,i);for(let r=0;r<s.length;r++){const a=n[o+r];s[r]._custom=T(a&&a.r&&+a.r,this.resolveDataElementOptions(r+o).radius)}return s}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let o=e.length-1;o>=0;--o)n=Math.max(n,e[o].size(this.resolveDataElementOptions(o))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,r=this.getParsed(e),a=i.getLabelForValue(r.x),c=s.getLabelForValue(r.y),d=r._custom;return{label:o[e]||"",value:"("+a+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,i),u=r.axis,f=a.axis;for(let p=n;p<n+o;p++){const h=e[p],g=!s&&this.getParsed(p),m={},b=m[u]=s?r.getPixelForDecimal(.5):r.getPixelForValue(g[u]),x=m[f]=s?a.getBasePixel():a.getPixelForValue(g[f]);m.skip=isNaN(b)||isNaN(x),d&&(m.options=c||this.resolveDataElementOptions(p,h.active?"active":i),s&&(m.options.radius=0)),this.updateElement(h,p,m,i)}}resolveDataElementOptions(e,n){const o=this.getParsed(e);let i=super.resolveDataElementOptions(e,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=T(o&&o._custom,s),i}}F(An,"id","bubble"),F(An,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),F(An,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function _u(t,e,n){let o=1,i=1,s=0,r=0;if(e<K){const a=t,c=a+e,d=Math.cos(a),u=Math.sin(a),f=Math.cos(c),p=Math.sin(c),h=(w,S,_)=>Wt(w,a,c,!0)?1:Math.max(S,S*n,_,_*n),g=(w,S,_)=>Wt(w,a,c,!0)?-1:Math.min(S,S*n,_,_*n),m=h(0,d,f),b=h(ne,u,p),x=g(X,d,f),y=g(X+ne,u,p);o=(m-x)/2,i=(b-y)/2,s=-(m+x)/2,r=-(b+y)/2}return{ratioX:o,ratioY:i,offsetX:s,offsetY:r}}class bt extends Me{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const o=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=o;else{let s=c=>+o[c];if(z(o[e])){const{key:c="value"}=this._parsing;s=d=>+Ke(o[d],c)}let r,a;for(r=e,a=e+n;r<a;++r)i._parsed[r]=s(r)}}_getRotation(){return ve(this.options.rotation-90)}_getCircumference(){return ve(this.options.circumference)}_getRotationExtents(){let e=K,n=-K;for(let o=0;o<this.chart.data.datasets.length;++o)if(this.chart.isDatasetVisible(o)&&this.chart.getDatasetMeta(o).type===this._type){const i=this.chart.getDatasetMeta(o).controller,s=i._getRotation(),r=i._getCircumference();e=Math.min(e,s),n=Math.max(n,s+r)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,i=this._cachedMeta,s=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(o.width,o.height)-r)/2,0),c=Math.min($c(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:m}=_u(f,u,c),b=(o.width-r)/p,x=(o.height-r)/h,y=Math.max(Math.min(b,x)/2,0),w=as(this.options.radius,y),S=Math.max(w*c,0),_=(w-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=m*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const o=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||i._parsed[e]===null||i.data[e].hidden?0:this.calculateCircumference(i._parsed[e]*s/K)}updateElements(e,n,o,i){const s=i==="reset",r=this.chart,a=r.chartArea,d=r.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=s&&d.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,i);let x=this._getRotation(),y;for(y=0;y<n;++y)x+=this._circumference(y,s);for(y=n;y<n+o;++y){const w=this._circumference(y,s),S=e[y],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+w,circumference:w,outerRadius:g,innerRadius:h};b&&(_.options=m||this.resolveDataElementOptions(y,S.active?"active":i)),x+=w,this.updateElement(S,y,_,i)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let o=0,i;for(i=0;i<n.length;i++){const s=e._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(o+=Math.abs(s))}return o}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?K*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Yt(n._parsed[e],o.options.locale);return{label:i[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const o=this.chart;let i,s,r,a,c;if(!e){for(i=0,s=o.data.datasets.length;i<s;++i)if(o.isDatasetVisible(i)){r=o.getDatasetMeta(i),e=r.data,a=r.controller;break}}if(!e)return 0;for(i=0,s=e.length;i<s;++i)c=a.resolveDataElementOptions(i),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let o=0,i=e.length;o<i;++o){const s=this.resolveDataElementOptions(o);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let o=0;o<e;++o)this.chart.isDatasetVisible(o)&&(n+=this._getRingWeight(o));return n}_getRingWeight(e){return Math.max(T(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}F(bt,"id","doughnut"),F(bt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),F(bt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),F(bt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:i}}=e.legend.options;return n.labels.map((s,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class On extends Me{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:i=[],_dataset:s}=n,r=this.chart._animationsDisabled;let{start:a,count:c}=Cs(n,i,r);this._drawStart=a,this._drawCount=c,ks(n)&&(a=0,c=i.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=i;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:d},e),this.updateElements(i,a,c,e)}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,i),p=r.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,b=Et(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",y=n+o,w=e.length;let S=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const k=e[_],v=x?k:{};if(_<n||_>=y){v.skip=!0;continue}const C=this.getParsed(_),D=H(C[h]),V=v[p]=r.getPixelForValue(C[p],_),$=v[h]=s||D?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[h],_);v.skip=isNaN(V)||isNaN($)||D,v.stop=_>0&&Math.abs(C[p]-S[p])>b,m&&(v.parsed=C,v.raw=d.data[_]),f&&(v.options=u||this.resolveDataElementOptions(_,k.active?"active":i)),x||this.updateElement(k,_,v,i),S=C}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,o=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return o;const s=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,s,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}F(On,"id","line"),F(On,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(On,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Kt extends Me{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,i=o.data.labels||[],s=Yt(n._parsed[e].r,o.options.locale);return{label:i[e]||"",value:s}}parseObjectData(e,n,o,i){return Is.bind(this)(e,n,o,i)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((o,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,o=e.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),r=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),a=(s-r)/e.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,o,i){const s=i==="reset",r=this.chart,c=r.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,f=d.yCenter,p=d.getIndexAngle(0)-.5*X;let h=p,g;const m=360/this.countVisibleElements();for(g=0;g<n;++g)h+=this._computeAngle(g,i,m);for(g=n;g<n+o;g++){const b=e[g];let x=h,y=h+this._computeAngle(g,i,m),w=r.getDataVisibility(g)?d.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=y,s&&(c.animateScale&&(w=0),c.animateRotate&&(x=y=p));const S={x:u,y:f,innerRadius:0,outerRadius:w,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":i)};this.updateElement(b,g,S,i)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((o,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(e,n,o){return this.chart.getDataVisibility(e)?ve(this.resolveDataElementOptions(e,n).angle||o):0}}F(Kt,"id","polarArea"),F(Kt,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),F(Kt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:i}}=e.legend.options;return n.labels.map((s,r)=>{const c=e.getDatasetMeta(0).controller.getStyle(r);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Go extends bt{}F(Go,"id","pie"),F(Go,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Nn extends Me{getLabelAndValue(e){const n=this._cachedMeta.vScale,o=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(o[n.axis])}}parseObjectData(e,n,o,i){return Is.bind(this)(e,n,o,i)}update(e){const n=this._cachedMeta,o=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(o.points=i,e!=="resize"){const r=this.resolveDatasetElementOptions(e);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:r};this.updateElement(o,void 0,a,e)}this.updateElements(i,0,i.length,e)}updateElements(e,n,o,i){const s=this._cachedMeta.rScale,r=i==="reset";for(let a=n;a<n+o;a++){const c=e[a],d=this.resolveDataElementOptions(a,c.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),f=r?s.xCenter:u.x,p=r?s.yCenter:u.y,h={x:f,y:p,angle:u.angle,skip:isNaN(f)||isNaN(p),options:d};this.updateElement(c,a,h,i)}}}F(Nn,"id","radar"),F(Nn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),F(Nn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class In extends Me{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:i,yScale:s}=n,r=this.getParsed(e),a=i.getLabelForValue(r.x),c=s.getLabelForValue(r.y);return{label:o[e]||"",value:"("+a+", "+c+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:r}=Cs(n,o,i);if(this._drawStart=s,this._drawCount=r,ks(n)&&(s=0,r=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=o;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,s,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,o,i){const s=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(u),p=this.includeOptions(i,f),h=r.axis,g=a.axis,{spanGaps:m,segment:b}=this.options,x=Et(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||i==="none";let w=n>0&&this.getParsed(n-1);for(let S=n;S<n+o;++S){const _=e[S],k=this.getParsed(S),v=y?_:{},C=H(k[g]),D=v[h]=r.getPixelForValue(k[h],S),V=v[g]=s||C?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,k,c):k[g],S);v.skip=isNaN(D)||isNaN(V)||C,v.stop=S>0&&Math.abs(k[h]-w[h])>x,b&&(v.parsed=k,v.raw=d.data[S]),p&&(v.options=f||this.resolveDataElementOptions(S,_.active?"active":i)),y||this.updateElement(_,S,v,i),w=k}this.updateSharedOptions(f,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const o=e.dataset,i=o.options&&o.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}}F(In,"id","scatter"),F(In,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),F(In,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var xu=Object.freeze({__proto__:null,BarController:Pn,BubbleController:An,DoughnutController:bt,LineController:On,PieController:Go,PolarAreaController:Kt,RadarController:Nn,ScatterController:In});function yt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(e){F(this,"options");this.options=e||{}}static override(e){Object.assign(Uo.prototype,e)}init(){}formats(){return yt()}parse(){return yt()}format(){return yt()}add(){return yt()}diff(){return yt()}startOf(){return yt()}endOf(){return yt()}}var wu={_date:Uo};function Cu(t,e,n,o){const{controller:i,data:s,_sorted:r}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&r&&s.length){const c=a._reversePixels?Yc:Oe;if(o){if(i._sharedOptions){const d=s[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(s,e,n-u),p=c(s,e,n+u);return{lo:f.lo,hi:p.hi}}}}else return c(s,e,n)}return{lo:0,hi:s.length-1}}function Zt(t,e,n,o,i){const s=t.getSortedVisibleDatasetMetas(),r=n[e];for(let a=0,c=s.length;a<c;++a){const{index:d,data:u}=s[a],{lo:f,hi:p}=Cu(s[a],e,r,i);for(let h=f;h<=p;++h){const g=u[h];g.skip||o(g,d,h)}}}function ku(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(o,i){const s=e?Math.abs(o.x-i.x):0,r=n?Math.abs(o.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(r,2))}}function qo(t,e,n,o,i){const s=[];return!i&&!t.isPointInArea(e)||Zt(t,n,e,function(a,c,d){!i&&!Ne(a,t.chartArea,0)||a.inRange(e.x,e.y,o)&&s.push({element:a,datasetIndex:c,index:d})},!0),s}function Su(t,e,n,o){let i=[];function s(r,a,c){const{startAngle:d,endAngle:u}=r.getProps(["startAngle","endAngle"],o),{angle:f}=ms(r,{x:e.x,y:e.y});Wt(f,d,u)&&i.push({element:r,datasetIndex:a,index:c})}return Zt(t,n,e,s),i}function vu(t,e,n,o,i,s){let r=[];const a=ku(n);let c=Number.POSITIVE_INFINITY;function d(u,f,p){const h=u.inRange(e.x,e.y,i);if(o&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||t.isPointInArea(g))&&!h)return;const b=a(e,g);b<c?(r=[{element:u,datasetIndex:f,index:p}],c=b):b===c&&r.push({element:u,datasetIndex:f,index:p})}return Zt(t,n,e,d),r}function Xo(t,e,n,o,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?Su(t,e,n,i):vu(t,e,n,o,i,s)}function cr(t,e,n,o,i){const s=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Zt(t,n,e,(c,d,u)=>{c[r](e[n],i)&&(s.push({element:c,datasetIndex:d,index:u}),a=a||c.inRange(e.x,e.y,i))}),o&&!a?[]:s}var Mu={evaluateInteractionItems:Zt,modes:{index(t,e,n,o){const i=gt(e,t),s=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?qo(t,i,s,o,r):Xo(t,i,s,!1,o,r),c=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=a[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?qo(t,i,s,o,r):Xo(t,i,s,!1,o,r);if(a.length>0){const c=a[0].datasetIndex,d=t.getDatasetMeta(c).data;a=[];for(let u=0;u<d.length;++u)a.push({element:d[u],datasetIndex:c,index:u})}return a},point(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;return qo(t,i,s,o,r)},nearest(t,e,n,o){const i=gt(e,t),s=n.axis||"xy",r=n.includeInvisible||!1;return Xo(t,i,s,n.intersect,o,r)},x(t,e,n,o){const i=gt(e,t);return cr(t,i,"x",n.intersect,o)},y(t,e,n,o){const i=gt(e,t);return cr(t,i,"y",n.intersect,o)}}};const dr=["left","top","right","bottom"];function Jt(t,e){return t.filter(n=>n.pos===e)}function ur(t,e){return t.filter(n=>dr.indexOf(n.pos)===-1&&n.box.axis===e)}function Qt(t,e){return t.sort((n,o)=>{const i=e?o:n,s=e?n:o;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Eu(t){const e=[];let n,o,i,s,r,a;for(n=0,o=(t||[]).length;n<o;++n)i=t[n],{position:s,options:{stack:r,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:r&&s+r,stackWeight:a});return e}function Du(t){const e={};for(const n of t){const{stack:o,pos:i,stackWeight:s}=n;if(!o||!dr.includes(i))continue;const r=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}function Vu(t,e){const n=Du(t),{vBoxMaxWidth:o,hBoxMaxHeight:i}=e;let s,r,a;for(s=0,r=t.length;s<r;++s){a=t[s];const{fullSize:c}=a.box,d=n[a.stack],u=d&&a.stackWeight/d.weight;a.horizontal?(a.width=u?u*o:c&&e.availableWidth,a.height=i):(a.width=o,a.height=u?u*i:c&&e.availableHeight)}return n}function Ru(t){const e=Eu(t),n=Qt(e.filter(d=>d.box.fullSize),!0),o=Qt(Jt(e,"left"),!0),i=Qt(Jt(e,"right")),s=Qt(Jt(e,"top"),!0),r=Qt(Jt(e,"bottom")),a=ur(e,"x"),c=ur(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:i.concat(c).concat(r).concat(a),chartArea:Jt(e,"chartArea"),vertical:o.concat(i).concat(c),horizontal:s.concat(r).concat(a)}}function fr(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function hr(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Fu(t,e,n,o){const{pos:i,box:s}=n,r=t.maxPadding;if(!z(i)){n.size&&(t[i]-=n.size);const f=o[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,t[i]+=n.size}s.getPadding&&hr(r,s.getPadding());const a=Math.max(0,e.outerWidth-fr(r,t,"left","right")),c=Math.max(0,e.outerHeight-fr(r,t,"top","bottom")),d=a!==t.w,u=c!==t.h;return t.w=a,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Bu(t){const e=t.maxPadding;function n(o){const i=Math.max(e[o]-t[o],0);return t[o]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function $u(t,e){const n=e.maxPadding;function o(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(r=>{s[r]=Math.max(e[r],n[r])}),s}return o(t?["left","right"]:["top","bottom"])}function en(t,e,n,o){const i=[];let s,r,a,c,d,u;for(s=0,r=t.length,d=0;s<r;++s){a=t[s],c=a.box,c.update(a.width||e.w,a.height||e.h,$u(a.horizontal,e));const{same:f,other:p}=Fu(e,n,a,o);d|=f&&i.length,u=u||p,c.fullSize||i.push(a)}return d&&en(i,e,n,o)||u}function Ln(t,e,n,o,i){t.top=n,t.left=e,t.right=e+o,t.bottom=n+i,t.width=o,t.height=i}function pr(t,e,n,o){const i=n.padding;let{x:s,y:r}=e;for(const a of t){const c=a.box,d=o[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/d.weight||1;if(a.horizontal){const f=e.w*u,p=d.size||c.height;zt(d.start)&&(r=d.start),c.fullSize?Ln(c,i.left,r,n.outerWidth-i.right-i.left,p):Ln(c,e.left+d.placed,r,f,p),d.start=r,d.placed+=f,r=c.bottom}else{const f=e.h*u,p=d.size||c.width;zt(d.start)&&(s=d.start),c.fullSize?Ln(c,s,i.top,p,n.outerHeight-i.bottom-i.top):Ln(c,s,e.top+d.placed,p,f),d.start=s,d.placed+=f,s=c.right}}e.x=s,e.y=r}var ce={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,o){if(!t)return;const i=ae(t.options.layout.padding),s=Math.max(e-i.width,0),r=Math.max(n-i.height,0),a=Ru(t.boxes),c=a.vertical,d=a.horizontal;j(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=c.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/u,hBoxMaxHeight:r/2}),p=Object.assign({},i);hr(p,ae(o));const h=Object.assign({maxPadding:p,w:s,h:r,x:i.left,y:i.top},i),g=Vu(c.concat(d),f);en(a.fullSize,h,f,g),en(c,h,f,g),en(d,h,f,g)&&en(c,h,f,g),Bu(h),pr(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,pr(a.rightAndBottom,h,f,g),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},j(a.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class gr{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,o){}removeEventListener(e,n,o){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,o,i){return n=Math.max(0,n||e.width),o=o||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):o)}}isAttached(e){return!0}updateConfig(e){}}class Pu extends gr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Tn="$chartjs",Au={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mr=t=>t===null||t==="";function Ou(t,e){const n=t.style,o=t.getAttribute("height"),i=t.getAttribute("width");if(t[Tn]={initial:{height:o,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",mr(i)){const s=zs(t,"width");s!==void 0&&(t.width=s)}if(mr(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=zs(t,"height");s!==void 0&&(t.height=s)}return t}const br=Id?{passive:!0}:!1;function Nu(t,e,n){t.addEventListener(e,n,br)}function Iu(t,e,n){t.canvas.removeEventListener(e,n,br)}function Lu(t,e){const n=Au[t.type]||t.type,{x:o,y:i}=gt(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:i!==void 0?i:null}}function zn(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Tu(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let r=!1;for(const a of s)r=r||zn(a.addedNodes,o),r=r&&!zn(a.removedNodes,o);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function zu(t,e,n){const o=t.canvas,i=new MutationObserver(s=>{let r=!1;for(const a of s)r=r||zn(a.removedNodes,o),r=r&&!zn(a.addedNodes,o);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const tn=new Map;let yr=0;function _r(){const t=window.devicePixelRatio;t!==yr&&(yr=t,tn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Hu(t,e){tn.size||window.addEventListener("resize",_r),tn.set(t,e)}function Wu(t){tn.delete(t),tn.size||window.removeEventListener("resize",_r)}function ju(t,e,n){const o=t.canvas,i=o&&Ho(o);if(!i)return;const s=ws((a,c)=>{const d=i.clientWidth;n(a,c),d<i.clientWidth&&n()},window),r=new ResizeObserver(a=>{const c=a[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return r.observe(i),Hu(t,s),r}function Ko(t,e,n){n&&n.disconnect(),e==="resize"&&Wu(t)}function Yu(t,e,n){const o=t.canvas,i=ws(s=>{t.ctx!==null&&n(Lu(s,t))},t);return Nu(o,e,i),i}class Gu extends gr{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Ou(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[Tn])return!1;const o=n[Tn].initial;["height","width"].forEach(s=>{const r=o[s];H(r)?n.removeAttribute(s):n.setAttribute(s,r)});const i=o.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[Tn],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),r={attach:Tu,detach:zu,resize:ju}[n]||Yu;i[n]=r(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),i=o[n];if(!i)return;({attach:Ko,detach:Ko,resize:Ko}[n]||Iu)(e,n,i),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,i){return Nd(e,n,o,i)}isAttached(e){const n=Ho(e);return!!(n&&n.isConnected)}}function Uu(t){return!zo()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Pu:Gu}let Le=(mo=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return Et(this.x)&&Et(this.y)}getProps(e,n){const o=this.$animations;if(!n||!o)return this;const i={};return e.forEach(s=>{i[s]=o[s]&&o[s].active()?o[s]._to:this[s]}),i}},F(mo,"defaults",{}),F(mo,"defaultRoutes"),mo);function qu(t,e){const n=t.options.ticks,o=Xu(t),i=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?Zu(e):[],r=s.length,a=s[0],c=s[r-1],d=[];if(r>i)return Ju(e,d,s,r/i),d;const u=Ku(s,e,i);if(r>0){let f,p;const h=r>1?Math.round((c-a)/(r-1)):null;for(Hn(e,d,u,H(h)?0:a-h,a),f=0,p=r-1;f<p;f++)Hn(e,d,u,s[f],s[f+1]);return Hn(e,d,u,c,H(h)?e.length:c+h),d}return Hn(e,d,u),d}function Xu(t){const e=t.options.offset,n=t._tickSize(),o=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(o,i))}function Ku(t,e,n){const o=Qu(t),i=e.length/n;if(!o)return Math.max(i,1);const s=zc(o);for(let r=0,a=s.length-1;r<a;r++){const c=s[r];if(c>i)return c}return Math.max(i,1)}function Zu(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function Ju(t,e,n,o){let i=0,s=n[0],r;for(o=Math.ceil(o),r=0;r<t.length;r++)r===s&&(e.push(t[r]),i++,s=n[i*o])}function Hn(t,e,n,o,i){const s=T(o,0),r=Math.min(T(i,t.length),t.length);let a=0,c,d,u;for(n=Math.ceil(n),i&&(c=i-o,n=c/Math.floor(c/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(d=Math.max(s,0);d<r;d++)d===u&&(e.push(t[d]),a++,u=Math.round(s+a*n))}function Qu(t){const e=t.length;let n,o;if(e<2)return!1;for(o=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==o)return!1;return o}const ef=t=>t==="left"?"right":t==="right"?"left":t,xr=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,wr=(t,e)=>Math.min(e||t,t);function Cr(t,e){const n=[],o=t.length/e,i=t.length;let s=0;for(;s<i;s+=o)n.push(t[Math.floor(s)]);return n}function tf(t,e,n){const o=t.ticks.length,i=Math.min(e,o-1),s=t._startPixel,r=t._endPixel,a=1e-6;let c=t.getPixelForTick(i),d;if(!(n&&(o===1?d=Math.max(c-s,r-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(i-1))/2,c+=i<e?d:-d,c<s-a||c>r+a)))return c}function nf(t,e){j(t,n=>{const o=n.gc,i=o.length/2;let s;if(i>e){for(s=0;s<i;++s)delete n.data[o[s]];o.splice(0,i)}})}function nn(t){return t.drawTicks?t.tickLength:0}function kr(t,e){if(!t.display)return 0;const n=oe(t.font,e),o=ae(t.padding);return(q(t.text)?t.text.length:1)*n.lineHeight+o.height}function of(t,e){return Qe(t,{scale:e,type:"scale"})}function sf(t,e,n){return Qe(t,{tick:n,index:e,type:"tick"})}function rf(t,e,n){let o=Fo(t);return(n&&e!=="right"||!n&&e==="right")&&(o=ef(o)),o}function lf(t,e,n,o){const{top:i,left:s,bottom:r,right:a,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,p,h,g;const m=r-i,b=a-s;if(t.isHorizontal()){if(h=le(o,s,a),z(n)){const x=Object.keys(n)[0],y=n[x];g=u[x].getPixelForValue(y)+m-e}else n==="center"?g=(d.bottom+d.top)/2+m-e:g=xr(t,n,e);p=a-s}else{if(z(n)){const x=Object.keys(n)[0],y=n[x];h=u[x].getPixelForValue(y)-b+e}else n==="center"?h=(d.left+d.right)/2-b+e:h=xr(t,n,e);g=le(o,r,i),f=n==="left"?-ne:ne}return{titleX:h,titleY:g,maxWidth:p,rotation:f}}class _t extends Le{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:o,_suggestedMax:i}=this;return e=ye(e,Number.POSITIVE_INFINITY),n=ye(n,Number.NEGATIVE_INFINITY),o=ye(o,Number.POSITIVE_INFINITY),i=ye(i,Number.NEGATIVE_INFINITY),{min:ye(e,o),max:ye(n,i),minDefined:ee(e),maxDefined:ee(n)}}getMinMax(e){let{min:n,max:o,minDefined:i,maxDefined:s}=this.getUserBounds(),r;if(i&&s)return{min:n,max:o};const a=this.getMatchingVisibleMetas();for(let c=0,d=a.length;c<d;++c)r=a[c].controller.getMinMax(this,e),i||(n=Math.min(n,r.min)),s||(o=Math.max(o,r.max));return n=s&&n>o?o:n,o=i&&n>o?n:o,{min:ye(n,ye(o,n)),max:ye(o,ye(n,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){G(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:i,grace:s,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+o.left+o.right:this.height+o.top+o.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gd(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Cr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,o;this.isHorizontal()?(n=this.left,o=this.right):(n=this.top,o=this.bottom,e=!e),this._startPixel=n,this._endPixel=o,this._reversePixels=e,this._length=o-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){G(this.options.afterUpdate,[this])}beforeSetDimensions(){G(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(){G(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),G(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){G(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let o,i,s;for(o=0,i=e.length;o<i;o++)s=e[o],s.label=G(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){G(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){G(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=wr(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let r=i,a,c,d;if(!this._isVisible()||!n.display||i>=s||o<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),f=u.widest.width,p=u.highest.height,h=ie(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/o:h/(o-1),f+6>a&&(a=h/(o-(e.offset?.5:1)),c=this.maxHeight-nn(e.grid)-n.padding-kr(e.title,this.chart.options.font),d=Math.sqrt(f*f+p*p),r=Do(Math.min(Math.asin(ie((u.highest.height+6)/a,-1,1)),Math.asin(ie(c/d,-1,1))-Math.asin(ie(p/d,-1,1)))),r=Math.max(i,Math.min(s,r))),this.labelRotation=r}afterCalculateLabelRotation(){G(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){G(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:i,grid:s}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=kr(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=nn(s)+c):(e.height=this.maxHeight,e.width=nn(s)+c),o.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:p}=this._getLabelSizes(),h=o.padding*2,g=ve(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(a){const x=o.mirror?0:b*f.width+m*p.height;e.height=Math.min(this.maxHeight,e.height+x+h)}else{const x=o.mirror?0:m*f.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+x+h)}this._calculatePadding(d,u,b,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,o,i){const{ticks:{align:s,padding:r},position:a}=this.options,c=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;c?d?(p=i*e.width,h=o*n.height):(p=o*e.height,h=i*n.width):s==="start"?h=n.width:s==="end"?p=e.width:s!=="inner"&&(p=e.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+r)*this.width/(this.width-f),0)}else{let u=n.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=n.height,f=0),this.paddingTop=u+r,this.paddingBottom=f+r}}_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(){G(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,o;for(n=0,o=e.length;n<o;n++)H(e[n].label)&&(e.splice(n,1),o--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let o=this.ticks;n<o.length&&(o=Cr(o,n)),this._labelSizes=e=this._computeLabelSizes(o,o.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,o){const{ctx:i,_longestTextCache:s}=this,r=[],a=[],c=Math.floor(n/wr(n,o));let d=0,u=0,f,p,h,g,m,b,x,y,w,S,_;for(f=0;f<n;f+=c){if(g=e[f].label,m=this._resolveTickFontOptions(f),i.font=b=m.string,x=s[b]=s[b]||{data:{},gc:[]},y=m.lineHeight,w=S=0,!H(g)&&!q(g))w=En(i,x.data,x.gc,w,g),S=y;else if(q(g))for(p=0,h=g.length;p<h;++p)_=g[p],!H(_)&&!q(_)&&(w=En(i,x.data,x.gc,w,_),S+=y);r.push(w),a.push(S),d=Math.max(w,d),u=Math.max(S,u)}nf(s,n);const k=r.indexOf(d),v=a.indexOf(u),C=D=>({width:r[D]||0,height:a[D]||0});return{first:C(0),last:C(n-1),widest:C(k),highest:C(v),widths:r,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return jc(this._alignToPixels?ut(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const o=n[e];return o.$context||(o.$context=sf(this.getContext(),e,o))}return this.$context||(this.$context=of(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=ve(this.labelRotation),o=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),r=e.autoSkipPadding||0,a=s?s.widest.width+r:0,c=s?s.highest.height+r:0;return this.isHorizontal()?c*o>a*i?a/o:c/i:c*i<a*o?c/o:a/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,o=this.chart,i=this.options,{grid:s,position:r,border:a}=i,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),p=nn(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,x=function(M){return ut(o,M,m)};let y,w,S,_,k,v,C,D,V,$,O,U;if(r==="top")y=x(this.bottom),v=this.bottom-p,D=y-b,$=x(e.top)+b,U=e.bottom;else if(r==="bottom")y=x(this.top),$=e.top,U=x(e.bottom)-b,v=y+b,D=this.top+p;else if(r==="left")y=x(this.right),k=this.right-p,C=y-b,V=x(e.left)+b,O=e.right;else if(r==="right")y=x(this.left),V=e.left,O=x(e.right)-b,k=y+b,C=this.left+p;else if(n==="x"){if(r==="center")y=x((e.top+e.bottom)/2+.5);else if(z(r)){const M=Object.keys(r)[0],R=r[M];y=x(this.chart.scales[M].getPixelForValue(R))}$=e.top,U=e.bottom,v=y+b,D=v+p}else if(n==="y"){if(r==="center")y=x((e.left+e.right)/2);else if(z(r)){const M=Object.keys(r)[0],R=r[M];y=x(this.chart.scales[M].getPixelForValue(R))}k=y-b,C=k-p,V=e.left,O=e.right}const P=T(i.ticks.maxTicksLimit,f),E=Math.max(1,Math.ceil(f/P));for(w=0;w<f;w+=E){const M=this.getContext(w),R=s.setContext(M),B=a.setContext(M),A=R.lineWidth,N=R.color,W=B.dash||[],Y=B.dashOffset,Z=R.tickWidth,J=R.tickColor,se=R.tickBorderDash||[],me=R.tickBorderDashOffset;S=tf(this,w,c),S!==void 0&&(_=ut(o,S,A),d?k=C=V=O=_:v=D=$=U=_,h.push({tx1:k,ty1:v,tx2:C,ty2:D,x1:V,y1:$,x2:O,y2:U,width:A,color:N,borderDash:W,borderDashOffset:Y,tickWidth:Z,tickColor:J,tickBorderDash:se,tickBorderDashOffset:me}))}return this._ticksLength=f,this._borderValue=y,h}_computeLabelItems(e){const n=this.axis,o=this.options,{position:i,ticks:s}=o,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,p=nn(o.grid),h=p+u,g=f?-u:h,m=-ve(this.labelRotation),b=[];let x,y,w,S,_,k,v,C,D,V,$,O,U="middle";if(i==="top")k=this.bottom-g,v=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,v=this._getXAxisLabelAlignment();else if(i==="left"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(i==="right"){const E=this._getYAxisLabelAlignment(p);v=E.textAlign,_=E.x}else if(n==="x"){if(i==="center")k=(e.top+e.bottom)/2+h;else if(z(i)){const E=Object.keys(i)[0],M=i[E];k=this.chart.scales[E].getPixelForValue(M)+h}v=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(e.left+e.right)/2-h;else if(z(i)){const E=Object.keys(i)[0],M=i[E];_=this.chart.scales[E].getPixelForValue(M)}v=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const P=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){w=a[x],S=w.label;const E=s.setContext(this.getContext(x));C=this.getPixelForTick(x)+s.labelOffset,D=this._resolveTickFontOptions(x),V=D.lineHeight,$=q(S)?S.length:1;const M=$/2,R=E.color,B=E.textStrokeColor,A=E.textStrokeWidth;let N=v;r?(_=C,v==="inner"&&(x===y-1?N=this.options.reverse?"left":"right":x===0?N=this.options.reverse?"right":"left":N="center"),i==="top"?d==="near"||m!==0?O=-$*V+V/2:d==="center"?O=-P.highest.height/2-M*V+V:O=-P.highest.height+V/2:d==="near"||m!==0?O=V/2:d==="center"?O=P.highest.height/2-M*V:O=P.highest.height-$*V,f&&(O*=-1),m!==0&&!E.showLabelBackdrop&&(_+=V/2*Math.sin(m))):(k=C,O=(1-$)*V/2);let W;if(E.showLabelBackdrop){const Y=ae(E.backdropPadding),Z=P.heights[x],J=P.widths[x];let se=O-Y.top,me=0-Y.left;switch(U){case"middle":se-=Z/2;break;case"bottom":se-=Z;break}switch(v){case"center":me-=J/2;break;case"right":me-=J;break;case"inner":x===y-1?me-=J:x>0&&(me-=J/2);break}W={left:me,top:se,width:J+Y.width,height:Z+Y.height,color:E.backdropColor}}b.push({label:S,font:D,textOffset:O,options:{rotation:m,color:R,strokeColor:B,strokeWidth:A,textAlign:N,textBaseline:U,translation:[_,k],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-ve(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:o,mirror:i,padding:s}}=this.options,r=this._getLabelSizes(),a=e+s,c=r.widest.width;let d,u;return n==="left"?i?(u=this.right+s,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-a,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?i?(u=this.left+s,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+a,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:o,top:i,width:s,height:r}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,i,s,r),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,o=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,r;const a=(c,d,u)=>{!u.width||!u.color||(o.save(),o.lineWidth=u.width,o.strokeStyle=u.color,o.setLineDash(u.borderDash||[]),o.lineDashOffset=u.borderDashOffset,o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(d.x,d.y),o.stroke(),o.restore())};if(n.display)for(s=0,r=i.length;s<r;++s){const c=i[s];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:o,grid:i}}=this,s=o.setContext(this.getContext()),r=o.display?s.width:0;if(!r)return;const a=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,p;this.isHorizontal()?(d=ut(e,this.left,r)-r/2,u=ut(e,this.right,a)+a/2,f=p=c):(f=ut(e,this.top,r)-r/2,p=ut(e,this.bottom,a)+a/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,i=this._computeLabelArea();i&&Dn(o,i);const s=this.getLabelItems(e);for(const r of s){const a=r.options,c=r.font,d=r.label,u=r.textOffset;ft(o,d,0,u,c,a)}i&&Vn(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:i}}=this;if(!o.display)return;const s=oe(o.font),r=ae(o.padding),a=o.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||z(n)?(c+=r.bottom,q(o.text)&&(c+=s.lineHeight*(o.text.length-1))):c+=r.top;const{titleX:d,titleY:u,maxWidth:f,rotation:p}=lf(this,c,n,a);ft(e,o.text,0,0,s,{color:o.color,maxWidth:f,rotation:p,textAlign:rf(a,n,i),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,o=T(e.grid&&e.grid.z,-1),i=T(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==_t.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:o,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),o=this.axis+"AxisID",i=[];let s,r;for(s=0,r=n.length;s<r;++s){const a=n[s];a[o]===this.id&&(!e||a.type===e)&&i.push(a)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return oe(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Wn{constructor(e,n,o){this.type=e,this.scope=n,this.override=o,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let o;df(n)&&(o=this.register(n));const i=this.items,s=e.id,r=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,af(e,r,o),this.override&&te.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const n=this.items,o=e.id,i=this.scope;o in n&&delete n[o],i&&o in te[i]&&(delete te[i][o],this.override&&delete dt[o])}}function af(t,e,n){const o=Lt(Object.create(null),[n?te.get(n):{},te.get(e),t.defaults]);te.set(e,o),t.defaultRoutes&&cf(e,t.defaultRoutes),t.descriptors&&te.describe(e,t.descriptors)}function cf(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),i=o.pop(),s=[t].concat(o).join("."),r=e[n].split("."),a=r.pop(),c=r.join(".");te.route(s,i,c,a)})}function df(t){return"id"in t&&"defaults"in t}class uf{constructor(){this.controllers=new Wn(Me,"datasets",!0),this.elements=new Wn(Le,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(_t,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,o){[...n].forEach(i=>{const s=o||this._getRegistryForType(i);o||s.isForType(i)||s===this.plugins&&i.id?this._exec(e,s,i):j(i,r=>{const a=o||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,n,o){const i=Eo(e);G(o["before"+i],[],o),n[e](o),G(o["after"+i],[],o)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const o=this._typedRegistries[n];if(o.isForType(e))return o}return this.plugins}_get(e,n,o){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+o+".");return i}}var Re=new uf;class ff{constructor(){this._init=[]}notify(e,n,o,i){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=i?this._descriptors(e).filter(i):this._descriptors(e),r=this._notify(s,e,n,o);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,n,o,i){i=i||{};for(const s of e){const r=s.plugin,a=r[o],c=[n,i,s.options];if(G(a,c,r)===!1&&i.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const o=e&&e.config,i=T(o.options&&o.options.plugins,{}),s=hf(o);return i===!1&&!n?[]:gf(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,i=(s,r)=>s.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(i(n,o),e,"stop"),this._notify(i(o,n),e,"start")}}function hf(t){const e={},n=[],o=Object.keys(Re.plugins.items);for(let s=0;s<o.length;s++)n.push(Re.getPlugin(o[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const r=i[s];n.indexOf(r)===-1&&(n.push(r),e[r.id]=!0)}return{plugins:n,localIds:e}}function pf(t,e){return!e&&t===!1?null:t===!0?{}:t}function gf(t,{plugins:e,localIds:n},o,i){const s=[],r=t.getContext();for(const a of e){const c=a.id,d=pf(o[c],i);d!==null&&s.push({plugin:a,options:mf(t.config,{plugin:a,local:n[c]},d,r)})}return s}function mf(t,{plugin:e,local:n},o,i){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(o,s);return n&&e.defaults&&r.push(e.defaults),t.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zo(t,e){const n=te.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function bf(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function yf(t,e){return t===e?"_index_":"_value_"}function Sr(t){if(t==="x"||t==="y"||t==="r")return t}function _f(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Jo(t,...e){if(Sr(t))return t;for(const n of e){const o=n.axis||_f(n.position)||t.length>1&&Sr(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vr(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function xf(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(o=>o.xAxisID===t||o.yAxisID===t);if(n.length)return vr(t,"x",n[0])||vr(t,"y",n[0])}return{}}function wf(t,e){const n=dt[t.type]||{scales:{}},o=e.scales||{},i=Zo(t.type,e),s=Object.create(null);return Object.keys(o).forEach(r=>{const a=o[r];if(!z(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=Jo(r,a,xf(r,t),te.scales[a.type]),d=yf(c,i),u=n.scales||{};s[r]=Tt(Object.create(null),[{axis:c},a,u[c],u[d]])}),t.data.datasets.forEach(r=>{const a=r.type||t.type,c=r.indexAxis||Zo(a,e),u=(dt[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=bf(f,c),h=r[p+"AxisID"]||p;s[h]=s[h]||Object.create(null),Tt(s[h],[{axis:p},o[h],u[f]])})}),Object.keys(s).forEach(r=>{const a=s[r];Tt(a,[te.scales[a.type],te.scale])}),s}function Mr(t){const e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=wf(t,e)}function Er(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Cf(t){return t=t||{},t.data=Er(t.data),Mr(t),t}const Dr=new Map,Vr=new Set;function jn(t,e){let n=Dr.get(t);return n||(n=e(),Dr.set(t,n),Vr.add(n)),n}const on=(t,e,n)=>{const o=Ke(e,n);o!==void 0&&t.add(o)};class kf{constructor(e){this._config=Cf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Er(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Mr(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return jn(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return jn(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return jn(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return jn(`${o}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const o=this._scopeCache;let i=o.get(e);return(!i||n)&&(i=new Map,o.set(e,i)),i}getOptionScopes(e,n,o){const{options:i,type:s}=this,r=this._cachedScopes(e,o),a=r.get(n);if(a)return a;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>on(c,e,f))),u.forEach(f=>on(c,i,f)),u.forEach(f=>on(c,dt[s]||{},f)),u.forEach(f=>on(c,te,f)),u.forEach(f=>on(c,Po,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Vr.has(n)&&r.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,dt[n]||{},te.datasets[n]||{},{type:n},te,Po]}resolveNamedOptions(e,n,o,i=[""]){const s={$shared:!0},{resolver:r,subPrefixes:a}=Rr(this._resolverCache,e,i);let c=r;if(vf(r,n)){s.$shared=!1,o=Ze(o)?o():o;const d=this.createResolver(e,o,a);c=Dt(r,o,d)}for(const d of n)s[d]=c[d];return s}createResolver(e,n,o=[""],i){const{resolver:s}=Rr(this._resolverCache,e,o);return z(n)?Dt(s,n,void 0,i):s}}function Rr(t,e,n){let o=t.get(e);o||(o=new Map,t.set(e,o));const i=n.join();let s=o.get(i);return s||(s={resolver:Io(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},o.set(i,s)),s}const Sf=t=>z(t)&&Object.getOwnPropertyNames(t).some(e=>Ze(t[e]));function vf(t,e){const{isScriptable:n,isIndexable:o}=Bs(t);for(const i of e){const s=n(i),r=o(i),a=(r||s)&&t[i];if(s&&(Ze(a)||Sf(a))||r&&q(a))return!0}return!1}var Mf="4.4.1";const Ef=["top","bottom","left","right","chartArea"];function Fr(t,e){return t==="top"||t==="bottom"||Ef.indexOf(t)===-1&&e==="x"}function Br(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function $r(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),G(n&&n.onComplete,[t],e)}function Df(t){const e=t.chart,n=e.options.animation;G(n&&n.onProgress,[t],e)}function Pr(t){return zo()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Yn={},Ar=t=>{const e=Pr(t);return Object.values(Yn).filter(n=>n.canvas===e).pop()};function Vf(t,e,n){const o=Object.keys(t);for(const i of o){const s=+i;if(s>=e){const r=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=r)}}}function Rf(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}function Gn(t,e,n){return t.options.clip?t[n]:e[n]}function Ff(t,e){const{xScale:n,yScale:o}=t;return n&&o?{left:Gn(n,e,"left"),right:Gn(n,e,"right"),top:Gn(o,e,"top"),bottom:Gn(o,e,"bottom")}:e}class Te{static register(...e){Re.add(...e),Or()}static unregister(...e){Re.remove(...e),Or()}constructor(e,n){const o=this.config=new kf(n),i=Pr(e),s=Ar(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const r=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||Uu(i)),this.platform.updateConfig(o);const a=this.platform.acquireContext(i,r.aspectRatio),c=a&&a.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Bc(),this.ctx=a,this.canvas=c,this.width=u,this.height=d,this._options=r,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 ff,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qc(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],Yn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ie.listen(this,"complete",$r),Ie.listen(this,"progress",Df),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:i,_aspectRatio:s}=this;return H(e)?n&&s?s:i?o/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Re}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ts(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vs(this.canvas,this.ctx),this}stop(){return Ie.stop(this),this}resize(e,n){Ie.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const o=this.options,i=this.canvas,s=o.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,e,n,s),a=o.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ts(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),G(o.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};j(n,(o,i)=>{o.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,i=Object.keys(o).reduce((r,a)=>(r[a]=!1,r),{});let s=[];n&&(s=s.concat(Object.keys(n).map(r=>{const a=n[r],c=Jo(r,a),d=c==="r",u=c==="x";return{options:a,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),j(s,r=>{const a=r.options,c=a.id,d=Jo(c,a),u=T(a.type,r.dtype);(a.position===void 0||Fr(a.position,d)!==Fr(r.dposition))&&(a.position=r.dposition),i[c]=!0;let f=null;if(c in o&&o[c].type===u)f=o[c];else{const p=Re.getScale(u);f=new p({id:c,type:u,ctx:this.ctx,chart:this}),o[f.id]=f}f.init(a,e)}),j(i,(r,a)=>{r||delete o[a]}),j(o,r=>{ce.configure(this,r,r.options),ce.addBox(this,r)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,o=e.length;if(e.sort((i,s)=>i.index-s.index),o>n){for(let i=n;i<o;++i)this._destroyDatasetMeta(i);e.splice(n,o-n)}this._sortedMetasets=e.slice(0).sort(Br("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((o,i)=>{n.filter(s=>s===o._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let o,i;for(this._removeUnreferencedMetasets(),o=0,i=n.length;o<i;o++){const s=n[o];let r=this.getDatasetMeta(o);const a=s.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(o),r=this.getDatasetMeta(o)),r.type=a,r.indexAxis=s.indexAxis||Zo(a,this.options),r.order=s.order||0,r.index=o,r.label=""+s.label,r.visible=this.isDatasetVisible(o),r.controller)r.controller.updateIndex(o),r.controller.linkScales();else{const c=Re.getController(a),{datasetElementType:d,dataElementType:u}=te.datasets[a];Object.assign(c,{dataElementType:Re.getElement(u),datasetElementType:d&&Re.getElement(d)}),r.controller=new c(this,o),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){j(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const o=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!o.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),p=!i&&s.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=o.layout.autoPadding?r:0,this._updateLayout(r),i||j(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Br("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){j(this.scales,e=>{ce.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!us(n,o)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:o,start:i,count:s}of n){const r=o==="_removeElements"?-s:s;Vf(e,i,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=s=>new Set(e.filter(r=>r[0]===s).map((r,a)=>a+","+r.splice(1).join(","))),i=o(0);for(let s=1;s<n;s++)if(!us(i,o(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ce.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],j(this.boxes,i=>{o&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,o=this.data.datasets.length;n<o;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,o=this.data.datasets.length;n<o;++n)this._updateDataset(n,Ze(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const o=this.getDatasetMeta(e),i={meta:o,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(o.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ie.has(this)?this.attached&&!Ie.running(this)&&Ie.start(this):(this.draw(),$r({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:o,height:i}=this._resizeBeforeDraw;this._resize(o,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,o=[];let i,s;for(i=0,s=n.length;i<s;++i){const r=n[i];(!e||r.visible)&&o.push(r)}return o}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,o=e._clip,i=!o.disabled,s=Ff(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Dn(n,{left:o.left===!1?0:s.left-o.left,right:o.right===!1?this.width:s.right+o.right,top:o.top===!1?0:s.top-o.top,bottom:o.bottom===!1?this.height:s.bottom+o.bottom}),e.controller.draw(),i&&Vn(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return Ne(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,i){const s=Mu.modes[n];return typeof s=="function"?s(this,e,o,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],o=this._metasets;let i=o.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},o.push(i)),i}getContext(){return this.$context||(this.$context=Qe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const o=this.getDatasetMeta(e);return typeof o.hidden=="boolean"?!o.hidden:!n.hidden}setDatasetVisibility(e,n){const o=this.getDatasetMeta(e);o.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,o){const i=o?"show":"hide",s=this.getDatasetMeta(e),r=s.controller._resolveAnimations(void 0,i);zt(n)?(s.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),r.update(s,{visible:o}),this.update(a=>a.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Ie.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Vs(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Yn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,o=(s,r)=>{n.addEventListener(this,s,r),e[s]=r},i=(s,r,a)=>{s.offsetX=r,s.offsetY=a,this._eventHandler(s)};j(this.options.events,s=>o(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},i=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),o("resize",s),o("detach",r)};r=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),o("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){j(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},j(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,o){const i=o?"set":"remove";let s,r,a,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){r=e[a];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:s,index:r})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[r],index:r}});!Cn(o,n)&&(this._active=o,this._lastEvent=null,this._updateHoverStyles(o,n))}notifyPlugins(e,n,o){return this._plugins.notify(this,e,n,o)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,o){const i=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),r=s(n,e),a=o?e:s(e,n);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const o={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",o,i)===!1)return;const s=this._handleEvent(e,n,o.inChartArea);return o.cancelable=!1,this.notifyPlugins("afterEvent",o,i),(s||o.changed)&&this.render(),this}_handleEvent(e,n,o){const{_active:i=[],options:s}=this,r=n,a=this._getActiveElements(e,i,o,r),c=Ic(e),d=Rf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,G(s.onHover,[e,a,this],this),c&&G(s.onClick,[e,a,this],this));const u=!Cn(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=d,u}_getActiveElements(e,n,o,i){if(e.type==="mouseout")return[];if(!o)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,i)}}F(Te,"defaults",te),F(Te,"instances",Yn),F(Te,"overrides",dt),F(Te,"registry",Re),F(Te,"version",Mf),F(Te,"getChart",Ar);function Or(){return j(Te.instances,t=>t._plugins.invalidate())}function Bf(t,e,n){const{startAngle:o,pixelMargin:i,x:s,y:r,outerRadius:a,innerRadius:c}=e;let d=i/a;t.beginPath(),t.arc(s,r,a,o-d,n+d),c>i?(d=i/c,t.arc(s,r,c,n+d,o-d,!0)):t.arc(s,r,i,n+ne,o-ne),t.closePath(),t.clip()}function $f(t){return No(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Pf(t,e,n,o){const i=$f(t.options.borderRadius),s=(n-e)/2,r=Math.min(s,o*e/2),a=c=>{const d=(n-Math.min(s,c))*o/2;return ie(c,0,Math.min(s,d))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:ie(i.innerStart,0,r),innerEnd:ie(i.innerEnd,0,r)}}function Ft(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function Un(t,e,n,o,i,s){const{x:r,y:a,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+o+n-d,0),p=u>0?u+o+n+d:0;let h=0;const g=i-c;if(o){const E=u>0?u-o:0,M=f>0?f-o:0,R=(E+M)/2,B=R!==0?g*R/(R+o):g;h=(g-B)/2}const m=Math.max(.001,g*f-n/X)/f,b=(g-m)/2,x=c+b+h,y=i-b-h,{outerStart:w,outerEnd:S,innerStart:_,innerEnd:k}=Pf(e,p,f,y-x),v=f-w,C=f-S,D=x+w/v,V=y-S/C,$=p+_,O=p+k,U=x+_/$,P=y-k/O;if(t.beginPath(),s){const E=(D+V)/2;if(t.arc(r,a,f,D,E),t.arc(r,a,f,E,V),S>0){const A=Ft(C,V,r,a);t.arc(A.x,A.y,S,V,y+ne)}const M=Ft(O,y,r,a);if(t.lineTo(M.x,M.y),k>0){const A=Ft(O,P,r,a);t.arc(A.x,A.y,k,y+ne,P+Math.PI)}const R=(y-k/p+(x+_/p))/2;if(t.arc(r,a,p,y-k/p,R,!0),t.arc(r,a,p,R,x+_/p,!0),_>0){const A=Ft($,U,r,a);t.arc(A.x,A.y,_,U+Math.PI,x-ne)}const B=Ft(v,x,r,a);if(t.lineTo(B.x,B.y),w>0){const A=Ft(v,D,r,a);t.arc(A.x,A.y,w,x-ne,D)}}else{t.moveTo(r,a);const E=Math.cos(D)*f+r,M=Math.sin(D)*f+a;t.lineTo(E,M);const R=Math.cos(V)*f+r,B=Math.sin(V)*f+a;t.lineTo(R,B)}t.closePath()}function Af(t,e,n,o,i){const{fullCircles:s,startAngle:r,circumference:a}=e;let c=e.endAngle;if(s){Un(t,e,n,o,c,i);for(let d=0;d<s;++d)t.fill();isNaN(a)||(c=r+(a%K||K))}return Un(t,e,n,o,c,i),t.fill(),c}function Of(t,e,n,o,i){const{fullCircles:s,startAngle:r,circumference:a,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:p}=c,h=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=p,h?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let g=e.endAngle;if(s){Un(t,e,n,o,g,i);for(let m=0;m<s;++m)t.stroke();isNaN(a)||(g=r+(a%K||K))}h&&Bf(t,e,g),s||(Un(t,e,n,o,g,i),t.stroke())}class sn extends Le{constructor(n){super();F(this,"circumference");F(this,"endAngle");F(this,"fullCircles");F(this,"innerRadius");F(this,"outerRadius");F(this,"pixelMargin");F(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,o,i){const s=this.getProps(["x","y"],i),{angle:r,distance:a}=ms(s,{x:n,y:o}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=T(p,d-c)>=K||Wt(r,c,d),b=Ae(a,u+h,f+h);return m&&b}getCenterPoint(n){const{x:o,y:i,startAngle:s,endAngle:r,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,f=(s+r)/2,p=(a+c+u+d)/2;return{x:o+Math.cos(f)*p,y:i+Math.sin(f)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:i}=this,s=(o.offset||0)/4,r=(o.spacing||0)/2,a=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=i>K?Math.floor(i/K):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(X,i||0)),u=s*d;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,Af(n,this,u,r,a),Of(n,this,u,r,a),n.restore()}}F(sn,"id","arc"),F(sn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),F(sn,"defaultRoutes",{backgroundColor:"backgroundColor"}),F(sn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Nr(t,e,n=e){t.lineCap=T(n.borderCapStyle,e.borderCapStyle),t.setLineDash(T(n.borderDash,e.borderDash)),t.lineDashOffset=T(n.borderDashOffset,e.borderDashOffset),t.lineJoin=T(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=T(n.borderWidth,e.borderWidth),t.strokeStyle=T(n.borderColor,e.borderColor)}function Nf(t,e,n){t.lineTo(n.x,n.y)}function If(t){return t.stepped?rd:t.tension||t.cubicInterpolationMode==="monotone"?ld:Nf}function Ir(t,e,n={}){const o=t.length,{start:i=0,end:s=o-1}=n,{start:r,end:a}=e,c=Math.max(i,r),d=Math.min(s,a),u=i<r&&s<r||i>a&&s>a;return{count:o,start:c,loop:e.loop,ilen:d<c&&!u?o+d-c:d-c}}function Lf(t,e,n,o){const{points:i,options:s}=e,{count:r,start:a,loop:c,ilen:d}=Ir(i,n,o),u=If(s);let{move:f=!0,reverse:p}=o||{},h,g,m;for(h=0;h<=d;++h)g=i[(a+(p?d-h:h))%r],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,m,g,p,s.stepped),m=g);return c&&(g=i[(a+(p?d:0))%r],u(t,m,g,p,s.stepped)),!!c}function Tf(t,e,n,o){const i=e.points,{count:s,start:r,ilen:a}=Ir(i,n,o),{move:c=!0,reverse:d}=o||{};let u=0,f=0,p,h,g,m,b,x;const y=S=>(r+(d?a-S:S))%s,w=()=>{m!==b&&(t.lineTo(u,b),t.lineTo(u,m),t.lineTo(u,x))};for(c&&(h=i[y(0)],t.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=i[y(p)],h.skip)continue;const S=h.x,_=h.y,k=S|0;k===g?(_<m?m=_:_>b&&(b=_),u=(f*u+S)/++f):(w(),t.lineTo(S,_),g=k,f=0,m=b=_),x=_}w()}function Qo(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Tf:Lf}function zf(t){return t.stepped?Ld:t.tension||t.cubicInterpolationMode==="monotone"?Td:mt}function Hf(t,e,n,o){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,o)&&i.closePath()),Nr(t,e.options),t.stroke(i)}function Wf(t,e,n,o){const{segments:i,options:s}=e,r=Qo(e);for(const a of i)Nr(t,s,a.style),t.beginPath(),r(t,e,a,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const jf=typeof Path2D=="function";function Yf(t,e,n,o){jf&&!e.options.segment?Hf(t,e,n,o):Wf(t,e,n,o)}class et extends Le{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const o=this.options;if((o.tension||o.cubicInterpolationMode==="monotone")&&!o.stepped&&!this._pointsUpdated){const i=o.spanGaps?this._loop:this._fullLoop;Fd(this._points,o,e,i,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Gd(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,o=e.length;return o&&n[e[o-1].end]}interpolate(e,n){const o=this.options,i=e[n],s=this.points,r=Us(this,{property:n,start:i,end:i});if(!r.length)return;const a=[],c=zf(o);let d,u;for(d=0,u=r.length;d<u;++d){const{start:f,end:p}=r[d],h=s[f],g=s[p];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),b=c(h,g,m,o.stepped);b[n]=e[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(e,n,o){return Qo(this)(e,this,n,o)}path(e,n,o){const i=this.segments,s=Qo(this);let r=this._loop;n=n||0,o=o||this.points.length-n;for(const a of i)r&=s(e,this,a,{start:n,end:n+o-1});return!!r}draw(e,n,o,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),Yf(e,this,o,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}F(et,"id","line"),F(et,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(et,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(et,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Lr(t,e,n,o){const i=t.options,{[n]:s}=t.getProps([n],o);return Math.abs(e-s)<i.radius+i.hitRadius}class qn extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(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,o,i){const s=this.options,{x:r,y:a}=this.getProps(["x","y"],i);return Math.pow(n-r,2)+Math.pow(o-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,o){return Lr(this,n,"x",o)}inYRange(n,o){return Lr(this,n,"y",o)}getCenterPoint(n){const{x:o,y:i}=this.getProps(["x","y"],n);return{x:o,y:i}}size(n){n=n||this.options||{};let o=n.radius||0;o=Math.max(o,o&&n.hoverRadius||0);const i=o&&n.borderWidth||0;return(o+i)*2}draw(n,o){const i=this.options;this.skip||i.radius<.1||!Ne(this,o,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Oo(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}F(qn,"id","point"),F(qn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(qn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Tr(t,e){const{x:n,y:o,base:i,width:s,height:r}=t.getProps(["x","y","base","width","height"],e);let a,c,d,u,f;return t.horizontal?(f=r/2,a=Math.min(n,i),c=Math.max(n,i),d=o-f,u=o+f):(f=s/2,a=n-f,c=n+f,d=Math.min(o,i),u=Math.max(o,i)),{left:a,top:d,right:c,bottom:u}}function tt(t,e,n,o){return t?0:ie(e,n,o)}function Gf(t,e,n){const o=t.options.borderWidth,i=t.borderSkipped,s=Fs(o);return{t:tt(i.top,s.top,0,n),r:tt(i.right,s.right,0,e),b:tt(i.bottom,s.bottom,0,n),l:tt(i.left,s.left,0,e)}}function Uf(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=ht(i),r=Math.min(e,n),a=t.borderSkipped,c=o||z(i);return{topLeft:tt(!c||a.top||a.left,s.topLeft,0,r),topRight:tt(!c||a.top||a.right,s.topRight,0,r),bottomLeft:tt(!c||a.bottom||a.left,s.bottomLeft,0,r),bottomRight:tt(!c||a.bottom||a.right,s.bottomRight,0,r)}}function qf(t){const e=Tr(t),n=e.right-e.left,o=e.bottom-e.top,i=Gf(t,n/2,o/2),s=Uf(t,n/2,o/2);return{outer:{x:e.left,y:e.top,w:n,h:o,radius:s},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:o-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function ei(t,e,n,o){const i=e===null,s=n===null,a=t&&!(i&&s)&&Tr(t,o);return a&&(i||Ae(e,a.left,a.right))&&(s||Ae(n,a.top,a.bottom))}function Xf(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Kf(t,e){t.rect(e.x,e.y,e.w,e.h)}function ti(t,e,n={}){const o=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-o,r=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+o,y:t.y+i,w:t.w+s,h:t.h+r,radius:t.radius}}class Xn extends Le{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:o,backgroundColor:i}}=this,{inner:s,outer:r}=qf(this),a=Xf(r.radius)?Ut:Kf;e.save(),(r.w!==s.w||r.h!==s.h)&&(e.beginPath(),a(e,ti(r,n,s)),e.clip(),a(e,ti(s,-n,r)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),a(e,ti(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,o){return ei(this,e,n,o)}inXRange(e,n){return ei(this,e,null,n)}inYRange(e,n){return ei(this,null,e,n)}getCenterPoint(e){const{x:n,y:o,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+i)/2:n,y:s?o:(o+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}F(Xn,"id","bar"),F(Xn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),F(Xn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Zf=Object.freeze({__proto__:null,ArcElement:sn,BarElement:Xn,LineElement:et,PointElement:qn});const ni=["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)"],zr=ni.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Hr(t){return ni[t%ni.length]}function Wr(t){return zr[t%zr.length]}function Jf(t,e){return t.borderColor=Hr(e),t.backgroundColor=Wr(e),++e}function Qf(t,e){return t.backgroundColor=t.data.map(()=>Hr(e++)),e}function eh(t,e){return t.backgroundColor=t.data.map(()=>Wr(e++)),e}function th(t){let e=0;return(n,o)=>{const i=t.getDatasetMeta(o).controller;i instanceof bt?e=Qf(n,e):i instanceof Kt?e=eh(n,e):i&&(e=Jf(n,e))}}function jr(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function nh(t){return t&&(t.borderColor||t.backgroundColor)}var oh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:o},options:i}=t.config,{elements:s}=i;if(!n.forceOverride&&(jr(o)||nh(i)||s&&jr(s)))return;const r=th(t);o.forEach(r)}};function ih(t,e,n,o,i){const s=i.samples||o;if(s>=n)return t.slice(e,e+n);const r=[],a=(n-2)/(s-2);let c=0;const d=e+n-1;let u=e,f,p,h,g,m;for(r[c++]=t[u],f=0;f<s-2;f++){let b=0,x=0,y;const w=Math.floor((f+1)*a)+1+e,S=Math.min(Math.floor((f+2)*a)+1,n)+e,_=S-w;for(y=w;y<S;y++)b+=t[y].x,x+=t[y].y;b/=_,x/=_;const k=Math.floor(f*a)+1+e,v=Math.min(Math.floor((f+1)*a)+1,n)+e,{x:C,y:D}=t[u];for(h=g=-1,y=k;y<v;y++)g=.5*Math.abs((C-b)*(t[y].y-D)-(C-t[y].x)*(x-D)),g>h&&(h=g,p=t[y],m=y);r[c++]=p,u=m}return r[c++]=t[d],r}function sh(t,e,n,o){let i=0,s=0,r,a,c,d,u,f,p,h,g,m;const b=[],x=e+n-1,y=t[e].x,S=t[x].x-y;for(r=e;r<e+n;++r){a=t[r],c=(a.x-y)/S*o,d=a.y;const _=c|0;if(_===u)d<g?(g=d,f=r):d>m&&(m=d,p=r),i=(s*i+a.x)/++s;else{const k=r-1;if(!H(f)&&!H(p)){const v=Math.min(f,p),C=Math.max(f,p);v!==h&&v!==k&&b.push({...t[v],x:i}),C!==h&&C!==k&&b.push({...t[C],x:i})}r>0&&k!==h&&b.push(t[k]),b.push(a),u=_,s=0,g=m=d,f=p=h=r}}return b}function Yr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Gr(t){t.data.datasets.forEach(e=>{Yr(e)})}function rh(t,e){const n=e.length;let o=0,i;const{iScale:s}=t,{min:r,max:a,minDefined:c,maxDefined:d}=s.getUserBounds();return c&&(o=ie(Oe(e,s.axis,r).lo,0,n-1)),d?i=ie(Oe(e,s.axis,a).hi+1,o,n)-o:i=n-o,{start:o,count:i}}var lh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){Gr(t);return}const o=t.width;t.data.datasets.forEach((i,s)=>{const{_data:r,indexAxis:a}=i,c=t.getDatasetMeta(s),d=r||i.data;if(qt([a,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:f,count:p}=rh(c,d);const h=n.threshold||4*o;if(p<=h){Yr(i);return}H(r)&&(i._data=d,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(n.algorithm){case"lttb":g=ih(d,f,p,o,n);break;case"min-max":g=sh(d,f,p,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=g})},destroy(t){Gr(t)}};function ah(t,e,n){const o=t.segments,i=t.points,s=e.points,r=[];for(const a of o){let{start:c,end:d}=a;d=ii(c,d,i);const u=oi(n,i[c],i[d],a.loop);if(!e.segments){r.push({source:a,target:u,start:i[c],end:i[d]});continue}const f=Us(e,u);for(const p of f){const h=oi(n,s[p.start],s[p.end],p.loop),g=Gs(a,i,h);for(const m of g)r.push({source:m,target:p,start:{[n]:Ur(u,h,"start",Math.max)},end:{[n]:Ur(u,h,"end",Math.min)}})}}return r}function oi(t,e,n,o){if(o)return;let i=e[t],s=n[t];return t==="angle"&&(i=_e(i),s=_e(s)),{property:t,start:i,end:s}}function ch(t,e){const{x:n=null,y:o=null}=t||{},i=e.points,s=[];return e.segments.forEach(({start:r,end:a})=>{a=ii(r,a,i);const c=i[r],d=i[a];o!==null?(s.push({x:c.x,y:o}),s.push({x:d.x,y:o})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function ii(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function Ur(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function qr(t,e){let n=[],o=!1;return q(t)?(o=!0,n=t):n=ch(t,e),n.length?new et({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Xr(t){return t&&t.fill!==!1}function dh(t,e,n){let i=t[e].fill;const s=[e];let r;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!ee(i))return i;if(r=t[i],!r)return!1;if(r.visible)return i;s.push(i),i=r.fill}return!1}function uh(t,e,n){const o=gh(t);if(z(o))return isNaN(o.value)?!1:o;let i=parseFloat(o);return ee(i)&&Math.floor(i)===i?fh(o[0],e,i,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function fh(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function hh(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:z(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function ph(t,e,n){let o;return t==="start"?o=n:t==="end"?o=e.options.reverse?e.min:e.max:z(t)?o=t.value:o=e.getBaseValue(),o}function gh(t){const e=t.options,n=e.fill;let o=T(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function mh(t){const{scale:e,index:n,line:o}=t,i=[],s=o.segments,r=o.points,a=bh(e,n);a.push(qr({x:null,y:e.bottom},o));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)yh(i,r[u],a)}return new et({points:i,options:{}})}function bh(t,e){const n=[],o=t.getMatchingVisibleMetas("line");for(let i=0;i<o.length;i++){const s=o[i];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function yh(t,e,n){const o=[];for(let i=0;i<n.length;i++){const s=n[i],{first:r,last:a,point:c}=_h(s,e,"x");if(!(!c||r&&a)){if(r)o.unshift(c);else if(t.push(c),!a)break}}t.push(...o)}function _h(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const i=o[n],s=t.segments,r=t.points;let a=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=r[u.start][n],p=r[u.end][n];if(Ae(i,f,p)){a=i===f,c=i===p;break}}return{first:a,last:c,point:o}}class Kr{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:i,y:s,radius:r}=this;return n=n||{start:0,end:K},e.arc(i,s,r,n.end,n.start,!0),!o.bounds}interpolate(e){const{x:n,y:o,radius:i}=this,s=e.angle;return{x:n+Math.cos(s)*i,y:o+Math.sin(s)*i,angle:s}}}function xh(t){const{chart:e,fill:n,line:o}=t;if(ee(n))return wh(e,n);if(n==="stack")return mh(t);if(n==="shape")return!0;const i=Ch(t);return i instanceof Kr?i:qr(i,o)}function wh(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function Ch(t){return(t.scale||{}).getPointPositionForValue?Sh(t):kh(t)}function kh(t){const{scale:e={},fill:n}=t,o=hh(n,e);if(ee(o)){const i=e.isHorizontal();return{x:i?o:null,y:i?null:o}}return null}function Sh(t){const{scale:e,fill:n}=t,o=e.options,i=e.getLabels().length,s=o.reverse?e.max:e.min,r=ph(n,e,s),a=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new Kr({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(r)})}for(let c=0;c<i;++c)a.push(e.getPointPositionForValue(c,r));return a}function si(t,e,n){const o=xh(e),{line:i,scale:s,axis:r}=e,a=i.options,c=a.fill,d=a.backgroundColor,{above:u=d,below:f=d}=c||{};o&&i.points.length&&(Dn(t,n),vh(t,{line:i,target:o,above:u,below:f,area:n,scale:s,axis:r}),Vn(t))}function vh(t,e){const{line:n,target:o,above:i,below:s,area:r,scale:a}=e,c=n._loop?"angle":e.axis;t.save(),c==="x"&&s!==i&&(Zr(t,o,r.top),Jr(t,{line:n,target:o,color:i,scale:a,property:c}),t.restore(),t.save(),Zr(t,o,r.bottom)),Jr(t,{line:n,target:o,color:s,scale:a,property:c}),t.restore()}function Zr(t,e,n){const{segments:o,points:i}=e;let s=!0,r=!1;t.beginPath();for(const a of o){const{start:c,end:d}=a,u=i[c],f=i[ii(c,d,i)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),r=!!e.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Jr(t,e){const{line:n,target:o,property:i,color:s,scale:r}=e,a=ah(n,o,i);for(const{source:c,target:d,start:u,end:f}of a){const{style:{backgroundColor:p=s}={}}=c,h=o!==!0;t.save(),t.fillStyle=p,Mh(t,r,h&&oi(i,u,f)),t.beginPath();const g=!!n.pathSegment(t,c);let m;if(h){g?t.closePath():Qr(t,o,f,i);const b=!!o.pathSegment(t,d,{move:g,reverse:!0});m=g&&b,m||Qr(t,o,u,i)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Mh(t,e,n){const{top:o,bottom:i}=e.chart.chartArea,{property:s,start:r,end:a}=n||{};s==="x"&&(t.beginPath(),t.rect(r,o,a-r,i-o),t.clip())}function Qr(t,e,n,o){const i=e.interpolate(n,o);i&&t.lineTo(i.x,i.y)}var Eh={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,i=[];let s,r,a,c;for(r=0;r<o;++r)s=t.getDatasetMeta(r),a=s.dataset,c=null,a&&a.options&&a instanceof et&&(c={visible:t.isDatasetVisible(r),index:r,fill:uh(a,r,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=c,i.push(c);for(r=0;r<o;++r)c=i[r],!(!c||c.fill===!1)&&(c.fill=dh(i,r,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",i=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;a&&(a.line.updateControlPoints(s,a.axis),o&&a.fill&&si(t.ctx,a,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const o=t.getSortedVisibleDatasetMetas();for(let i=o.length-1;i>=0;--i){const s=o[i].$filler;Xr(s)&&si(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Xr(o)||n.drawTime!=="beforeDatasetDraw"||si(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const el=(t,e)=>{let{boxHeight:n=e,boxWidth:o=e}=t;return t.usePointStyle&&(n=Math.min(n,e),o=t.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:n,itemHeight:Math.max(e,n)}},Dh=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class tl extends Le{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,o){this.maxWidth=e,this.maxHeight=n,this._margins=o,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 e=this.options.labels||{};let n=G(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(o=>e.filter(o,this.chart.data))),e.sort&&(n=n.sort((o,i)=>e.sort(o,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const o=e.labels,i=oe(o.font),s=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=el(o,s);let d,u;n.font=i.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(r,s,a,c)+10):(u=this.maxHeight,d=this._fitCols(r,i,a,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,i){const{ctx:s,maxWidth:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=i+a;let f=e;s.textAlign="left",s.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((g,m)=>{const b=o+n/2+s.measureText(g.text).width;(m===0||d[d.length-1]+b+2*a>r)&&(f+=u,d[d.length-(m>0?0:1)]=0,h+=u,p++),c[m]={left:0,top:h,row:p,width:b,height:i},d[d.length-1]+=b+a}),f}_fitCols(e,n,o,i){const{ctx:s,maxHeight:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=r-e;let f=a,p=0,h=0,g=0,m=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:y,itemHeight:w}=Vh(o,n,s,b,i);x>0&&h+w+2*a>u&&(f+=p+a,d.push({width:p,height:h}),g+=p+a,m++,p=h=0),c[x]={left:g,top:h,col:m,width:y,height:w},p=Math.max(p,y),h+=w+a}),f+=p,d.push({width:p,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:i},rtl:s}}=this,r=Rt(s,this.left,this.width);if(this.isHorizontal()){let a=0,c=le(o,this.left+i,this.right-this.lineWidths[a]);for(const d of n)a!==d.row&&(a=d.row,c=le(o,this.left+i,this.right-this.lineWidths[a])),d.top+=this.top+e+i,d.left=r.leftForLtr(r.x(c),d.width),c+=d.width+i}else{let a=0,c=le(o,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const d of n)d.col!==a&&(a=d.col,c=le(o,this.top+e+i,this.bottom-this.columnSizes[a].height)),d.top=c,d.left+=this.left+i,d.left=r.leftForLtr(r.x(d.left),d.width),c+=d.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Dn(e,this),this._draw(),Vn(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:i}=this,{align:s,labels:r}=e,a=te.color,c=Rt(e.rtl,this.left,this.width),d=oe(r.font),{padding:u}=r,f=d.size,p=f/2;let h;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=el(r,f),x=function(k,v,C){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const D=T(C.lineWidth,1);if(i.fillStyle=T(C.fillStyle,a),i.lineCap=T(C.lineCap,"butt"),i.lineDashOffset=T(C.lineDashOffset,0),i.lineJoin=T(C.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=T(C.strokeStyle,a),i.setLineDash(T(C.lineDash,[])),r.usePointStyle){const V={radius:m*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:D},$=c.xPlus(k,g/2),O=v+p;Rs(i,V,$,O,r.pointStyleWidth&&g)}else{const V=v+Math.max((f-m)/2,0),$=c.leftForLtr(k,g),O=ht(C.borderRadius);i.beginPath(),Object.values(O).some(U=>U!==0)?Ut(i,{x:$,y:V,w:g,h:m,radius:O}):i.rect($,V,g,m),i.fill(),D!==0&&i.stroke()}i.restore()},y=function(k,v,C){ft(i,C.text,k,v+b/2,d,{strikethrough:C.hidden,textAlign:c.textAlign(C.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?h={x:le(s,this.left+u,this.right-o[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:le(s,this.top+S+u,this.bottom-n[0].height),line:0},Hs(this.ctx,e.textDirection);const _=b+u;this.legendItems.forEach((k,v)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const C=i.measureText(k.text).width,D=c.textAlign(k.textAlign||(k.textAlign=r.textAlign)),V=g+p+C;let $=h.x,O=h.y;c.setWidth(this.width),w?v>0&&$+V+u>this.right&&(O=h.y+=_,h.line++,$=h.x=le(s,this.left+u,this.right-o[h.line])):v>0&&O+_>this.bottom&&($=h.x=$+n[h.line].width+u,h.line++,O=h.y=le(s,this.top+S+u,this.bottom-n[h.line].height));const U=c.x($);if(x(U,O,k),$=Xc(D,$+g+p,w?$+V:this.right,e.rtl),y(c.x($),O,k),w)h.x+=V+u;else if(typeof k.text!="string"){const P=d.lineHeight;h.y+=nl(k,P)+u}else h.y+=_}),Ws(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=oe(n.font),i=ae(n.padding);if(!n.display)return;const s=Rt(e.rtl,this.left,this.width),r=this.ctx,a=n.position,c=o.size/2,d=i.top+c;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+d,f=le(e.align,f,this.right-p);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);u=d+le(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}const h=le(a,f,f+p);r.textAlign=s.textAlign(Fo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=o.string,ft(r,n.text,h,u,o)}_computeTitleHeight(){const e=this.options.title,n=oe(e.font),o=ae(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,i,s;if(Ae(e,this.left,this.right)&&Ae(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(i=s[o],Ae(e,i.left,i.left+i.width)&&Ae(n,i.top,i.top+i.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!Bh(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=Dh(i,o);i&&!s&&G(n.onLeave,[e,i,this],this),this._hoveredItem=o,o&&!s&&G(n.onHover,[e,o,this],this)}else o&&G(n.onClick,[e,o,this],this)}}function Vh(t,e,n,o,i){const s=Rh(o,t,e,n),r=Fh(i,o,e.lineHeight);return{itemWidth:s,itemHeight:r}}function Rh(t,e,n,o){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,r)=>s.length>r.length?s:r)),e+n.size/2+o.measureText(i).width}function Fh(t,e,n){let o=t;return typeof e.text!="string"&&(o=nl(e,n)),o}function nl(t,e){const n=t.text?t.text.length:0;return e*n}function Bh(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var $h={id:"legend",_element:tl,start(t,e,n){const o=t.legend=new tl({ctx:t.ctx,options:n,chart:t});ce.configure(t,o,n),ce.addBox(t,o)},stop(t){ce.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;ce.configure(t,o,n),o.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const o=e.datasetIndex,i=n.chart;i.isDatasetVisible(o)?(i.hide(o),e.hidden=!0):(i.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:o,textAlign:i,color:s,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=ae(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:o||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:r&&(a||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ri extends Le{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const o=this.options;if(this.left=0,this.top=0,!o.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=q(o.text)?o.text.length:1;this._padding=ae(o.padding);const s=i*oe(o.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:o,bottom:i,right:s,options:r}=this,a=r.align;let c=0,d,u,f;return this.isHorizontal()?(u=le(a,o,s),f=n+e,d=s-o):(r.position==="left"?(u=o+e,f=le(a,i,n),c=X*-.5):(u=s-e,f=le(a,n,i),c=X*.5),d=i-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=oe(n.font),s=o.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:c,rotation:d}=this._drawArgs(s);ft(e,n.text,0,0,o,{color:n.color,maxWidth:c,rotation:d,textAlign:Fo(n.align),textBaseline:"middle",translation:[r,a]})}}function Ph(t,e){const n=new ri({ctx:t.ctx,options:e,chart:t});ce.configure(t,n,e),ce.addBox(t,n),t.titleBlock=n}var Ah={id:"title",_element:ri,start(t,e,n){Ph(t,n)},stop(t){const e=t.titleBlock;ce.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;ce.configure(t,o,n),o.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 Kn=new WeakMap;var Oh={id:"subtitle",start(t,e,n){const o=new ri({ctx:t.ctx,options:n,chart:t});ce.configure(t,o,n),ce.addBox(t,o),Kn.set(t,o)},stop(t){ce.removeBox(t,Kn.get(t)),Kn.delete(t)},beforeUpdate(t,e,n){const o=Kn.get(t);ce.configure(t,o,n),o.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 rn={average(t){if(!t.length)return!1;let e,n,o=0,i=0,s=0;for(e=0,n=t.length;e<n;++e){const r=t[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();o+=a.x,i+=a.y,++s}}return{x:o/s,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,i=Number.POSITIVE_INFINITY,s,r,a;for(s=0,r=t.length;s<r;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Vo(e,d);u<i&&(i=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,o=c.y}return{x:n,y:o}}};function Fe(t,e){return e&&(q(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ze(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
24
+ `)>-1?t.split(`
25
+ `):t}function Nh(t,e){const{element:n,datasetIndex:o,index:i}=e,s=t.getDatasetMeta(o).controller,{label:r,value:a}=s.getLabelAndValue(i);return{chart:t,label:r,parsed:s.getParsed(i),raw:t.data.datasets[o].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:o,element:n}}function ol(t,e){const n=t.chart.ctx,{body:o,footer:i,title:s}=t,{boxWidth:r,boxHeight:a}=e,c=oe(e.bodyFont),d=oe(e.titleFont),u=oe(e.footerFont),f=s.length,p=i.length,h=o.length,g=ae(e.padding);let m=g.height,b=0,x=o.reduce((S,_)=>S+_.before.length+_.lines.length+_.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),x){const S=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=h*S+(x-h)*c.lineHeight+(x-1)*e.bodySpacing}p&&(m+=e.footerMarginTop+p*u.lineHeight+(p-1)*e.footerSpacing);let y=0;const w=function(S){b=Math.max(b,n.measureText(S).width+y)};return n.save(),n.font=d.string,j(t.title,w),n.font=c.string,j(t.beforeBody.concat(t.afterBody),w),y=e.displayColors?r+2+e.boxPadding:0,j(o,S=>{j(S.before,w),j(S.lines,w),j(S.after,w)}),y=0,n.font=u.string,j(t.footer,w),n.restore(),b+=g.width,{width:b,height:m}}function Ih(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function Lh(t,e,n,o){const{x:i,width:s}=o,r=n.caretSize+n.caretPadding;if(t==="left"&&i+s+r>e.width||t==="right"&&i-s-r<0)return!0}function Th(t,e,n,o){const{x:i,width:s}=n,{width:r,chartArea:{left:a,right:c}}=t;let d="center";return o==="center"?d=i<=(a+c)/2?"left":"right":i<=s/2?d="left":i>=r-s/2&&(d="right"),Lh(d,t,e,n)&&(d="center"),d}function il(t,e,n){const o=n.yAlign||e.yAlign||Ih(t,n);return{xAlign:n.xAlign||e.xAlign||Th(t,e,n,o),yAlign:o}}function zh(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function Hh(t,e,n){let{y:o,height:i}=t;return e==="top"?o+=n:e==="bottom"?o-=i+n:o-=i/2,o}function sl(t,e,n,o){const{caretSize:i,caretPadding:s,cornerRadius:r}=t,{xAlign:a,yAlign:c}=n,d=i+s,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:h}=ht(r);let g=zh(e,a);const m=Hh(e,c,d);return c==="center"?a==="left"?g+=d:a==="right"&&(g-=d):a==="left"?g-=Math.max(u,p)+i:a==="right"&&(g+=Math.max(f,h)+i),{x:ie(g,0,o.width-e.width),y:ie(m,0,o.height-e.height)}}function Zn(t,e,n){const o=ae(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function rl(t){return Fe([],ze(t))}function Wh(t,e,n){return Qe(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function ll(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const al={beforeTitle:Pe,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:Pe,beforeBody:Pe,beforeLabel:Pe,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return H(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.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(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Pe,afterBody:Pe,beforeFooter:Pe,footer:Pe,afterFooter:Pe};function he(t,e,n,o){const i=t[e].call(n,o);return typeof i>"u"?al[e].call(n,o):i}class li extends Le{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),i=o.enabled&&n.options.animation&&o.animations,s=new Zs(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Wh(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,i=he(o,"beforeTitle",this,e),s=he(o,"title",this,e),r=he(o,"afterTitle",this,e);let a=[];return a=Fe(a,ze(i)),a=Fe(a,ze(s)),a=Fe(a,ze(r)),a}getBeforeBody(e,n){return rl(he(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,i=[];return j(e,s=>{const r={before:[],lines:[],after:[]},a=ll(o,s);Fe(r.before,ze(he(a,"beforeLabel",this,s))),Fe(r.lines,he(a,"label",this,s)),Fe(r.after,ze(he(a,"afterLabel",this,s))),i.push(r)}),i}getAfterBody(e,n){return rl(he(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,i=he(o,"beforeFooter",this,e),s=he(o,"footer",this,e),r=he(o,"afterFooter",this,e);let a=[];return a=Fe(a,ze(i)),a=Fe(a,ze(s)),a=Fe(a,ze(r)),a}_createItems(e){const n=this._active,o=this.chart.data,i=[],s=[],r=[];let a=[],c,d;for(c=0,d=n.length;c<d;++c)a.push(Nh(this.chart,n[c]));return e.filter&&(a=a.filter((u,f,p)=>e.filter(u,f,p,o))),e.itemSort&&(a=a.sort((u,f)=>e.itemSort(u,f,o))),j(a,u=>{const f=ll(e.callbacks,u);i.push(he(f,"labelColor",this,u)),s.push(he(f,"labelPointStyle",this,u)),r.push(he(f,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=a,a}update(e,n){const o=this.options.setContext(this.getContext()),i=this._active;let s,r=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=rn[o.position].call(this,i,this._eventPosition);r=this._createItems(o),this.title=this.getTitle(r,o),this.beforeBody=this.getBeforeBody(r,o),this.body=this.getBody(r,o),this.afterBody=this.getAfterBody(r,o),this.footer=this.getFooter(r,o);const c=this._size=ol(this,o),d=Object.assign({},a,c),u=il(this.chart,o,d),f=sl(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,i){const s=this.getCaretPosition(e,o,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,o){const{xAlign:i,yAlign:s}=this,{caretSize:r,cornerRadius:a}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ht(a),{x:p,y:h}=e,{width:g,height:m}=n;let b,x,y,w,S,_;return s==="center"?(S=h+m/2,i==="left"?(b=p,x=b-r,w=S+r,_=S-r):(b=p+g,x=b+r,w=S-r,_=S+r),y=b):(i==="left"?x=p+Math.max(c,u)+r:i==="right"?x=p+g-Math.max(d,f)-r:x=this.caretX,s==="top"?(w=h,S=w-r,b=x-r,y=x+r):(w=h+m,S=w+r,b=x+r,y=x-r),_=w),{x1:b,x2:x,x3:y,y1:w,y2:S,y3:_}}drawTitle(e,n,o){const i=this.title,s=i.length;let r,a,c;if(s){const d=Rt(o.rtl,this.x,this.width);for(e.x=Zn(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",r=oe(o.titleFont),a=o.titleSpacing,n.fillStyle=o.titleColor,n.font=r.string,c=0;c<s;++c)n.fillText(i[c],d.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,c+1===s&&(e.y+=o.titleMarginBottom-a)}}_drawColorBox(e,n,o,i,s){const r=this.labelColors[o],a=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=s,u=oe(s.bodyFont),f=Zn(this,"left",s),p=i.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(d,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=i.leftForLtr(p,d)+d/2,x=g+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Oo(e,m,b,x),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,Oo(e,m,b,x)}else{e.lineWidth=z(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,e.strokeStyle=r.borderColor,e.setLineDash(r.borderDash||[]),e.lineDashOffset=r.borderDashOffset||0;const m=i.leftForLtr(p,d),b=i.leftForLtr(i.xPlus(p,1),d-2),x=ht(r.borderRadius);Object.values(x).some(y=>y!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Ut(e,{x:m,y:g,w:d,h:c,radius:x}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),Ut(e,{x:b,y:g+1,w:d-2,h:c-2,radius:x}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(m,g,d,c),e.strokeRect(m,g,d,c),e.fillStyle=r.backgroundColor,e.fillRect(b,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:i}=this,{bodySpacing:s,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:d,boxPadding:u}=o,f=oe(o.bodyFont);let p=f.lineHeight,h=0;const g=Rt(o.rtl,this.x,this.width),m=function(C){n.fillText(C,g.x(e.x+h),e.y+p/2),e.y+=p+s},b=g.textAlign(r);let x,y,w,S,_,k,v;for(n.textAlign=r,n.textBaseline="middle",n.font=f.string,e.x=Zn(this,b,o),n.fillStyle=o.bodyColor,j(this.beforeBody,m),h=a&&b!=="right"?r==="center"?d/2+u:d+2+u:0,S=0,k=i.length;S<k;++S){for(x=i[S],y=this.labelTextColors[S],n.fillStyle=y,j(x.before,m),w=x.lines,a&&w.length&&(this._drawColorBox(n,e,S,g,o),p=Math.max(f.lineHeight,c)),_=0,v=w.length;_<v;++_)m(w[_]),p=f.lineHeight;j(x.after,m)}h=0,p=f.lineHeight,j(this.afterBody,m),e.y-=s}drawFooter(e,n,o){const i=this.footer,s=i.length;let r,a;if(s){const c=Rt(o.rtl,this.x,this.width);for(e.x=Zn(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=c.textAlign(o.footerAlign),n.textBaseline="middle",r=oe(o.footerFont),n.fillStyle=o.footerColor,n.font=r.string,a=0;a<s;++a)n.fillText(i[a],c.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+o.footerSpacing}}drawBackground(e,n,o,i){const{xAlign:s,yAlign:r}=this,{x:a,y:c}=e,{width:d,height:u}=o,{topLeft:f,topRight:p,bottomLeft:h,bottomRight:g}=ht(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,c),r==="top"&&this.drawCaret(e,n,o,i),n.lineTo(a+d-p,c),n.quadraticCurveTo(a+d,c,a+d,c+p),r==="center"&&s==="right"&&this.drawCaret(e,n,o,i),n.lineTo(a+d,c+u-g),n.quadraticCurveTo(a+d,c+u,a+d-g,c+u),r==="bottom"&&this.drawCaret(e,n,o,i),n.lineTo(a+h,c+u),n.quadraticCurveTo(a,c+u,a,c+u-h),r==="center"&&s==="left"&&this.drawCaret(e,n,o,i),n.lineTo(a,c+f),n.quadraticCurveTo(a,c,a+f,c),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,i=o&&o.x,s=o&&o.y;if(i||s){const r=rn[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ol(this,e),c=Object.assign({},r,this._size),d=il(n,e,c),u=sl(e,c,d,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const r=ae(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=o,this.drawBackground(s,e,i,n),Hs(e,n.textDirection),s.y+=r.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Ws(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,i=e.map(({datasetIndex:a,index:c})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[c],index:c}}),s=!Cn(o,i),r=this._positionChanged(i,n);(s||r)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],r=this._getActiveElements(e,s,n,o),a=this._positionChanged(r,e),c=n||!Cn(r,s)||a;return c&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,o,i){const s=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&r.reverse(),r}_positionChanged(e,n){const{caretX:o,caretY:i,options:s}=this,r=rn[s.position].call(this,e,n);return r!==!1&&(o!==r.x||i!==r.y)}}F(li,"positioners",rn);var jh={id:"tooltip",_element:li,positioners:rn,afterInit(t,e,n){n&&(t.tooltip=new li({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:al},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Yh=Object.freeze({__proto__:null,Colors:oh,Decimation:lh,Filler:Eh,Legend:$h,SubTitle:Oh,Title:Ah,Tooltip:jh});const Gh=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function Uh(t,e,n,o){const i=t.indexOf(e);if(i===-1)return Gh(t,e,n,o);const s=t.lastIndexOf(e);return i!==s?n:i}const qh=(t,e)=>t===null?null:ie(Math.round(t),0,e);function cl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ai extends _t{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:i,label:s}of n)o[i]===s&&o.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(H(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:Uh(o,e,T(n,e),this._addedLabels),qh(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(i=this.getLabels().length-1)),this.min=o,this.max=i}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,i=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let r=e;r<=n;r++)i.push({value:r});return i}getLabelForValue(e){return cl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}F(ai,"id","category"),F(ai,"defaults",{ticks:{callback:cl}});function Xh(t,e){const n=[],{bounds:i,step:s,min:r,max:a,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:p}=t,h=s||1,g=u-1,{min:m,max:b}=e,x=!H(r),y=!H(a),w=!H(d),S=(b-m)/(f+1);let _=hs((b-m)/g/h)*h,k,v,C,D;if(_<1e-14&&!x&&!y)return[{value:m},{value:b}];D=Math.ceil(b/_)-Math.floor(m/_),D>g&&(_=hs(D*_/g/h)*h),H(c)||(k=Math.pow(10,c),_=Math.ceil(_*k)/k),i==="ticks"?(v=Math.floor(m/_)*_,C=Math.ceil(b/_)*_):(v=m,C=b),x&&y&&s&&Hc((a-r)/s,_/1e3)?(D=Math.round(Math.min((a-r)/_,u)),_=(a-r)/D,v=r,C=a):w?(v=x?r:v,C=y?a:C,D=d-1,_=(C-v)/D):(D=(C-v)/_,Ht(D,Math.round(D),_/1e3)?D=Math.round(D):D=Math.ceil(D));const V=Math.max(gs(_),gs(v));k=Math.pow(10,H(c)?V:c),v=Math.round(v*k)/k,C=Math.round(C*k)/k;let $=0;for(x&&(p&&v!==r?(n.push({value:r}),v<r&&$++,Ht(Math.round((v+$*_)*k)/k,r,dl(r,S,t))&&$++):v<r&&$++);$<D;++$){const O=Math.round((v+$*_)*k)/k;if(y&&O>a)break;n.push({value:O})}return y&&p&&C!==a?n.length&&Ht(n[n.length-1].value,a,dl(a,S,t))?n[n.length-1].value=a:n.push({value:a}):(!y||C===a)&&n.push({value:C}),n}function dl(t,e,{horizontal:n,minRotation:o}){const i=ve(o),s=(n?Math.sin(i):Math.cos(i))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}class Jn extends _t{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return H(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:i,max:s}=this;const r=c=>i=n?i:c,a=c=>s=o?s:c;if(e){const c=Ve(i),d=Ve(s);c<0&&d<0?a(0):c>0&&d>0&&r(0)}if(i===s){let c=s===0?1:Math.abs(s*.05);a(s+c),e||r(i-c)}this.min=i,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,i;return o?(i=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const i={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,r=Xh(i,s);return e.bounds==="ticks"&&ps(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const i=(o-n)/Math.max(e.length-1,1)/2;n-=i,o+=i}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return Yt(e,this.chart.options.locale,this.options.ticks.format)}}class ci extends Jn{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ee(e)?e:0,this.max=ee(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=ve(this.options.ticks.minRotation),i=(e?Math.sin(o):Math.cos(o))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}F(ci,"id","linear"),F(ci,"defaults",{ticks:{callback:Mn.formatters.numeric}});const ln=t=>Math.floor(Je(t)),xt=(t,e)=>Math.pow(10,ln(t)+e);function ul(t){return t/Math.pow(10,ln(t))===1}function fl(t,e,n){const o=Math.pow(10,n),i=Math.floor(t/o);return Math.ceil(e/o)-i}function Kh(t,e){const n=e-t;let o=ln(n);for(;fl(t,e,o)>10;)o++;for(;fl(t,e,o)<10;)o--;return Math.min(o,ln(t))}function Zh(t,{min:e,max:n}){e=ye(t.min,e);const o=[],i=ln(e);let s=Kh(e,n),r=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),c=i>s?Math.pow(10,i):0,d=Math.round((e-c)*r)/r,u=Math.floor((e-c)/a/10)*a*10;let f=Math.floor((d-u)/Math.pow(10,s)),p=ye(t.min,Math.round((c+u+f*Math.pow(10,s))*r)/r);for(;p<n;)o.push({value:p,major:ul(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,r=s>=0?1:r),p=Math.round((c+u+f*Math.pow(10,s))*r)/r;const h=ye(t.max,p);return o.push({value:h,major:ul(h),significand:f}),o}class di extends _t{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=Jn.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ee(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ee(e)?Math.max(0,e):null,this.max=ee(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ee(this._userMin)&&(this.min=e===xt(this.min,0)?xt(this.min,-1):xt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,i=this.max;const s=a=>o=e?o:a,r=a=>i=n?i:a;o===i&&(o<=0?(s(1),r(10)):(s(xt(o,-1)),r(xt(i,1)))),o<=0&&s(xt(i,-1)),i<=0&&r(xt(o,1)),this.min=o,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=Zh(n,this);return e.bounds==="ticks"&&ps(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":Yt(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Je(e),this._valueRange=Je(this.max)-Je(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Je(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}F(di,"id","logarithmic"),F(di,"defaults",{ticks:{callback:Mn.formatters.logarithmic,major:{enabled:!0}}});function ui(t){const e=t.ticks;if(e.display&&t.display){const n=ae(e.backdropPadding);return T(e.font&&e.font.size,te.font.size)+n.height}return 0}function Jh(t,e,n){return n=q(n)?n:[n],{w:sd(t,e.string,n),h:n.length*e.lineHeight}}function hl(t,e,n,o,i){return t===o||t===i?{start:e-n/2,end:e+n/2}:t<o||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function Qh(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],i=[],s=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?X/s:0;for(let c=0;c<s;c++){const d=r.setContext(t.getPointLabelContext(c));i[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+i[c],a),f=oe(d.font),p=Jh(t.ctx,f,t._pointLabels[c]);o[c]=p;const h=_e(t.getIndexAngle(c)+a),g=Math.round(Do(h)),m=hl(g,u.x,p.w,0,180),b=hl(g,u.y,p.h,90,270);ep(n,e,h,m,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=op(t,o,i)}function ep(t,e,n,o,i){const s=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,c=0;o.start<e.l?(a=(e.l-o.start)/s,t.l=Math.min(t.l,e.l-a)):o.end>e.r&&(a=(o.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),i.start<e.t?(c=(e.t-i.start)/r,t.t=Math.min(t.t,e.t-c)):i.end>e.b&&(c=(i.end-e.b)/r,t.b=Math.max(t.b,e.b+c))}function tp(t,e,n){const o=t.drawingArea,{extra:i,additionalAngle:s,padding:r,size:a}=n,c=t.getPointPosition(e,o+i+r,s),d=Math.round(Do(_e(c.angle+ne))),u=rp(c.y,a.h,d),f=ip(d),p=sp(c.x,a.w,f);return{visible:!0,x:c.x,y:u,textAlign:f,left:p,top:u,right:p+a.w,bottom:u+a.h}}function np(t,e){if(!e)return!0;const{left:n,top:o,right:i,bottom:s}=t;return!(Ne({x:n,y:o},e)||Ne({x:n,y:s},e)||Ne({x:i,y:o},e)||Ne({x:i,y:s},e))}function op(t,e,n){const o=[],i=t._pointLabels.length,s=t.options,{centerPointLabels:r,display:a}=s.pointLabels,c={extra:ui(s)/2,additionalAngle:r?X/i:0};let d;for(let u=0;u<i;u++){c.padding=n[u],c.size=e[u];const f=tp(t,u,c);o.push(f),a==="auto"&&(f.visible=np(f,d),f.visible&&(d=f))}return o}function ip(t){return t===0||t===180?"center":t<180?"left":"right"}function sp(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function rp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function lp(t,e,n){const{left:o,top:i,right:s,bottom:r}=n,{backdropColor:a}=e;if(!H(a)){const c=ht(e.borderRadius),d=ae(e.backdropPadding);t.fillStyle=a;const u=o-d.left,f=i-d.top,p=s-o+d.width,h=r-i+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),Ut(t,{x:u,y:f,w:p,h,radius:c}),t.fill()):t.fillRect(u,f,p,h)}}function ap(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let i=e-1;i>=0;i--){const s=t._pointLabelItems[i];if(!s.visible)continue;const r=o.setContext(t.getPointLabelContext(i));lp(n,r,s);const a=oe(r.font),{x:c,y:d,textAlign:u}=s;ft(n,t._pointLabels[i],c,d+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function pl(t,e,n,o){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,K);else{let s=t.getPointPosition(0,e);i.moveTo(s.x,s.y);for(let r=1;r<o;r++)s=t.getPointPosition(r,e),i.lineTo(s.x,s.y)}}function cp(t,e,n,o,i){const s=t.ctx,r=e.circular,{color:a,lineWidth:c}=e;!r&&!o||!a||!c||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=c,s.setLineDash(i.dash),s.lineDashOffset=i.dashOffset,s.beginPath(),pl(t,n,r,o),s.closePath(),s.stroke(),s.restore())}function dp(t,e,n){return Qe(t,{label:n,index:e,type:"pointLabel"})}class an extends Jn{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=ae(ui(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=ee(e)&&!isNaN(e)?e:0,this.max=ee(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ui(this.options))}generateTickLabels(e){Jn.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const i=G(this.options.pointLabels.callback,[n,o],this);return i||i===0?i:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?Qh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,i){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,i))}getIndexAngle(e){const n=K/(this._pointLabels.length||1),o=this.options.startAngle||0;return _e(e*n+ve(o))}getDistanceFromCenterForValue(e){if(H(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(H(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return dp(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const i=this.getIndexAngle(e)-ne+o;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:i,bottom:s}=this._pointLabelItems[e];return{left:n,top:o,right:i,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),pl(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:i,border:s}=n,r=this._pointLabels.length;let a,c,d;if(n.pointLabels.display&&ap(this,r),i.display&&this.ticks.forEach((u,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(f),h=i.setContext(p),g=s.setContext(p);cp(this,h,c,r,g)}}),o.display){for(e.save(),a=r-1;a>=0;a--){const u=o.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=u;!p||!f||(e.lineWidth=p,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const i=this.getIndexAngle(0);let s,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!n.reverse)return;const d=o.setContext(this.getContext(c)),u=oe(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const f=ae(d.backdropPadding);e.fillRect(-r/2-f.left,-s-u.size/2-f.top,r+f.width,u.size+f.height)}ft(e,a.label,0,-s,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}F(an,"id","radialLinear"),F(an,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),F(an,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(an,"descriptors",{angleLines:{_fallback:"grid"}});const Qn={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}},pe=Object.keys(Qn);function gl(t,e){return t-e}function ml(t,e){if(H(e))return null;const n=t._adapter,{parser:o,round:i,isoWeekday:s}=t._parseOpts;let r=e;return typeof o=="function"&&(r=o(r)),ee(r)||(r=typeof o=="string"?n.parse(r,o):n.parse(r)),r===null?null:(i&&(r=i==="week"&&(Et(s)||s===!0)?n.startOf(r,"isoWeek",s):n.startOf(r,i)),+r)}function bl(t,e,n,o){const i=pe.length;for(let s=pe.indexOf(t);s<i-1;++s){const r=Qn[pe[s]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-e)/(a*r.size))<=o)return pe[s]}return pe[i-1]}function up(t,e,n,o,i){for(let s=pe.length-1;s>=pe.indexOf(n);s--){const r=pe[s];if(Qn[r].common&&t._adapter.diff(i,o,r)>=e-1)return r}return pe[n?pe.indexOf(n):0]}function fp(t){for(let e=pe.indexOf(t)+1,n=pe.length;e<n;++e)if(Qn[pe[e]].common)return pe[e]}function yl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:i}=Ro(n,e),s=n[o]>=e?n[o]:n[i];t[s]=!0}}function hp(t,e,n,o){const i=t._adapter,s=+i.startOf(e[0].value,o),r=e[e.length-1].value;let a,c;for(a=s;a<=r;a=+i.add(a,1,o))c=n[a],c>=0&&(e[c].major=!0);return e}function _l(t,e,n){const o=[],i={},s=e.length;let r,a;for(r=0;r<s;++r)a=e[r],i[a]=r,o.push({value:a,major:!1});return s===0||!n?o:hp(t,o,i,n)}class cn extends _t{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),i=this._adapter=new wu._date(e.adapters.date);i.init(n),Tt(o.displayFormats,i.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:ml(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:i,max:s,minDefined:r,maxDefined:a}=this.getUserBounds();function c(d){!r&&!isNaN(d.min)&&(i=Math.min(i,d.min)),!a&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!r||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=ee(i)&&!isNaN(i)?i:+n.startOf(Date.now(),o),s=ee(s)&&!isNaN(s)?s:+n.endOf(Date.now(),o)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,i=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,r=this.max,a=Gc(i,s,r);return this._unit=n.unit||(o.autoSkip?bl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):up(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:fp(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),_l(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,i,s;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?o=s:o=(s-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;n=ie(n,0,r),o=ie(o,0,r),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,i=this.options,s=i.time,r=s.unit||bl(s.minUnit,n,o,this._getLabelCapacity(n)),a=T(i.ticks.stepSize,1),c=r==="week"?s.isoWeekday:!1,d=Et(c)||c===!0,u={};let f=n,p,h;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":r),e.diff(o,n,r)>1e5*a)throw new Error(n+" and "+o+" are too far apart with stepSize of "+a+" "+r);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(p=f,h=0;p<o;p=+e.add(p,a,r),h++)yl(u,p,g);return(p===o||i.bounds==="ticks"||h===1)&&yl(u,p,g),Object.keys(u).sort(gl).map(m=>+m)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,s=this._unit,r=n||i[s];return this._adapter.format(e,r)}_tickFormatFunction(e,n,o,i){const s=this.options,r=s.ticks.callback;if(r)return G(r,[e,n,o],this);const a=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&a[c],f=d&&a[d],p=o[n],h=d&&f&&p&&p.major;return this._adapter.format(e,i||(h?f:u))}generateTickLabels(e){let n,o,i;for(n=0,o=e.length;n<o;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,i=ve(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:o*s+a*r,h:o*r+a*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,i=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,_l(this,[e],this._majorUnit),i),r=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,o=i.length;n<o;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const i=this.getLabels();for(n=0,o=i.length;n<o;++n)e.push(ml(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _s(e.sort(gl))}}F(cn,"id","time"),F(cn,"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 eo(t,e,n){let o=0,i=t.length-1,s,r,a,c;n?(e>=t[o].pos&&e<=t[i].pos&&({lo:o,hi:i}=Oe(t,"pos",e)),{pos:s,time:a}=t[o],{pos:r,time:c}=t[i]):(e>=t[o].time&&e<=t[i].time&&({lo:o,hi:i}=Oe(t,"time",e)),{time:s,pos:a}=t[o],{time:r,pos:c}=t[i]);const d=r-s;return d?a+(c-a)*(e-s)/d:a}class fi extends cn{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=eo(n,this.min),this._tableRange=eo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,i=[],s=[];let r,a,c,d,u;for(r=0,a=e.length;r<a;++r)d=e[r],d>=n&&d<=o&&i.push(d);if(i.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(r=0,a=i.length;r<a;++r)u=i[r+1],c=i[r-1],d=i[r],Math.round((u+c)/2)!==d&&s.push({time:d,pos:r/(a-1)});return s}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((i,s)=>i-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(eo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return eo(this._table,o*this._tableRange+this._minPos,!0)}}F(fi,"id","timeseries"),F(fi,"defaults",cn.defaults);var pp=Object.freeze({__proto__:null,CategoryScale:ai,LinearScale:ci,LogarithmicScale:di,RadialLinearScale:an,TimeScale:cn,TimeSeriesScale:fi});const gp=[xu,Zf,Yh,pp];Te.register(...gp);const mp={class:"px-24 py-16"},bp={class:"flex flex-col gap-8"},yp={class:"fm-color-typo-primary fm-typo-body-lg-400"},_p={class:"fm-color-typo-secondary fm-typo-body-md-400"},xp=l.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(t){const e=t,n=l.ref(null);let o=null;l.watch([()=>e.xAxis,()=>e.datasets],()=>{o&&(o.data.datasets=e.datasets,o.data.labels=e.xAxis.categories,o.update())});function i(d,u){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${u})`;if(d.startsWith("rgb")){const p=d.split(",");if(p.length===3)return[...p.slice(0,2),p[2].replace(")",`,${u})`)].join(",");if(p.length===4)return[...p.slice(0,3),`${u})`].join(",")}return""}function s(d){const u=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return u.startsWith("rgb")||u.startsWith("#")?u:null}function r({context:d,color:u}){const{ctx:f,chartArea:p}=d.chart;if(!p)return;const h=f==null?void 0:f.createLinearGradient(0,0,0,p.height);return h.addColorStop(0,i(u,.5)),h.addColorStop(1,i(u,0)),h}const a=l.computed(()=>({labels:e.xAxis.categories,datasets:e.datasets.map(d=>{const u=s(d.color)??"";return{...d,backgroundColor:u?f=>r({context:f,color:u}):"",borderColor:u,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){n.value&&(o=new Te(n.value,{type:"line",data:a.value,options:{plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},beginAtZero:!0},y:{grid:{display:!0},beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return l.onMounted(()=>{c()}),(d,u)=>(l.openBlock(),l.createElementBlock("div",mp,[l.createElementVNode("div",bp,[l.createElementVNode("div",yp,l.toDisplayString(d.name),1),l.createElementVNode("div",_p,l.toDisplayString(d.paragraph),1)]),l.createElementVNode("canvas",{ref_key:"canvas",ref:n},null,512)]))}});function wp(){var t;return(t=l.getCurrentInstance())==null?void 0:t.emit}function de(t,e){const n=wp(),o=l.ref(t[e]);return l.watch(()=>t[e],()=>{o.value=t[e]}),l.computed({get(){return o.value},set(s){o.value=s,n==null||n(`update:${e}`,s)}})}function ge(t,e){return typeof t!="object"&&typeof e!="object"?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ge(t[n],e[n]))}const Cp={class:"fm-checkbox"},kp={class:"fm-checkbox--wrapper"},Sp={class:"fm-checkbox__input--container"},vp=["checked","disabled","indeterminate"],Mp={key:0,class:"fm-checkbox__label-container"},Ep={class:"fm-typo-body-lg-400"},Dp={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},xl=l.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(t){const e=t,n=de(e,"modelValue"),o=de(e,"indeterminate"),i=Array.isArray(n.value),s=l.ref(i?n.value.some(c=>ge(c,e.value)):n.value),r=l.computed(()=>{const c=i?n.value.some(d=>ge(d,e.value)):n.value;return o.value&&!c?"remove":n.value?"check_small":""});function a(){if(e.disabled)return;o.value=!1,s.value=!s.value;let c=n.value;i?c=s.value?c.concat(e.value):c.filter(d=>!ge(d,e.value)):c=s.value,n.value=c}return l.watch(()=>n.value,()=>{s.value=i?n.value.some(c=>ge(c,e.value)):n.value}),(c,d)=>(l.openBlock(),l.createElementBlock("div",Cp,[l.createElementVNode("label",kp,[l.createElementVNode("div",Sp,[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":s.value}),type:"checkbox",checked:s.value,disabled:e.disabled,indeterminate:l.unref(o),onClick:a},null,10,vp),l.unref(o)||s.value?(l.openBlock(),l.createBlock(L,{key:0,class:"fm-checkbox__input--checkmark",name:r.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]),e.label?(l.openBlock(),l.createElementBlock("div",Mp,[l.renderSlot(c.$slots,"label"),l.createElementVNode("div",Ep,l.toDisplayString(e.label),1),e.sublabel?(l.openBlock(),l.createElementBlock("div",Dp,l.toDisplayString(e.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),Wy="";var Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wl={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Vp,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",r="second",a="minute",c="hour",d="day",u="week",f="month",p="quarter",h="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var E=["th","st","nd","rd"],M=P%100;return"["+P+(E[(M-20)%10]||E[M]||E[0])+"]"}},w=function(P,E,M){var R=String(P);return!R||R.length>=E?P:""+Array(E+1-R.length).join(M)+P},S={s:w,z:function(P){var E=-P.utcOffset(),M=Math.abs(E),R=Math.floor(M/60),B=M%60;return(E<=0?"+":"-")+w(R,2,"0")+":"+w(B,2,"0")},m:function P(E,M){if(E.date()<M.date())return-P(M,E);var R=12*(M.year()-E.year())+(M.month()-E.month()),B=E.clone().add(R,f),A=M-B<0,N=E.clone().add(R+(A?-1:1),f);return+(-(R+(M-B)/(A?B-N:N-B))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:f,y:h,w:u,d,D:g,h:c,m:a,s:r,ms:s,Q:p}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},_="en",k={};k[_]=y;var v="$isDayjsObject",C=function(P){return P instanceof O||!(!P||!P[v])},D=function P(E,M,R){var B;if(!E)return _;if(typeof E=="string"){var A=E.toLowerCase();k[A]&&(B=A),M&&(k[A]=M,B=A);var N=E.split("-");if(!B&&N.length>1)return P(N[0])}else{var W=E.name;k[W]=E,B=W}return!R&&B&&(_=B),B||!R&&_},V=function(P,E){if(C(P))return P.clone();var M=typeof E=="object"?E:{};return M.date=P,M.args=arguments,new O(M)},$=S;$.l=D,$.i=C,$.w=function(P,E){return V(P,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var O=function(){function P(M){this.$L=D(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[v]=!0}var E=P.prototype;return E.parse=function(M){this.$d=function(R){var B=R.date,A=R.utc;if(B===null)return new Date(NaN);if($.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var N=B.match(b);if(N){var W=N[2]-1||0,Y=(N[7]||"0").substring(0,3);return A?new Date(Date.UTC(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)):new Date(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Y)}}return new Date(B)}(M),this.init()},E.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},E.$utils=function(){return $},E.isValid=function(){return this.$d.toString()!==m},E.isSame=function(M,R){var B=V(M);return this.startOf(R)<=B&&B<=this.endOf(R)},E.isAfter=function(M,R){return V(M)<this.startOf(R)},E.isBefore=function(M,R){return this.endOf(R)<V(M)},E.$g=function(M,R,B){return $.u(M)?this[R]:this.set(B,M)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(M,R){var B=this,A=!!$.u(R)||R,N=$.p(M),W=function(vt,be){var at=$.w(B.$u?Date.UTC(B.$y,be,vt):new Date(B.$y,be,vt),B);return A?at:at.endOf(d)},Y=function(vt,be){return $.w(B.toDate()[vt].apply(B.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(be)),B)},Z=this.$W,J=this.$M,se=this.$D,me="set"+(this.$u?"UTC":"");switch(N){case h:return A?W(1,0):W(31,11);case f:return A?W(1,J):W(0,J+1);case u:var St=this.$locale().weekStart||0,gn=(Z<St?Z+7:Z)-St;return W(A?se-gn:se+(6-gn),J);case d:case g:return Y(me+"Hours",0);case c:return Y(me+"Minutes",1);case a:return Y(me+"Seconds",2);case r:return Y(me+"Milliseconds",3);default:return this.clone()}},E.endOf=function(M){return this.startOf(M,!1)},E.$set=function(M,R){var B,A=$.p(M),N="set"+(this.$u?"UTC":""),W=(B={},B[d]=N+"Date",B[g]=N+"Date",B[f]=N+"Month",B[h]=N+"FullYear",B[c]=N+"Hours",B[a]=N+"Minutes",B[r]=N+"Seconds",B[s]=N+"Milliseconds",B)[A],Y=A===d?this.$D+(R-this.$W):R;if(A===f||A===h){var Z=this.clone().set(g,1);Z.$d[W](Y),Z.init(),this.$d=Z.set(g,Math.min(this.$D,Z.daysInMonth())).$d}else W&&this.$d[W](Y);return this.init(),this},E.set=function(M,R){return this.clone().$set(M,R)},E.get=function(M){return this[$.p(M)]()},E.add=function(M,R){var B,A=this;M=Number(M);var N=$.p(R),W=function(J){var se=V(A);return $.w(se.date(se.date()+Math.round(J*M)),A)};if(N===f)return this.set(f,this.$M+M);if(N===h)return this.set(h,this.$y+M);if(N===d)return W(1);if(N===u)return W(7);var Y=(B={},B[a]=o,B[c]=i,B[r]=n,B)[N]||1,Z=this.$d.getTime()+M*Y;return $.w(Z,this)},E.subtract=function(M,R){return this.add(-1*M,R)},E.format=function(M){var R=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var A=M||"YYYY-MM-DDTHH:mm:ssZ",N=$.z(this),W=this.$H,Y=this.$m,Z=this.$M,J=B.weekdays,se=B.months,me=B.meridiem,St=function(be,at,mn,bo){return be&&(be[at]||be(R,A))||mn[at].slice(0,bo)},gn=function(be){return $.s(W%12||12,be,"0")},vt=me||function(be,at,mn){var bo=be<12?"AM":"PM";return mn?bo.toLowerCase():bo};return A.replace(x,function(be,at){return at||function(mn){switch(mn){case"YY":return String(R.$y).slice(-2);case"YYYY":return $.s(R.$y,4,"0");case"M":return Z+1;case"MM":return $.s(Z+1,2,"0");case"MMM":return St(B.monthsShort,Z,se,3);case"MMMM":return St(se,Z);case"D":return R.$D;case"DD":return $.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return St(B.weekdaysMin,R.$W,J,2);case"ddd":return St(B.weekdaysShort,R.$W,J,3);case"dddd":return J[R.$W];case"H":return String(W);case"HH":return $.s(W,2,"0");case"h":return gn(1);case"hh":return gn(2);case"a":return vt(W,Y,!0);case"A":return vt(W,Y,!1);case"m":return String(Y);case"mm":return $.s(Y,2,"0");case"s":return String(R.$s);case"ss":return $.s(R.$s,2,"0");case"SSS":return $.s(R.$ms,3,"0");case"Z":return N}return null}(be)||N.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(M,R,B){var A,N=this,W=$.p(R),Y=V(M),Z=(Y.utcOffset()-this.utcOffset())*o,J=this-Y,se=function(){return $.m(N,Y)};switch(W){case h:A=se()/12;break;case f:A=se();break;case p:A=se()/3;break;case u:A=(J-Z)/6048e5;break;case d:A=(J-Z)/864e5;break;case c:A=J/i;break;case a:A=J/o;break;case r:A=J/n;break;default:A=J}return B?A:$.a(A)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return k[this.$L]},E.locale=function(M,R){if(!M)return this.$L;var B=this.clone(),A=D(M,R,!0);return A&&(B.$L=A),B},E.clone=function(){return $.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},P}(),U=O.prototype;return V.prototype=U,[["$ms",s],["$s",r],["$m",a],["$H",c],["$W",d],["$M",f],["$y",h],["$D",g]].forEach(function(P){U[P[1]]=function(E){return this.$g(E,P[0],P[1])}}),V.extend=function(P,E){return P.$i||(P(E,O,V),P.$i=!0),V},V.locale=D,V.isDayjs=C,V.unix=function(P){return V(1e3*P)},V.en=k[_],V.Ls=k,V.p={},V})})(wl);var Fp=wl.exports;const ue=Rp(Fp),Bt=Math.min,wt=Math.max,to=Math.round,no=Math.floor,nt=t=>({x:t,y:t}),Bp={left:"right",right:"left",bottom:"top",top:"bottom"},$p={start:"end",end:"start"};function hi(t,e,n){return wt(t,Bt(e,n))}function dn(t,e){return typeof t=="function"?t(e):t}function Ct(t){return t.split("-")[0]}function un(t){return t.split("-")[1]}function Cl(t){return t==="x"?"y":"x"}function pi(t){return t==="y"?"height":"width"}function oo(t){return["top","bottom"].includes(Ct(t))?"y":"x"}function gi(t){return Cl(oo(t))}function Pp(t,e,n){n===void 0&&(n=!1);const o=un(t),i=gi(t),s=pi(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=io(r)),[r,io(r)]}function Ap(t){const e=io(t);return[mi(t),e,mi(e)]}function mi(t){return t.replace(/start|end/g,e=>$p[e])}function Op(t,e,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function Np(t,e,n,o){const i=un(t);let s=Op(Ct(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(mi)))),s}function io(t){return t.replace(/left|right|bottom|top/g,e=>Bp[e])}function Ip(t){return{top:0,right:0,bottom:0,left:0,...t}}function kl(t){return typeof t!="number"?Ip(t):{top:t,right:t,bottom:t,left:t}}function so(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Sl(t,e,n){let{reference:o,floating:i}=t;const s=oo(e),r=gi(e),a=pi(r),c=Ct(e),d=s==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-i.width,y:f};break;default:h={x:o.x,y:o.y}}switch(un(e)){case"start":h[r]-=p*(n&&d?-1:1);break;case"end":h[r]+=p*(n&&d?-1:1);break}return h}const Lp=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Sl(d,o,c),p=o,h={},g=0;for(let m=0;m<a.length;m++){const{name:b,fn:x}=a[m],{x:y,y:w,data:S,reset:_}=await x({x:u,y:f,initialPlacement:o,placement:p,strategy:i,middlewareData:h,rects:d,platform:r,elements:{reference:t,floating:e}});if(u=y??u,f=w??f,h={...h,[b]:{...h[b],...S}},_&&g<=50){g++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(d=_.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:f}=Sl(d,p,c)),m=-1;continue}}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};async function vl(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=dn(e,t),g=kl(h),b=a[p?f==="floating"?"reference":"floating":f],x=so(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:c})),y=f==="floating"?{...r.floating,x:o,y:i}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},_=so(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-_.top+g.top)/S.y,bottom:(_.bottom-x.bottom+g.bottom)/S.y,left:(x.left-_.left+g.left)/S.x,right:(_.right-x.right+g.right)/S.x}}const Tp=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:s,platform:r,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=dn(t,e)||{};if(d==null)return{};const f=kl(u),p={x:n,y:o},h=gi(i),g=pi(h),m=await r.getDimensions(d),b=h==="y",x=b?"top":"left",y=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-p[h]-s.floating[g],_=p[h]-s.reference[h],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(d));let v=k?k[w]:0;(!v||!await(r.isElement==null?void 0:r.isElement(k)))&&(v=a.floating[w]||s.floating[g]);const C=S/2-_/2,D=v/2-m[g]/2-1,V=Bt(f[x],D),$=Bt(f[y],D),O=V,U=v-m[g]-$,P=v/2-m[g]/2+C,E=hi(O,P,U),M=!c.arrow&&un(i)!=null&&P!=E&&s.reference[g]/2-(P<O?V:$)-m[g]/2<0,R=M?P<O?P-O:P-U:0;return{[h]:p[h]+R,data:{[h]:E,centerOffset:P-E-R,...M&&{alignmentOffset:R}},reset:M}}}),bi=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=dn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Ct(i),y=Ct(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(y||!m?[io(a)]:Ap(a));!p&&g!=="none"&&S.push(...Np(a,m,g,w));const _=[a,...S],k=await vl(e,b),v=[];let C=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&v.push(k[x]),f){const O=Pp(i,r,w);v.push(k[O[0]],k[O[1]])}if(C=[...C,{placement:i,overflows:v}],!v.every(O=>O<=0)){var D,V;const O=(((D=s.flip)==null?void 0:D.index)||0)+1,U=_[O];if(U)return{data:{index:O,overflows:C},reset:{placement:U}};let P=(V=C.filter(E=>E.overflows[0]<=0).sort((E,M)=>E.overflows[1]-M.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(h){case"bestFit":{var $;const E=($=C.map(M=>[M.placement,M.overflows.filter(R=>R>0).reduce((R,B)=>R+B,0)]).sort((M,R)=>M[1]-R[1])[0])==null?void 0:$[0];E&&(P=E);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};async function zp(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Ct(n),a=un(n),c=oo(n)==="y",d=["left","top"].includes(r)?-1:1,u=s&&c?-1:1,f=dn(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),c?{x:h*u,y:p*d}:{x:p*d,y:h*u}}const yi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:a}=e,c=await zp(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:r}}}}},Hp=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x,y}=b;return{x,y}}},...c}=dn(t,e),d={x:n,y:o},u=await vl(e,c),f=oo(Ct(i)),p=Cl(f);let h=d[p],g=d[f];if(s){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=h+u[b],w=h-u[x];h=hi(y,h,w)}if(r){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[b],w=g-u[x];g=hi(y,g,w)}const m=a.fn({...e,[p]:h,[f]:g});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function ot(t){return Ml(t)?(t.nodeName||"").toLowerCase():"#document"}function xe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function He(t){var e;return(e=(Ml(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ml(t){return t instanceof Node||t instanceof xe(t).Node}function We(t){return t instanceof Element||t instanceof xe(t).Element}function Be(t){return t instanceof HTMLElement||t instanceof xe(t).HTMLElement}function El(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xe(t).ShadowRoot}function fn(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Se(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Wp(t){return["table","td","th"].includes(ot(t))}function _i(t){const e=xi(),n=Se(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function jp(t){let e=$t(t);for(;Be(e)&&!ro(e);){if(_i(e))return e;e=$t(e)}return null}function xi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ro(t){return["html","body","#document"].includes(ot(t))}function Se(t){return xe(t).getComputedStyle(t)}function lo(t){return We(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $t(t){if(ot(t)==="html")return t;const e=t.assignedSlot||t.parentNode||El(t)&&t.host||He(t);return El(e)?e.host:e}function Dl(t){const e=$t(t);return ro(e)?t.ownerDocument?t.ownerDocument.body:t.body:Be(e)&&fn(e)?e:Dl(e)}function hn(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Dl(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=xe(i);return s?e.concat(r,r.visualViewport||[],fn(i)?i:[],r.frameElement&&n?hn(r.frameElement):[]):e.concat(i,hn(i,[],n))}function Vl(t){const e=Se(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=Be(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=to(n)!==s||to(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function wi(t){return We(t)?t:t.contextElement}function Pt(t){const e=wi(t);if(!Be(e))return nt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Vl(e);let r=(s?to(n.width):n.width)/o,a=(s?to(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Yp=nt(0);function Rl(t){const e=xe(t);return!xi()||!e.visualViewport?Yp:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Gp(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xe(t)?!1:e}function kt(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=wi(t);let r=nt(1);e&&(o?We(o)&&(r=Pt(o)):r=Pt(t));const a=Gp(s,n,o)?Rl(s):nt(0);let c=(i.left+a.x)/r.x,d=(i.top+a.y)/r.y,u=i.width/r.x,f=i.height/r.y;if(s){const p=xe(s),h=o&&We(o)?xe(o):o;let g=p.frameElement;for(;g&&o&&h!==p;){const m=Pt(g),b=g.getBoundingClientRect(),x=Se(g),y=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*m.x,w=b.top+(g.clientTop+parseFloat(x.paddingTop))*m.y;c*=m.x,d*=m.y,u*=m.x,f*=m.y,c+=y,d+=w,g=xe(g).frameElement}}return so({width:u,height:f,x:c,y:d})}function Up(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=Be(n),s=He(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a=nt(1);const c=nt(0);if((i||!i&&o!=="fixed")&&((ot(n)!=="body"||fn(s))&&(r=lo(n)),Be(n))){const d=kt(n);a=Pt(n),c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+c.x,y:e.y*a.y-r.scrollTop*a.y+c.y}}function qp(t){return Array.from(t.getClientRects())}function Fl(t){return kt(He(t)).left+lo(t).scrollLeft}function Xp(t){const e=He(t),n=lo(t),o=t.ownerDocument.body,i=wt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=wt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Fl(t);const a=-n.scrollTop;return Se(o).direction==="rtl"&&(r+=wt(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}function Kp(t,e){const n=xe(t),o=He(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){s=i.width,r=i.height;const d=xi();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:r,x:a,y:c}}function Zp(t,e){const n=kt(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=Be(t)?Pt(t):nt(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,d=o*s.y;return{width:r,height:a,x:c,y:d}}function Bl(t,e,n){let o;if(e==="viewport")o=Kp(t,n);else if(e==="document")o=Xp(He(t));else if(We(e))o=Zp(e,n);else{const i=Rl(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return so(o)}function $l(t,e){const n=$t(t);return n===e||!We(n)||ro(n)?!1:Se(n).position==="fixed"||$l(n,e)}function Jp(t,e){const n=e.get(t);if(n)return n;let o=hn(t,[],!1).filter(a=>We(a)&&ot(a)!=="body"),i=null;const s=Se(t).position==="fixed";let r=s?$t(t):t;for(;We(r)&&!ro(r);){const a=Se(r),c=_i(r);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||fn(r)&&!c&&$l(t,r))?o=o.filter(u=>u!==r):i=a,r=$t(r)}return e.set(t,o),o}function Qp(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?Jp(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((d,u)=>{const f=Bl(e,u,i);return d.top=wt(f.top,d.top),d.right=Bt(f.right,d.right),d.bottom=Bt(f.bottom,d.bottom),d.left=wt(f.left,d.left),d},Bl(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eg(t){return Vl(t)}function tg(t,e,n){const o=Be(e),i=He(e),s=n==="fixed",r=kt(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=nt(0);if(o||!o&&!s)if((ot(e)!=="body"||fn(i))&&(a=lo(e)),o){const d=kt(e,!0,s,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=Fl(i));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function Pl(t,e){return!Be(t)||Se(t).position==="fixed"?null:e?e(t):t.offsetParent}function Al(t,e){const n=xe(t);if(!Be(t))return n;let o=Pl(t,e);for(;o&&Wp(o)&&Se(o).position==="static";)o=Pl(o,e);return o&&(ot(o)==="html"||ot(o)==="body"&&Se(o).position==="static"&&!_i(o))?n:o||jp(t)||n}const ng=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Al,s=this.getDimensions;return{reference:tg(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function og(t){return Se(t).direction==="rtl"}const ig={convertOffsetParentRelativeRectToViewportRelativeRect:Up,getDocumentElement:He,getClippingRect:Qp,getOffsetParent:Al,getElementRects:ng,getClientRects:qp,getDimensions:eg,getScale:Pt,isElement:We,isRTL:og};function sg(t,e){let n=null,o;const i=He(t);function s(){clearTimeout(o),n&&n.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:d,top:u,width:f,height:p}=t.getBoundingClientRect();if(a||e(),!f||!p)return;const h=no(u),g=no(i.clientWidth-(d+f)),m=no(i.clientHeight-(u+p)),b=no(d),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:wt(0,Bt(1,c))||1};let w=!0;function S(_){const k=_[0].intersectionRatio;if(k!==c){if(!w)return r();k?r(!1,k):o=setTimeout(()=>{r(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return r(!0),s}function Ol(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=wi(t),u=i||s?[...d?hn(d):[],...hn(e)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=d&&a?sg(d,n):null;let p=-1,h=null;r&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===d&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(e)})),n()}),d&&!c&&h.observe(d),h.observe(e));let g,m=c?kt(t):null;c&&b();function b(){const x=kt(t);m&&(x.x!==m.x||x.y!==m.y||x.width!==m.width||x.height!==m.height)&&n(),m=x,g=requestAnimationFrame(b)}return n(),()=>{u.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const Nl=(t,e,n)=>{const o=new Map,i={platform:ig,...n},s={...i.platform,_c:o};return Lp(t,e,{...i,platform:s})};function Ci(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function rg(t){return{name:"arrow",options:t,fn(e){const n=Ci(l.unref(t.element));return n==null?{}:Tp({element:n,padding:t.padding}).fn(e)}}}function Il(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ll(t,e){const n=Il(t);return Math.round(e*n)/n}function Tl(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=l.computed(()=>{var v;return(v=l.unref(n.open))!=null?v:!0}),s=l.computed(()=>l.unref(n.middleware)),r=l.computed(()=>{var v;return(v=l.unref(n.placement))!=null?v:"bottom"}),a=l.computed(()=>{var v;return(v=l.unref(n.strategy))!=null?v:"absolute"}),c=l.computed(()=>{var v;return(v=l.unref(n.transform))!=null?v:!0}),d=l.computed(()=>Ci(t.value)),u=l.computed(()=>Ci(e.value)),f=l.ref(0),p=l.ref(0),h=l.ref(a.value),g=l.ref(r.value),m=l.shallowRef({}),b=l.ref(!1),x=l.computed(()=>{const v={position:h.value,left:"0",top:"0"};if(!u.value)return v;const C=Ll(u.value,f.value),D=Ll(u.value,p.value);return c.value?{...v,transform:"translate("+C+"px, "+D+"px)",...Il(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:C+"px",top:D+"px"}});let y;function w(){d.value==null||u.value==null||Nl(d.value,u.value,{middleware:s.value,placement:r.value,strategy:a.value}).then(v=>{f.value=v.x,p.value=v.y,h.value=v.strategy,g.value=v.placement,m.value=v.middlewareData,b.value=!0})}function S(){typeof y=="function"&&(y(),y=void 0)}function _(){if(S(),o===void 0){w();return}if(d.value!=null&&u.value!=null){y=o(d.value,u.value,w);return}}function k(){i.value||(b.value=!1)}return l.watch([s,r,a],w,{flush:"sync"}),l.watch([d,u],_,{flush:"sync"}),l.watch(i,k,{flush:"sync"}),l.getCurrentScope()&&l.onScopeDispose(S),{x:l.shallowReadonly(f),y:l.shallowReadonly(p),strategy:l.shallowReadonly(h),placement:l.shallowReadonly(g),middlewareData:l.shallowReadonly(m),isPositioned:l.shallowReadonly(b),floatingStyles:x,update:w}}function lg(t){for(;t;){if(ag(t))return t;t=t.parentElement}return document.scrollingElement}function ag(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;const e=window.getComputedStyle(t);return e.overflowY==="scroll"||e.overflowY==="auto"&&t.scrollHeight>t.clientHeight}class cg{constructor(e,n){F(this,"onScroll");F(this,"scrollParent");this.onScroll=n,this.scrollParent=lg(e)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const dg={class:"fm-menu__wrapper"},ug=l.defineComponent({__name:"FmMenu",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(t,{expose:e,emit:n}){const o=t,i=l.ref(!1),s=l.ref(null),r=l.ref(null),{floatingStyles:a}=Tl(s,r,{middleware:[yi(4),bi()],placement:o.placement,whileElementsMounted:Ol});let c;const d=n;e({show:()=>{i.value||(i.value=!0,d("dropdown-changed",i.value))},hide:()=>{i.value&&(i.value=!1,d("dropdown-changed",i.value))}});const u=h=>{h.preventDefault(),h.stopPropagation(),!o.disabled&&(i.value=!i.value,d("dropdown-changed",i.value))},f=h=>{if(!i.value)return;const g=h.path||h.composedPath();for(const m of g)if(m==s.value||m==r.value)return;i.value=!1,d("dropdown-changed",i.value)},p=()=>{d("dropdown-changed",!1)};return l.watch(()=>o.showMenu,h=>i.value=h),l.onMounted(()=>{i.value=o.showMenu,window.addEventListener("click",f),c=new cg(s.value,p),c.bindScroll()}),l.onUnmounted(()=>{window.removeEventListener("click",f),c.unbindScroll()}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:s,class:"fm-menu",onClick:u},[l.renderSlot(h.$slots,"menu-button",{},void 0,!0)],512),i.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"menuEl",ref:r,class:l.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":i.value}),style:l.normalizeStyle(l.unref(a))},[l.renderSlot(h.$slots,"menu-wrapper",{},()=>[l.createElementVNode("div",dg,[l.renderSlot(h.$slots,"menu-content",{},void 0,!0)])],!0)],6)):l.createCommentVNode("",!0)]))}}),jy="",we=Q(ug,[["__scopeId","data-v-6ad9d23d"]]),fg={class:"fm-menu-item--left"},hg={key:0,class:"fm-menu-item--right"},pg=l.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=l.ref(!1),i=e,s=c=>{c.preventDefault(),!n.disabled&&i("update:modelValue",!n.modelValue)},r=()=>{i("update:modelValue",n.modelValue)};function a(c){o.value=c}return(c,d)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{class:l.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":c.modelValue&&!c.hasCheckbox,"fm-menu-item--disabled":c.disabled}),onClick:s,onMousedown:d[1]||(d[1]=()=>a(!0)),onMouseup:d[2]||(d[2]=()=>a(!1)),onMouseleave:d[3]||(d[3]=()=>a(!1))},[l.createElementVNode("div",fg,[!c.hasCheckbox&&c.icon?(l.openBlock(),l.createBlock(L,{key:0,name:c.icon,size:"md",outline:!o.value&&!c.modelValue,color:c.disabled?"#C7C7CC":c.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),c.hasCheckbox?(l.openBlock(),l.createBlock(xl,{key:1,"model-value":c.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:c.disabled,"onUpdate:modelValue":r,onClick:d[0]||(d[0]=u=>u.preventDefault())},null,8,["model-value","disabled"])):l.createCommentVNode("",!0),l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-typo-body-lg-400 ${c.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},l.toDisplayString(c.label),3),c.sublabel?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`fm-typo-body-md-400 ${c.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},l.toDisplayString(c.sublabel),3)):l.createCommentVNode("",!0)])],!0)]),l.renderSlot(c.$slots,"append",{},void 0,!0),c.expandable?(l.openBlock(),l.createElementBlock("div",hg,[l.createVNode(L,{name:"chevron_right",size:"md",color:c.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):l.createCommentVNode("",!0)],34)]))}}),Yy="",Ee=Q(pg,[["__scopeId","data-v-a50682bb"]]),gg={class:"w-full"},mg=l.defineComponent({__name:"FmField",props:{tag:{default:"div"},prependIcon:{default:""},appendIcon:{default:""},invalid:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},setup(t){const e=t;return(n,o)=>(l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-field":!0,"fm-field--focused":n.focused,"fm-field--invalid":n.invalid,"fm-field--valid":n.showValidBorder&&!n.invalid,"fm-field--disabled":n.disabled}),tabindex:"0"},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"prepend",{},()=>[n.prependIcon?(l.openBlock(),l.createBlock(L,{key:0,name:n.prependIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0),l.createElementVNode("div",gg,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"append",{},()=>[n.appendIcon?(l.openBlock(),l.createBlock(L,{key:0,name:n.appendIcon,size:"md",color:n.disabled?"disabled":"neutral-black"},null,8,["name","color"])):l.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),Gy="",it=Q(mg,[["__scopeId","data-v-177cd78a"]]),bg={class:"flex gap-4"},zl=l.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(t){const e=t,n=l.computed(()=>e.state==="success"?"check_circle":e.state==="warning"?"warning":e.state==="error"?"error":""),o=l.computed(()=>e.state==="success"?"text-fm-color-system-success-300":e.state==="warning"?"text-fm-color-system-warning-300":e.state==="error"?"text-fm-color-system-error-300":"");return(i,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":i.disabled,"text-fm-color-typo-secondary":i.state==="none"&&!i.disabled,"text-fm-color-typo-success":i.state==="success"&&!i.disabled,"text-fm-color-typo-warning":i.state==="warning"&&!i.disabled,"text-fm-color-typo-error":i.state==="error"&&!i.disabled}])},[i.errorMessages.length===0?l.renderSlot(i.$slots,"default",{key:0},()=>[l.createElementVNode("div",bg,[n.value?(l.openBlock(),l.createBlock(L,{key:0,size:"sm",name:n.value,class:l.normalizeClass(["mt-[2px]",o.value])},null,8,["name","class"])):l.createCommentVNode("",!0),l.createElementVNode("span",null,l.toDisplayString(i.text),1)])]):l.renderSlot(i.$slots,"default",{key:1},()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.errorMessages,r=>(l.openBlock(),l.createElementBlock("div",{key:r,class:"flex gap-4 text-fm-color-typo-error"},[l.createVNode(L,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),l.createElementVNode("span",null,l.toDisplayString(r),1)]))),128))])],2))}}),yg={class:"px-2 py-0"},_g={key:0,class:"fm-typo-body-xl-700"},xg={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Hl=l.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{default:null},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=l.ref(null),o=l.ref(null),i=l.ref(null),s=async()=>{var x,y,w,S;const{x:h,y:g,placement:m,middlewareData:b}=await Nl(n.value,o.value,{placement:e.beak,middleware:[yi(10),bi(),Hp({padding:5}),e.hasArrow?rg({element:i.value,padding:10}):null]});if(Object.assign(o.value.style,{left:`${h}px`,top:`${g}px`}),e.hasArrow){const _={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];Object.assign(i.value.style,{left:((x=b.arrow)==null?void 0:x.x)!=null?`${(y=b.arrow)==null?void 0:y.x}px`:"",top:((w=b.arrow)==null?void 0:w.y)!=null?`${(S=b.arrow)==null?void 0:S.y}px`:"",right:"",bottom:"",background:e.variant==="rich"?"#FFF":"#1C1C1E",[_]:"-4px"})}},r=l.ref(!1),a=l.ref(0),c=l.ref(0),d=l.computed(()=>({...{plain:{color:"#FFF",background:"#1C1C1E",boxShadow:"0 2px 4px rgba(0, 0, 0, 0)"},rich:{background:"#FFF",boxShadow:"0px 8px 16px 0px rgba(199, 199, 204, 0.24)"}}[e.variant],display:r.value?"block":"none"})),u=()=>{clearTimeout(c.value),a.value=window.setTimeout(()=>{r.value=!0},500)},f=()=>{clearTimeout(a.value),c.value=window.setTimeout(()=>r.value=!1,1500)},p=()=>{clearTimeout(c.value),r.value=!0};return l.watchEffect(()=>{r.value?(s(),window.addEventListener("resize",s)):window.removeEventListener("resize",s)}),(h,g)=>(l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"tooltipContainer",ref:n,class:l.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":h.disabled}]),onMouseenter:u,onMouseleave:f},[l.renderSlot(h.$slots,"default")],34),l.createElementVNode("div",{ref_key:"tooltip",ref:o,class:"absolute box-border break-words left-0 max-w-xs px-4 py-3 rounded-2xl top-0 w-max whitespace-normal z-50",style:l.normalizeStyle(d.value),onMouseenter:p,onMouseleave:f},[l.createElementVNode("div",null,[l.createElementVNode("div",yg,[h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",_g,l.toDisplayString(h.titleText),1)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(h.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},l.toDisplayString(h.contentText),3)]),h.variant=="rich"?(l.openBlock(),l.createElementBlock("div",xg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.actionButtons,(m,b)=>(l.openBlock(),l.createElementBlock("div",{key:b},[l.createVNode(fe,{variant:"tertiary",label:m.label,onClick:m.handler},null,8,["label","onClick"])]))),128))])):l.createCommentVNode("",!0)]),l.createElementVNode("div",{ref_key:"arrowEl",ref:i,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),Wl=l.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(t){return(e,n)=>e.label?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-typo-body-lg-400 flex gap-4",e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":e.info}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createElementVNode("span",null,l.toDisplayString(e.label),1),e.required?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["fm-typo-body-lg-700",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):l.createCommentVNode("",!0),e.optional?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):l.createCommentVNode("",!0),e.info?(l.openBlock(),l.createBlock(Hl,{key:2,beak:"top","content-text":e.info,disabled:e.disabled},{default:l.withCtx(()=>[l.createVNode(L,{name:"info",size:"sm",class:l.normalizeClass(["fm-typo-body-md-400",e.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):l.createCommentVNode("",!0)])],2)):l.createCommentVNode("",!0)}});function jl(t,e){const n=l.ref([]);function o(){const s=[];if(e.value&&e.value.length>0)for(const r of e.value){const c=(typeof r=="function"?r:()=>r)(t.value);c!==!0&&s.push(c)}return n.value=s,n.value}function i(){n.value=[]}return{validate:o,resetValidation:i,errorMessages:n}}function Yl(t,e=null,n=null){let o=null;const i=de(t,"modelValue"),s=l.ref(!0),r=l.inject(Xi,null),{validate:a,resetValidation:c,errorMessages:d}=jl(i,l.toRef(()=>t.rules)),u=(f=n)=>{s.value=!0,c(),f&&typeof f=="function"&&f(),i.value=e};return l.onMounted(()=>{r&&(o=r.register({validate:a,resetValidation:c,resetValue:u})),e=e??i.value}),l.onUnmounted(()=>{r&&r.unregister(o)}),l.watch(()=>i.value,()=>{s.value=!1,i.value!==e&&a()}),l.watch(()=>t.focused,f=>{s.value=!1,f||a()}),{validate:a,resetValidation:c,errorMessages:d,resetValue:u,isPristine:s}}function ao(){const t=l.ref(!1);function e(){t.value=!0}function n(){t.value=!1}return{focus:e,blur:n,isFocused:t}}const wg={key:1,class:"flex items-center justify-between"},je=l.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""},helperText:{default:""},helperState:{default:"none"},tag:{default:"label"}},setup(t){const e=t,{errorMessages:n,isPristine:o}=Yl(e),{focus:i,blur:s}=ao(),r=l.computed(()=>({label:e.label,disabled:e.disabled,required:e.required,optional:e.optional,info:e.info})),a=l.computed(()=>({text:e.helperText,disabled:e.disabled,state:e.helperState,errorMessages:n.value})),c=l.computed(()=>({isPristine:o,invalid:n.value.length>0}));return(d,u)=>(l.openBlock(),l.createBlock(e.tag,{class:"flex flex-col gap-4",onClick:l.unref(i),onBlur:l.unref(s)},{default:l.withCtx(()=>[d.label?(l.openBlock(),l.createBlock(Wl,l.normalizeProps(l.mergeProps({key:0},r.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),_:3},16)):l.createCommentVNode("",!0),l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps(c.value))),a.value.text||a.value.errorMessages.length>0||d.$slots["helper-append"]?(l.openBlock(),l.createElementBlock("div",wg,[l.createVNode(zl,l.normalizeProps(l.guardReactiveProps(a.value)),{default:l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},16),l.renderSlot(d.$slots,"helper-append")])):l.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),Cg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},kg={class:"w-max"},Sg={class:"flex h-40 justify-between px-4 py-8"},vg={class:"flex gap-4 items-center"},Mg={class:"fm-typo-body-lg-700"},Eg={class:"h-[264px] w-[160px]"},Dg={class:"fm-typo-body-lg-700"},Vg={class:"h-[264px] w-[160px]"},Rg={class:"flex gap-4 items-center justify-center"},Fg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Bg=["onClick"],$g={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Pg=l.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(ue(n.value,"YYYY-MM-DD")),i=l.ref(!1),s=l.ref(ue().startOf("month")),r=l.ref(!1),a=l.ref(!1),c=m=>{o.value=m},d=()=>{n.value=o.value.format("YYYY-MM-DD"),setTimeout(()=>{i.value=!1},0)},u=()=>{o.value=n.value?ue(n.value):null,i.value=!1},f=m=>{const b=[],x=m.endOf("month"),y=m.month();let w=m.startOf("week"),S=[];for(;w.isBefore(x.endOf("week"));)w.day()===0&&S.length>0&&(b.push(S),S=[]),S.push({date:w,isCurrentMonth:w.month()===y}),w=w.add(1,"day");return S.length>0&&b.push(S),b},p=m=>{r.value=!1,a.value=!1,s.value=m},h=l.computed(()=>Array.from(Array(7),(m,b)=>ue().day(b).format("ddd"))),g=l.computed(()=>{let m=-5;const b=[];for(;m!=5;)b.push(s.value.add(m,"year")),m++;return b});return(m,b)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":b[5]||(b[5]=x=>l.isRef(n)?n.value=x:null),label:m.label,disabled:m.disabled,required:m.labelMark==="required",optional:m.labelMark==="optional",info:m.labelInfo,rules:m.rules,focused:i.value,"helper-text":m.helperText,"helper-state":m.helperState,tag:"div"},{label:l.withCtx(()=>[l.renderSlot(m.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:x})=>[l.createVNode(we,{"show-menu":i.value,disabled:m.disabled,onDropdownChanged:b[4]||(b[4]=y=>i.value=y)},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:"cursor-text",focused:i.value,invalid:x,"show-valid-border":m.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(m.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(m.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(l.unref(n)?l.unref(ue)(l.unref(n)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Cg,[l.createElementVNode("div",kg,[l.createElementVNode("div",Sg,[l.createElementVNode("div",vg,[l.createVNode(we,{"show-menu":r.value,onDropdownChanged:b[0]||(b[0]=y=>r.value=y)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",r.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Mg,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(L,{name:r.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Eg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(y,w)=>s.value.month(w)),y=>(l.openBlock(),l.createElementBlock("li",{key:y.format("MMMM")},[l.createVNode(Ee,{"model-value":s.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":w=>p(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":a.value,onDropdownChanged:b[1]||(b[1]=y=>a.value=y)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Dg,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(L,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Vg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(g.value,y=>(l.openBlock(),l.createElementBlock("li",{key:y.format("YYYY")},[l.createVNode(Ee,{"model-value":s.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":w=>p(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createElementVNode("div",Rg,[l.createVNode(L,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>p(s.value.subtract(1,"month")))}),l.createVNode(L,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>p(s.value.add(1,"month")))})])]),l.createElementVNode("div",null,[l.createElementVNode("div",Fg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,y=>(l.openBlock(),l.createElementBlock("div",{key:y,class:"fm-calendar__cell"},l.toDisplayString(y),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f(s.value),(y,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y,S=>(l.openBlock(),l.createElementBlock("div",{key:S.date.date(),class:"fm-calendar__cell"},[S.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":S.date.isSame(o.value)}]),type:"button",onClick:()=>c(S.date)},l.toDisplayString(S.date.date()),11,Bg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",$g,[l.createVNode(fe,{label:"Cancel",size:"md",variant:"tertiary",onClick:u}),l.createVNode(fe,{label:"Apply",size:"md",variant:"primary",disabled:!o.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(m.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Uy="",Ag=Q(Pg,[["__scopeId","data-v-16edf7f9"]]),Og=t=>(l.pushScopeId("data-v-431b8ad3"),t=t(),l.popScopeId(),t),Ng={class:"flex gap-1 items-center relative w-full"},Ig={class:"flex flex-col gap-4 w-full"},Lg=Og(()=>l.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," to ",-1)),Tg={class:"flex flex-col gap-4 w-full"},zg={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Hg={class:"flex gap-24"},Wg={class:"w-max"},jg={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Yg={class:"flex gap-4 items-center"},Gg={class:"fm-typo-body-lg-700"},Ug={class:"h-[264px] w-[160px]"},qg={class:"fm-typo-body-lg-700"},Xg={class:"h-[264px] w-[160px]"},Kg={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Zg=["onClick","onMouseover"],Jg={class:"w-max"},Qg={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},em={class:"flex gap-4 items-center"},tm={class:"fm-typo-body-lg-700"},nm={class:"h-[264px] w-[160px]"},om={class:"fm-typo-body-lg-700"},im={class:"h-[264px] w-[160px]"},sm={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},rm=["onClick","onMouseover"],lm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},am=l.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref({startDate:ue(n.value.startDate,"YYYY-MM-DD"),endDate:ue(n.value.endDate,"YYYY-MM-DD")}),i=l.ref(!1),s=l.ref(ue().startOf("month")),r=l.ref(ue().startOf("month").add(1,"month")),a=l.ref(null),c=l.ref(!1),d=l.ref(!1),u=l.ref(!1),f=l.ref(!1),p=_=>{if(o.value.startDate&&o.value.endDate){o.value={startDate:_,endDate:null};return}if(!o.value.startDate&&!o.value.endDate)o.value.startDate=_;else if(_.isBefore(o.value.startDate)){const k=o.value.startDate;o.value={startDate:_,endDate:k}}else o.value.endDate=_},h=()=>{n.value={startDate:o.value.startDate.format("YYYY-MM-DD"),endDate:o.value.endDate.format("YYYY-MM-DD")},setTimeout(()=>{i.value=!1})},g=()=>{var _,k;o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null},i.value=!1},m=_=>{const k=[],v=_.endOf("month"),C=_.month();let D=_.startOf("week"),V=[];for(;D.isBefore(v.endOf("week"));)D.day()===0&&V.length>0&&(k.push(V),V=[]),V.push({date:D,isCurrentMonth:D.month()===C}),D=D.add(1,"day");return V.length>0&&k.push(V),k},b=(_,k)=>{c.value=!1,u.value=!1,d.value=!1,f.value=!1,_==="left"?(s.value=k,r.value=k.add(1,"month")):_==="right"&&(r.value=k,s.value=k.subtract(1,"month"))},x=l.computed(()=>Array.from(Array(7),(_,k)=>ue().day(k).format("ddd"))),y=_=>{const k=o.value.startDate,v=o.value.endDate;a.value=k&&v?null:a.value;const C=a.value,D=k==null?void 0:k.isSame(_),V=v==null?void 0:v.isSame(_),$=C==null?void 0:C.isSame(_);return{"fm-calendar__cell__button--selected":D&&V||D&&!v,"fm-calendar__cell__button--selected-start":D&&v&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isAfter(k))||k&&!v&&$&&(C==null?void 0:C.isBefore(k)),"fm-calendar__cell__button--selected-end":V&&k&&!(D&&V)||k&&!v&&D&&(C==null?void 0:C.isBefore(k))||k&&!v&&$&&(C==null?void 0:C.isAfter(k)),"fm-calendar__cell__button--selected-between":k&&(v||C)&&v?_.isAfter(k)&&_.isBefore(v):_.isAfter(C)&&_.isBefore(k)||_.isBefore(C)&&_.isAfter(k)}},w=_=>{a.value=_},S=l.computed(()=>{let _=-5;const k=[];for(;_!=5;)k.push(s.value.add(_,"year")),_++;return k});return l.watch(()=>n.value,()=>{var _,k;return o.value={startDate:(_=n.value)!=null&&_.startDate?ue(n.value.startDate,"YYYY-MM-DD"):null,endDate:(k=n.value)!=null&&k.endDate?ue(n.value.endDate,"YYYY-MM-DD"):null}}),(_,k)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":k[7]||(k[7]=v=>l.isRef(n)?n.value=v:null),disabled:_.disabled,rules:_.rules,focused:i.value,"helper-text":_.helperText,"helper-state":_.helperState,tag:"div"},{default:l.withCtx(({invalid:v})=>[l.createVNode(we,{"show-menu":i.value,disabled:_.disabled,onDropdownChanged:k[6]||(k[6]=C=>i.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",Ng,[l.createElementVNode("label",Ig,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(e.startLabel),3),l.createVNode(it,{class:l.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:v,"show-valid-border":_.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(_.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.startDate?l.unref(ue)(l.unref(n).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),Lg,l.createElementVNode("label",Tg,[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},l.toDisplayString(e.endLabel),3),l.createVNode(it,{class:l.normalizeClass(_.disabled?"cursor-not-allowed":"cursor-pointer"),focused:i.value,invalid:v,"show-valid-border":_.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(_.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(_.$slots,"append",{},void 0,!0)]),default:l.withCtx(()=>{var C,D;return[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":(C=l.unref(n))!=null&&C.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString((D=l.unref(n))!=null&&D.endDate?l.unref(ue)(l.unref(n).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",zg,[l.createElementVNode("div",Hg,[l.createElementVNode("div",Wg,[l.createElementVNode("div",jg,[l.createElementVNode("div",Yg,[l.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:k[0]||(k[0]=()=>b("left",s.value.subtract(1,"month")))}),l.createVNode(we,{"show-menu":c.value,onDropdownChanged:k[1]||(k[1]=C=>c.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",Gg,l.toDisplayString(s.value.format("MMMM")),1),l.createVNode(L,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Ug,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(C,D)=>s.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(Ee,{"model-value":s.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":u.value,onDropdownChanged:k[2]||(k[2]=C=>u.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",u.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",qg,l.toDisplayString(s.value.format("YYYY")),1),l.createVNode(L,{name:u.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",Xg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(Ee,{"model-value":s.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("left",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),l.createElementVNode("div",null,[l.createElementVNode("div",Kg,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(s.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,V=>(l.openBlock(),l.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",y(V.date)]),type:"button",onClick:()=>p(V.date),onMouseover:$=>w(V.date)},l.toDisplayString(V.date.date()),43,Zg)):l.createCommentVNode("",!0)]))),128))]))),128))])])]),l.createElementVNode("div",Jg,[l.createElementVNode("div",Qg,[l.createElementVNode("div",em,[l.createVNode(we,{"show-menu":d.value,onDropdownChanged:k[3]||(k[3]=C=>d.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",tm,l.toDisplayString(r.value.format("MMMM")),1),l.createVNode(L,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",nm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Array.from(Array(12),(C,D)=>r.value.month(D)),C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("MMMM")},[l.createVNode(Ee,{"model-value":r.value.format("MMMM")===C.format("MMMM"),label:C.format("MMMM"),"onUpdate:modelValue":D=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),l.createVNode(we,{"show-menu":f.value,onDropdownChanged:k[4]||(k[4]=C=>f.value=C)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[l.createElementVNode("div",om,l.toDisplayString(r.value.format("YYYY")),1),l.createVNode(L,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("ul",im,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,C=>(l.openBlock(),l.createElementBlock("li",{key:C.format("YYYY")},[l.createVNode(Ee,{"model-value":r.value.format("YYYY")===C.format("YYYY"),label:C.format("YYYY"),"onUpdate:modelValue":D=>b("right",C)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),l.createVNode(L,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:k[5]||(k[5]=()=>b("left",s.value.add(1,"month")))})]),l.createElementVNode("div",null,[l.createElementVNode("div",sm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(x.value,C=>(l.openBlock(),l.createElementBlock("div",{key:C,class:"fm-calendar__cell"},l.toDisplayString(C),1))),128))]),l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m(r.value),(C,D)=>(l.openBlock(),l.createElementBlock("div",{key:D,class:"fm-calendar__row fm-typo-body-lg-400"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(C,V=>(l.openBlock(),l.createElementBlock("div",{key:V.date.date(),class:"fm-calendar__cell"},[V.isCurrentMonth?(l.openBlock(),l.createElementBlock("button",{key:0,class:l.normalizeClass(["fm-calendar__cell__button",y(V.date)]),type:"button",onClick:()=>p(V.date),onMouseover:$=>w(V.date)},l.toDisplayString(V.date.date()),43,rm)):l.createCommentVNode("",!0)]))),128))]))),128))])])])]),l.createElementVNode("div",lm,[l.createVNode(fe,{label:"Cancel",size:"md",variant:"tertiary",onClick:g}),l.createVNode(fe,{label:"OK",size:"md",variant:"primary",disabled:!o.value.startDate||!o.value.endDate,onClick:h},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":l.withCtx(()=>[l.renderSlot(_.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),qy="",cm=Q(am,[["__scopeId","data-v-431b8ad3"]]),dm=l.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(t,{expose:e,emit:n}){const o=l.ref([]),i=l.ref(0),s=n,r=()=>{let d=[];for(let u=0;u<o.value.length;u++){const f=o.value[u];d=[...d,...f.validate()]}d.length?s("validation-failed",d):s("validation-success")},a=()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValue();s("reset")};return e({validateInputs:r,resetInputsValidation:()=>{for(let d=0;d<o.value.length;d++)o.value[d].resetValidation();s("validation-reset")},resetInputs:a}),l.provide(Xi,{register({validate:d,resetValidation:u,resetValue:f}){return o.value.push({componentId:i.value,validate:d,resetValidation:u,resetValue:f}),i.value++},unregister(d){o.value.filter(u=>u.componentId!==d)}}),(d,u)=>(l.openBlock(),l.createElementBlock("form",{onSubmit:l.withModifiers(r,["prevent"]),onReset:l.withModifiers(a,["prevent"])},[l.renderSlot(d.$slots,"default")],32))}}),um={class:"fm-radio-btn"},fm={class:"fm-radio-btn__input--container"},hm=["value","disabled","checked"],pm={class:"py-8"},gm={class:"fm-typo-body-lg-400"},mm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},bm=l.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(),i=l.inject(Ki,null),s=()=>{r.value||(i?i.updateValue(e.value):n.value=e.value)},r=l.computed(()=>i?i.getDisabled():e.disabled),a=l.computed(()=>i?e.value===i.groupValue.value:n.value===e.value);return(c,d)=>{const u=l.resolveDirective("wave");return l.openBlock(),l.createElementBlock("div",um,[l.createElementVNode("label",{class:l.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":r.value,"cursor-pointer":!r.value}),onClick:s},[l.withDirectives((l.openBlock(),l.createElementBlock("div",fm,[l.createElementVNode("input",{ref_key:"inputEl",ref:o,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:r.value,checked:a.value},null,8,hm)])),[[u,!r.value]]),l.createElementVNode("div",pm,[l.renderSlot(c.$slots,"label",{},()=>[l.createElementVNode("div",gm,l.toDisplayString(c.label),1),c.sublabel?(l.openBlock(),l.createElementBlock("div",mm,l.toDisplayString(c.sublabel),1)):l.createCommentVNode("",!0)],!0)])],2)])}}}),Xy="",ym=Q(bm,[["__scopeId","data-v-24fa5bf9"]]),_m=l.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[t=>!!t||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue");return l.provide(Ki,{groupValue:n,getDisabled:()=>e.disabled,updateValue(o){n.value=o}}),(o,i)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":i[0]||(i[0]=s=>l.isRef(n)?n.value=s:null),label:o.label,disabled:o.disabled,required:o.labelMark==="required",optional:o.labelMark==="optional",info:o.labelInfo,rules:o.rules,"helper-text":o.helperText,"helper-state":o.helperState},{label:l.withCtx(()=>[l.renderSlot(o.$slots,"label")]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass({"flex items-center gap-16 justify-start":o.inline})},[l.renderSlot(o.$slots,"default")],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(o.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}}),xm={class:"flex flex-col gap-4"},wm={class:"w-[280px]"},Cm={class:"flex flex-col gap-4 justify-center"},km=l.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=l.ref(!1),i=(d,u)=>{if(e.multiselect){let f=[];d?f=n.value.length===0?[u]:e.items.filter(p=>n.value.some(h=>ge(p.value,h)||ge(p.value,u.value))):f=e.items.filter(p=>n.value.some(h=>ge(p.value,h)&&!ge(p.value,u.value))),n.value=f.map(p=>p.value)}else n.value=u.value,setTimeout(()=>{o.value=!1},0)},s=d=>{const u=[...n.value].filter((f,p)=>p!==d);n.value=u},r=l.computed(()=>e.multiselect?e.items.filter(d=>l.toRaw(n.value).some(u=>ge(u,d.value))):e.items.filter(d=>ge(n.value,d.value))),a=l.computed(()=>e.items.filter(d=>n.value.some(u=>ge(d.value,u))).map(d=>({label:d.label}))),c=l.computed(()=>{var d;return e.multiselect?e.placeholder:((d=e.items.find(u=>ge(u.value,n.value)))==null?void 0:d.label)??e.placeholder});return(d,u)=>(l.openBlock(),l.createElementBlock("div",xm,[l.createVNode(je,{modelValue:l.unref(n),"onUpdate:modelValue":u[1]||(u[1]=f=>l.isRef(n)?n.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:o.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:l.withCtx(()=>[l.renderSlot(d.$slots,"label")]),default:l.withCtx(({invalid:f})=>[l.createVNode(we,{"show-menu":o.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:u[0]||(u[0]=p=>o.value=p)},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:l.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(d.$slots,"prepend")]),append:l.withCtx(()=>[l.createVNode(L,{name:o.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":l.unref(n)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},l.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",wm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.items,p=>(l.openBlock(),l.createBlock(Ee,{key:p.value,"has-checkbox":d.multiselect,label:p.label,value:p.value,"model-value":r.value.some(h=>l.unref(ge)(h.value,p.value)),"onUpdate:modelValue":h=>i(h,p)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":l.withCtx(()=>[l.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),l.createElementVNode("div",Cm,[d.multiselect&&r.value.length>0?(l.openBlock(),l.createBlock(Ui,{key:0,items:a.value,removable:"",disabled:d.disabled,onChipClosed:s},null,8,["items","disabled"])):l.createCommentVNode("",!0)])]))}}),Sm=["inputMode","value","placeholder","readOnly"],vm={key:0},Mm=l.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),{isFocused:o,blur:i,focus:s}=ao(),r=l.ref(null);let a;const c=y=>{if(y!==""){const w=+y.replace(/,/g,"");return isNaN(w)?null:w}return null},d=y=>a.format(y),u=y=>{if(typeof n.value!="number"){n.value=+n.value;return}if(y>0&&m.value||y<0&&b.value)return;let w=x(n.value)?n.value+y:0;w=f(w),n.value=w},f=y=>e.max!==void 0&&y>e.max?e.max:e.min!==void 0&&y<e.min?e.min:y,p=()=>{var y;n.value=c(((y=r.value)==null?void 0:y.value)??"")},h=y=>{if(![...Array(10).keys()].map(w=>w.toString()).includes(y.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(y.key)){y.preventDefault();return}},g=l.computed(()=>n.value!=null?d(n.value):""),m=l.computed(()=>{let y=!1;return e.max!==void 0&&(y=n.value>=e.max),e.min!==void 0&&(y=n.value<e.min),y}),b=l.computed(()=>{let y=!1;return e.max!==void 0&&(y=n.value>e.max),e.min!==void 0&&(y=n.value<=e.min),y});l.onMounted(()=>{a=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping})});function x(y){return typeof y=="number"&&isFinite(y)}return(y,w)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":w[8]||(w[8]=S=>l.isRef(n)?n.value=S:null),label:y.label,disabled:y.disabled,required:y.labelMark==="required",optional:y.labelMark==="optional",info:y.labelInfo,rules:y.rules,focused:l.unref(o),"helper-text":y.helperText,"helper-state":y.helperState},{label:l.withCtx(()=>[l.renderSlot(y.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:S})=>[l.createVNode(it,{class:"cursor-text","append-icon":y.appendIcon,"prepend-icon":y.prependIcon,focused:l.unref(o),invalid:S,"show-valid-border":y.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(y.$slots,"prepend",{},void 0,!0)]),append:l.withCtx(()=>[l.renderSlot(y.$slots,"append",{},()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center justify-center",{"mr-32":y.showSteppers}])},[y.appendText?(l.openBlock(),l.createElementBlock("div",vm,l.toDisplayString(y.appendText),1)):l.createCommentVNode("",!0),y.appendIcon?(l.openBlock(),l.createBlock(L,{key:1,name:y.appendIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)],!0),y.showSteppers?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["fm-stepper-field__stepper__container",l.unref(o)?"right-[6px]":"right-[7px]"])},[l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:w[2]||(w[2]=()=>u(y.step)),onFocus:w[3]||(w[3]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[4]||(w[4]=(..._)=>l.unref(i)&&l.unref(i)(..._))},[l.createVNode(L,{name:"expand_less",size:"md",color:y.disabled||m.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),l.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:w[5]||(w[5]=()=>u(-y.step)),onFocus:w[6]||(w[6]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[7]||(w[7]=(..._)=>l.unref(i)&&l.unref(i)(..._))},[l.createVNode(L,{name:"expand_more",size:"md",color:y.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:r,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:g.value,placeholder:y.placeholder,readOnly:y.readonly,onInput:p,onFocus:w[0]||(w[0]=(..._)=>l.unref(s)&&l.unref(s)(..._)),onBlur:w[1]||(w[1]=(..._)=>l.unref(i)&&l.unref(i)(..._)),onKeydown:h},null,40,Sm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(y.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Ky="",Em=Q(Mm,[["__scopeId","data-v-46378d3b"]]),Dm={class:"cursor-pointer fm-switch__container"},Vm={key:0},Rm={class:"fm-typo-body-lg-400"},Fm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Bm={class:"fm-switch__input--container"},$m=["checked","value","disabled"],Pm={key:1},Am={class:"fm-typo-body-lg-400"},Om={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Nm=l.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{},disabled:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const e=t,n=de(e,"modelValue"),o=()=>{e.disabled||(n.value=!n.value)};return(i,s)=>(l.openBlock(),l.createElementBlock("label",Dm,[i.labelPlacement==="left"?(l.openBlock(),l.createElementBlock("div",Vm,[l.renderSlot(i.$slots,"label",{},void 0,!0),l.createElementVNode("div",Rm,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Fm,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",Bm,[l.createElementVNode("input",{checked:l.unref(n),class:"fm-switch__input--btn",type:"checkbox",value:i.value,disabled:i.disabled,onClick:o},null,8,$m),l.createElementVNode("div",{class:l.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":i.showIcon})},[i.showIcon?(l.openBlock(),l.createBlock(L,{key:0,name:l.unref(n)?"check":"close",size:"sm",color:i.disabled?"#C7C7CC":l.unref(n)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):l.createCommentVNode("",!0)],2)]),i.labelPlacement==="right"?(l.openBlock(),l.createElementBlock("div",Pm,[l.createElementVNode("div",Am,l.toDisplayString(i.label),1),i.sublabel?(l.openBlock(),l.createElementBlock("div",Om,l.toDisplayString(i.sublabel),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)]))}}),Zy="",Im=Q(Nm,[["__scopeId","data-v-c967bf28"]]),Lm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],Tm=l.defineComponent({__name:"FmTextField",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},prependIcon:{default:""},appendIcon:{default:""},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const e=t,n=l.ref(null),o=de(e,"modelValue"),{isFocused:i,focus:s,blur:r}=ao(),a=c=>{o.value=c.target.value};return(c,d)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(o),"onUpdate:modelValue":d[2]||(d[2]=u=>l.isRef(o)?o.value=u:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:l.unref(i),"helper-text":c.helperText,"helper-state":c.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(c.$slots,"label")]),default:l.withCtx(({invalid:u})=>[l.createVNode(it,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:l.unref(i),invalid:u,"show-valid-border":c.showValidBorder},{prepend:l.withCtx(()=>[l.renderSlot(c.$slots,"prepend")]),append:l.withCtx(()=>[l.renderSlot(c.$slots,"append")]),default:l.withCtx(()=>[l.createElementVNode("input",{ref_key:"inputEl",ref:n,class:l.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:l.unref(o),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:a,onFocus:d[0]||(d[0]=(...f)=>l.unref(s)&&l.unref(s)(...f)),onBlur:d[1]||(d[1]=(...f)=>l.unref(r)&&l.unref(r)(...f))},null,42,Lm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":l.withCtx(()=>[l.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(c.maxLength?`${l.unref(o).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Jy="",zm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Hm=l.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelInfo:{default:""},helperText:{default:""},helperState:{default:"none"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),{isFocused:o,focus:i,blur:s}=ao(),r=a=>{n.value=a.target.value};return(a,c)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":c[2]||(c[2]=d=>l.isRef(n)?n.value=d:null),label:a.label,disabled:a.disabled,required:a.labelMark==="required",optional:a.labelMark==="optional",info:a.labelInfo,rules:a.rules,focused:l.unref(o),"helper-text":a.helperText,"helper-state":a.helperState},l.createSlots({label:l.withCtx(()=>[l.renderSlot(a.$slots,"label",{},void 0,!0)]),default:l.withCtx(({invalid:d})=>[l.createElementVNode("div",{class:l.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":l.unref(o),"fm-textarea__container--invalid":!!l.unref(n)&&d,"fm-textarea__container--valid":a.showValidBorder&&a.showSuccess&&!!l.unref(n)&&!d,"fm-textarea__container--disabled":a.disabled})},[l.createElementVNode("textarea",{class:l.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!a.disabled,"fm-color-typo-disabled":a.disabled}),value:l.unref(n),placeholder:a.placeholder,minlength:a.minLength,maxlength:a.maxLength,readOnly:a.readonly,disabled:a.disabled,onInput:r,onFocus:c[0]||(c[0]=(...u)=>l.unref(i)&&l.unref(i)(...u)),onBlur:c[1]||(c[1]=(...u)=>l.unref(s)&&l.unref(s)(...u))},null,42,zm)],2)]),"helper-text":l.withCtx(()=>[l.renderSlot(a.$slots,"helper-text",{},void 0,!0)]),_:2},[a.showWordCount?{name:"helper-append",fn:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass([a.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},l.toDisplayString(a.maxLength?`${l.unref(n).length} / ${a.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Qy="",Wm=Q(Hm,[["__scopeId","data-v-280a005d"]]),jm={class:"flex flex-col fm-time-input items-center"},Ym=["value"],Gm=l.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(t,{emit:e}){const n=t,o=e,i=l.ref();function s(u){i.value&&(i.value.value=u)}l.watch(()=>n.modelValue,s);function r(){if(!i.value)return;const u=a(i.value.value);if(u==null||u>n.max||u<n.min){s(n.modelValue);return}o("update:model-value",u)}function a(u){return u&&/^\d+$/.test(u)?Number(u):null}function c(){o("update:model-value",a(n.modelValue)+1)}function d(){o("update:model-value",a(n.modelValue)-1)}return(u,f)=>(l.openBlock(),l.createElementBlock("div",jm,[l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[l.createVNode(L,{name:"expand_less",size:"lg"})]),l.createElementVNode("input",{ref_key:"inputRef",ref:i,value:n.modelValue,onInput:r},null,40,Ym),l.createElementVNode("div",{class:"fm-time-input__scroller",onClick:d},[l.createVNode(L,{name:"expand_more",size:"lg"})])]))}}),e_="",Gl=Q(Gm,[["__scopeId","data-v-e8ddb125"]]);var Ye=(t=>(t.AM="AM",t.PM="PM",t))(Ye||{});function st(t){return t.toString().padStart(2,"0")}const Um={class:"flex fm-time-input gap-16 items-center"},qm=l.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Xm={class:"fm-time-input-periods"},Km=["onClick"],Ul=l.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e;function i(s){const r={hours:s.hours??n.modelValue.hours,minutes:s.minutes??n.modelValue.minutes,period:s.period??n.modelValue.period},a=n.modelValue.hours;(a===12&&r.hours===11||a===11&&r.hours===12)&&(r.period=n.modelValue.period===Ye.AM?Ye.PM:Ye.AM),r.hours>12?r.hours=1:r.hours<1&&(r.hours=12),r.minutes>59?r.minutes=0:r.minutes<0&&(r.minutes=59),o("update:model-value",r)}return(s,r)=>(l.openBlock(),l.createElementBlock("div",Um,[l.createVNode(Gl,{"model-value":l.unref(st)(t.modelValue.hours),min:1,max:12,"onUpdate:modelValue":r[0]||(r[0]=a=>i({hours:a}))},null,8,["model-value"]),qm,l.createVNode(Gl,{"model-value":l.unref(st)(t.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":r[1]||(r[1]=a=>i({minutes:a}))},null,8,["model-value"]),l.createElementVNode("div",Xm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Ye),a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass([{"fm-time-input-period__selected":a===t.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},l.toDisplayString(a),11,Km))),128))])]))}}),t_="",Zm={class:"flex gap-8"},Jm={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},Qm=l.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),eb={class:"flex justify-center w-full"},tb={class:"flex justify-end"},nb=l.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),o=l.ref(null),i=l.computed(()=>{if(!n.value)return null;const{hours:h,minutes:g,period:m}=a(n.value);return`${st(h)}:${st(g)} ${m}`});function s(){if(!o.value){n.value=null;return}const{hours:h,minutes:g,period:m}=o.value,b=r(h,g,m);n.value=b,u()}function r(h,g,m){let b=h;return m===Ye.PM?b=h===12?h:h+12:h===12&&(b=0),`${st(b)}:${st(g)}`}l.onMounted(()=>{n.value&&(o.value=a(n.value))}),l.watch(()=>n.value,h=>{h&&(o.value=a(h))});function a(h){const[g,m,b]=c(h).split(":");return{hours:Number(g),minutes:Number(m),period:b}}function c(h){const[g,m]=h.split(":"),b=Number(g),x=Number(m),y=b>11?Ye.PM:Ye.AM;let w=b;return w===0?w=12:w>12&&(w-=12),`${st(w)}:${st(x)}:${y}`}const d=l.ref();function u(){var h;(h=d.value)==null||h.hide()}const f=l.ref(!1);function p(h){h?o.value=a(n.value??"00:00"):o.value=n.value?a(n.value):null,f.value=h}return(h,g)=>(l.openBlock(),l.createBlock(je,{modelValue:l.unref(n),"onUpdate:modelValue":g[1]||(g[1]=m=>l.isRef(n)?n.value=m:null),label:h.label,disabled:h.disabled,required:h.labelMark==="required",optional:h.labelMark==="optional",info:h.labelInfo,rules:h.rules,focused:f.value,"helper-text":h.helperText,"helper-state":h.helperState},{label:l.withCtx(()=>[l.renderSlot(h.$slots,"label")]),default:l.withCtx(({invalid:m})=>[l.createVNode(we,{ref_key:"dropdownRef",ref:d,onDropdownChanged:p},{"menu-button":l.withCtx(()=>[l.createVNode(it,{class:l.normalizeClass(h.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:m,"show-valid-border":h.showValidBorder},{default:l.withCtx(()=>[l.createElementVNode("div",Zm,[l.createVNode(L,{name:"schedule",outline:!f.value},null,8,["outline"]),l.createElementVNode("div",{class:l.normalizeClass(["grow",{"text-fm-color-typo-disabled":!i.value}])},l.toDisplayString(i.value??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":l.withCtx(()=>[l.createElementVNode("div",Jm,[Qm,l.createElementVNode("div",eb,[l.createVNode(Ul,{"model-value":o.value??{hours:0,minutes:0,period:l.unref(Ye).AM},class:"py-16","onUpdate:modelValue":g[0]||(g[0]=b=>o.value=b)},null,8,["model-value"])]),l.createElementVNode("div",tb,[l.createVNode(fe,{label:"Cancel",variant:"tertiary",onClick:u}),l.createVNode(fe,{label:"Confirm",variant:"tertiary",onClick:s})])])]),_:2},1536)]),"helper-text":l.withCtx(()=>[l.renderSlot(h.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),ob=l.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"fm-list--separator":e.separator,activeClass:e.activeClass})},[l.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),n_="",ib=Q(ob,[["__scopeId","data-v-884ba127"]]),sb=l.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(t){const e=t;return(n,o)=>{const i=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createBlock(e.tag,{class:l.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":n.disabled,"cursor-pointer":n.clickable&&!n.disabled,"cursor-not-allowed":n.clickable&&n.disabled,activeClass:n.activeClass})},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[i,n.clickable&&!n.disabled]])}}}),o_="",rb=Q(sb,[["__scopeId","data-v-f565b558"]]),lb={class:"fm-progress-indicator relative"},ab=["data-progress"],cb={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},ql=l.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(t){const e=t,n=l.ref(null),o=l.computed(()=>`${e.modelValue/100*360}deg`),i=s=>{n.value&&n.value.style.setProperty("--progress",s)};return l.onMounted(()=>{i(o.value)}),l.onUpdated(()=>{i(o.value)}),l.watch(o,async s=>{i(s)}),(s,r)=>(l.openBlock(),l.createElementBlock("div",lb,[l.createElementVNode("div",{ref_key:"progress",ref:n,class:"fm-progress-circular w-full","data-progress":o.value},null,8,ab),l.createElementVNode("div",cb,[l.renderSlot(s.$slots,"default")])]))}}),i_="",db={class:"flex"},ub={key:0,class:"mt-8"},fb=l.defineComponent({__name:"FmSnackbar",props:{title:{type:String,default:void 0},description:{type:String,default:void 0},variant:{type:String,default:"info"},dismissable:{type:Boolean,default:!1},action:{type:String,default:void 0},color:{type:String,default:void 0},bgColor:{type:String,default:void 0}},emits:["onDismiss","onAction"],setup(t,{emit:e}){const n=t,o=e,i=l.computed(()=>{switch(n.variant){case"info":return{icon:{name:"info",color:"system-info-300"},actionColor:"typo-info",bgColor:"system-info-100"};case"success":return{icon:{name:"check_circle",color:"system-success-300"},actionColor:"typo-success",bgColor:"system-success-100"};case"warning":return{icon:{name:"warning",color:"system-warning-300"},actionColor:"typo-warning",bgColor:"system-warning-100"};case"error":return{icon:{name:"error",color:"system-error-300"},actionColor:"typo-error",bgColor:"system-error-100"};case"neutral":return{actionColor:"primary",bgColor:"neutral-gray-100"};default:throw Error(`Unimplement snackbar variant ${n.variant}`)}}),s=l.computed(()=>n.title?{text:n.title,classes:"fm-typo-body-lg-700"}:{text:n.description,classes:""}),r=l.computed(()=>n.bgColor?wo(n.bgColor)?{style:{backgroundColor:n.bgColor}}:{class:`bg-fm-color-${n.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=l.computed(()=>n.color?wo(n.color)?{style:{color:n.color}}:{class:`text-fm-color-${n.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(c,d)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(r.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[l.createElementVNode("div",db,[i.value.icon?(l.openBlock(),l.createBlock(L,{key:0,name:i.value.icon.name,color:n.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(`${s.value.classes} grow ellipsis`)},l.toDisplayString(s.value.text),3),n.dismissable?(l.openBlock(),l.createBlock(L,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:d[0]||(d[0]=()=>o("onDismiss"))})):l.createCommentVNode("",!0)]),n.title&&n.description?(l.openBlock(),l.createElementBlock("div",ub,l.toDisplayString(n.description),1)):l.createCommentVNode("",!0),l.renderSlot(c.$slots,"actions",{},()=>[n.action?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[l.createElementVNode("span",{class:"cursor-pointer",onClick:d[1]||(d[1]=()=>o("onAction"))},l.toDisplayString(n.action),1)],16)):l.createCommentVNode("",!0)],!0)],16))}}),s_="",hb=Q(fb,[["__scopeId","data-v-b6db34bb"]]),pb={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Xl=l.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-col",t.disabled?"text-fm-color-typo-disabled":""])},[l.createElementVNode("div",{class:l.normalizeClass(["fm-step-title line-clamp-2",t.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},l.toDisplayString(t.title),3),t.description?(l.openBlock(),l.createElementBlock("div",pb,l.toDisplayString(t.description),1)):l.createCommentVNode("",!0)],2))}}),gb=["data-title","data-description","data-disabled"],mb={class:"flex fm-step-container gap-12 grow"},bb=l.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(t){const e=t,{currentStep:n,goToStep:o}=l.inject(Zi);function i(){s.value||o(e.value)}const s=l.computed(()=>e.disabled?e.disabled():!1),r=l.computed(()=>e.error?e.error():!1),a=l.computed(()=>n()===e.value),c=l.computed(()=>e.complete()),d=l.computed(()=>a.value||c.value||n()>e.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),u=l.computed(()=>a.value?{className:"bg-fm-color-primary"}:r.value?{config:{name:"warning",color:"system-error-300"}}:s.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,p)=>{const h=l.resolveDirective("wave");return l.withDirectives((l.openBlock(),l.createElementBlock("div",{"data-title":t.title,"data-description":t.description,"data-disabled":s.value,class:l.normalizeClass(`fm-step gap-4 grow ${s.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:l.withModifiers(i,["stop"])},[l.createElementVNode("div",null,[l.createElementVNode("div",{class:l.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),l.createElementVNode("div",mb,[l.createElementVNode("div",{class:l.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",u.value.className])},[u.value.config?(l.openBlock(),l.createBlock(L,{key:0,name:u.value.config.name,color:u.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):l.createCommentVNode("",!0)],2),l.createVNode(Xl,{title:t.title,description:t.description,disabled:s.value,class:"grow"},null,8,["title","description","disabled"])])],10,gb)),[[h,!s.value]])}}}),r_="",yb=Q(bb,[["__scopeId","data-v-ee172cad"]]),_b={class:"hidden items-center xs:flex"},xb={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},wb=l.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(t,{emit:e}){const n=t,o=e,i=f=>{o("update:model-value",f)};l.provide(Zi,{currentStep:()=>n.modelValue,goToStep:i});const s=l.ref(),r=l.ref([]),a=l.computed(()=>r.value[n.modelValue-1]),c=l.computed(()=>n.modelValue/r.value.length*100),d=l.computed(()=>`${n.modelValue} of ${r.value.length}`),u=()=>{var p;const f=Array.from(((p=s.value)==null?void 0:p.querySelectorAll(":scope > .fm-step"))??[]);r.value=f.map(h=>({title:h.dataset.title??"",description:h.dataset.description,disabled:h.dataset.disabled=="true"}))};return l.onMounted(()=>{u()}),(f,p)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(`fm-stepper fm-stepper__${t.orientation}`)},[l.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:l.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${t.orientation==="vertical"?"flex-col":""}`)},[l.renderSlot(f.$slots,"default")],2),l.createElementVNode("div",_b,[l.createVNode(ql,{"model-value":c.value,class:"mr-12",style:{"min-width":"60px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.value),1)]),_:1},8,["model-value"]),a.value?(l.openBlock(),l.createBlock(Xl,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):l.createCommentVNode("",!0)]),f.$slots.contents?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${t.orientation==="vertical"?"w-2/3":""}`)},[l.renderSlot(f.$slots,"contents"),l.createElementVNode("div",xb,[l.renderSlot(f.$slots,"actions")])],2)):l.createCommentVNode("",!0)],2))}});let Cb=0;function kb(){return Cb++}const Sb=t=>(l.pushScopeId("data-v-fae3740e"),t=t(),l.popScopeId(),t),vb=["disabled"],Mb=[Sb(()=>l.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Eb={class:"max-w-[360px] min-w-[186px]"},Db=l.defineComponent({__name:"FmTab",props:{modelValue:{default:null},label:{default:""},vertical:{type:Boolean,default:!1},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:()=>kb()},children:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=l.ref(!1),o=t,i=e,s=l.ref(!1);function r(f){n.value=f}const a=()=>{o.disabled||o.children.length>0||i("update:modelValue",o.value)},c=f=>{o.children.length!==0&&(s.value=f)},d=l.computed(()=>o.children.length>0?o.children.some(f=>f.value===o.modelValue):o.modelValue===o.value),u=f=>{s.value=!1,i("update:modelValue",f)};return(f,p)=>(l.openBlock(),l.createBlock(we,{"show-menu":s.value,disabled:f.children.length===0,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":f.vertical}]),placement:f.vertical?"right-start":"bottom-start",onDropdownChanged:c},{"menu-button":l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["fm-tab",`fm-tab--${f.vertical?"vertical":"horizontal"}`,f.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":d.value}]),disabled:f.disabled,onMousedown:p[0]||(p[0]=()=>r(!0)),onMouseup:p[1]||(p[1]=()=>r(!1)),onMouseleave:p[2]||(p[2]=()=>r(!1)),onClick:a},[l.renderSlot(f.$slots,"prepend",{},void 0,!0),f.icon?(l.openBlock(),l.createBlock(L,{key:0,name:f.icon,outline:!n.value&&!d.value,color:f.disabled?"neutral-gray-200":d.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",d.value?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.label?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",f.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!d.value||f.disabled?"visible":"invisible"])},l.toDisplayString(f.label),3)):l.createCommentVNode("",!0),f.badge?(l.openBlock(),l.createBlock(yn,{key:3,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0),f.children.length>0?(l.openBlock(),l.createBlock(L,{key:4,size:"md",name:s.value?"expand_less":"expand_more"},null,8,["name"])):l.createCommentVNode("",!0),l.renderSlot(f.$slots,"append",{},void 0,!0),d.value?(l.openBlock(),l.createElementBlock("div",{key:5,class:l.normalizeClass([`fm-tab__indicator__wrapper--${f.vertical?"vertical":"horizontal"}`])},Mb,2)):l.createCommentVNode("",!0)],42,vb)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Eb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.children,h=>l.renderSlot(f.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(h)),()=>[l.createVNode(Ee,{"model-value":o.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:g=>u(h.value)},{append:l.withCtx(()=>[h.badge?(l.openBlock(),l.createBlock(yn,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),a_="",Kl=Q(Db,[["__scopeId","data-v-fae3740e"]]);/**
26
+ * table-core
27
+ *
28
+ * Copyright (c) TanStack
29
+ *
30
+ * This source code is licensed under the MIT license found in the
31
+ * LICENSE.md file in the root directory of this source tree.
32
+ *
33
+ * @license MIT
34
+ */function rt(t,e){return typeof t=="function"?t(e):t}function Ce(t,e){return n=>{e.setState(o=>({...o,[t]:rt(n,o[t])}))}}function co(t){return t instanceof Function}function Vb(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Rb(t,e){const n=[],o=i=>{i.forEach(s=>{n.push(s);const r=e(s);r!=null&&r.length&&o(r)})};return o(t),n}function I(t,e,n){let o=[],i;return()=>{let s;n.key&&n.debug&&(s=Date.now());const r=t();if(!(r.length!==o.length||r.some((d,u)=>o[u]!==d)))return i;o=r;let c;if(n.key&&n.debug&&(c=Date.now()),i=e(...r),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-s)*100)/100,u=Math.round((Date.now()-c)*100)/100,f=u/16,p=(h,g)=>{for(h=String(h);h.length<g;)h=" "+h;return h};console.info(`%c⏱ ${p(u,5)} /${p(d,5)} ms`,`
35
+ font-size: .6rem;
36
+ font-weight: bold;
37
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Fb(t,e,n,o){var i,s;const a={...t._getDefaultColumnDef(),...e},c=a.accessorKey;let d=(i=(s=a.id)!=null?s:c?c.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:c&&(c.includes(".")?u=p=>{let h=p;for(const m of c.split(".")){var g;h=(g=h)==null?void 0:g[m],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${m}" in deeply nested key "${c}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(d)}`,accessorFn:u,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:I(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}}),getLeafColumns:I(()=>[t._getOrderColumnsFn()],p=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(m=>m.getLeafColumns());return p(g)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=t.options.debugAll)!=null?p:t.options.debugColumns}})};for(const p of t._features)p.createColumn==null||p.createColumn(f,t);return f}function Zl(t,e,n){var o;let s={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),r.push(c)};return a(s),r},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(r=>{r.createHeader==null||r.createHeader(s,t)}),s}const Bb={createTable:t=>{t.getHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>{var s,r;const a=(s=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?s:[],c=(r=i==null?void 0:i.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?r:[],d=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(i!=null&&i.includes(f.id)));return uo(e,[...a,...d,...c],t)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,i)=>(n=n.filter(s=>!(o!=null&&o.includes(s.id))&&!(i!=null&&i.includes(s.id))),uo(e,n,t,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?i:[];return uo(e,s,t,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightHeaderGroups=I(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var i;const s=(i=o==null?void 0:o.map(r=>n.find(a=>a.id===r)).filter(Boolean))!=null?i:[];return uo(e,s,t,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFooterGroups=I(()=>[t.getHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFooterGroups=I(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFooterGroups=I(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFooterGroups=I(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getFlatHeaders=I(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftFlatHeaders=I(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterFlatHeaders=I(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightFlatHeaders=I(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getCenterLeafHeaders=I(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeftLeafHeaders=I(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getRightLeafHeaders=I(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}}),t.getLeafHeaders=I(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var i,s,r,a,c,d;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(r=(a=n[0])==null?void 0:a.headers)!=null?r:[],...(c=(d=o[0])==null?void 0:d.headers)!=null?c:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugHeaders}})}};function uo(t,e,n,o){var i,s;let r=0;const a=function(p,h){h===void 0&&(h=1),r=Math.max(r,h),p.filter(g=>g.getIsVisible()).forEach(g=>{var m;(m=g.columns)!=null&&m.length&&a(g.columns,h+1)},0)};a(t);let c=[];const d=(p,h)=>{const g={depth:h,id:[o,`${h}`].filter(Boolean).join("_"),headers:[]},m=[];p.forEach(b=>{const x=[...m].reverse()[0],y=b.column.depth===g.depth;let w,S=!1;if(y&&b.column.parent?w=b.column.parent:(w=b.column,S=!0),x&&(x==null?void 0:x.column)===w)x.subHeaders.push(b);else{const _=Zl(n,w,{id:[o,h,w.id,b==null?void 0:b.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(k=>k.column===w).length}`:void 0,depth:h,index:m.length});_.subHeaders.push(b),m.push(_)}g.headers.push(b),b.headerGroup=g}),c.push(g),h>0&&d(m,h-1)},u=e.map((p,h)=>Zl(n,p,{depth:r,index:h}));d(u,r-1),c.reverse();const f=p=>p.filter(g=>g.column.getIsVisible()).map(g=>{let m=0,b=0,x=[0];g.subHeaders&&g.subHeaders.length?(x=[],f(g.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:_}=w;m+=S,x.push(_)})):m=1;const y=Math.min(...x);return b=b+y,g.colSpan=m,g.rowSpan=b,{colSpan:m,rowSpan:b}});return f((i=(s=c[0])==null?void 0:s.headers)!=null?i:[]),c}const fo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ki=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),$b={getDefaultColumnDef:()=>fo,getInitialState:t=>({columnSizing:{},columnSizingInfo:ki(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ce("columnSizing",t),onColumnSizingInfoChange:Ce("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:fo.minSize,(o=s??t.columnDef.size)!=null?o:fo.size),(i=t.columnDef.maxSize)!=null?i:fo.maxSize)},t.getStart=n=>{const o=n?n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns(),i=o.findIndex(s=>s.id===t.id);if(i>0){const s=o[i-1];return s.getStart(n)+s.getSize()}return 0},t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...i}=n;return i})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=i=>{if(i.subHeaders.length)i.subHeaders.forEach(o);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=()=>{const n=e.getColumn(t.column.id),o=n==null?void 0:n.getCanResize();return i=>{if(!n||!o||(i.persist==null||i.persist(),Si(i)&&i.touches&&i.touches.length>1))return;const s=t.getSize(),r=t?t.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=Si(i)?Math.round(i.touches[0].clientX):i.clientX,c={},d=(m,b)=>{typeof b=="number"&&(e.setColumnSizingInfo(x=>{var y,w;const S=e.options.columnResizeDirection==="rtl"?-1:1,_=(b-((y=x==null?void 0:x.startOffset)!=null?y:0))*S,k=Math.max(_/((w=x==null?void 0:x.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(v=>{let[C,D]=v;c[C]=Math.round(Math.max(D+D*k,0)*100)/100}),{...x,deltaOffset:_,deltaPercentage:k}}),(e.options.columnResizeMode==="onChange"||m==="end")&&e.setColumnSizing(x=>({...x,...c})))},u=m=>d("move",m),f=m=>{d("end",m),e.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p={moveHandler:m=>u(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",p.moveHandler),document.removeEventListener("mouseup",p.upHandler),f(m.clientX)}},h={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),u(m.touches[0].clientX),!1),upHandler:m=>{var b;document.removeEventListener("touchmove",h.moveHandler),document.removeEventListener("touchend",h.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((b=m.touches[0])==null?void 0:b.clientX)}},g=Pb()?{passive:!1}:!1;Si(i)?(document.addEventListener("touchmove",h.moveHandler,g),document.addEventListener("touchend",h.upHandler,g)):(document.addEventListener("mousemove",p.moveHandler,g),document.addEventListener("mouseup",p.upHandler,g)),e.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?ki():(n=t.initialState.columnSizingInfo)!=null?n:ki())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,i)=>o+i.getSize(),0))!=null?e:0}}};let ho=null;function Pb(){if(typeof ho=="boolean")return ho;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return ho=t,ho}function Si(t){return t.type==="touchstart"}const Ab={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ce("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,i;if(!e){t._queue(()=>{e=!0});return}if((o=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var i,s;t.setExpanded(o?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const r=s.split(".");o=Math.max(o,r.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var i;const s=o===!0?!0:!!(o!=null&&o[t.id]);let r={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=o,n=(i=n)!=null?i:!s,!s&&n)return{...r,[t.id]:!0};if(s&&!n){const{[t.id]:a,...c}=r;return c}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o!=null&&o[t.id])},t.getCanExpand=()=>{var n,o,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Jl=(t,e,n)=>{var o;const i=n.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Jl.autoRemove=t=>De(t);const Ql=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};Ql.autoRemove=t=>De(t);const ea=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};ea.autoRemove=t=>De(t);const ta=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};ta.autoRemove=t=>De(t)||!(t!=null&&t.length);const na=(t,e,n)=>!n.some(o=>{var i;return!((i=t.getValue(e))!=null&&i.includes(o))});na.autoRemove=t=>De(t)||!(t!=null&&t.length);const oa=(t,e,n)=>n.some(o=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(o)});oa.autoRemove=t=>De(t)||!(t!=null&&t.length);const ia=(t,e,n)=>t.getValue(e)===n;ia.autoRemove=t=>De(t);const sa=(t,e,n)=>t.getValue(e)==n;sa.autoRemove=t=>De(t);const vi=(t,e,n)=>{let[o,i]=n;const s=t.getValue(e);return s>=o&&s<=i};vi.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(o)?-1/0:o,r=n===null||Number.isNaN(i)?1/0:i;if(s>r){const a=s;s=r,r=a}return[s,r]},vi.autoRemove=t=>De(t)||De(t[0])&&De(t[1]);const Ge={includesString:Jl,includesStringSensitive:Ql,equalsString:ea,arrIncludes:ta,arrIncludesAll:na,arrIncludesSome:oa,equals:ia,weakEquals:sa,inNumberRange:vi};function De(t){return t==null||t===""}const Ob={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],globalFilter:void 0,...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ce("columnFilters",t),onGlobalFilterChange:Ce("globalFilter",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);return typeof o=="string"?Ge.includesString:typeof o=="number"?Ge.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ge.equals:Array.isArray(o)?Ge.arrIncludes:Ge.weakEquals},t.getFilterFn=()=>{var n,o;return co(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Ge[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getCanGlobalFilter=()=>{var n,o,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const i=t.getFilterFn(),s=o==null?void 0:o.find(u=>u.id===t.id),r=rt(n,s?s.value:void 0);if(ra(i,r,t)){var a;return(a=o==null?void 0:o.filter(u=>u.id!==t.id))!=null?a:[]}const c={id:t.id,value:r};if(s){var d;return(d=o==null?void 0:o.map(u=>u.id===t.id?c:u))!=null?d:[]}return o!=null&&o.length?[...o,c]:[c]})},t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Ge.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return co(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Ge[o]},t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=i=>{var s;return(s=rt(e,i))==null?void 0:s.filter(r=>{const a=n.find(c=>c.id===r.id);if(a){const c=a.getFilterFn();if(ra(c,r.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel()),t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}};function ra(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Mi={sum:(t,e,n)=>n.reduce((o,i)=>{const s=i.getValue(t);return o+(typeof s=="number"?s:0)},0),min:(t,e,n)=>{let o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},max:(t,e,n)=>{let o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},extent:(t,e,n)=>{let o,i;return n.forEach(s=>{const r=s.getValue(t);r!=null&&(o===void 0?r>=r&&(o=i=r):(o>r&&(o=r),i<r&&(i=r)))}),[o,i]},mean:(t,e)=>{let n=0,o=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,o+=s)}),n)return o/n},median:(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!Vb(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),i=n.sort((s,r)=>s-r);return n.length%2!==0?i[o]:(i[o-1]+i[o])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},Nb={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ce("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o,i,s;return(n=(o=(i=(s=t.columnDef.enableGrouping)!=null?s:!0)!=null?i:e.options.enableGrouping)!=null?o:!0)!=null?n:!!t.accessorFn},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(t.id);if(typeof o=="number")return Mi.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Mi.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return co(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:Mi[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function Ib(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(s=>!e.includes(s.id));return n==="remove"?o:[...e.map(s=>t.find(r=>r.id===s)).filter(Boolean),...o]}const Lb={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ce("columnOrder",t)}),createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=I(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const r=[...e],a=[...i];for(;a.length&&r.length;){const c=r.shift(),d=a.findIndex(u=>u.id===c);d>-1&&s.push(a.splice(d,1)[0])}s=[...s,...a]}return Ib(s,n,o)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Ei=0,Di=10,Vi=()=>({pageIndex:Ei,pageSize:Di}),Tb={getInitialState:t=>({...t,pagination:{...Vi(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ce("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,i;if(!e){t._queue(()=>{e=!0});return}if((o=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const i=s=>rt(o,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=o=>{var i;t.setPagination(o?Vi():(i=t.initialState.pagination)!=null?i:Vi())},t.setPageIndex=o=>{t.setPagination(i=>{let s=rt(o,i.pageIndex);const r=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,r)),{...i,pageIndex:s}})},t.resetPageIndex=o=>{var i,s;t.setPageIndex(o?Ei:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Ei)},t.resetPageSize=o=>{var i,s;t.setPageSize(o?Di:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Di)},t.setPageSize=o=>{t.setPagination(i=>{const s=Math.max(1,rt(o,i.pageSize)),r=i.pageSize*i.pageIndex,a=Math.floor(r/s);return{...i,pageIndex:a,pageSize:s}})},t.setPageCount=o=>t.setPagination(i=>{var s;let r=rt(o,(s=t.options.pageCount)!=null?s:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...i,pageCount:r}}),t.getPageOptions=I(()=>[t.getPageCount()],o=>{let i=[];return o&&o>0&&(i=[...new Array(o)].fill(null).map((s,r)=>r)),i},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var o;return(o=t.options.debugAll)!=null?o:t.options.debugTable}}),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:o<i-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getPrePaginationRowModel().rows.length/t.getState().pagination.pageSize)}}},Ri=()=>({left:[],right:[]}),Fi=()=>({top:[],bottom:[]}),zb={getInitialState:t=>({columnPinning:Ri(),rowPinning:Fi(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ce("columnPinning",t),onRowPinningChange:Ce("rowPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,r;if(n==="right"){var a,c;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((c=i==null?void 0:i.right)!=null?c:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var d,u;return{left:[...((d=i==null?void 0:i.left)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(f=>!(o!=null&&o.includes(f)))}}return{left:((s=i==null?void 0:i.left)!=null?s:[]).filter(f=>!(o!=null&&o.includes(f))),right:((r=i==null?void 0:i.right)!=null?r:[]).filter(f=>!(o!=null&&o.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var i,s,r;return((i=o.columnDef.enablePinning)!=null?i:!0)&&((s=(r=e.options.enableColumnPinning)!=null?r:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:o,right:i}=e.getState().columnPinning,s=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>i==null?void 0:i.includes(a));return s?"left":r?"right":!1},t.getPinnedIndex=()=>{var n,o;const i=t.getIsPinned();return i?(n=(o=e.getState().columnPinning)==null||(o=o[i])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.pin=(n,o,i)=>{const s=o?t.getLeafRows().map(c=>{let{id:d}=c;return d}):[],r=i?t.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...r,t.id,...s]);e.setRowPinning(c=>{var d,u;if(n==="bottom"){var f,p;return{top:((f=c==null?void 0:c.top)!=null?f:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((p=c==null?void 0:c.bottom)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=c==null?void 0:c.top)!=null?h:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((g=c==null?void 0:c.bottom)!=null?g:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((u=c==null?void 0:c.bottom)!=null?u:[]).filter(m=>!(a!=null&&a.has(m)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:i}=e.options;return typeof o=="function"?o(t):(n=o??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:i}=e.getState().rowPinning,s=n.some(a=>o==null?void 0:o.includes(a)),r=n.some(a=>i==null?void 0:i.includes(a));return s?"top":r?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const i=t.getIsPinned();if(!i)return-1;const s=(n=e._getPinnedRows(i))==null?void 0:n.map(r=>{let{id:a}=r;return a});return(o=s==null?void 0:s.indexOf(t.id))!=null?o:-1},t.getCenterVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,i)=>{const s=[...o??[],...i??[]];return n.filter(r=>!s.includes(r.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getLeftVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,,],(n,o)=>(o??[]).map(s=>n.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getRightVisibleCells=I(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?Ri():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:Ri())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var i,s;return!!((i=o.left)!=null&&i.length||(s=o.right)!=null&&s.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getRightLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(i=>i.id===o)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.getCenterLeafColumns=I(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const i=[...n??[],...o??[]];return e.filter(s=>!i.includes(s.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugColumns}}),t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?Fi():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:Fi())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var i,s;return!!((i=o.top)!=null&&i.length||(s=o.bottom)!=null&&s.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=e=>I(()=>[t.getRowModel().rows,t.getState().rowPinning[e]],(n,o)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(o??[]).map(r=>{const a=t.getRow(r,!0);return a.getIsAllParentsExpanded()?a:null}):(o??[]).map(r=>n.find(a=>a.id===r))).filter(Boolean).map(r=>({...r,position:e}))},{key:process.env.NODE_ENV==="development"&&`row.get${e==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})(),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=I(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const i=new Set([...n??[],...o??[]]);return e.filter(s=>!i.has(s.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugRows}})}},Hb={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ce("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(o[s.id]=!0)}):i.forEach(s=>{delete o[s.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{Bi(i,s.id,o,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=I(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getFilteredSelectedRowModel=I(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getGroupedSelectedRowModel=I(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?$i(t,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable}}),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(i=>!n[i.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var r;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const a={...s};return Bi(a,t.id,n,(r=o==null?void 0:o.selectChildren)!=null?r:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Pi(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Ai(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Ai(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var i;n&&t.toggleSelected((i=o.target)==null?void 0:i.checked)}}}},Bi=(t,e,n,o,i)=>{var s;const r=i.getRow(e,!0);n?(r.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),r.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(s=r.subRows)!=null&&s.length&&r.getCanSelectSubRows()&&r.subRows.forEach(a=>Bi(t,a.id,n,o,i))};function $i(t,e){const n=t.getState().rowSelection,o=[],i={},s=function(r,a){return r.map(c=>{var d;const u=Pi(c,n);if(u&&(o.push(c),i[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:s(c.subRows)}),u)return c}).filter(Boolean)};return{rows:s(e.rows),flatRows:o,rowsById:i}}function Pi(t,e){var n;return(n=e[t.id])!=null?n:!1}function Ai(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let i=!0,s=!1;return t.subRows.forEach(r=>{if(!(s&&!i)&&(r.getCanSelect()&&(Pi(r,e)?s=!0:i=!1),r.subRows&&r.subRows.length)){const a=Ai(r,e);a==="all"?s=!0:(a==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const Oi=/([0-9]+)/gm,Wb=(t,e,n)=>la(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),jb=(t,e,n)=>la(lt(t.getValue(n)),lt(e.getValue(n))),Yb=(t,e,n)=>Ni(lt(t.getValue(n)).toLowerCase(),lt(e.getValue(n)).toLowerCase()),Gb=(t,e,n)=>Ni(lt(t.getValue(n)),lt(e.getValue(n))),Ub=(t,e,n)=>{const o=t.getValue(n),i=e.getValue(n);return o>i?1:o<i?-1:0},qb=(t,e,n)=>Ni(t.getValue(n),e.getValue(n));function Ni(t,e){return t===e?0:t>e?1:-1}function lt(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function la(t,e){const n=t.split(Oi).filter(Boolean),o=e.split(Oi).filter(Boolean);for(;n.length&&o.length;){const i=n.shift(),s=o.shift(),r=parseInt(i,10),a=parseInt(s,10),c=[r,a].sort();if(isNaN(c[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(c[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return n.length-o.length}const pn={alphanumeric:Wb,alphanumericCaseSensitive:jb,text:Yb,textCaseSensitive:Gb,datetime:Ub,basic:qb},aa=[Bb,{getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ce("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;return(n=(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=I(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}}),t.getVisibleCells=I(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,i)=>[...n,...o,...i],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})},createTable:t=>{const e=(n,o)=>I(()=>[o(),o().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),{key:n,debug:()=>{var i;return(i=t.options.debugAll)!=null?i:t.options.debugColumns}});t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}},Lb,zb,Ob,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ce("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const i of n){const s=i==null?void 0:i.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return pn.datetime;if(typeof s=="string"&&(o=!0,s.split(Oi).length>1))return pn.alphanumeric}return o?pn.text:pn.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return co(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:pn[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(r=>{const a=r==null?void 0:r.find(h=>h.id===t.id),c=r==null?void 0:r.findIndex(h=>h.id===t.id);let d=[],u,f=s?n:i==="desc";if(r!=null&&r.length&&t.getCanMultiSort()&&o?a?u="toggle":u="add":r!=null&&r.length&&c!==r.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(s||i||(u="remove")),u==="add"){var p;d=[...r,{id:t.id,desc:f}],d.splice(0,d.length-((p=e.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?d=r.map(h=>h.id===t.id?{...h,desc:f}:h):u==="remove"?d=r.filter(h=>h.id!==t.id):d=[{id:t.id,desc:f}];return d})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,i;const s=t.getFirstSortDir(),r=t.getIsSorted();return r?r!==s&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:r==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Nb,Ab,Tb,Hb,$b];function Xb(t){var e;(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");let n={_features:aa};const o=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=u=>n.options.mergeOptions?n.options.mergeOptions(o,u):{...o,...u};let r={...{},...(e=t.initialState)!=null?e:{}};n._features.forEach(u=>{var f;r=(f=u.getInitialState==null?void 0:u.getInitialState(r))!=null?f:r});const a=[];let c=!1;const d={_features:aa,options:{...o,...t},initialState:r,_queue:u=>{a.push(u),c||(c=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();c=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=rt(u,n.options);n.options=i(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,p)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,p))!=null?h:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{const p=(f?n.getCoreRowModel():n.getRowModel()).rowsById[u];if(!p)throw process.env.NODE_ENV!=="production"?new Error(`getRow expected an ID, but got ${u}`):new Error;return p},_getDefaultColumnDef:I(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:p=>{const h=p.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:p=>{var h,g;return(h=(g=p.renderValue())==null||g.toString==null?void 0:g.toString())!=null?h:null},...n._features.reduce((p,h)=>Object.assign(p,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:I(()=>[n._getColumnDefs()],u=>{const f=function(p,h,g){return g===void 0&&(g=0),p.map(m=>{const b=Fb(n,m,g,h),x=m;return b.columns=x.columns?f(x.columns,b,g+1):[],b})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:I(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:I(()=>[n.getAllFlatColumns()],u=>u.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:I(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let p=u.flatMap(h=>h.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,d);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function Kb(t,e,n,o){const i=()=>{var r;return(r=s.getValue())!=null?r:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:i,getContext:I(()=>[t,n,e,s],(r,a,c,d)=>({table:r,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>t.options.debugAll})};return t._features.forEach(r=>{r.createCell==null||r.createCell(s,n,e,t)},{}),s}const Ii=(t,e,n,o,i,s,r)=>{let a={id:e,index:o,original:n,depth:i,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,o),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=t.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:t.options.renderFallbackValue},subRows:s??[],getLeafRows:()=>Rb(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const u=d.getParentRow();if(!u)break;c.push(u),d=u}return c.reverse()},getAllCells:I(()=>[t.getAllLeafColumns()],c=>c.map(d=>Kb(t,a,d,d.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}}),_getAllCellsByColumnId:I(()=>[a.getAllCells()],c=>c.reduce((d,u)=>(d[u.column.id]=u,d),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var c;return(c=t.options.debugAll)!=null?c:t.options.debugRows}})};for(let c=0;c<t._features.length;c++){const d=t._features[c];d==null||d.createRow==null||d.createRow(a,t)}return a};function Zb(){return t=>I(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(i,s,r){s===void 0&&(s=0);const a=[];for(let d=0;d<i.length;d++){const u=Ii(t,t._getRowId(i[d],d,r),i[d],d,s,void 0,r==null?void 0:r.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var c;u.originalSubRows=t.options.getSubRows(i[d],d),(c=u.originalSubRows)!=null&&c.length&&(u.subRows=o(u.originalSubRows,s+1,u))}}return a};return n.rows=o(e),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function Jb(t,e,n){return n.options.filterFromLeafRows?Qb(t,e,n):ey(t,e,n)}function Qb(t,e,n){var o;const i=[],s={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){var f;let h=c[p];const g=Ii(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(f=h.subRows)!=null&&f.length&&d<r){if(g.subRows=a(h.subRows,d+1),h=g,e(h)&&!g.subRows.length){u.push(h),s[h.id]=h,i.push(h);continue}if(e(h)||g.subRows.length){u.push(h),s[h.id]=h,i.push(h);continue}}else h=g,e(h)&&(u.push(h),s[h.id]=h,i.push(h))}return u};return{rows:a(t),flatRows:i,rowsById:s}}function ey(t,e,n){var o;const i=[],s={},r=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(c,d){d===void 0&&(d=0);const u=[];for(let p=0;p<c.length;p++){let h=c[p];if(e(h)){var f;if((f=h.subRows)!=null&&f.length&&d<r){const m=Ii(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);m.subRows=a(h.subRows,d+1),h=m}u.push(h),i.push(h),s[h.id]=h}}return u};return{rows:a(t),flatRows:i,rowsById:s}}function ty(){return t=>I(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let p=0;p<e.flatRows.length;p++)e.flatRows[p].columnFilters={},e.flatRows[p].columnFiltersMeta={};return e}const i=[],s=[];(n??[]).forEach(p=>{var h;const g=t.getColumn(p.id);if(!g)return;const m=g.getFilterFn();if(!m){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${g.id}.`);return}i.push({id:p.id,filterFn:m,resolvedValue:(h=m.resolveFilterValue==null?void 0:m.resolveFilterValue(p.value))!=null?h:p.value})});const r=n.map(p=>p.id),a=t.getGlobalFilterFn(),c=t.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());o&&a&&c.length&&(r.push("__global__"),c.forEach(p=>{var h;s.push({id:p.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?h:o})}));let d,u;for(let p=0;p<e.flatRows.length;p++){const h=e.flatRows[p];if(h.columnFilters={},i.length)for(let g=0;g<i.length;g++){d=i[g];const m=d.id;h.columnFilters[m]=d.filterFn(h,m,d.resolvedValue,b=>{h.columnFiltersMeta[m]=b})}if(s.length){for(let g=0;g<s.length;g++){u=s[g];const m=u.id;if(u.filterFn(h,m,u.resolvedValue,b=>{h.columnFiltersMeta[m]=b})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const f=p=>{for(let h=0;h<r.length;h++)if(p.columnFilters[r[h]]===!1)return!1;return!0};return Jb(e.rows,f,t)},{key:process.env.NODE_ENV==="development"&&"getFilteredRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function ny(){return t=>I(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,i=[],s=o.filter(c=>{var d;return(d=t.getColumn(c.id))==null?void 0:d.getCanSort()}),r={};s.forEach(c=>{const d=t.getColumn(c.id);d&&(r[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(u=>({...u}));return d.sort((u,f)=>{for(let h=0;h<s.length;h+=1){var p;const g=s[h],m=r[g.id],b=(p=g==null?void 0:g.desc)!=null?p:!1;let x=0;if(m.sortUndefined){const y=u.getValue(g.id),w=f.getValue(g.id),S=y===void 0,_=w===void 0;(S||_)&&(x=S&&_?0:S?m.sortUndefined:-m.sortUndefined)}if(x===0&&(x=m.sortingFn(u,f,g.id)),x!==0)return b&&(x*=-1),m.invertSorting&&(x*=-1),x}return u.index-f.index}),d.forEach(u=>{var f;i.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),d};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var e;return(e=t.options.debugAll)!=null?e:t.options.debugTable},onChange:()=>{t._autoResetPageIndex()}})}function oy(t){const e=[],n=o=>{var i;e.push(o),(i=o.subRows)!=null&&i.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function iy(t){return e=>I(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:i,pageIndex:s}=n;let{rows:r,flatRows:a,rowsById:c}=o;const d=i*s,u=d+i;r=r.slice(d,u);let f;e.options.paginateExpandedRows?f={rows:r,flatRows:a,rowsById:c}:f=oy({rows:r,flatRows:a,rowsById:c}),f.flatRows=[];const p=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}})}/**
38
+ * vue-table
39
+ *
40
+ * Copyright (c) TanStack
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE.md file in the root directory of this source tree.
44
+ *
45
+ * @license MIT
46
+ */function po(){return!0}const sy=Symbol("merge-proxy"),ry={get(t,e,n){return e===sy?n:t.get(e)},has(t,e){return t.has(e)},set:po,deleteProperty:po,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:po,deleteProperty:po}},ownKeys(t){return t.keys()}};function Li(t){return"value"in t?t.value:t}function go(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Proxy({get(o){for(let i=e.length-1;i>=0;i--){const s=Li(e[i])[o];if(s!==void 0)return s}},has(o){for(let i=e.length-1;i>=0;i--)if(o in Li(e[i]))return!0;return!1},keys(){const o=[];for(let i=0;i<e.length;i++)o.push(...Object.keys(Li(e[i])));return[...Array.from(new Set(o))]}},ry)}const ca=l.defineComponent({props:["render","props"],setup:t=>()=>typeof t.render=="function"||typeof t.render=="object"?l.h(t.render,t.props):t.render});function ly(t){const e=go({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(i,s){return go(i,s)}},t),n=Xb(e),o=l.ref(n.initialState);return l.watchEffect(()=>{n.setOptions(i=>{var s;const r=new Proxy({},{get:(a,c)=>o.value[c]});return go(i,t,{state:go(r,(s=t.state)!=null?s:{}),onStateChange:a=>{a instanceof Function?o.value=a(o.value):o.value=a,t.onStateChange==null||t.onStateChange(a)}})})}),n}const ay=["checked","disabled","indeterminate"],cy=l.defineComponent({__name:"FmTableCheckbox",props:{checked:{type:Boolean},disabled:{type:Boolean},indeterminate:{type:Boolean},onChange:{type:Function}},setup(t){const e=t,n=l.computed(()=>e.indeterminate&&!e.checked?"remove":e.checked?"check_small":"");return(o,i)=>(l.openBlock(),l.createElementBlock("div",{class:"fm-checkbox__input--container",onClick:i[0]||(i[0]=(...s)=>o.onChange&&o.onChange(...s))},[l.createElementVNode("input",{class:l.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.checked}),type:"checkbox",checked:o.checked,disabled:o.disabled,indeterminate:o.indeterminate},null,10,ay),o.indeterminate||o.checked?(l.openBlock(),l.createBlock(L,{key:0,class:"fm-checkbox__input--checkmark",name:n.value,size:"md",color:"#FFFFFF"},null,8,["name"])):l.createCommentVNode("",!0)]))}}),x_="",da=Q(cy,[["__scopeId","data-v-2508b8c4"]]),dy={mounted:(t,e)=>{t.clickOutsideEvent=n=>{const o=e.arg?document.querySelectorAll(`#${e.arg}`):[];!(t==n.target||t.contains(n.target))&&!Array.from(o).some(i=>i&&(n.target==i||i.contains(n.target)))&&e.value(n,t)},document.addEventListener("click",t.clickOutsideEvent)},unmounted:t=>{document.removeEventListener("click",t.clickOutsideEvent)}},uy={class:"fm-menu__wrapper"},fy=l.defineComponent({__name:"FmMenuList",props:{items:{default:()=>[]},placement:{default:"bottom-start"},level:{default:0},trigger:{default:"click"}},emits:["menu-changed"],setup(t,{emit:e}){const n=t,o=e,i=l.ref([]);let s;const r=l.ref(),a=l.ref(!1),c=l.ref(!1),d=l.inject(Qi,null),u=l.ref(null),f=l.ref(null),{floatingStyles:p}=Tl(u,f,{middleware:[yi({mainAxis:d?8:4,crossAxis:d?-12:0}),bi()],placement:n.placement,whileElementsMounted:Ol}),h=()=>{x&&clearTimeout(x)},g=()=>{v.value==="hover"&&b()},m=()=>{v.value==="click"&&b()},b=()=>{h(),c.value=!0,a.value=!0,d==null||d.setChildId(s)};let x;const y=()=>{v.value==="hover"&&(c.value=!1,h(),x=setTimeout(()=>{a.value=!1},1e3))},w=()=>{h(),c.value=!0},S=()=>{c.value=!1,x&&clearTimeout(x),x=setTimeout(()=>{c.value||(i.value.length>0?a.value=i.value.some(({injectProps:C})=>C.mouseInMenu.value):(d&&d.closeParent(),v.value!=="click"&&(a.value=!1)))},1e3)},_=()=>{a.value=!1},k=l.computed(()=>({mouseInMenu:c}));l.provide(Qi,{register({injectProps:C}){return i.value=[...i.value,{injectProps:C}],i.value.length},closeParent(){a.value=!1,d==null||d.closeParent()},setChildId(C){r.value=C},mouseInChildId:r,trigger:n.trigger}),l.onMounted(()=>{d&&(s=d.register({injectProps:k}))}),l.watch(()=>d==null?void 0:d.mouseInChildId.value,C=>{C!==s&&(h(),a.value=!1)});const v=l.computed(()=>d===null?n.trigger:"hover");return l.watch(()=>a.value,()=>o("menu-changed",a.value)),(C,D)=>l.withDirectives((l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",{ref_key:"anchorEl",ref:u,class:"fm-menu",onMouseenter:g,onMouseleave:y,onClick:m},[l.renderSlot(C.$slots,"menu-button",{},void 0,!0)],544),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[a.value?(l.openBlock(),l.createElementBlock("div",{key:0,id:"fm-menu",ref_key:"menuEl",ref:f,style:l.normalizeStyle(l.unref(p)),onMouseenter:w,onMouseleave:S},[l.renderSlot(C.$slots,"menu-wrapper",{forceHide:()=>a.value=!1},()=>[l.createElementVNode("div",uy,[l.renderSlot(C.$slots,"default",{forceHide:()=>a.value=!1},void 0,!0)])],!0)],36)):l.createCommentVNode("",!0)]))])),[[l.unref(dy),_,"fm-menu"]])}}),w_="",hy=Q(fy,[["__scopeId","data-v-dec76cad"]]),py={class:"bg-fm-color-neutral-white flex flex-col max-h-[264px] overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"},ua=l.defineComponent({__name:"FmTableSelection",props:{modelValue:{},items:{}},emits:["update:modelValue"],setup(t){const n=de(t,"modelValue"),o=l.ref(!1);return(i,s)=>(l.openBlock(),l.createBlock(hy,{onMenuChanged:s[0]||(s[0]=r=>o.value=r)},{"menu-button":l.withCtx(()=>{var r;return[l.createVNode(fe,{variant:"secondary",label:(r=i.items.find(a=>a.value===i.modelValue))==null?void 0:r.label,size:"md",icon:o.value?"expand_less":"expand_more","icon-position":"append"},null,8,["label","icon"])]}),"menu-wrapper":l.withCtx(({forceHide:r})=>[l.createElementVNode("div",py,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,a=>(l.openBlock(),l.createBlock(Ee,{key:a.value,"model-value":a.value===l.unref(n),label:a.label,value:a.value,"onUpdate:modelValue":c=>n.value=a.value,onClick:r},null,8,["model-value","label","value","onUpdate:modelValue","onClick"]))),128))])]),_:1}))}}),gy={class:"overflow-x-auto"},my={class:"w-full"},by=["colSpan","onClick"],yy={class:"flex gap-8 items-center justify-between"},_y={className:"h-72 flex items-center justify-between px-24"},xy={class:"flex gap-24 items-center justify-between"},wy={class:"flex gap-8 items-center"},Cy=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-primary"}," Items per page: ",-1),ky={class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"},Sy={class:"flex gap-8 items-center"},vy={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},My=l.defineComponent({__name:"FmTable",props:{modelValue:{default:{}},selection:{default:void 0},rowData:{default:()=>[]},columnDefs:{default:()=>[]},searchValue:{default:""},pageCount:{default:0},fetchFn:{type:Function,default:void 0},pageSize:{default:10}},setup(t){const e=t,n=de(e,"modelValue"),o=de(e,"searchValue"),i=l.computed(()=>{const c=[...e.columnDefs];return e.selection&&c.unshift({id:"row-selection",header:({table:d})=>l.createVNode(da,{checked:d.getIsAllPageRowsSelected(),indeterminate:d.getIsSomePageRowsSelected(),onChange:d.getToggleAllPageRowsSelectedHandler()},null),cell:({row:d})=>l.createVNode(da,{checked:d.getIsSelected(),disabled:!d.getCanSelect(),onChange:d.getToggleSelectedHandler()},null),enableResizing:!1,meta:{headerClass:"py-4 pl-4 pr-16",cellClass:"py-16 pl-4 pr-16",width:"60px"}}),c}),s=l.ref([]),r=l.ref({pageIndex:0,pageSize:e.pageSize}),a=ly({enableRowSelection:!!e.selection,enableMultiRowSelection:e.selection==="multiple",columns:i.value,get data(){return e.rowData},state:{get pagination(){return typeof e.fetchFn=="function"?r.value:void 0},get globalFilter(){return o.value},get rowSelection(){return n.value},get sorting(){return s.value}},getCoreRowModel:Zb(),getSortedRowModel:ny(),getFilteredRowModel:ty(),getPaginationRowModel:iy(),onRowSelectionChange:c=>n.value=typeof c=="function"?c(n.value):c,onSortingChange:c=>{s.value=typeof c=="function"?c(s.value):c},onGlobalFilterChange:c=>{o.value=typeof c=="function"?c(o.value):c},manualPagination:typeof e.fetchFn=="function",...typeof e.fetchFn=="function"&&{onPaginationChange:c=>r.value=typeof c=="function"?c(r.value):c},pageCount:typeof e.fetchFn=="function"?e.pageCount:void 0});return l.watch(()=>r.value,c=>{e.fetchFn&&e.fetchFn(c)}),l.watch(()=>e.rowData,()=>{a.setOptions(c=>({...c,data:e.rowData}))}),l.watch(()=>e.pageCount,()=>{a.setOptions(c=>({...c,pageCount:e.pageCount}))}),l.watch(()=>e.pageSize,()=>{a.setPageSize(e.pageSize)}),l.onMounted(()=>{e.fetchFn&&e.fetchFn(a.getState().pagination),a.setPageSize(e.pageSize)}),(c,d)=>(l.openBlock(),l.createElementBlock("div",gy,[l.createElementVNode("table",my,[l.createElementVNode("thead",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getHeaderGroups(),u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.headers,f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("th",{key:f.id,colSpan:f.colSpan,class:l.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-secondary border-b border-fm-color-neutral-gray-100 h-24",f.column.getCanSort()?"cursor-pointer select-none":"",((p=f.column.columnDef.meta)==null?void 0:p.headerClass)??"px-16 py-12"]),style:l.normalizeStyle({width:`${(h=f.column.columnDef.meta)==null?void 0:h.width}`,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"}),onClick:b=>{var x;return(x=f.column.getToggleSortingHandler())==null?void 0:x(b)}},[l.createElementVNode("div",yy,[f.isPlaceholder?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(ca),{key:0,render:f.column.columnDef.header,props:f.getContext()},null,8,["render","props"])),f.column.getCanSort()?(l.openBlock(),l.createBlock(L,{key:1,color:"neutral-gray-400",name:{asc:"arrow_upward",desc:"arrow_downward"}[f.column.getIsSorted()]??"unfold_more"},null,8,["name"])):l.createCommentVNode("",!0)])],14,by)}),128))]))),128))]),l.createElementVNode("tbody",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(a).getRowModel().rows,u=>(l.openBlock(),l.createElementBlock("tr",{key:u.id,class:"border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.getVisibleCells(),f=>{var p,h,g,m;return l.openBlock(),l.createElementBlock("td",{key:f.id,class:l.normalizeClass(["h-48 fm-typo-body-lg-400 px-16 py-12 text-fm-color-typo-primary text-ellipsis whitespace-nowrap overflow-hidden",((p=f.column.columnDef.meta)==null?void 0:p.cellClass)??"px-16 py-12"]),style:l.normalizeStyle({width:(h=f.column.columnDef.meta)==null?void 0:h.width,maxWidth:(g=f.column.columnDef.meta)==null?void 0:g.maxWidth,textAlign:((m=f.column.columnDef.meta)==null?void 0:m.textAlign)??"left"})},[l.createVNode(l.unref(ca),{render:f.column.columnDef.cell,props:f.getContext()},null,8,["render","props"])],6)}),128))]))),128))])]),l.createElementVNode("div",_y,[l.createElementVNode("div",xy,[l.createElementVNode("div",wy,[Cy,l.createVNode(ua,{"model-value":l.unref(a).getState().pagination.pageSize,items:[...Array.from(Array(5),(u,f)=>(f+1)*10).map(u=>({label:u.toString(),value:u})),{label:"All",value:e.rowData.length}],"onUpdate:modelValue":d[0]||(d[0]=u=>l.unref(a).setPageSize(u))},null,8,["model-value","items"])]),l.createElementVNode("span",ky,l.toDisplayString(e.rowData.length<l.unref(a).getState().pagination.pageSize?e.rowData.length:l.unref(a).getState().pagination.pageIndex*l.unref(a).getState().pagination.pageSize+1)+" - "+l.toDisplayString((l.unref(a).getState().pagination.pageIndex+1)*l.unref(a).getState().pagination.pageSize)+" of "+l.toDisplayString(e.rowData.length)+" items ",1)]),l.createElementVNode("div",Sy,[l.createVNode(ua,{"model-value":l.unref(a).getState().pagination.pageIndex+1,items:Array.from(Array(l.unref(a).getPageCount()),(u,f)=>f+1).map(u=>({label:u.toString(),value:u})),"onUpdate:modelValue":d[1]||(d[1]=u=>l.unref(a).setPageIndex(u?u-1:0))},null,8,["model-value","items"]),l.createElementVNode("span",vy," of "+l.toDisplayString(l.unref(a).getPageCount())+" pages ",1),l.createVNode(fe,{disabled:!l.unref(a).getCanPreviousPage(),icon:"chevron_left",variant:"tertiary","icon-color":"neutral-black",onClick:d[2]||(d[2]=()=>l.unref(a).previousPage())},null,8,["disabled"]),l.createVNode(fe,{disabled:!l.unref(a).getCanNextPage(),icon:"chevron_right",variant:"tertiary","icon-color":"neutral-black",onClick:d[3]||(d[3]=()=>l.unref(a).nextPage())},null,8,["disabled"])])])]))}}),Ey=l.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Dy={class:"max-w-[360px] min-w-[186px]"},Vy={FmBadge:yn,FmBreadcrumb:Da,FmButton:fe,FmButtonGroup:Ta,FmCard:Wa,FmCardActions:ja,FmCardSection:Ya,FmCardTitle:Yi,FmChip:Gi,FmChipGroup:Ui,FmDialog:Xa,FmDropField:Qa,FmDynamicDialog:es,FmLineChart:xp,FmCheckbox:xl,FmDatePicker:Ag,FmDateRangePicker:cm,FmField:it,FmForm:dm,FmFormGroup:je,FmHelperText:zl,FmLabel:Wl,FmRadio:ym,FmRadioGroup:_m,FmSelect:km,FmStepperField:Em,FmSwitch:Im,FmTextField:Tm,FmTextarea:Wm,FmTimeInput:Ul,FmTimePicker:nb,FmIcon:L,FmList:ib,FmListItem:rb,FmMenu:we,FmMenuItem:Ee,FmProgressIndicator:ql,FmSnackbar:hb,FmSpacer:qi,FmStep:yb,FmStepper:wb,FmTab:Kl,FmTable:My,FmTabs:l.defineComponent({__name:"FmTabs",props:{modelValue:{default:null},items:{},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showMoreAt:{default:6}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,i=l.ref(!1),s=l.computed(()=>({vertical:n.vertical,disabled:n.disabled})),r=l.computed(()=>n.items.slice(0,n.showMoreAt)),a=l.computed(()=>n.items.slice(n.showMoreAt)),c=d=>{i.value=!1,o("update:modelValue",d)};return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex",d.vertical?"flex-col":"flex-row items-center"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,f=>l.renderSlot(d.$slots,"default",l.normalizeProps(l.guardReactiveProps({...f,tabsProps:s.value})),()=>[l.createVNode(Kl,l.mergeProps({"model-value":n.modelValue},{children:f.children,label:f.label,icon:f.icon,disabled:f.disabled,badge:f.badge,value:f.value,tabsProps:s.value},{disabled:f.disabled===void 0?d.disabled:f.disabled,vertical:d.vertical,"onUpdate:modelValue":u[0]||(u[0]=p=>o("update:modelValue",p))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(l.openBlock(),l.createBlock(we,{key:0,"show-menu":i.value,class:l.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":d.vertical}]),placement:d.vertical?"right-start":"bottom-start",onDropdownChanged:u[1]||(u[1]=f=>i.value=f)},{"menu-button":l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[d.vertical?"h-40":"h-[46px]"]])},[l.createVNode(L,{name:"more_vert"}),Ey],2)]),"menu-content":l.withCtx(()=>[l.createElementVNode("div",Dy,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,f=>l.renderSlot(d.$slots,"list-item",l.normalizeProps(l.guardReactiveProps(f)),()=>[l.createVNode(Ee,{"model-value":n.modelValue===f.value,label:f.label,icon:f.icon,disabled:f.disabled,onClick:p=>c(f.value)},{append:l.withCtx(()=>[f.badge?(l.openBlock(),l.createBlock(yn,{key:0,value:f.badge,inline:"",variant:"numeric"},null,8,["value"])):l.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):l.createCommentVNode("",!0)],2))}}),FmTooltip:Hl};function Ry(){const t=l.inject(Ji);if(!t)throw new Error("No provider");return t}const Fy=t=>{t.use(wa,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),t.use(oc),Object.entries(Vy).forEach(([e,n])=>{t.component(e,n)})};re.uiPlugin=Fy,re.useDialog=Ry,re.useFormChild=Yl,re.useValidation=jl,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});